Qtableview table scroll bar style (QSs is really meticulous home)

Source: Internet
Author: User

Environment: Qt5.3

Ide:qtcreator

Effect preview:

Vertical and horizontal scroll bar styles

Code:

[CPP]View Plaincopyprint?
  1. Ui->qtableview->verticalscrollbar ()->setstylesheet ("qscrollbar:vertical{" //Vertical slider overall
  2. "background: #FFFFFF;" //Background color
  3. "padding-top:20px;" //on reserved position (place up arrow)
  4. "padding-bottom:20px;" //down reserved position (place down arrow)
  5. "PADDING-LEFT:3PX;" //left reserved position (beautiful)
  6. "PADDING-RIGHT:3PX;" //Right reserved position (beautiful)
  7. "border-left:1px solid #d7d7d7;}" //Left split line
  8. "qscrollbar::handle:vertical{"//Slider style
  9. "background: #dbdbdb;" //Slider color
  10. "BORDER-RADIUS:6PX;" //Rounded corners
  11. "min-height:80px;}" //Slider minimum height
  12. "qscrollbar::handle:vertical:hover{"//mouse touches the slider style
  13. "background: #d0d0d0;}" //Slider color
  14. "qscrollbar::add-line:vertical{"//down arrow style
  15. "Background:url (:/images/resource/images/checkout/down.png) center no-repeat;}"
  16. "qscrollbar::sub-line:vertical{"//Up ARROW style
  17. "Background:url (:/images/resource/images/checkout/up.png) center no-repeat;}");
  18. Ui->qtableview->horizontalscrollbar ()->setstylesheet ("qscrollbar:horizontal{"
  19. "background: #FFFFFF;"
  20. "PADDING-TOP:3PX;"
  21. "PADDING-BOTTOM:3PX;"
  22. "padding-left:20px;"
  23. "padding-right:20px;}"
  24. "qscrollbar::handle:horizontal{"
  25. "background: #dbdbdb;"
  26. "BORDER-RADIUS:6PX;"
  27. "min-width:80px;}"
  28. "qscrollbar::handle:horizontal:hover{"
  29. "background: #d0d0d0;}"
  30. "qscrollbar::add-line:horizontal{"
  31. "Background:url (:/images/resource/images/checkout/right.png) center no-repeat;}"
  32. "qscrollbar::sub-line:horizontal{"
  33. "Background:url (:/images/resource/images/checkout/left.png) center no-repeat;}");

http://blog.csdn.net/shihoongbo/article/details/48970515

Qtableview table scroll bar style (QSs is really meticulous home)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.