增加样式表
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "qtextstream.h"
|
#include "qtextstream.h"
|
||||||
#include "qtranslator.h"
|
#include "qtranslator.h"
|
||||||
#include "qdesktopwidget.h"
|
#include "qdesktopwidget.h"
|
||||||
|
#include "qmessagebox.h"
|
||||||
#include "qdebug.h"
|
#include "qdebug.h"
|
||||||
|
|
||||||
frmMain::frmMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::frmMain)
|
frmMain::frmMain(QWidget *parent) : QMainWindow(parent), ui(new Ui::frmMain)
|
||||||
@@ -157,9 +158,9 @@ void frmMain::initStyle()
|
|||||||
{
|
{
|
||||||
//加载样式表
|
//加载样式表
|
||||||
QString qss;
|
QString qss;
|
||||||
//QFile file(":/qss/psblack.css");
|
QFile file(":/qss/psblack.css");
|
||||||
//QFile file(":/qss/flatwhite.css");
|
//QFile file(":/qss/flatwhite.css");
|
||||||
QFile file(":/qss/lightblue.css");
|
//QFile file(":/qss/lightblue.css");
|
||||||
if (file.open(QFile::ReadOnly)) {
|
if (file.open(QFile::ReadOnly)) {
|
||||||
#if 1
|
#if 1
|
||||||
//用QTextStream读取样式文件不用区分文件编码 带bom也行
|
//用QTextStream读取样式文件不用区分文件编码 带bom也行
|
||||||
@@ -196,3 +197,8 @@ void frmMain::initTranslator()
|
|||||||
translator2->load(":/image/widgets.qm");
|
translator2->load(":/image/widgets.qm");
|
||||||
qApp->installTranslator(translator2);
|
qApp->installTranslator(translator2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void frmMain::on_btnInfo_clicked()
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, "提示", "这里是提示信息!");
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ private slots:
|
|||||||
void initOther();
|
void initOther();
|
||||||
void initStyle();
|
void initStyle();
|
||||||
void initTranslator();
|
void initTranslator();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_btnInfo_clicked();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FRMMAIN_H
|
#endif // FRMMAIN_H
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
frmMain w;
|
frmMain w;
|
||||||
w.setWindowTitle("styledemo Author: feiyangqingyun@163.com QQ: 517216493");
|
w.setWindowTitle("styledemo Author: feiyangqingyun@163.com QQ: 517216493");
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
//居中显示窗体
|
//居中显示窗体
|
||||||
|
|||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#FFFFFF;
|
||||||
|
color:#57595B;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled,QTabBar::tab:disabled{
|
||||||
background:#FFFFFF;
|
background:#FFFFFF;
|
||||||
border-color:#E4E4E4;
|
border-color:#E4E4E4;
|
||||||
color:#B6B6B6;
|
color:#B6B6B6;
|
||||||
|
|||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#EAF7FF;
|
||||||
|
color:#386487;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled,QTabBar::tab:disabled{
|
||||||
background:#EAF7FF;
|
background:#EAF7FF;
|
||||||
border-color:#DEF0FE;
|
border-color:#DEF0FE;
|
||||||
color:#C0DCF2;
|
color:#C0DCF2;
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ border:1px solid #242424;
|
|||||||
border-radius:3px;
|
border-radius:3px;
|
||||||
padding:2px;
|
padding:2px;
|
||||||
background:none;
|
background:none;
|
||||||
selection-background-color:#484848;
|
selection-background-color:#00BB9E;
|
||||||
selection-color:#DCDCDC;
|
selection-color:#FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{
|
QLineEdit:focus,QTextEdit:focus,QPlainTextEdit:focus,QSpinBox:focus,QDoubleSpinBox:focus,QComboBox:focus,QDateEdit:focus,QTimeEdit:focus,QDateTimeEdit:focus,QLineEdit:hover,QTextEdit:hover,QPlainTextEdit:hover,QSpinBox:hover,QDoubleSpinBox:hover,QComboBox:hover,QDateEdit:hover,QTimeEdit:hover,QDateTimeEdit:hover{
|
||||||
@@ -632,7 +632,16 @@ QTabWidget::pane:bottom{bottom:-1px;}
|
|||||||
QTabWidget::pane:left{right:-1px;}
|
QTabWidget::pane:left{right:-1px;}
|
||||||
QTabWidget::pane:right{left:-1px;}
|
QTabWidget::pane:right{left:-1px;}
|
||||||
|
|
||||||
*:disabled{
|
QDialog {
|
||||||
|
background-color:#444444;
|
||||||
|
color:#DCDCDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDialogButtonBox > QPushButton {
|
||||||
|
min-width:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
*:disabled,QMenu::item:disabled,QTabBar::tab:disabled{
|
||||||
background:#444444;
|
background:#444444;
|
||||||
border-color:#484848;
|
border-color:#484848;
|
||||||
color:#242424;
|
color:#242424;
|
||||||
|
|||||||
Reference in New Issue
Block a user