调整部分样式

This commit is contained in:
2026-05-11 09:11:30 +08:00
parent e40a72cd7c
commit c8a5a121c9
31 changed files with 2763 additions and 660 deletions
+10 -1
View File
@@ -44,7 +44,9 @@ BarcodeEditor::BarcodeEditor(QWidget *parent) :
ui(new Ui::BarcodeEditor)
{
ui->setupUi(this);
setWindowModality(Qt::NonModal);
applyStyleSheet();
m_dateFormatEditor = new DateFormatEditor();
m_dateReplaceEditor = new DateReplaceEditor();
m_counterEditor = new CounterEditor();
@@ -382,6 +384,13 @@ bool BarcodeEditor::eventFilter(QObject *obj, QEvent *event)
return false;
}
void BarcodeEditor::applyStyleSheet()
{
// QFile stylesFile(":/styles.qss");
// QTextStream ts(&stylesFile);
// setStyleSheet(ts.readAll());
}
void BarcodeEditor::onContentChanged(QString content)
{
const DateItemModel& dateVm = m_vm.dateViewModel;
+2
View File
@@ -185,6 +185,8 @@ protected:
private:
Ui::BarcodeEditor *ui;
void applyStyleSheet();
BarcodeViewModel m_vm;
DateFormatEditor *m_dateFormatEditor = nullptr;
+31 -1
View File
@@ -173,6 +173,36 @@ QSpinBox::down-arrow {
<height>471</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"> QTabWidget {
border: none;
background-color: #7B838E;
}
QTabBar::tab {
min-width: 90px;
min-height: 45px;
padding: 4px 10px;
margin-right: 4px;
border: 1px solid #dddddd;
border-bottom: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-color: #5396C1;
color: #ffffff;
}
QTabWidget::tab-bar {
top: -3px;
left: 10px;
}
QTabBar::tab:selected {
background-color: #6bb1e0;
color: #ffffff;
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
}</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
@@ -270,7 +300,7 @@ QSpinBox::down-arrow {
<x>420</x>
<y>120</y>
<width>261</width>
<height>291</height>
<height>231</height>
</rect>
</property>
<property name="title">
+104 -2
View File
@@ -20,9 +20,108 @@
<string>Dialog</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget{
<string notr="true">QWidget {
font-size: 16px;
}</string>
}
QPushButton#closeBtn, QPushButton#checkBtn{
background-color: #E6F7FF;
border: 1px solid #87CEEB;
border-radius: 4px;
font-size: 24px;
color: #228B22;
}
QPushButton#closeBtn:hover,QPushButton#checkBtn:hover{
background-color: #D1E9FF;
}
QPushButton#closeBtn:pressed,QPushButton#checkBtn:pressed{
background-color: #BAE7FF;
}
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
width: 180px;
height: 90px;
}
QPushButton:hover {
background-color: #5396C1;
}
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
QComboBox {
border: 1px solid #000000;
border-radius: 3px;
font-size: 14px;
width: 180px;
height: 90px;
padding-left: 10px; /* 文字左边距,避免紧贴边缘 */
}
/* 下拉箭头区域 */
QComboBox::drop-down {
border: 1px solid #333333;
border-radius: 3px;
width: 30px; /* 箭头区域宽度 */
background-color: #5396C1;
}
/* 下拉箭头图标 */
QComboBox::down-arrow {
image: url(image/down_white.png);
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
}
/* 悬停状态 */
QComboBox:hover {
background-color: #efefef;
}
// 下拉框
QComboBox QAbstractItemView {
border: 1px solid #000000;
border-radius: 3px;
font-size: 14px;
selection-background-color: #5396C1; /* 选中项背景色(稍深) */
selection-color: #ffffff;
}
QSpinBox::up-button {
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
border: 1px solid #333333;
border-radius: 3px;
background-color: #5396C1;
}
QSpinBox::up-arrow {
image: url(image/up_white.png);
}
QSpinBox::down-button {
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
border: 1px solid #333333;
border-radius: 3px;
background-color: #5396C1;
}
QSpinBox::down-arrow {
image: url(image/down_white.png);
}
</string>
</property>
<widget class="QSpinBox" name="BarCodeScale">
<property name="geometry">
@@ -42,6 +141,9 @@
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="keyboardTracking">
<bool>false</bool>
</property>
+103 -1
View File
@@ -22,7 +22,109 @@
<property name="styleSheet">
<string notr="true">QWidget{
font-size: 16px;
}</string>
}
QWidget {
font-size: 16px;
}
QPushButton#closeBtn, QPushButton#checkBtn{
background-color: #E6F7FF;
border: 1px solid #87CEEB;
border-radius: 4px;
font-size: 24px;
color: #228B22;
}
QPushButton#closeBtn:hover,QPushButton#checkBtn:hover{
background-color: #D1E9FF;
}
QPushButton#closeBtn:pressed,QPushButton#checkBtn:pressed{
background-color: #BAE7FF;
}
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
width: 180px;
height: 90px;
}
QPushButton:hover {
background-color: #5396C1;
}
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
QComboBox {
border: 1px solid #000000;
border-radius: 3px;
font-size: 14px;
width: 180px;
height: 90px;
padding-left: 10px; /* 文字左边距,避免紧贴边缘 */
}
/* 下拉箭头区域 */
QComboBox::drop-down {
border: 1px solid #333333;
border-radius: 3px;
width: 30px; /* 箭头区域宽度 */
background-color: #5396C1;
}
/* 下拉箭头图标 */
QComboBox::down-arrow {
image: url(image/down_white.png);
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
}
/* 悬停状态 */
QComboBox:hover {
background-color: #efefef;
}
// 下拉框
QComboBox QAbstractItemView {
border: 1px solid #000000;
border-radius: 3px;
font-size: 14px;
selection-background-color: #5396C1; /* 选中项背景色(稍深) */
selection-color: #ffffff;
}
QSpinBox::up-button {
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
border: 1px solid #333333;
border-radius: 3px;
background-color: #5396C1;
}
QSpinBox::up-arrow {
image: url(image/up_white.png);
}
QSpinBox::down-button {
width: 16px; /* 图标显示宽度 */
height: 16px; /* 图标显示高度 */
border: 1px solid #333333;
border-radius: 3px;
background-color: #5396C1;
}
QSpinBox::down-arrow {
image: url(image/down_white.png);
}
</string>
</property>
<widget class="QComboBox" name="comboBoxType">
<property name="geometry">
+8 -1
View File
@@ -257,7 +257,14 @@ void ScheduleShiftsEditor::applyStyleSheet()
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
}
)";
this->setStyleSheet(styleSheet);
// QFile stylesFile(":/styles.qss");
// QTextStream ts(&stylesFile);
// auto str = ts.readAll();
// setStyleSheet(str);
// ui->tabWidget->setStyleSheet(str);
// // this->setStyleSheet(styleSheet);
}
SelectedStyleTimeEdit::SelectedStyleTimeEdit(QWidget *parent)
+78 -4
View File
@@ -13,6 +13,77 @@
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">
QPushButton#closeBtn, QPushButton#checkBtn{
background-color: #E6F7FF;
border: 1px solid #87CEEB;
border-radius: 4px;
font-size: 24px;
color: #228B22;
}
QPushButton#closeBtn:hover,QPushButton#checkBtn:hover{
background-color: #D1E9FF;
}
QPushButton#closeBtn:pressed,QPushButton#checkBtn:pressed{
background-color: #BAE7FF;
}
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
width: 100px;
height: 50px;
}
QPushButton:hover {
background-color: #5396C1;
}
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
QTabWidget {
border: 1px solid #dddddd;
background-color: #ffffff;
}
QTabBar::tab:focus {
outline: none;
}
QTabBar::tab {
min-width: 90px;
min-height: 45px;
padding: 4px 10px;
margin-right: 4px;
border: 1px solid #dddddd;
border-bottom: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-color: #5396C1;
color: #ffffff;
}
QTabWidget::tab-bar {
top: -3px;
left: 10px;
}
QTabBar::tab:selected {
background-color: #6bb1e0;
color: #ffffff;
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
}</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
@@ -48,8 +119,8 @@
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>42</height>
<width>102</width>
<height>52</height>
</size>
</property>
<property name="maximumSize">
@@ -91,8 +162,8 @@
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>42</height>
<width>102</width>
<height>52</height>
</size>
</property>
<property name="maximumSize">
@@ -139,6 +210,9 @@
</item>
<item row="1" column="0" colspan="4">
<widget class="QTabWidget" name="tabWidget">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="currentIndex">
<number>1</number>
</property>
+91
View File
@@ -0,0 +1,91 @@
/*
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
width: 180px;
height: 90px;
}
QPushButton:hover {
background-color: #5396C1;
}
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
*/
QPushButton#closeBtn, QPushButton#checkBtn{
background-color: #E6F7FF;
border: 1px solid #87CEEB;
border-radius: 4px;
font-size: 24px;
color: #228B22;
}
QPushButton#closeBtn:hover,QPushButton#checkBtn:hover{
background-color: #D1E9FF;
}
QPushButton#closeBtn:pressed,QPushButton#checkBtn:pressed{
background-color: #BAE7FF;
}
QPushButton {
background-color: #5396C1;
color: #ffffff;
border: 1px solid #000000;
border-radius: 3px;
font-size: 18px;
font-weight:500;
width: 100px;
height: 50px;
}
QPushButton:hover {
background-color: #5396C1;
}
QPushButton:disabled {
background-color: #7C828E;
color: #606060;
border-color: #808080;
}
QTabWidget::pane {
border: 1px solid #dddddd;
background-color: #ffffff;
}
QTabBar::tab:focus {
outline: none;
}
QTabBar::tab {
min-width: 90px;
min-height: 45px;
padding: 4px 10px;
margin-right: 4px;
border: 1px solid #dddddd;
border-bottom: none;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
background-color: #5396C1;
color: #ffffff;
}
QTabWidget::tab-bar {
top: -3px;
left: 10px;
}
QTabBar::tab:selected {
background-color: #6bb1e0;
color: #ffffff;
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
}