Gui: [skip ci] set working directory when using QUiLoader so it can find its resources

This commit is contained in:
wmayer
2020-06-02 13:27:28 +02:00
parent c5193ec6f7
commit fa7ae69dac

View File

@@ -119,6 +119,7 @@ PreferenceUiForm::PreferenceUiForm(const QString& fn, QWidget* parent)
#if QT_VERSION >= 0x040500
loader.setLanguageChangeEnabled(true);
#endif
loader.setWorkingDirectory(QFileInfo(fn).absolutePath());
QFile file(fn);
if (file.open(QFile::ReadOnly))
form = loader.load(&file, this);