Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.11.0
-
Windows 10 1703
Qt.labs.platform 1.0
Qt.labs.settings 1.0
Description
If a native MenuBar from qt.labs.platform is used, the y position of the ApplicationWindow is applied incorrectly after a restart if it has been saved via Qt.labs.settings. Appearently the height of the MenuBar is not considered as part of the ApplicationWindow, thus the window is a bit closer to the bottom edge of the screen.
Example
main.qml:
import QtQuick 2.11 import QtQuick.Controls 2.4 import Qt.labs.settings 1.0 import Qt.labs.platform 1.0 as Platform ApplicationWindow { id: window visible: true width: 640 height: 480 title: qsTr("Example") Settings { id: appSettings property alias x: window.x property alias y: window.y property alias width: window.width property alias height: window.height } Platform.MenuBar { Platform.Menu { id: settingsToolButton title: "File" Platform.MenuItem { id: settingsMenuItem text: "New..." } } } }
main.cpp
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); app.setOrganizationName("random.company"); app.setOrganizationDomain("random-company.com"); app.setApplicationName("Test PRG1"); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); }