BatteryMonitor/main.cpp

24 lines
776 B
C++

#include "dialoglogin.h"
#include <QApplication>
#include <QTranslator>
int main(int argc, char *argv[])
{
// 设置高DPI
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QGuiApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
#endif
QApplication a(argc, argv);
a.setStyleSheet("QToolTip { font-size: 18px; font-family: 'SimHei'; }");
DialogLogin loginWidget;
loginWidget.setStyleSheet("background-color: #FFFFFF;");
loginWidget.show();
return a.exec();
}