彻底改版2.0
This commit is contained in:
33
ui/uidemo09/main.cpp
Normal file
33
ui/uidemo09/main.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "frmmain.h"
|
||||
#include "appinit.h"
|
||||
#include "quihelper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//设置不应用操作系统设置比如字体
|
||||
QApplication::setDesktopSettingsAware(false);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
|
||||
#endif
|
||||
QApplication a(argc, argv);
|
||||
AppInit::Instance()->start();
|
||||
|
||||
QUIHelper::setFont();
|
||||
QUIHelper::setCode();
|
||||
|
||||
//加载样式表
|
||||
QFile file(":/qss/psblack.css");
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
QString qss = QLatin1String(file.readAll());
|
||||
QString paletteColor = qss.mid(20, 7);
|
||||
qApp->setPalette(QPalette(paletteColor));
|
||||
qApp->setStyleSheet(qss);
|
||||
file.close();
|
||||
}
|
||||
|
||||
frmMain w;
|
||||
QUIHelper::setFormInCenter(&w);
|
||||
w.show();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user