支持文件qss
This commit is contained in:
parent
e53ad5903c
commit
7dc8b59aa2
86
bin/defaultstyle.qss
Normal file
86
bin/defaultstyle.qss
Normal file
@ -0,0 +1,86 @@
|
||||
QLineEdit
|
||||
{
|
||||
border: 1px solid #ABCDA0;
|
||||
border-radius: 3px;
|
||||
padding-left: 5px;
|
||||
background-color: #F2F2F2;
|
||||
color: #A0A0A0;
|
||||
selection-background-color: #A0A0A0;
|
||||
selection-color: #F2F2F2;
|
||||
font-family: "Microsoft YaHei";
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
QLineEdit:hover
|
||||
{
|
||||
border: 1px solid #298DFF;
|
||||
border-radius: 3px;
|
||||
background-color: #F2F2F2;
|
||||
color: #298DFF;
|
||||
selection-background-color: #298DFF;
|
||||
selection-color: #F2F2F2;
|
||||
}
|
||||
|
||||
QLineEdit[echoMode="2"]
|
||||
{
|
||||
lineedit-password-character: 9679;
|
||||
lineedit-password-mask-delay: 2000;
|
||||
}
|
||||
|
||||
QLineEdit:disabled
|
||||
{
|
||||
border: 1px solid #CDCDCD;
|
||||
background-color: #CDCDCD;
|
||||
color: #B4B4B4;
|
||||
}
|
||||
|
||||
QLineEdit:read-only
|
||||
{
|
||||
background-color: #CDCDCD;
|
||||
color: #F2F2F2;
|
||||
}
|
||||
QTextEdit
|
||||
{
|
||||
color: black;
|
||||
background-color: white;
|
||||
border:1px solid black;
|
||||
}
|
||||
QPushButton
|
||||
{border:1px solid black;}
|
||||
QGroupBox
|
||||
{
|
||||
background-color: #4F4F4F;
|
||||
border: 1px solid #969696;
|
||||
color: rgb(13,157,219);
|
||||
border-radius: 5px;
|
||||
margin-top: 2ex;
|
||||
}
|
||||
QDateEdit
|
||||
{
|
||||
border: 1px solid rgb(22,63,23);
|
||||
color: black;
|
||||
}
|
||||
QPushButton
|
||||
{
|
||||
background: white;
|
||||
border-radius:10px;
|
||||
padding:7px 10px;
|
||||
}
|
||||
QPushButton:hover
|
||||
{
|
||||
background: #0d9ddb;
|
||||
border-radius:10px;
|
||||
padding:7px 10px;
|
||||
}
|
||||
QPushButton:pressed
|
||||
{
|
||||
background: #0d9aab;
|
||||
border-radius:10px;
|
||||
padding:7px 10px;
|
||||
}
|
||||
QPushButton:checked
|
||||
{
|
||||
background: #0d9ddb;
|
||||
border-radius:10px;
|
||||
padding:7px 10px;
|
||||
};
|
Binary file not shown.
@ -12,23 +12,22 @@
|
||||
|
||||
#include "framewindow.h"
|
||||
#include <QStackedWidget>
|
||||
|
||||
#include "framelesswindow.h"
|
||||
|
||||
#include <QTextCodec>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
void LoadStyleFile(QString strStyle)
|
||||
{
|
||||
QFile qss(strStyle);
|
||||
qss.open(QFile::ReadOnly);
|
||||
qApp->setStyleSheet(qss.readAll());
|
||||
QString sqss =qss.readAll();
|
||||
qApp->setStyleSheet(sqss);
|
||||
qss.close();
|
||||
}
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
qInstallMessageHandler(MessageHandler);
|
||||
//qInstallMessageHandler(MessageHandler);
|
||||
QTextCodec *codec = QTextCodec::codecForName("GBK");
|
||||
QTextCodec::setCodecForLocale(codec);
|
||||
FrameWindow *mainw = new FrameWindow;
|
||||
@ -39,69 +38,6 @@ int main(int argc, char *argv[])
|
||||
QFont globalFont;
|
||||
globalFont.setFamily("黑体");
|
||||
QApplication::setFont(globalFont);
|
||||
//
|
||||
LoadStyleFile(QApplication::applicationDirPath()+"/defaultstyle.qss");
|
||||
|
||||
#if 0
|
||||
QString qss1=R"(
|
||||
QLineEdit{
|
||||
border: 1px solid #ABCDA0; /* 边框宽度为1px,颜色为#A0A0A0 */
|
||||
border-radius: 3px; /* 边框圆角 */
|
||||
padding-left: 5px; /* 文本距离左边界有5px */
|
||||
background-color: #F2F2F2; /* 背景颜色 */
|
||||
color: #A0A0A0; /* 文本颜色 */
|
||||
selection-background-color: #A0A0A0; /* 选中文本的背景颜色 */
|
||||
selection-color: #F2F2F2; /* 选中文本的颜色 */
|
||||
font-family: "Microsoft YaHei"; /* 文本字体族 */
|
||||
font-size: 10pt; /* 文本字体大小 */
|
||||
}
|
||||
|
||||
QLineEdit:hover { /* 鼠标悬浮在QLineEdit时的状态 */
|
||||
border: 1px solid #298DFF;
|
||||
border-radius: 3px;
|
||||
background-color: #F2F2F2;
|
||||
color: #298DFF;
|
||||
selection-background-color: #298DFF;
|
||||
selection-color: #F2F2F2;
|
||||
}
|
||||
|
||||
QLineEdit[echoMode="2"] { /* QLineEdit有输入掩码时的状态 */
|
||||
lineedit-password-character: 9679;
|
||||
lineedit-password-mask-delay: 2000;
|
||||
}
|
||||
|
||||
QLineEdit:disabled { /* QLineEdit在禁用时的状态 */
|
||||
border: 1px solid #CDCDCD;
|
||||
background-color: #CDCDCD;
|
||||
color: #B4B4B4;
|
||||
}
|
||||
|
||||
QLineEdit:read-only { /* QLineEdit在只读时的状态 */
|
||||
background-color: #CDCDCD;
|
||||
color: #F2F2F2;
|
||||
}
|
||||
QTextEdit{ color: black;
|
||||
background-color: white; border:1px solid black;
|
||||
}
|
||||
QPushButton{border:1px solid black;}
|
||||
QGroupBox{
|
||||
background-color: #4F4F4F;
|
||||
border: 1px solid #969696;
|
||||
color: rgb(13,157,219);
|
||||
border-radius: 5px;
|
||||
margin-top: 2ex;
|
||||
}
|
||||
QDateEdit
|
||||
{
|
||||
border: 1px solid rgb(22,63,23);
|
||||
color: black;
|
||||
}
|
||||
|
||||
)";
|
||||
|
||||
a.setStyleSheet(qss1);
|
||||
|
||||
#endif
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ void MedicalRecordWidget::init()
|
||||
// m_labName.setFixedWidth(iwidth);
|
||||
// m_labLaterality.setFixedWidth(iwidth);
|
||||
//m_labDiagnosticRecord.setFixedWidth(iwidth);
|
||||
#if 1
|
||||
#if 0
|
||||
m_btnOk.setStyleSheet("QPushButton{\
|
||||
background: white;\
|
||||
border-radius:10px;padding:7px 10px;\
|
||||
|
Loading…
x
Reference in New Issue
Block a user