更新代码

master
feiyangqingyun 2021-12-27 09:38:55 +08:00
parent 5c0c9637c4
commit 6eea8cbbee
6 changed files with 34 additions and 23 deletions

View File

@ -17,7 +17,6 @@ greaterThan(QT_MAJOR_VERSION, 5) {
SUBDIRS -= hotkey
SUBDIRS -= shortcut
SUBDIRS -= qwtdemo
SUBDIRS -= qcustomplotdemo
}
win32 {

View File

@ -53,7 +53,7 @@ QString FlatUI::setProgressQss(QProgressBar *bar, int barHeight,
{
QStringList list;
list.append(QString("QProgressBar{font:%1pt;background:%2;max-height:%3px;border-radius:%4px;text-align:center;border:1px solid %2;}")
list.append(QString("QProgressBar{font:%1px;background:%2;max-height:%3px;border-radius:%4px;text-align:center;border:1px solid %2;}")
.arg(fontSize).arg(normalColor).arg(barHeight).arg(barRadius));
list.append(QString("QProgressBar:chunk{border-radius:%2px;background-color:%1;}")
.arg(chunkColor).arg(barRadius));

View File

@ -53,7 +53,7 @@ public:
static QString setProgressQss(QProgressBar *bar,
int barHeight = 8, //进度条高度
int barRadius = 5, //进度条半径
int fontSize = 9, //文字字号
int fontSize = 12, //文字字号
const QString &normalColor = "#E8EDF2", //正常颜色
const QString &chunkColor = "#E74C3C"); //进度颜色

View File

@ -24,9 +24,7 @@ void frmMain::initForm()
int rowHeight = 23;
ui->tableWidget->horizontalHeader()->setFixedHeight(rowHeight);
for (int i = 0; i < 5; ++i) {
ui->tableWidget->setRowHeight(i, rowHeight);
}
ui->tableWidget->verticalHeader()->setDefaultSectionSize(rowHeight);
//加载鼠标右键菜单翻译文件
QTranslator *translator1 = new QTranslator(qApp);

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>817</width>
<height>616</height>
<width>820</width>
<height>632</height>
</rect>
</property>
<property name="windowTitle">
@ -310,7 +310,7 @@
<item row="3" column="2">
<widget class="QPushButton" name="btnWidget">
<property name="text">
<string>弹出新窗体</string>
<string>新窗体</string>
</property>
</widget>
</item>
@ -427,7 +427,7 @@
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun'; font-size:9.07563pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'SimSun'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9.07563pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
@ -545,9 +545,6 @@ p, li { white-space: pre-wrap; }
</item>
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderMinimumSectionSize">
<number>20</number>
</attribute>
@ -563,9 +560,6 @@ p, li { white-space: pre-wrap; }
<attribute name="verticalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="verticalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<row>
<property name="text">
<string>1</string>
@ -765,7 +759,7 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>817</width>
<width>820</width>
<height>26</height>
</rect>
</property>
@ -892,12 +886,28 @@ p, li { white-space: pre-wrap; }
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>369</x>
<y>235</y>
<x>424</x>
<y>265</y>
</hint>
<hint type="destinationlabel">
<x>468</x>
<y>235</y>
<x>547</x>
<y>260</y>
</hint>
</hints>
</connection>
<connection>
<sender>verticalSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>progressBar2</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>736</x>
<y>101</y>
</hint>
<hint type="destinationlabel">
<x>760</x>
<y>115</y>
</hint>
</hints>
</connection>

View File

@ -5,9 +5,13 @@ int main(int argc, char *argv[])
{
//设置不应用操作系统设置比如字体
QApplication::setDesktopSettingsAware(false);
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
QApplication::setAttribute(Qt::AA_Use96Dpi);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
#endif
QApplication a(argc, argv);
//a.setFont(QFont("Microsoft Yahei", 9));
QFont font;