Make ui independent of launch path (#31517)

* Make ui independent of launch path

* comment
old-commit-hash: 5d4dc1dc2ffa5c4066dc33b818e4a2f0497b7043
This commit is contained in:
Adeeb Shihadeh
2024-02-19 22:34:24 -08:00
committed by GitHub
parent 5b8eb7f9c7
commit 97b823efe6
+6
View File
@@ -5,6 +5,7 @@
#include <vector>
#include <QApplication>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QHash>
@@ -114,6 +115,11 @@ void initApp(int argc, char *argv[], bool disable_hidpi) {
qputenv("QT_DBL_CLICK_DIST", QByteArray::number(150));
// ensure the current dir matches the exectuable's directory
QApplication tmp(argc, argv);
QString appDir = QCoreApplication::applicationDirPath();
QDir::setCurrent(appDir);
setQtSurfaceFormat();
}