Save and restore window size
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -19,6 +19,7 @@
|
||||
#endif
|
||||
#include <KLocalizedContext>
|
||||
#include <KLocalizedString>
|
||||
#include <KWindowConfig>
|
||||
|
||||
#include "neochat-version.h"
|
||||
|
||||
@@ -152,6 +153,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
});
|
||||
const auto rootObjects = engine.rootObjects();
|
||||
for (auto obj : rootObjects) {
|
||||
auto view = qobject_cast<QQuickWindow*>(obj);
|
||||
if (view) {
|
||||
KConfig dataResource("data", KConfig::SimpleConfig, QStandardPaths::AppDataLocation);
|
||||
KConfigGroup windowGroup(&dataResource, "Window");
|
||||
KWindowConfig::restoreWindowSize(view, windowGroup);
|
||||
KWindowConfig::restoreWindowPosition(view, windowGroup);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return QApplication::exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user