271108411的个人主页

http://www.qtcn.org/bbs/u/186351  [收藏] [复制]

271108411

  • 0

    关注

  • 0

    粉丝

  • 0

    访客

  • 等级:新手上路
  • 总积分:0
  • 保密,2011-12-05

最后登录:2019-09-25

更多资料

日志

设置滚动条样式

2019-09-16 13:23
QString style= QString("QScrollBar{margin:20px 0px 20px 0px;background:rgb(225,227,229);width:16px;border-radius:0px;}"
                           "QScrollBar::handle{background:rgb(179,179,179);border-radius: 6px; margin: 0px 2px 0px 2px;}"
                           "QScrollBar::up-arrow {height: 20px;border-image: url(:/images/38.png);}"
                           "QScrollBar::down-arrow{height: 20px;border-image: url(:/images/39.png); }"
                           "QScrollBar::up-arrow:pressed {height: 20px; border-image: url(:/images/38-1.png);}"
                           "QScrollBar::down-arrow::pressed {height: 20px; border-image: url(:/images/39-1.png);}"
                           "QScrollBar::sub-line{subcontrol-origin: margin;height:20px;border:0,0,0,0;}"
                           "QScrollBar::add-line{subcontrol-origin: margin;height:20px;border:0,0,0,0;}"
                           "QScrollBar::sub-page{background:none;border:0,0,0,0;}"
                           "QScrollBar::add-page{background:none;border:0,0,0,0;}");

   ui->tableWidget->verticalScrollBar()->setStyleSheet(style);

   QString style1= QString("QScrollBar{margin:0px 20px 0px 20px;background:rgb(225,227,229);height:16px;border-radius:0px;}"
                          "QScrollBar::handle{background:rgb(179,179,179);border-radius: 6px; margin: 2px 0px 2px 0px;}"
                          "QScrollBar::left-arrow{width: 20px;border-image: url(:/images/40.png); }"
                          "QScrollBar::right-arrow{width: 20px;border-image: url(:/images/41.png); }"
                          "QScrollBar::left-arrow:pressed {width: 20px; border-image: url(:/images/40-1.png);}"
                          "QScrollBar::right-arrow::pressed {width: 20px; border-image: url(:/images/41-1.png);
                          "QScrollBar::sub-line{subcontrol-origin: margin;width:20px;subcontrol-position: left;border: none;}"
                          "QScrollBar::add-line{subcontrol-origin: margin;width:20px;border:0,0,0,0;}"
                          "QScrollBar::sub-page{background:none;border:0,0,0,0;}"
                          "QScrollBar::add-page{background:none;border:0,0,0,0;}");

    ui->tableWidget->horizontalScrollBar()->setStyleSheet(style1);
        
分类:默认分类|回复:0|浏览:116|全站可见|转载
 

下一篇:

上一篇: 保证仅一个程序运行

Powered by phpwind v8.7 Certificate Copyright Time now is:10-18 23:41
©2005-2016 QTCN开发网 版权所有 Gzip disabled