/*中央窗口央视*/ QWidget#CentralWidget{ background: rgb(237,255,243); } /*测试题管理窗口*/ QWidget#ManageTestQuestions{ /*background: rgb(0,0,0,80);*/ border-image: url(:/resource/modified5.png); } /*测试题编辑窗口*/ QWidget#EditTestQuestions{ background: rgb(255,255,255); } /*设置测试题库标题头边框样式*/ QWidget#m_titleWid{ border: 0px solid blue; } /*测试题库窗口下拉按钮样式 图标*/ QToolButton#m_foldBt{ background: rgba(0,0,0,0); color:rgb(255,255,255); } /*测试题库窗口下拉按钮样式 文字*/ QPushButton#m_titleNameBt{ background: rgba(0,0,0,0); font: 25 12pt "Microsoft YaHei"; /*粗细 字号 字体*/ color:rgb(255,255,255); padding-left: 5px; /*边距*/ text-align: left; /*文字在左显示*/ } /*添加*/ QToolButton#m_addquestion{ background: rgba(0,0,0,0); border: 0px solid white; font: 24 11pt "Microsoft YaHei"; /*粗细 字号 字体*/ color:rgb(255,255,255); } /*删除*/ QToolButton#m_delquestion{ background: rgba(0,0,0,0); border: 0px solid white; font: 20 11pt "Microsoft YaHei"; /*粗细 字号 字体*/ color:rgb(255,255,255); } /*测试题列表样式*/ QListWidget#m_listwidget{ background: rgba(0,0,0,100); font: 15 10pt "Microsoft YaHei"; /*粗细 字号 字体*/ color:rgb(255,255,255); border: 0px solid white;/* 设置边框的大小,样式,颜色 */ border-radius: 10px; } /*测试题列表项悬浮样式*/ QListView::item:hover { background: rgba(158,152,32,100); color:rgb(255,255,255); /*padding: 10px;*/ border-left: 3px solid rgb(130, 130, 130); } /*测试题列表项选择样式*/ QListView::item:selected { background: rgba(0,0,0,100); color:rgb(39,149,217); /*padding: 10px;*/ border-left: 3px solid black; } /*设置测试题库窗口背景样式*/ QWidget#QuestionBankWidget{ background: rgba(255,255,255,45); } /*主窗口背景*/ QWidget#mainwindow{ background: rgb(36,51,64); } /*滚动条中央控件背景窗口样式*/ QWidget#m_scrollCenterWidget{ background: rgba(0,0,0,0); } /*滑动条的样式*/ /* 整个垂直滚动条区域样式 */ QScrollBar:vertical { border: none; background: rgba(0,0,0,0); width: 10px; margin: 0px 0 0px 0; } /* 整个水平滚动条区域样式 */ QScrollBar:horizontal { border: none; background: rgb(30, 30, 30); height: 10px; margin: 0px 0 0px 0; } /* 滑块区域样式 */ QScrollBar::handle:vertical { background: rgb(79, 79, 79); min-height: 20px; border-radius: 5px; border: none; /* margin: 0 1px 0 1px; */ } QScrollBar::handle:horizontal { background: rgb(66, 66, 66); min-height: 20px; border-radius: 5px; border: none; } /* 鼠标滑过滑块样式 */ QScrollBar::handle:vertical:hover,QScrollBar::handle:vertical:pressed { background: rgba(255,255,255,100); /* margin: 0 0 0 0; */ } QScrollBar::handle:horizontal:hover,QScrollBar::handle:horizontal:pressed { background: rgba(255,255,255,100); } /* 向下箭头样式 */ QScrollBar::add-line:vertical { border: none; background: none; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } /* 向右箭头样式 */ QScrollBar::add-line:horizontal { border: none; background: none; height: 0px; subcontrol-position: bottom; subcontrol-origin: margin; } /* 向上箭头样式 */ QScrollBar::sub-line:vertical { border: none; background: none; height: 0px; subcontrol-position: top; subcontrol-origin: margin; } /* 向左箭头样式 */ QScrollBar::sub-line:horizontal { border: none; background: none; height: 0px; subcontrol-position: top; subcontrol-origin: margin; } /* 滚动条上面和下面区域样式 */ QScrollBar::sub-page:vertical, QScrollBar::add-page:vertical { background: none; width: 0px; height: 0px; } /* 滚动条左面和右面区域样式 */ QScrollBar::sub-page:horizontal, QScrollBar::add-page:horizontal { background: none; width: 0px; height: 0px; } /*滑动条窗口背景样式*/ QScrollArea#m_scrollarea{ background: rgba(0,0,0,0); border: 0px solid blue; }
标签:控件,qt,样式,QScrollBar,background,0px,border,255 From: https://www.cnblogs.com/RedWetPlace/p/17909612.html