Qt控件样式 Style Sheet Demo
迟来的笔记,作为一个程序员每日记事已养成习惯,离开许久,不知不觉已喜欢用文字表达对技术的热爱,学无止境!
Qt – 一个跨平台应用程序和UI开发框架;它包括跨平台类库、集成开发工具和跨平台 IDE,使用 Qt 您只需一次性开发应用程序,无须重新编写源代码,便可跨不同桌面和嵌入式操作系统部署这些应用程序;深感强大的功能就是支持校本化和样式文件化,对于做web开发的同学能很快上手,强烈推荐。以下是Qt部分控件的样式写法例子,仅作参考,看着跟css3是不是很像。
*{font-size:15px;font-family:"微软雅黑","宋体";color:#333;font-weight:normal;outline:none;}
*::down-arrow {image: url(:/skin/common/icon/downArrow.png);}
*::up-arrow {image: url(:/skin/common/icon/upArrow.png);}
QLabel{background:transparent;outline:none;color:#333;}
/**QComboBox,QDateEdit**/
QComboBox,QDateEdit,QDateTimeEdit{outline:none;color:#333;background-color:#fff;border:1px solid #a9a9a8;border-radius:0px;}
QComboBox:focus,QDateEdit:focus,QDateTimeEdit:focus{color: #333;border:1px solid #bfbfbf;background-color:#eefcfc;}
QComboBox::drop-down,QDateEdit::drop-down,QDateTimeEdit::drop-down{border-left:1px solid #a9a9a8;background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #fcfcfb, stop: 0.5 #f1eeec,stop: 1 #e7e1dc);}
QComboBox::drop-down:hover{border-left:1px solid #a9a9a8;background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #eee, stop: 0.5 #ddd,stop: 1 #ccc);}
/**QRadioButton**/
QRadioButton {spacing: 5px;outline:none;}
QRadioButton::indicator {width: 21px;height: 21px;}
QRadioButton::indicator::unchecked {image: url(:/skin/common/icon/radioButtonUnchecked.png);}
QRadioButton::indicator:unchecked:hover {image: url(:/skin/common/icon/radioButtonUncheckedHover.png);}
QRadioButton::indicator:unchecked:pressed {image: url(:/skin/common/icon/radioButtonUncheckedPressed.png);}
QRadioButton::indicator::checked {image: url(:/skin/common/icon/radioButtonChecked.png);}
QRadioButton::indicator:checked:hover {image: url(:/skin/common/icon/radioButtonCheckedHover.png);}
QRadioButton::indicator:checked:pressed {image: url(:/skin/common/icon/radioButtonCheckedPressed.png);}
/**QCheckBox**/
QCheckBox {color:#333;spacing:0px;outline:none;}
QCheckBox::indicator {width: 15px; height: 15px;margin-right:5px;}
QCheckBox::indicator:unchecked{ image: url(:/skin/common/icon/checkbox.png);}
QCheckBox::indicator:unchecked:!enabled{ image: url(:/skin/common/icon/checkboxDisable.png);}
QCheckBox::indicator:unchecked:hover {image: url(:/skin/common/icon/checkboxHover.png);}
QCheckBox::indicator:unchecked:pressed {image: url(:/skin/common/icon/checkboxPressed.png);}
QCheckBox::indicator:checked {image: url(:/skin/common/icon/checkboxPressed.png);}
QCheckBox::indicator:checked:hover {image: url(:/skin/common/icon/checkboxPressedHover.png);}
QCheckBox::indicator:checked:pressed {image: url(:/skin/common/icon/checkbox.png);}
/**日期控件QDateEdit**/
QCalendarWidget QMenu{width:80px;left:10px;}
QCalendarWidget QToolButton {height: 18px; }
QCalendarWidget QToolButton:hover {border-radius:0px;color:red;}
QCalendarWidget QWidget#qt_calendar_calendarview{background-color: #fefbea;border:0px;}
QCalendarWidget QAbstractItemView {selection-background-color: rgb(255, 174, 0);}
/**QSpinBox**/
QSpinBox{min-height:16px;max-height:16px;outline:none;}
*::up-button {subcontrol-origin: border;subcontrol-position: top right;width: 16px;height:12px;image: url(:/skin/common/icon/spinup.png);border-width:1px;margin:0px;}
*::up-button:hover {image: url(:/skin/common/icon/spinup_hover.png);}
*::up-button:pressed {image: url(:/skin/common/icon/spinup_pressed.png);}
;}
*::down-button:hover {image: url(:/skin/common/icon/spindown_hover.png);}
*::down-button:pressed {image: url(:/skin/common/icon/spindown_pressed.png);}
/**QTabWidget**/
QTabWidget{border:none;margin:0px;outline:none;}
QTabWidget[showHeader='true']::pane{border:1px solid #55B023;border-radius:0px;position: absolute;top: -1px;}
QTabWidget[showHeader='false']::pane{border:none;position: absolute;margin:0px;}
QTabWidget[showHeader='true'] QTabBar::tab{alignment:left;color:white;padding:2px 16px;margin-top:3px;margin-left:5px;height:21px;border-top-left-radius: 5px;border-top-right-radius: 5px;background:#C9B084}
QTabWidget[showHeader='true'] QTabBar::tab:selected{background:#55B023;margin-top:1px;height:23px;}
/**Pager**/
QWidget#Pager_First, QWidget#Pager_Last, QWidget#Pager_Previous, QWidget#Pager_Next{font-size:1px;color:transparent;min-width:18px;min-height:15px;}
QWidget#Pager_First{background:url(:/skin/common/pager/first.png) no-repeat center}
QWidget#Pager_Last{background:url(:/skin/common/pager/last.png) no-repeat center}
QWidget#Pager_Previous{background:url(:/skin/common/pager/previous.png) no-repeat center}
QWidget#Pager_Next{background:url(:/skin/common/pager/next.png) no-repeat center}
QWidget#Pager_First:!enabled{background:url(:/skin/common/pager/first_disabled.png) no-repeat center}
QWidget#Pager_Last:!enabled{background:url(:/skin/common/pager/last_disabled.png) no-repeat center}
QWidget#Pager_Previous:!enabled{background:url(:/skin/common/pager/previous_disabled.png) no-repeat center}
QWidget#Pager_Next:!enabled{background:url(:/skin/common/pager/next_disabled.png) no-repeat center}
QWidget#Pager_Lable{min-width:18px;min-height:15px;text-align:center;}
QWidget#Pager_Lable:hover{border-bottom:1px solid blue;color:blue}
QWidget#Pager_Lable:!enabled{color: red;font-weight:bold;}
/**QScrollBar**/
QScrollArea{outline:none;border:none;background:transparent;}
QScrollArea QWidget#AreaMainWidget{outline:none;background:transparent;}
QScrollBar:vertical{width:4px;border-radius:2px;min-height:50px;background-color:transparent;}
QScrollBar:horizontal{height:0px;border-radius:2px;min-width:50px;background-color:transparent;}
QScrollBar::handle:horizontal, QScrollBar::add-line, QScrollBar::sub-line{border-image:none;background:rgba(0, 0, 0, 0)}
QScrollBar::up-arrow, QScrollBar::down-arrow{image:none;border-image:url();}
/**QPushButton**/
QPushButton{color:#eee;border:1px solid #4FB418;border-radius:0px;background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #7CDA47, stop: 0.5 #5FBB2C,stop: 1 #40A10B);}
QPushButton:hover{color:#fff;border:1px solid #7cb4f5;background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0, stop: 0 #88EC4F, stop: 0.49 #5BBF0B, stop: 0.50 #4DB40E, stop: 1 #48B70F);}
QPushButton:focus{color:#fff;outline:none;background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0, stop: 0 #88EC4F, stop: 0.49 #5BBF0B, stop: 0.50 #4DB40E, stop: 1 #48B70F);}
QPushButton:focus:hover{color:#fff;}
QPushButton:!enabled, QPushButton:!enabled:hover{color:#999;border:1px solid #999;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #efefef, stop: 0.5 #ccc,stop: 1 #bbb);}
/*隔行交替色列表*/
ListWidget[style='ListTable']{background-color:#f5f5f5;border:none;}
ListWidget[style='ListTable']>Widget{min-height:40px;max-height:40px;}
ListWidget[style='ListTable']>Widget[IsItem='true']>QLabel[style="nameText"]{color:#333;}
ListWidget[style='ListTable']>Widget[IsItem='true']>QLabel[style="fileName"]{color:#333;}
ListWidget[style='ListTable']>Widget[IsEvenRow='true']{background-color:#ececec;}
ListWidget[style='ListTable']>Widget[IsEvenRow='false']{background-color:#f5f5f5;}
ListWidget[style='ListTable']>Widget[style='CurrentItem']{background-color:#6f6f6f;}
ListWidget[style='ListTable']>Widget[style='CurrentItem']>QLabel[style="nameText"]{color:#fff;}
ListWidget[style='ListTable']>Widget[style='CurrentItem']>QLabel[style="fileName"]{color:#fff;}
/*块列表*/
ListWidget[style='ListBlock']>Widget[style='NormalItem']{min-height:110px;max-height:110px;margin-bottom:16px;border:1px solid #eee;}
ListWidget[style='ListBlock']>Widget[style='NormalItem']>QLabel[style="nameText"]{font-size:24px;color:#333;}
ListWidget[style='ListBlock']>Widget[style='NormalItem']>QLabel[style="markText"]{}
ListWidget[style='ListBlock']>Widget[style='CurrentItem']{min-height:110px;max-height:110px;margin-bottom:16px;border:1px solid #eee;}
ListWidget[style='ListBlock']>Widget[style='CurrentItem']>QLabel[style="nameText"]{font-size:24px;color:#333;}
ListWidget[style='ListBlock']>Widget[style='CurrentItem']>QLabel[style="markText"]{color:#333;}
/*无背景色*/
QPushButton[style="dark_cur"]{background-color:#919192; min-width:50px;min-height:16px;border:1px solid #ccc;border-radius:0px;}
QPushButton[style="dark"]{background-color:transparent; min-width:50px;min-height:16px;border:1px solid #7a7b7c;border-radius:0px;}
QPushButton[style="dark"]:hover{border:1px solid #eee;}
QPushButton[style="dark_cur"]:hover{border:1px solid #eee;background-color:#aaa;}
/*白色*/
QPushButton[style='white2']{color:#333;border:1px solid #e2e2e2;border-radius:0px;background-color:#f5f5f5;}
QPushButton[style='white2']:hover{color:#333;border:1px solid #4976ac;background-color:#deecfc;}
QPushButton[style='white2']:focus{color:#222;outline:none;background-color:#f6f6f6;}
QPushButton[style='white2']:focus:hover{color:#111;}
QPushButton[style='white2']:!enabled:hover{color:#999;border:1px solid #999;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #efefef, stop: 0.5 #ccc,stop: 1 #bbb);}
/*绿色*/
QPushButton[style='green']{color:#fff;border:1px solid #9bbe8b;border-radius:0px;min-height:22px;background-color:#9bbe8b;}
QPushButton[style='green']:hover{color:#fff;border:1px solid #9bbe8b;background-color:#75aa5d;}
QPushButton[style='green']:focus{color:#fff;outline:none;background-color:#7ab460;}
QPushButton[style='green']:focus:hover{color:#fff;}
QPushButton[style='green']:!enabled:hover{color:#999;border:1px solid #999;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #efefef, stop: 0.5 #ccc,stop: 1 #bbb);}
/*红色*/
QPushButton[style='red']{color:#fff;font-weight:bold;border:1px solid red;border-radius:0px;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #ff5f76, stop: 0.49 #fb576e, stop: 0.5 #f9324e,stop: 1 #e60b2a);}
QPushButton[style='red']:hover{color:#eee;border:1px solid #cd0925;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #f9324e, stop: 0.5 #eb1d3a,stop: 1 #ec0425);}
QPushButton[style='red']:focus{color:#fff;outline:none;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #f9324e, stop: 0.5 #eb1d3a,stop: 1 #ec0425);}
QPushButton[style='red']:focus:hover{color:#fff;}
QPushButton[style='red']:!enabled:hover{color:#999;border:1px solid #999;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #efefef, stop: 0.5 #ccc,stop: 1 #bbb);}
/*黑色*/
QPushButton[style='black']{color:#fff;font-weight:bold;border:1px solid #666;border-radius:0px;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #a2a1a1, stop: 0.49 #5f5e5e,stop: 0.5 #535252,stop: 1 #383838);}
QPushButton[style='black']:hover{color:#eee;border:1px solid #000;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #666465, stop: 0.5 #4e4c4c,stop: 1 #211f1f);}
QPushButton[style='black']:focus{color:#fff;outline:none;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #a2a1a1, stop: 0.5 #5f5e5e,stop: 1 #383838);}
QPushButton[style='black']:focus:hover{color:#fff;}
QPushButton[style='black']:!enabled:hover{color:#999;border:1px solid #999;background-color :qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0,stop: 0 #efefef, stop: 0.5 #ccc,stop: 1 #bbb);}
/*灰色*/
QPushButton[style='gray']{border:1px solid #e2e2e2;border-radius:0px; color:#999;background-color:#f5f5f5;}
QPushButton[style='gray']:hover{border:1px solid #ababab;border-radius:0px; color:#666;background-color:#f5f5f5;}
QPushButton[style='gray']:focus{border:1px solid #ababab;border-radius:0px; color:#666;background-color:#f5f5f5;}
/*圆形图标*/
QWidget[round="green"]{min-width:16px;min-height:16px;max-width:16px;max-height:16px;border-radius:10px;background-color:#9bbe8b;}
QWidget[round="red"]{min-width:14px;min-height:14px;max-width:14px;max-height:14px;border-radius:7px;background-color:#cf5352;color:#fff;font-size:14px;text-align:center;}
/*部分按钮图标*/
QLabel[iconName='done_star']{background-image:url(:/skin/common/done.png);background-repeat:no-repeat;background-position:right center;min-width:30px;}
QWidget[iconName="dustbin"]{background-image:url(:/skin/common/dustbin.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName='dustbin2']{background:url(:/skin/common/dustbin2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='pen2']{background:url(:/skin/common/pen2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName="done"]{background-image:url(:/skin/common/done.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="done2"]{background-image:url(:/skin/common/done2.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="x"]{background-image:url(:/skin/common/x.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="edit"]{background-image:url(:/skin/common/pen.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="upload"]{background-image:url(:/skin/common/upload.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="upload2"]{background-image:url(:/skin/common/upload2.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName="download"]{background-image:url(:/skin/common/download.png); background-position:center center; background-repeat:no-repeat;}
QWidget[iconName='upArrow']{background-image:url(:/skin/common/upArrow.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='downArrow']{background-image:url(:/skin/common/downArrow.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='up']{background-image:url(:/skin/common/up.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='up2']{background-image:url(:/skin/common/up2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='down']{background-image:url(:/skin/common/down.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='down2']{background-image:url(:/skin/common/down2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='out']{background-image:url(:/skin/common/out.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='add']{background-image:url(:/skin/common/add.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='add2']{background-image:url(:/skin/common/add2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='btnUpgrade']{background-image:url(:/skin/common/upgrade.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='btnDegrade']{background-image:url(:/skin/common/degrade.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='file']{background-image:url(:/skin/common/file.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='file2']{background-image:url(:/skin/common/file2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='share']{background-image:url(:/skin/common/share.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='alarm']{background-image:url(:/skin/common/alarm.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='cycle']{background-image:url(:/skin/common/cycle.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='download2']{background-image:url(:/skin/common/download2.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='photo']{background-image:url(:/skin/common/photo.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='export']{background-image:url(:/skin/common/export.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='import']{background-image:url(:/skin/common/import.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='modify']{background-image:url(:/skin/common/pen.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='doc']{background:url(:/skin/common/fileIcon//doc.png); background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='key']{background-image:url(:/skin/common/key.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='tagicon']{background-image:url(:/skin/common/tagicon.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='search']{background-image:url(:/skin/common/search.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='detail']{background:url(:/skin/common/detail.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='sharehead']{background-image:url(:/skin/common/shareHead.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='sync']{background:url(:/skin/common/sync.png);background-repeat: no-repeat; background-position:center center;}
QWidget[iconName='sync']:hover{background-color:rgba(255, 255, 255, 45);}
QWidget[iconName='xls']{background:url(:/skin/common/fileIcon//xls.png) no-repeat center center;}
QWidget[iconName='ppt']{background:url(:/skin/common/fileIcon//ppt.png) no-repeat center center;}
QWidget[iconName='jpg']{background:url(:/skin/common/fileIcon//jpg.png) no-repeat center center;}
QWidget[iconName='png']{background:url(:/skin/common/fileIcon//png.png) no-repeat center center;}
/**TimeLine**/
QWidget[style="TimeLine_Date"]{font-weight:bold;}
QWidget[style="TimeLine_Explain"]{border-bottom-width:10px;min-height:30px;padding:5px; word-break:break-all;word-wrap:break-word;}
QWidget[style="TimeLine_Person"]{}
QLabel[style="TimeLine_FileName"]{color:#bbb;font-size:15px;}
;}
;}
/*不能编辑的编辑框样式*/
QWidget[edit=false]:!enabled{border:none;background:transparent;color:#666;}
QComboBox[style="noBorder"]{border:none;background:transparent;}
QComboBox[style="noBorder"]::drop-down{border:none;background-color:transparent;}
QComboBox[style="noBorder"]::drop-down:hover{border:none;background-color:transparent;}
/**MessageBox**/
QLabel[style="MessageText"]{font-size:15px;text-indent:15px;color:#444;padding:5px;}
/**Loading**/
QWidget#LoadingBorder{border:1px solid #ddd;border-radius:2px;background-color:rgba(255,255,255,200);}
QLabel[LoadingTextStyle='LoadingText']{font-size:14px;}
QLabel[LoadingTextStyle='LoadingBlackText']{font-size:14px;}
QLabel[style="bold"]{font-weight:bold;font-size:14px;}
/**QTreeView**/
QTreeWidget{background-color:#f5f5f5;border:none; outline:none;
selection-background-color: qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0, stop: 0 #6f6f6f, stop: 0.95 #6f6f6f, stop: 1 #7f7f7f);
show-decoration-selected: true;
alternate-background-color: #ececec;}
QTreeWidget::item{min-height:40px;max-height:200px;outline:none;}
TreeWidgetItem[style="FolderItem"]>QLabel[style="TitleText"]{font-weight:bold;}
TreeWidgetItem[style="DoneTask"]>QLabel[style="TitleText"]{color:#999;text-decoration:line-through;}
TreeWidgetItem>QLabel[style="TitleText"]{font-size:15px;}
TreeWidgetItem>QLabel[style="DateText"]{color:#999;font-size:14px;}
QTreeView::branch{margin-left:2px;background:transparent;}
QTreeView::branch:has-children:open{background: url(:/skin/common/treeFolder.png) no-repeat right center;}
QTreeView::branch:has-children:closed{background: url(:/skin/common/treeFolder2.png) no-repeat right center;}
QTreeView::item:hover{outline:none;color:#fff;border:none;}
QTreeView::item:selected:!active{}
QTreeView::item:selected,QTreeView::item:selected:active{outline:none;color:#fff;border:none;
background-color:qlineargradient(y1: 0, x1: 0, y2: 1, x2: 0, stop: 0 #6f6f6f, stop: 0.95 #6f6f6f, stop: 1 #7f7f7f);}
TreeWidgetItem[selected='active']>QLabel[style="TitleText"]{color:#fff;}
TreeWidgetItem[selected='active']>QLabel[style="DateText"]{color:#eee;}
TreeWidgetItem[selected='yes']>QLabel[style="TitleText"]{color:#ddd;}
TreeWidgetItem[selected='yes']>QLabel[style="DateText"]{color:#eee;}
TreeWidgetItem[dragMoveItem='true']{background: #6f6f6f;}
TreeWidgetItem[MoveType='left']{background-image:url(:/skin/common/moveLeft.png);background-repeat: no-repeat; background-position:left bottom;}
TreeWidgetItem[MoveType='right']{background-image:url(:/skin/common/moveRight.png);background-repeat: no-repeat; background-position:left bottom;}
TreeWidgetItem[MoveType='insert']{background-image:url(:/skin/common/moveInsert.png);background-repeat: no-repeat; background-position:left bottom;}
TreeWidgetItem[MoveType='first']{background-image:url(:/skin/common/moveFirst.png);background-repeat: no-repeat; background-position:left top;}
如何应用以上Style到应用程序呢?
QString commonSkin = ResourceUtils::readAllText(":/skin/skin.css"); // 读取资源文件,文本格式
qApp->setStyleSheet(commonSkin); // 程序启动时,注册全局Style
效果图:

图一

图二
图一、二都是去掉标题栏的自定义不规则窗体,欢迎拍砖。。。
Qt控件样式 Style Sheet Demo的更多相关文章
- Qt——常用控件样式
下面是我设计.调整.修改的Qt控件样式,仅供参考. Github地址:https://github.com/ikongziming/QtDemo/tree/master/StyleSheetDemo ...
- qt 设置程序控件样式
1. 以资源文件的形式设置控件样式 QFiledata(QString(":/style.qss")); QStringqssFile; if(data.open(QFile::R ...
- QSS基础-设置控件样式
1.QSS基础-设置同类控件样式'''QSS基础:Qt Style SheetQt样式表用于设置控件的样式和风格(比如控件的背景色,字体颜色,字体大小等)和CSS的功能比较相似,功能相似''' fro ...
- QtQuick自定义主题以及控件样式指引
自定义控件样式 请在Qt帮助索引中输入Customizing a Control进行查看 不过实际用下来感觉除非你想自己实现一套效果复杂的UI或是创造一个全新控件,比如:给UI添加模糊.虚化等Shad ...
- UWP入门(四)--设置控件样式
原文:UWP入门(四)--设置控件样式 官方定义:可以使用 XAML 框架通过多种方式自定义应用的外观. 通过样式可以设置控件属性,并重复使用这些设置,以便保持多个控件具有一致的外观. 可分享至不同e ...
- WPF中Expander控件样式,ListBox的样式(带checkbox)恢复
Expander控件样式: <ControlTemplate x:Key="ExpanderToggleButton" TargetType="ToggleButt ...
- WPF 自定义TabControl控件样式
一.前言 程序中经常会用到TabControl控件,默认的控件样式很普通.而且样式或功能不一定符合我们的要求.比如:我们需要TabControl的标题能够居中.或平均分布:或者我们希望TabContr ...
- silverlight 控件样式动态绑定
<telerik:RadDiagram x:Name="diagram1" GraphSource="{Binding GraphSource, Mode=TwoW ...
- WPF自定义控件(二)の重写原生控件样式模板
话外篇: 要写一个圆形控件,用Clip,重写模板,去除样式引用圆形图片可以有这三种方式. 开发过程中,我们有时候用WPF原生的控件就能实现自己的需求,但是样式.风格并不能满足我们的需求,那么我们该怎么 ...
随机推荐
- 1-web应用之LAMP源码环境搭建
目录 一.LAMP环境的介绍 1.LAMP环境的重要性 2.LAMP组件介绍 二.Apache源码安装 1.下载Apache以及相关依赖包 2.安装Apache以及相关 ...
- redis键命令
1.ping命令用于检测redis是否启动 成功返回pong表示链接成功 2.在远程redis服务上执行命令 Redis-cli -h host -p port -a password 如果是连接本机 ...
- git免密操作
windows下找到用户目录,新建 _netrc 文件 machine git.notech.cc login user password xxxxxx Linux下同样可行,需要在~目录下新建 .n ...
- phpmyadmin导入数据库大小限制修改
phpmyadmin默认导入数据库文件大小为2M,但一般网站的数据库导出的文件都会超出这个限制,要导入超过2M的数据库文件就需要手动修改php.ini配置文件! 在php.ini文件中修改: uplo ...
- [LeetCode] Substring with Concatenation of All Words 串联所有单词的子串
You are given a string, s, and a list of words, words, that are all of the same length. Find all sta ...
- 自动化运维工具ansible部署以及使用
测试环境master 192.168.16.74webserver1 192.168.16.70webserver2 192.168.16.72安装ansiblerpm -Uvh http://ftp ...
- 在Eclipse中使用建立使用Gradle做依赖管理的Spring Boot工程
前述: Gradle存在很长时间了,以前只知道Maven和ivy ,最近才知道有这个存在,因为以后要用这个了; 所以,要先学会怎么用这个工具,就从建立一个简单工程开始! 实际上以前是见过Gradle的 ...
- Spring_跨项目读取properties文件
应用背景:工程中有40~50个项目,分为4个模块,分别是核心模块.服务接口模块.服务实现模块.Web模块.其它模块(包括消息队列.quartz任务等).工程中很多配置项都是多个项目共有调用的,所以单独 ...
- Memcached+PHP+Mysql+Linux 实践
首先确保你的服务器环境已经具备了memcached和lamp,关于在Linux上搭建memcahced+php环境可以参考我的另外一篇帖子( http://www.cnblogs.com/codeAB ...
- Linux系统编程:基本I/O系统调用
文件描述符 进程每打开一个文件的时候,会获得该文件的文件描述符,而后续的读写操作都把文件描述符作为参数.在用户空间或者内核空间,都是通过文件描述符来唯一地索引一个打开的文件.文件描述符使用int类型表 ...