一、QT不同皮肤设置
本程序的BaseWindow是继承于QWidget,如果大家想要继承QMainWindow,则需要把BaseWindow的基类改为QMainWindow。
去掉窗口自带的边框,Qt中直接用一下代码即可去除窗口边框效果。
//1.------设置窗体标题栏隐藏this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint);
标题栏按钮图标采用文字库形式显示
//3.------标题栏按钮图标IconHelper::Instance()->SetIcon(ui->btnMenu_Close, QChar(0xf00d), 10);//QChar变图标IconHelper::Instance()->SetIcon(ui->btnMenu_Max, QChar(0xf096), 10);IconHelper::Instance()->SetIcon(ui->btnMenu_Min, QChar(0xf068), 10);
采用CSS的样式表形式实现不同按钮、标题栏、文字变颜色,只需要点击选择不同的按钮选择开关,实现样式的切换。
比如实现得到的蓝色主题样表如下:
切换的效果如下:
二、核心代码之路
采用的CSS样式列表分为不同的文件,放在资源:/Resources/css/SkinCss路径下,并且文件可任意多个,代码支持自由添加不同主题色。
黑色主题:
/*//===================================================================================// 函数名称 | QWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 窗体//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QWidget#widgetMain{border:1px solid #4D4D4D;border-radius:0px;}.QFrame{border:1px solid #636363;border-radius:5px;}QWidget#widget_title{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929);}/*//===================================================================================// 函数名称 | QLabel()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 标签//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QLabel#lab_Ico{border-radius:0px;color: #F0F0F0;background-color:rgba(0,0,0,0);border-style:none;}QLabel#lab_Title{border-radius:0px;color: #00DFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:11pt;font-weight: bold;}QLabel#lab_Wait{border-radius:0px;color: #00DFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:12pt;font-weight: bold;}/*//===================================================================================// 函数名称 | QLineEdit()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 输入框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QLineEdit {border: 1px solid #F0F0F0;/*输入框选中,线条颜色-灰色*/border-radius: 5px;padding: 2px;background: none;selection-background-color: #4D4D4D;}QLineEdit[echoMode="2"] {lineedit-password-character: 9679; }/*//===================================================================================// 函数名称 | QGroupBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 组合框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QGroupBox{border: 1px solid #636363;border-radius: 4px;margin-top: 2ex}QGroupBox::title{subcontrol-origin: margin;subcontrol-position: top left;left:10px;margin-left:0px;padding:0 1px;}/*//===================================================================================// 函数名称 | QPushButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 按钮//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*View左边按钮,添加一条、多条、插入菜单按钮*/QPushButton#btnAdd,QPushButton#btnAddMore,QPushButton#btnInsert,QPushButton#btnDel,QPushButton#btnMoveUp,QPushButton#btnMoveDown,QPushButton#btnOpenCRT,QPushButton#btnSaveCRT,QPushButton#btnStart,QPushButton#btnFIAStatus{border-style: none;border: 2px;color: #4D4D4D;/*字体颜色*/padding: 2px;min-height: 25px;border-radius:3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #08BA65, stop:1 #009F3C);}QPushButton#btnAdd:hover,QPushButton#btnAddMore:hover,QPushButton#btnInsert:hover,QPushButton#btnDel:hover,QPushButton#btnMoveUp:hover,QPushButton#btnMoveDown:hover,QPushButton#btnOpenCRT:hover,QPushButton#btnSaveCRT:hover,QPushButton#btnStart:hover,QPushButton#btnFIAStatus:hover{color: #00DFFF;}QPushButton#btnAdd:pressed,QPushButton#btnAddMore:pressed,QPushButton#btnInsert:pressed,QPushButton#btnDel:pressed,QPushButton#btnMoveUp:pressed,QPushButton#btnMoveDown:pressed,QPushButton#btnOpenCRT:pressed,QPushButton#btnSaveCRT:pressed,QPushButton#btnStart:pressed,QPushButton#btnFIAStatus:pressed{color:#083B48;}QPushButton#btnAdd:disabled,QPushButton#btnAddMore:disabled,QPushButton#btnInsert:disabled,QPushButton#btnDel:disabled,QPushButton#btnMoveUp:disabled,QPushButton#btnMoveDown:disabled,QPushButton#btnOpenCRT:disabled,QPushButton#btnSaveCRT:disabled,QPushButton#btnStart:disabled,QPushButton#btnFIAStatus:disabled{color:#949499;}/*更新、电机设置、导入TXT光谱、导入标准光谱xml按钮*/QPushButton#btnUpdate,QPushButton#btnSetCurZeroPoint,QPushButton#btnSetOffsetStepToCurZeroPoint,QPushButton#btnInSpecTxt,QPushButton#btnImportStandXml,QPushButton#btnSaveSpecFcd{border-radius:5px;background-color:rgb(255 , 0 , 0);border: 1px solid rgb(0 , 0 , 0);padding:4px;}QPushButton#btnUpdate:hover,QPushButton#btnSetCurZeroPoint:hover,QPushButton#btnSetOffsetStepToCurZeroPoint:hover,QPushButton#btnInSpecTxt:hover,QPushButton#btnImportStandXml:hover,QPushButton#btnSaveSpecFcd:hover{background-color:rgb(0 , 0 , 253);border: 2px solid rgb(255 , 0 , 0);}QPushButton#btnUpdate:pressed,QPushButton#btnSetCurZeroPoint:pressed,QPushButton#btnSetOffsetStepToCurZeroPoint:pressed,QPushButton#btnInSpecTxt:pressed,QPushButton#btnImportStandXml:pressed,QPushButton#btnSaveSpecFcd:pressed{background-color:rgb(0, 236 , 237);border: 2px solid rgb(79 , 173 , 216);padding-left:2px;padding-top:2px;}/*最大、最小、关闭按钮图标内部填充前景色*/QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{border-radius:0px;color: #F0F0F0;background-color:rgba(0,0,0,0);border-style:none;}QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(25, 134, 199, 0), stop:1 #636363);}QPushButton#btnMenu_Close:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(238, 0, 0, 128), stop:1 rgba(238, 44, 44, 255));}/*文件、设置、运行、关于按钮前景色*/QPushButton#menuBtnFile,QPushButton#menuBtnSet,QPushButton#menuBtnRun,QPushButton#menuBtnView,QPushButton#menuBtnAbout {border-style: none;border: 0px;color: #F0F0F0;padding: 0px;min-height: 28px;min-width:80px;border-radius:0px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929);}QPushButton#menuBtnFile:menu-indicator,QPushButton#menuBtnSet:menu-indicator,QPushButton#menuBtnRun:menu-indicator,QPushButton#menuBtnView:menu-indicator,QPushButton#menuBtnAbout:menu-indicator{image:none;}QPushButton#menuBtnFile:hover,QPushButton#menuBtnSet:hover,QPushButton#menuBtnRun:hover,QPushButton#menuBtnView:hover,QPushButton#menuBtnAbout:hover{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757);}QPushButton#menuBtnFile:pressed,QPushButton#menuBtnSet:pressed,QPushButton#menuBtnRun:pressed,QPushButton#menuBtnView:pressed,QPushButton#menuBtnAbout:pressed{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #6A6A6A);}/*//===================================================================================// 函数名称 | QCheckBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 复选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QCheckBox {spacing: 2px; }QCheckBox::indicator {width: 20px;height: 20px;}QCheckBox::indicator:unchecked {image: url(image/checkbox_unchecked.png);}QCheckBox::indicator:checked {image: url(image/checkbox_checked.png); }/*//===================================================================================// 函数名称 | QRadioButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 单选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QRadioButton {spacing: 2px;}QRadioButton::indicator {width: 15px; height: 15px; }QRadioButton::indicator::unchecked {image: url(:/Resources/image/radio_normal.png);}QRadioButton::indicator::checked {image: url(:/Resources/image/radio_selected.png);}/*//===================================================================================// 函数名称 | QComboBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 下拉框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QComboBox,QDateEdit{border-radius: 3px;padding: 1px 10px 1px 5px;border: 1px solid #636363;}QComboBox::drop-down,QDateEdit::drop-down {subcontrol-origin: padding;subcontrol-position: top right;width: 15px; border-left-width: 1px;border-left-style: solid;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-left-color: #636363;}QComboBox::down-arrow,QDateEdit::down-arrow {image: url(:/Resources/image/array_down.png);}/*//===================================================================================// 函数名称 | QMenu()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | QMenu边框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QMenu {background-color:#F0F0F0;margin: 0px;border:1px solid #4D4D4D;}QMenu::item {padding: 2px 12px 2px 12px;height:22;}QMenu::indicator {width: 13px;是height: 13px;}/*QMenu选项颜色*/QMenu::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }/*QMenu分割线*/QMenu::separator {height: 1px;background: #636363;}/*//===================================================================================// 函数名称 | QProgressBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 进度条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QProgressBar {border-radius: 5px;text-align: center;text-size:14pt;border: 1px solid #636363;}QProgressBar::chunk {width: 5px; background-color: #007F00;}/*//===================================================================================// 函数名称 | QSlider()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 滑动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QSlider::groove:horizontal,QSlider::add-page:horizontal {background: #808080; height: 8px; border-radius: 3px; }QSlider::sub-page:horizontal {height: 8px; border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }QSlider::handle:horizontal {width: 13px; margin-top: -3px; margin-bottom: -3px; border-radius: 6px;background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,stop:0.6 #F0F0F0, stop:0.778409 #636363);}QSlider::handle:horizontal:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #4D4D4D);}QSlider::groove:vertical,QSlider::sub-page:vertical {background:#808080; width: 8px; border-radius: 3px;}QSlider::add-page:vertical {width: 8px;border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }QSlider::handle:vertical {height: 14px; margin-left: -3px;margin-right: -3px;border-radius: 6px;background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0, stop:0.778409 #636363);}QSlider::handle:vertical:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #4D4D4D);}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 垂直拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:vertical {width:10px; background-color:rgba(0,0,0,0%); padding-top:10px; padding-bottom:10px;}QScrollBar::handle:vertical {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757);}QScrollBar::handle:vertical:hover {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929);}QScrollBar::add-line:vertical {height:10px;width:10px;subcontrol-position: bottom;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_vertical.png);}QScrollBar::sub-line:vertical {height:10px;width:10px;subcontrol-position: top;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_vertical.png);}QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical {width:10px;background: #C0C0C0;}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 水平拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:horizontal {height:10px; background-color:rgba(0,0,0,0%); padding-left:10px; padding-right:10px;}QScrollBar::handle:horizontal {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757); }QScrollBar::handle:horizontal:hover {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }QScrollBar::add-line:horizontal {height:10px;width:10px;subcontrol-position: right;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_horizontal.png);}QScrollBar::sub-line:horizontal {height:10px;width:10px;subcontrol-position: left;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_horizontal.png);}QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal {height:10px;background: #C0C0C0;}QScrollArea {border: 0px ; }/*//===================================================================================// 函数名称 | QTabWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 这是Tab//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabWidget::pane {border: none;padding: 5px;background:#FFFFFF;}QTabWidget::tab-bar {border: none;}/*//===================================================================================// 函数名称 | QTreeView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 视图//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTreeView,QListView,QTableView{border: 1px solid #636363; selection-background-color: #4D4D4D;selection-color: #F0F0F0;}QTableView::item:selected, QListView::item:selected, QTreeView::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }/*QTableView::item:hover, QListView::item:hover, QTreeView::item:hover {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757); }*//*item:网格线*/QTableView::item, QListView::item, QTreeView::item {padding: 5px;margin: 0px;border:1px solid #F0F0F0;}/*item:失能*/QTreeView::disable{border: 1px solid #63C488;}/*//===================================================================================// 函数名称 | QHeaderView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | View网格表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QHeaderView::section {padding:3px;margin:0px;color:#F0F0F0;border: 1px solid #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757);}/*//===================================================================================// 函数名称 | QTabBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | Tab-基体名称-表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabBar::tab {border-bottom-left-radius:0px;border-bottom-right-radius:0px;color: #F0F0F0;min-width: 60px;min-height: 20px;padding: 3px 8px 3px 8px;margin:1px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #636363, stop:1 #575757); }QTabBar::tab:selected, QTabBar::tab:hover {border: 1px solid #00DFFF;/*边框*/color:#00DFFF;font-weight: bold;/*加粗*/background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }/*//===================================================================================// 函数名称 | QStatusBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 状态栏//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QStatusBar::item {border: 1px solid #636363;border-radius: 3px;}
蓝色主题:
/*//===================================================================================// 函数名称 | QWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 窗体//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QWidget#widgetMain{border:1px solid #0181DB;/*蓝色*/border-radius:0px;}.QFrame{border:1px solid #0181DB;/*蓝色*/border-radius:5px;}/*标题栏背景线性渐变*//*线性渐变(QLinearGradient)、辐射渐变(QRadialGradient)、角度渐变(QConicalGradient)*/QWidget#widget_title{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #0181DB);/*颜色*/}/*//===================================================================================// 函数名称 | QLabel()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 标签//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QLabel#lab_Ico{border-radius:0px;color: #F0F0F0;/*字体颜色*/background-color:rgba(233,87,114,0);border-style:none;}QLabel#lab_Title{border-radius:0px;color: #F0F0F0;/*字体颜色*/background-color:rgba(0,255,255,0);border-style:none;font-size:11pt;font-weight: bold;}QLabel#lab_Wait{border-radius:0px;color: #00DFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:12pt;font-weight: bold;}/*//===================================================================================// 函数名称 | QLineEdit()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 输入框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QLineEdit线框颜色*/.QLineEdit {border: 1px solid #F0F0F0;/*输入框选中,线条颜色-灰色*/border-radius: 5px;padding: 2px;background: none;selection-background-color: darkgray;/*输入框选中字体背景颜色*/}/*密码字符*//* echoMode为 0(Normal) | 1(NoEcho) | 2(Password) | 3 (PasswordEchoOnEdit) */QLineEdit[echoMode="0"]{lineedit-password-character: darkgray;}/*//===================================================================================// 函数名称 | QGroupBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 组合框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QGroupBox组线框颜色*/QGroupBox{border: 1px solid #0181DB;/*蓝色*/border-radius: 4px;margin-top: 2ex}QGroupBox::title{subcontrol-origin: margin;subcontrol-position: top left;left:10px;margin-left:0px;padding:0 1px;}/*//===================================================================================// 函数名称 | QPushButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 按钮//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*View左边导航按钮,添加一条、多条、插入菜单按钮*/QPushButton#btnAdd,QPushButton#btnAddMore,QPushButton#btnInsert,QPushButton#btnDel,QPushButton#btnMoveUp,QPushButton#btnMoveDown,QPushButton#btnOpenCRT,QPushButton#btnSaveCRT,QPushButton#btnStart,QPushButton#btnFIAStatus{border-style: none;border: 2px;color: #0181DB;/*蓝色*/padding: 2px;min-height: 25px;border-radius:3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #08BA65, stop:1 #009F3C);}QPushButton#btnAdd:hover,QPushButton#btnAddMore:hover,QPushButton#btnInsert:hover,QPushButton#btnDel:hover,QPushButton#btnMoveUp:hover,QPushButton#btnMoveDown:hover,QPushButton#btnOpenCRT:hover,QPushButton#btnSaveCRT:hover,QPushButton#btnStart:hover,QPushButton#btnFIAStatus:hover{color: #FF9601;/*橙色*/}QPushButton#btnAdd:pressed,QPushButton#btnAddMore:pressed,QPushButton#btnInsert:pressed,QPushButton#btnDel:pressed,QPushButton#btnMoveUp:pressed,QPushButton#btnMoveDown:pressed,QPushButton#btnOpenCRT:pressed,QPushButton#btnSaveCRT:pressed,QPushButton#btnStart:pressed,QPushButton#btnFIAStatus:pressed{color:#00CAFF;}QPushButton#btnAdd:disabled,QPushButton#btnAddMore:disabled,QPushButton#btnInsert:disabled,QPushButton#btnDel:disabled,QPushButton#btnMoveUp:disabled,QPushButton#btnMoveDown:disabled,QPushButton#btnOpenCRT:disabled,QPushButton#btnSaveCRT:disabled,QPushButton#btnStart:disabled,QPushButton#btnFIAStatus:disabled{color:#949499;}/*更新、电机设置、导入TXT光谱、导入标准光谱xml按钮*/QPushButton#btnUpdate,QPushButton#btnSetCurZeroPoint,QPushButton#btnSetOffsetStepToCurZeroPoint,QPushButton#btnInSpecTxt,QPushButton#btnImportStandXml,QPushButton#btnSaveSpecFcd{/*background-color:rgb(255, 0, 0);*/color: #000000;/*黑色字*/border-radius:5px;border: 1px solid rgb(0 , 0 , 255);/*蓝色框*/padding:6px;}QPushButton#btnUpdate:hover,QPushButton#btnSetCurZeroPoint:hover,QPushButton#btnSetOffsetStepToCurZeroPoint:hover,QPushButton#btnInSpecTxt:hover,QPushButton#btnImportStandXml:hover,QPushButton#btnSaveSpecFcd:hover{background-color:rgb(0 , 0 , 253);border: 1px solid rgb(255 , 180 , 3);/*橙色*/}QPushButton#btnUpdate:pressed,QPushButton#btnSetCurZeroPoint:pressed,QPushButton#btnSetOffsetStepToCurZeroPoint:pressed,QPushButton#btnInSpecTxt:pressed,QPushButton#btnImportStandXml:pressed,QPushButton#btnSaveSpecFcd:pressed{background-color:rgb(0, 236 , 237);border: 2px solid rgb(79 , 173 , 216);padding-left:2px;padding-top:2px;}/*最大、最小、关闭按钮图标内部填充前景色*/QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{border-radius:0px;color: #F0F0F0;background-color:rgba(223,93,157,0);border-style:none;}QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,stop:0 #3300ff, stop:1 #3300ff);/*深蓝色*/}QPushButton#btnMenu_Close:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(238, 0, 0, 128), stop:1 rgba(238, 44, 44, 255));}/*文件、设置、运行、关于按钮前景色*/QPushButton#menuBtnFile,QPushButton#menuBtnSet,QPushButton#menuBtnRun,QPushButton#menuBtnView,QPushButton#menuBtnAbout{font-family:"Microsoft Yahei";border-style: none;border: 0px;color: #F0F0F0;padding: 0px;min-height: 28px;min-width:80px;border-radius:0px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #0181DB);/*蓝色*/}QPushButton#menuBtnFile:menu-indicator,QPushButton#menuBtnSet:menu-indicator,QPushButton#menuBtnRun:menu-indicator,QPushButton#menuBtnView:menu-indicator,QPushButton#menuBtnAbout:menu-indicator{image:none;}QPushButton#menuBtnFile:hover,QPushButton#menuBtnSet:hover,QPushButton#menuBtnRun:hover,QPushButton#menuBtnView:hover,QPushButton#menuBtnAbout:hover{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FFB403, stop:1 #FFCC00);/*橙色*/}QPushButton#menuBtnFile:pressed,QPushButton#menuBtnSet:pressed,QPushButton#menuBtnRun:pressed,QPushButton#menuBtnView:pressed,QPushButton#menuBtnAbout:pressed{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF9601, stop:1 #FF9601);/*深橙色*/}/*//===================================================================================// 函数名称 | QCheckBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 复选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QCheckBox {spacing: 2px; }QCheckBox::indicator {width: 20px;height: 20px;}QCheckBox::indicator:unchecked {image: url(:/Resources/image/checkbox_unchecked.png);}QCheckBox::indicator:checked {image: url(:/Resources/image/checkbox_checked.png);}/*//===================================================================================// 函数名称 | QRadioButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 单选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QRadioButton {spacing: 2px;}QRadioButton::indicator {width: 15px; height: 15px; }QRadioButton::indicator::unchecked {image: url(:/Resources/image/radio_normal.png);}QRadioButton::indicator::checked {image: url(:/Resources/image/radio_selected.png);}/*//===================================================================================// 函数名称 | QComboBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 下拉框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QComboBox,QDateEdit{border-radius: 3px;padding: 1px 10px 1px 5px;border: 1px solid #004BFC;/*蓝色*/}QComboBox::drop-down,QDateEdit::drop-down {subcontrol-origin: padding;subcontrol-position: top right;width: 15px; border-left-width: 1px;border-left-style: solid;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-left-color: #004BFC;/*蓝色*/}QComboBox::down-arrow,QDateEdit::down-arrow {image: url(:/Resources/image/array_down.png);}/*//===================================================================================// 函数名称 | QMenu()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | QMenu边框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QMenu {background-color:#F0F0F0;margin: 0px;border:1px solid #004BFC;/*右键菜单边框颜色蓝色*/}QMenu::item {padding: 2px 12px 2px 12px;height:22;}QMenu::indicator {width: 13px;height: 13px;}/*QMenu选项颜色*/QMenu::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #03B4FF, stop:1 #004BFC);/*蓝色*/}/*QMenu分割线*/QMenu::separator {height: 1px;background: #03B4FF;/*蓝色*/}/*//===================================================================================// 函数名称 | QProgressBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 进度条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QProgressBar {border-radius: 5px;text-align: center;text-size:14pt;border: 1px solid #004BFC;}QProgressBar::chunk {width: 5px; background-color: #E94172;}/*//===================================================================================// 函数名称 | QSlider()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 滑动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QSlider::groove:horizontal,QSlider::add-page:horizontal {background: #F7526B;height: 8px; border-radius: 3px; }QSlider::sub-page:horizontal {height: 8px; border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #004BFC);}QSlider::handle:horizontal {width: 13px; margin-top: -3px; margin-bottom: -3px; border-radius: 6px;background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,stop:0.6 #004BFC, stop:0.778409 #004BFC);}QSlider::handle:horizontal:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #0181DB,stop:0.778409 #0181DB);}QSlider::groove:vertical,QSlider::sub-page:vertical {background:#808080; width: 8px; border-radius: 3px;}QSlider::add-page:vertical {width: 8px;border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }QSlider::handle:vertical {height: 14px; margin-left: -3px;margin-right: -3px;border-radius: 6px;background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0, stop:0.778409 #636363);}QSlider::handle:vertical:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #4D4D4D);}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 垂直拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:vertical {width:10px; background-color:rgba(0,0,0,0%); padding-top:10px; padding-bottom:10px;}/*拖动条颜色设置*/QScrollBar::handle:vertical {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #0181DB, stop:1 #0181DB);/*深蓝*/}QScrollBar::handle:vertical:hover {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #004BFC, stop:1 #004BFC);/*亮蓝色*/}/*垂直下箭头*/QScrollBar::add-line:vertical {height:10px;width:10px;subcontrol-position: bottom;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_vertical.png);}/*垂直上箭头*/QScrollBar::sub-line:vertical {height:10px;width:10px;subcontrol-position: top;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_vertical.png);}/*灰色滑动条槽*/QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical {width:10px;background: #C0C0C0;}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 水平拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:horizontal {height:10px; background-color:rgba(0,0,0,0%);padding-left:10px; padding-right:10px;}/*拖动条颜色设置*/QScrollBar::handle:horizontal {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #0181DB, stop:1 #0181DB);/*深蓝*/}QScrollBar::handle:horizontal:hover {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #004BFC, stop:1 #004BFC);/*亮蓝色*/}/*水平右箭头*/QScrollBar::add-line:horizontal {height:10px;width:10px;subcontrol-position: right;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_horizontal.png);}/*水平左箭头*/QScrollBar::sub-line:horizontal {height:10px;width:10px;subcontrol-position: left;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_horizontal.png);}/*灰色滑动条槽*/QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal {height:10px;background: #C0C0C0;}QScrollArea {border: 0px ; }/*//===================================================================================// 函数名称 | QTabWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 这是Tab//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabWidget::pane {border: none;padding: 5px;background:#FFFFFF;}QTabWidget::tab-bar {border: none;}/*//===================================================================================// 函数名称 | QTreeView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 视图//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*常规*/QTreeView,QListView,QTableView{border: 1px solid #004BFC;/*下拉框线条*/selection-background-color: #3300ff;/*下拉框选中背景颜色*//*蓝色*/selection-color: #F0F0F0;/*下拉框选中字体颜色*/}/*item:selected*/QTableView::item:selected, QListView::item:selected, QTreeView::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #004BFC);/*亮蓝色*/}/*item:hover*//*蓝色*//*QTableView::item:hover, QListView::item:hover, QTreeView::item:hover {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #6137DB, stop:1 #6137DB);}*//*item:网格线*/QTableView::item, QListView::item, QTreeView::item {padding: 5px;margin: 0px;border:1px solid #F0F0F0;}/*item:失能*/QTreeView::disable{border: 1px solid #63C488;}/*//===================================================================================// 函数名称 | QHeaderView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | View网格表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QHeaderView::section {font-family:"Microsoft Yahei";padding:3px;margin:0px;color:#F0F0F0;border: 1px solid #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #004BFC);/*亮蓝*/}/*//===================================================================================// 函数名称 | QTabBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | Tab-基体名称-表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabBar::tab {border-bottom-left-radius:0px;border-bottom-right-radius:0px;color: #F0F0F0;min-width: 60px;min-height: 20px;padding: 3px 8px 3px 8px;margin:1px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #004BFC, stop:1 #004BFC);/*亮蓝色*/}/*Tab-基体名称-表头划上去颜色设置;*/QTabBar::tab:hover {color:#FFFF34;/*字体颜色*/background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #330066, stop:1 #330066);/*暗浅蓝色*/}/*Tab表头选中颜色设置;*/QTabBar::tab:selected{border: 1px solid #FFFF34;/*边框*/color:#FAF910;/*字体颜色*/font-weight: bold;/*加粗*/background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #000066, stop:1 #000066);/*暗蓝色*/}/*//===================================================================================// 函数名称 | QStatusBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 状态栏//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QStatusBar::item {border: 1px solid #FF9601;border-radius: 3px;}QToolButton {color: #008432;}
绿色主题:
/*//===================================================================================// 函数名称 | QWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 窗体//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QWidget#widgetMain{border:1px solid #06B74C;border-radius:0px;}.QFrame{border:1px solid #63C488;border-radius:5px;}/*标题栏背景线性渐变*//*线性渐变(QLinearGradient)、辐射渐变(QRadialGradient)、角度渐变(QConicalGradient)*/QWidget#widget_title{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C);}/*//===================================================================================// 函数名称 | QLabel()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 标签//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QLabel#lab_Ico{border-radius:0px;color: #F0F0F0;background-color:rgba(0,0,0,0);border-style:none;}QLabel#lab_Title{border-radius:0px;color: #FFFFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:11pt;font-weight: bold;}QLabel#lab_Wait{border-radius:0px;color: #FFFFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:12pt;font-weight: bold;}/*//===================================================================================// 函数名称 | QLineEdit()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 输入框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QLineEdit线框颜色*/QLineEdit {border: 1px solid #F0F0F0;/*输入框选中,线条颜色-灰色*/border-radius: 5px;padding: 2px;background: none;selection-background-color: #06B74C;}QLineEdit[echoMode="2"] {lineedit-password-character: 9679; }/*//===================================================================================// 函数名称 | QGroupBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 组合框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QGroupBox组线框颜色*/QGroupBox{border: 1px solid #63C488;border-radius: 4px;margin-top: 2ex}QGroupBox::title{subcontrol-origin: margin;subcontrol-position: top left;left:10px;margin-left:0px;padding:0 1px;}/*//===================================================================================// 函数名称 | QPushButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 按钮//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*View左边按钮,添加一条、多条、插入菜单按钮*/QPushButton#btnAdd,QPushButton#btnAddMore,QPushButton#btnInsert,QPushButton#btnDel,QPushButton#btnMoveUp,QPushButton#btnMoveDown,QPushButton#btnOpenCRT,QPushButton#btnSaveCRT,QPushButton#btnStart,QPushButton#btnFIAStatus{border-style: none;border: 2px;color: #06B74C;padding: 2px;min-height: 25px;border-radius:3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #08BA65, stop:1 #009F3C);}QPushButton#btnAdd:hover,QPushButton#btnAddMore:hover,QPushButton#btnInsert:hover,QPushButton#btnDel:hover,QPushButton#btnMoveUp:hover,QPushButton#btnMoveDown:hover,QPushButton#btnOpenCRT:hover,QPushButton#btnSaveCRT:hover,QPushButton#btnStart:hover,QPushButton#btnFIAStatus:hover{color: #47FF9F;}QPushButton#btnAdd:pressed,QPushButton#btnAddMore:pressed,QPushButton#btnInsert:pressed,QPushButton#btnDel:pressed,QPushButton#btnMoveUp:pressed,QPushButton#btnMoveDown:pressed,QPushButton#btnOpenCRT:pressed,QPushButton#btnSaveCRT:pressed,QPushButton#btnStart:pressed,QPushButton#btnFIAStatus:pressed{color:#2A7B44;}QPushButton#btnAdd:disabled,QPushButton#btnAddMore:disabled,QPushButton#btnInsert:disabled,QPushButton#btnDel:disabled,QPushButton#btnMoveUp:disabled,QPushButton#btnMoveDown:disabled,QPushButton#btnOpenCRT:disabled,QPushButton#btnSaveCRT:disabled,QPushButton#btnStart:disabled,QPushButton#btnFIAStatus:disabled{color:#949499;}/*更新、电机设置、导入TXT光谱、导入标准光谱xml按钮*/QPushButton#btnUpdate,QPushButton#btnSetCurZeroPoint,QPushButton#btnSetOffsetStepToCurZeroPoint,QPushButton#btnInSpecTxt,QPushButton#btnImportStandXml,QPushButton#btnSaveSpecFcd{border-radius:5px;background-color:rgb(255 , 0 , 0);border: 1px solid rgb(0 , 255 , 0);padding:4px;}QPushButton#btnUpdate:hover,QPushButton#btnSetCurZeroPoint:hover,QPushButton#btnSetOffsetStepToCurZeroPoint:hover,QPushButton#btnInSpecTxt:hover,QPushButton#btnImportStandXml:hover,QPushButton#btnSaveSpecFcd:hover{background-color:rgb(0 , 0 , 253);border: 2px solid rgb(255 , 0 , 0);}QPushButton#btnUpdate:pressed,QPushButton#btnSetCurZeroPoint:pressed,QPushButton#btnSetOffsetStepToCurZeroPoint:pressed,QPushButton#btnInSpecTxt:pressed,QPushButton#btnImportStandXml:pressed,QPushButton#btnSaveSpecFcd:pressed{background-color:rgb(0, 236 , 237);border: 2px solid rgb(79 , 173 , 216);padding-left:2px;padding-top:2px;}/*最大、最小、关闭按钮图标内部填充前景色*/QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{border-radius:0px;color: #F0F0F0;background-color:rgba(0,0,0,0);border-style:none;}QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(25, 134, 255, 0), stop:1 #63C488);}QPushButton#btnMenu_Close:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(238, 44, 44, 255), stop:1 #FF0000);}/*文件、设置、运行、关于按钮前景色*/QPushButton#menuBtnFile,QPushButton#menuBtnSet,QPushButton#menuBtnRun,QPushButton#menuBtnView,QPushButton#menuBtnAbout{font-family:"Microsoft Yahei";border-style: none;border: 0px;color: #F0F0F0;padding: 0px;min-height: 28px;min-width:80px;border-radius:0px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C);}QPushButton#menuBtnFile:menu-indicator,QPushButton#menuBtnSet:menu-indicator,QPushButton#menuBtnRun:menu-indicator,QPushButton#menuBtnView:menu-indicator,QPushButton#menuBtnAbout:menu-indicator{image:none;}QPushButton#menuBtnFile:hover,QPushButton#menuBtnSet:hover,QPushButton#menuBtnRun:hover,QPushButton#menuBtnView:hover,QPushButton#menuBtnAbout:hover{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #00AE42);}QPushButton#menuBtnFile:pressed,QPushButton#menuBtnSet:pressed,QPushButton#menuBtnRun:pressed,QPushButton#menuBtnView:pressed,QPushButton#menuBtnAbout:pressed{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #008432);}/*//===================================================================================// 函数名称 | QCheckBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 复选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QCheckBox {spacing: 2px; }QCheckBox::indicator {width: 20px;height: 20px;}QCheckBox::indicator:unchecked {image: url(:/Resources/image/checkbox_unchecked.png);}QCheckBox::indicator:checked {image: url(:/Resources/image/checkbox_checked.png);}/*//===================================================================================// 函数名称 | QRadioButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 单选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QRadioButton {spacing: 2px;}QRadioButton::indicator {width: 15px; height: 15px; }QRadioButton::indicator::unchecked {image: url(:/Resources/image/radio_normal.png);}QRadioButton::indicator::checked {image: url(:/Resources/image/radio_selected.png);}/*//===================================================================================// 函数名称 | QComboBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 下拉框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QComboBox,QDateEdit{border-radius: 3px;padding: 1px 10px 1px 5px;border: 1px solid #63C488;}QComboBox::drop-down,QDateEdit::drop-down {subcontrol-origin: padding;subcontrol-position: top right;width: 15px; border-left-width: 1px;border-left-style: solid;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-left-color: #63C488;}QComboBox::down-arrow,QDateEdit::down-arrow {image: url(:/Resources/image/array_down.png);}/*//===================================================================================// 函数名称 | QMenu()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | QMenu边框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QMenu {background-color:#F0F0F0;margin: 0px;border:1px solid #06B74C;/*右键菜单边框颜色蓝色*/}QMenu::item {padding: 2px 12px 2px 12px;height:22;}QMenu::indicator {width: 13px;height: 13px;}/*QMenu选项颜色*/QMenu::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C); }/*QMenu分割线*/QMenu::separator {height: 1px;background: #63C488;}/*//===================================================================================// 函数名称 | QProgressBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 进度条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QProgressBar {border-radius: 5px;text-align: center;text-size:14pt;border: 1px solid #63C488;}QProgressBar::chunk {width: 5px; background-color: #007F00;}/*//===================================================================================// 函数名称 | QSlider()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 滑动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QSlider::groove:horizontal,QSlider::add-page:horizontal {background: #808080; height: 8px; border-radius: 3px; }QSlider::sub-page:horizontal {height: 8px; border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C); }QSlider::handle:horizontal {width: 13px; margin-top: -3px; margin-bottom: -3px; border-radius: 6px;background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,stop:0.6 #F0F0F0, stop:0.778409 #63C488);}QSlider::handle:horizontal:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #06B74C);}QSlider::groove:vertical,QSlider::sub-page:vertical {background:#808080; width: 8px; border-radius: 3px;}QSlider::add-page:vertical {width: 8px;border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C); }QSlider::handle:vertical {height: 14px; margin-left: -3px;margin-right: -3px;border-radius: 6px;background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0, stop:0.778409 #63C488);}QSlider::handle:vertical:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #06B74C);}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 垂直拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:vertical {width:10px; background-color:rgba(0,0,0,0%); padding-top:10px; padding-bottom:10px;}/*拖动条颜色设置*/QScrollBar::handle:vertical {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #00AE42);}QScrollBar::handle:vertical:hover {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C);}/*垂直下箭头*/QScrollBar::add-line:vertical {height:10px;width:10px;subcontrol-position: bottom;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_vertical.png);}/*垂直上箭头*/QScrollBar::sub-line:vertical {height:10px;width:10px;subcontrol-position: top;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_vertical.png);}/*灰色滑动条槽*/QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical {width:10px;background: #C0C0C0;}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 水平拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:horizontal {height:10px; background-color:rgba(0,0,0,0%); padding-left:10px; padding-right:10px;}/*拖动条颜色设置*/QScrollBar::handle:horizontal {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #00AE42); }QScrollBar::handle:horizontal:hover {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C); }/*水平右箭头*/QScrollBar::add-line:horizontal {height:10px;width:10px;subcontrol-position: right;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_horizontal.png);}/*水平左箭头*/QScrollBar::sub-line:horizontal {height:10px;width:10px;subcontrol-position: left;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_horizontal.png);}/*灰色滑动条槽*/QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal {height:10px;background: #C0C0C0;}QScrollArea {border: 0px ; }/*//===================================================================================// 函数名称 | QTabWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 这是Tab//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabWidget::pane {border: none;padding: 5px; background:#FFFFFF;}QTabWidget::tab-bar {border: none;}/*//===================================================================================// 函数名称 | QTreeView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 视图//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTreeView,QListView,QTableView{border: 1px solid #63C488; }QTreeView::disable{border: 1px solid #63C488; }QTableView{padding: 5px; border:1px solid #F0F0F0;background: #FFFFFF; }QTableView::item:selected, QListView::item:selected, QTreeView::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #06B74C, stop:1 #009F3C); }/*QTableView::item:hover, QListView::item:hover, QTreeView::item:hover {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #00AE42); }*//*item:网格线*/QTableView::item, QListView::item, QTreeView::item {padding: 5px; margin: 0px; border:1px solid #F0F0F0;}/*item:失能*/QTreeView::disable{border: 1px solid #63C488;}/*//===================================================================================// 函数名称 | QHeaderView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | View网格表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QHeaderView::section {padding-left:5px;margin:0px;color:#F0F0F0;font-family:"Microsoft Yahei";font-size:10pt;border: 1px solid #F0F0F0;background: #00AE42;}/*//===================================================================================// 函数名称 | QTabBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | Tab-基体名称-表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabBar::tab {border-bottom-left-radius:0px;border-bottom-right-radius:0px;color: #F0F0F0;min-width: 60px;min-height: 20px;padding: 3px 8px 3px 8px;margin:1px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #63C488, stop:1 #00AE42); }QTabBar::tab:selected, QTabBar::tab:hover {color:#000000;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #129F0A, stop:1 #129F0A);}/*//===================================================================================// 函数名称 | QStatusBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 状态栏//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QStatusBar::item {border: 1px solid #63C488;border-radius: 3px;}QToolButton {color: #008432;}
粉色主题:
/*//===================================================================================// 函数名称 | QWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 窗体//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QWidget#widgetMain{border:1px solid #DB61A4;border-radius:0px;}.QFrame{border:1px solid #DB61A4;border-radius:5px;}/*标题栏背景线性渐变*//*线性渐变(QLinearGradient)、辐射渐变(QRadialGradient)、角度渐变(QConicalGradient)*/QWidget#widget_title{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #E93166, stop:1 #FF38C0);/*颜色*/}/*//===================================================================================// 函数名称 | QLabel()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 标签//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QLabel#lab_Ico{border-radius:0px;color: #F0F0F0;/*字体颜色*/background-color:rgba(233,87,114,0);border-style:none;}QLabel#lab_Title{border-radius:0px;color: #F0F0F0;/*字体颜色*/background-color:rgba(0,255,0,0);border-style:none;font-size:11pt;font-weight: bold;}QLabel#lab_Wait{border-radius:0px;color: #00DFFF;background-color:rgba(0,0,0,0);border-style:none;font-size:12pt;font-weight: bold;}/*//===================================================================================// 函数名称 | QLineEdit()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 输入框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QLineEdit线框颜色*/QLineEdit {border: 1px solid #F0F0F0;/*输入框选中,线条颜色-灰色*/border-radius: 5px;padding: 2px;background: none;selection-background-color: #4D4D4D;}/*密码字符*//* echoMode为 0(Normal) | 1(NoEcho) | 2(Password) | 3 (PasswordEchoOnEdit) */QLineEdit[echoMode="2"] {lineedit-password-character: 9679;}/*//===================================================================================// 函数名称 | QGroupBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 组合框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QGroupBox线框颜色*/QGroupBox{border: 1px solid #E94172;border-radius: 4px;margin-top: 2ex}QGroupBox::title{subcontrol-origin: margin;subcontrol-position: top left;left:10px;margin-left:0px;padding:0 1px;}/*//===================================================================================// 函数名称 | QPushButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 按钮//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*View左边按钮,添加一条、多条、插入菜单按钮*/QPushButton#btnAdd,QPushButton#btnAddMore,QPushButton#btnInsert,QPushButton#btnDel,QPushButton#btnMoveUp,QPushButton#btnMoveDown,QPushButton#btnOpenCRT,QPushButton#btnSaveCRT,QPushButton#btnStart,QPushButton#btnFIAStatus{border-style: none;border: 2px;color: #E93166;padding: 2px;min-height: 25px;border-radius:3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #08BA65, stop:1 #009F3C);}QPushButton#btnAdd:hover,QPushButton#btnAddMore:hover,QPushButton#btnInsert:hover,QPushButton#btnDel:hover,QPushButton#btnMoveUp:hover,QPushButton#btnMoveDown:hover,QPushButton#btnOpenCRT:hover,QPushButton#btnSaveCRT:hover,QPushButton#btnStart:hover,QPushButton#btnFIAStatus:hover{color: #FF03C9;}QPushButton#btnAdd:pressed,QPushButton#btnAddMore:pressed,QPushButton#btnInsert:pressed,QPushButton#btnDel:pressed,QPushButton#btnMoveUp:pressed,QPushButton#btnMoveDown:pressed,QPushButton#btnOpenCRT:pressed,QPushButton#btnSaveCRT:pressed,QPushButton#btnStart:pressed,QPushButton#btnFIAStatus:pressed{color:#00CAFF;}QPushButton#btnAdd:disabled,QPushButton#btnAddMore:disabled,QPushButton#btnInsert:disabled,QPushButton#btnDel:disabled,QPushButton#btnMoveUp:disabled,QPushButton#btnMoveDown:disabled,QPushButton#btnOpenCRT:disabled,QPushButton#btnSaveCRT:disabled,QPushButton#btnStart:disabled,QPushButton#btnFIAStatus:disabled{color:#949499;}/*更新、电机设置、导入TXT光谱、导入标准光谱xml按钮,保存光谱*/QPushButton#btnUpdate,QPushButton#btnSetCurZeroPoint,QPushButton#btnSetOffsetStepToCurZeroPoint,QPushButton#btnInSpecTxt,QPushButton#btnImportStandXml,QPushButton#btnSaveSpecFcd{background-color:rgb(255, 0, 0);border-radius:5px;border: 1px solid rgb(255 , 0 , 152);padding:6px;}QPushButton#btnUpdate:hover,QPushButton#btnSetCurZeroPoint:hover,QPushButton#btnSetOffsetStepToCurZeroPoint:hover,QPushButton#btnInSpecTxt:hover,QPushButton#btnImportStandXml:hover,QPushButton#btnSaveSpecFcd:hover{background-color:rgb(0 , 0 , 253);border: 1px solid rgb(255 , 180 , 3);}QPushButton#btnUpdate:pressed,QPushButton#btnSetCurZeroPoint:pressed,QPushButton#btnSetOffsetStepToCurZeroPoint:pressed,QPushButton#btnInSpecTxt:pressed,QPushButton#btnImportStandXml:pressed,QPushButton#btnSaveSpecFcd:pressed{background-color:rgb(0, 236 , 237);border: 2px solid rgb(79 , 173 , 216);padding-left:2px;padding-top:2px;}/*最大最小按钮图标内部填充前景色*/QPushButton#btnMenu,QPushButton#btnMenu_Min,QPushButton#btnMenu_Max,QPushButton#btnMenu_Close{border-radius:0px;color: #F0F0F0;background-color:rgba(223,93,157,0);border-style:none;}/*最大最小按钮hover前景色*/QPushButton#btnMenu:hover,QPushButton#btnMenu_Min:hover,QPushButton#btnMenu_Max:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0,stop:0 #E9819F, stop:1 #EF4375);}/*关闭按钮hover前景色*/QPushButton#btnMenu_Close:hover{background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:0, y2:0, stop:0 rgba(238, 0, 0, 128), stop:1 rgba(238, 44, 44, 255));}/*文件、设置、运行、关于按钮前景色*/QPushButton#menuBtnFile,QPushButton#menuBtnSet,QPushButton#menuBtnRun,QPushButton#menuBtnView,QPushButton#menuBtnAbout{font-family:"Microsoft Yahei";border-style: none;border: 0px;color: #F0F0F0;padding: 0px;min-height: 28px;min-width:80px;border-radius:0px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #E93166, stop:1 #FF42AD);}QPushButton#menuBtnFile:menu-indicator,QPushButton#menuBtnSet:menu-indicator,QPushButton#menuBtnRun:menu-indicator,QPushButton#menuBtnView:menu-indicator,QPushButton#menuBtnAbout:menu-indicator{image:none;}/*文件、设置、运行、关于按钮hover前景色*/QPushButton#menuBtnFile:hover,QPushButton#menuBtnSet:hover,QPushButton#menuBtnRun:hover,QPushButton#menuBtnView:hover,QPushButton#menuBtnAbout:hover{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #E9819F, stop:1 #EF4375);}/*文件、设置、运行、关于按钮pressed前景色*/QPushButton#menuBtnFile:pressed,QPushButton#menuBtnSet:pressed,QPushButton#menuBtnRun:pressed,QPushButton#menuBtnView:pressed,QPushButton#menuBtnAbout:pressed{background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF3366, stop:1 #AF3156);}/*//===================================================================================// 函数名称 | QCheckBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 复选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*复选框*/QCheckBox {spacing: 2px; }QCheckBox::indicator {width: 20px;height: 20px;}QCheckBox::indicator:unchecked {image: url(:/Resources/image/checkbox_unchecked.png);}QCheckBox::indicator:checked {image: url(:/Resources/image/checkbox_checked.png);}/*//===================================================================================// 函数名称 | QRadioButton()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 单选框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*单选框*/QRadioButton {spacing: 2px;}QRadioButton::indicator {width: 15px; height: 15px; }QRadioButton::indicator::unchecked {image: url(:/Resources/image/radio_normal.png);}QRadioButton::indicator::checked {image: url(:/Resources/image/radio_selected.png);}/*//===================================================================================// 函数名称 | QComboBox()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 下拉框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*下拉框*/QComboBox,QDateEdit{border-radius: 3px;padding: 1px 10px 1px 5px;border: 1px solid #E94172;}QComboBox::drop-down,QDateEdit::drop-down {subcontrol-origin: padding;subcontrol-position: top right;width: 15px; border-left-width: 1px;border-left-style: solid;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-left-color: #E94172;}QComboBox::down-arrow,QDateEdit::down-arrow {image: url(:/Resources/image/array_down.png);}/*//===================================================================================// 函数名称 | QMenu()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | QMenu边框//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QMenu边框*/QMenu {background-color:#F0F0F0;margin: 0px;border:1px solid #E9819F;}QMenu::item {padding: 2px 12px 2px 12px;height:22;}QMenu::indicator {width: 13px;height: 13px;}/*QMenu选项颜色*/QMenu::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #E9819F, stop:1 #FF03C9);}/*QMenu分割线*/QMenu::separator {height: 1px;background: #FF3366;}/*//===================================================================================// 函数名称 | QProgressBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 进度条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*进度条*/QProgressBar {border-radius: 5px;text-align: center;text-size:14pt;border: 1px solid #E94172;}QProgressBar::chunk {width: 5px; background-color: #E94172;}/*//===================================================================================// 函数名称 | QSlider()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 滑动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*滑动条*/QSlider::groove:horizontal,QSlider::add-page:horizontal {background: #F7526B;height: 8px; border-radius: 3px; }QSlider::sub-page:horizontal {height: 8px; border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #F7526B, stop:1 #F7526B);}QSlider::handle:horizontal {width: 13px; margin-top: -3px; margin-bottom: -3px; border-radius: 6px;background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.5, fx:0.5, fy:0.5,stop:0.6 #F7526B, stop:0.778409 #F7526B);}QSlider::handle:horizontal:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #4D4D4D);}QSlider::groove:vertical,QSlider::sub-page:vertical {background:#808080; width: 8px; border-radius: 3px;}QSlider::add-page:vertical {width: 8px;border-radius: 3px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4D4D4D, stop:1 #292929); }QSlider::handle:vertical {height: 14px; margin-left: -3px;margin-right: -3px;border-radius: 6px;background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0, stop:0.778409 #636363);}QSlider::handle:vertical:hover {background: qradialgradient(spread: pad, cx: 0.5, cy: 0.5, radius: 0.5, fx: 0.5, fy: 0.5, stop: 0.6 #F0F0F0,stop:0.778409 #4D4D4D);}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 垂直拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*拖动条*/QScrollBar:vertical {width:10px; background-color:rgba(0,0,0,0%); padding-top:10px; padding-bottom:10px;}/*拖动条颜色设置*/QScrollBar::handle:vertical {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #FF3366, stop:1 #FF03C9);}QScrollBar::handle:vertical:hover {width:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #FF00CC, stop:1 #FF02C9);}/*竖直下箭头*/QScrollBar::add-line:vertical {height:10px;width:10px;subcontrol-position: bottom;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_vertical.png);}/*竖直上箭头*/QScrollBar::sub-line:vertical {height:10px;width:10px;subcontrol-position: top;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_vertical.png);}/*灰色滑动条槽*/QScrollBar::add-page:vertical,QScrollBar::sub-page:vertical {width:10px;background: #C0C0C0;}/*//===================================================================================// 函数名称 | QScrollBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 水平拖动条//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QScrollBar:horizontal {height:10px; background-color:rgba(0,0,0,0%);padding-left:10px; padding-right:10px;}QScrollBar::handle:horizontal {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #FF3366, stop:1 #FF03C9);}QScrollBar::handle:horizontal:hover {height:10px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,stop:0 #FF00CC, stop:1 #FF02C9);}/*水平右箭头*/QScrollBar::add-line:horizontal {height:10px;width:10px;subcontrol-position: right;subcontrol-origin: margin;border-image:url(:/Resources/image/add-line_horizontal.png);}/*水平左箭头*/QScrollBar::sub-line:horizontal {height:10px;width:10px;subcontrol-position: left;subcontrol-origin: margin;border-image:url(:/Resources/image/sub-line_horizontal.png);}QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal {height:10px;background: #C0C0C0;}QScrollArea {border: 0px ; }/*//===================================================================================// 函数名称 | QTabWidget()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 这是Tab//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QTabWidget::pane {border: none;padding: 5px;background:#FFFFFF;}QTabWidget::tab-bar {border: none;}/*//===================================================================================// 函数名称 | QTreeView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 视图//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*QTabWidget*/QTreeView,QListView,QTableView{border: 1px solid #E94172;/*下拉框线条*/selection-background-color: #FF03C9;/*下拉框选中背景颜色*/selection-color: #F0F0F0;/*下拉框选中字体颜色*/}/*item:selected*/QTableView::item:selected, QListView::item:selected, QTreeView::item:selected {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF3399, stop:1 #BF2782);}/*item:hover*//*QTableView::item:hover, QListView::item:hover, QTreeView::item:hover {color: #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF42AD, stop:1 #FF71C2);}*//*item:网格线*/QTableView::item, QListView::item, QTreeView::item {padding: 5px;margin: 0px;border:1px solid #F0F0F0;}/*item:失能*/QTreeView::disable{border: 1px solid #63C488;}/*//===================================================================================// 函数名称 | QHeaderView()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | View网格表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*View网格表头颜色设置*/QHeaderView::section {font-family:"Microsoft Yahei";padding:3px;margin:0px;color:#F0F0F0;border: 1px solid #F0F0F0;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF38C0, stop:1 #FF38C0);}/*//===================================================================================// 函数名称 | QTabBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | Tab-基体名称-表头颜色设置//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*//*Tab表头颜色设置*/QTabBar::tab {border-bottom-left-radius:0px;border-bottom-right-radius:0px;color: #F0F0F0;min-width: 60px;min-height: 20px;padding: 3px 8px 3px 8px;margin:1px;background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF38C0, stop:1 #FF1CD4);}/*Tab表头划上去颜色设置;*/QTabBar::tab:hover {color:#FFFF34;/*字体颜色*/background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF42AD, stop:1 #E94172);}/*Tab表头选中颜色设置;*/QTabBar::tab:selected{border: 1px solid #FFFF34;/*边框*/color:#FAF910;/*字体颜色*/font-weight: bold;/*加粗*/background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #FF42AD, stop:1 #E94172);}/*//===================================================================================// 函数名称 | QStatusBar()//-----------------------------------------------------------------------------------// 函数输入 |//-----------------------------------------------------------------------------------// 函数功能 | 状态栏//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 |xt//===================================================================================*/QStatusBar::item {border: 1px solid #BF2782;border-radius: 3px;}
其中搜索某路径下所有匹配格式后缀,例如".css"的文件的函数:
//===================================================================================// 函数名称 | GetAllFormatFilePath()//-----------------------------------------------------------------------------------// 函数输入 | input: findPath: 指定文件夹//,format: 指定格式//,receiveFilePath: 存储所有指定后缀名文件的路径(绝对路径+文件名)//-----------------------------------------------------------------------------------// 函数功能 | 保存文件//-----------------------------------------------------------------------------------// 返回值为 |//-----------------------------------------------------------------------------------// 函数作者 | xt//===================================================================================bool myHelper::GetAllFormatFilePath(QString &findPath, QString format, QList<QString>& receiveFilePath){QDir *dir = new QDir(findPath);if(!dir->exists())return false;QStringList filter;filter << format;QList<QFileInfo> *dirInfoList = new QList<QFileInfo>(dir->entryInfoList(QDir::Dirs));QList<QFileInfo> *fomatInfoList = new QList<QFileInfo>(dir->entryInfoList(filter));for (int i = 0; i < dirInfoList->count(); i++){if(dirInfoList->at(i).fileName() == "." || dirInfoList->at(i).fileName() == "..")continue;QString dirTmp = dirInfoList->at(i).filePath();GetAllFormatFilePath(dirTmp, format, receiveFilePath);}for (int i = 0; i < fomatInfoList->count(); i++){receiveFilePath << fomatInfoList->at(i).filePath();}delete dirInfoList;delete dir;return true;}