mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
HiDPI workaroud
This commit is contained in:
@@ -32,12 +32,13 @@ int main(int argc, char *argv[]) {
|
||||
Windows_SetCrashHandler();
|
||||
#endif
|
||||
|
||||
QApplication a(argc, argv);
|
||||
// pre-init QApplication
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
|
||||
#endif
|
||||
QApplication::setAttribute(Qt::AA_DontUseNativeDialogs);
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
auto preQApp = new QApplication(argc, argv);
|
||||
|
||||
// Clean
|
||||
QDir::setCurrent(QApplication::applicationDirPath());
|
||||
@@ -74,6 +75,16 @@ int main(int argc, char *argv[]) {
|
||||
QDir::setCurrent(wd.absoluteFilePath("config"));
|
||||
QDir("temp").removeRecursively();
|
||||
|
||||
// HiDPI workaround
|
||||
if (ReadFileText("./groups/HiDPI").toInt() == 1) {
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
}
|
||||
|
||||
// init QApplication
|
||||
delete preQApp;
|
||||
QApplication a(argc, argv);
|
||||
|
||||
// RunGuard
|
||||
RunGuard guard("nekoray" + wd.absolutePath());
|
||||
quint64 guard_data_in = GetRandomUint64();
|
||||
|
||||
Reference in New Issue
Block a user