on xenial help sign in
Keep the way window geometry was being used before
1efe4deDaniel d'Andrada
src/ApplicationArguments.h+2−3
@@ -29,9 +29,8 @@ class ApplicationArguments : public QObject
29 Q_OBJECT
29 Q_OBJECT
30public:
30public:
31 // Not exposed to the app as setSize isn't invokable
31 // Not exposed to the app as setSize isn't invokable
32− void setSize(int width, int height) {
32+ void setSize(const QSize &size) {
33− m_size.rwidth() = width;
33+ m_size = size;
34− m_size.rheight() = height;
35 }
34 }
36
35
37 Q_INVOKABLE bool hasGeometry() const { return m_size.isValid(); }
36 Q_INVOKABLE bool hasGeometry() const { return m_size.isValid(); }
src/Dash/main.cpp+1−1
@@ -65,7 +65,7 @@ int main(int argc, const char *argv[])
65 parser.value(windowGeometryOption).split('x').size() == 2)
65 parser.value(windowGeometryOption).split('x').size() == 2)
66 {
66 {
67 QStringList geom = parser.value(windowGeometryOption).split('x');
67 QStringList geom = parser.value(windowGeometryOption).split('x');
68− qmlArgs.setSize(geom.at(0).toInt(), geom.at(1).toInt());
68+ qmlArgs.setSize(QSize(geom.at(0).toInt(), geom.at(1).toInt()));
69 }
69 }
70
70
71 if (getenv("QT_LOAD_TESTABILITY")) {
71 if (getenv("QT_LOAD_TESTABILITY")) {
src/main.cpp+1−4
@@ -56,6 +56,7 @@ int main(int argc, const char *argv[])
56 }
56 }
57
57
58 ApplicationArguments qmlArgs;
58 ApplicationArguments qmlArgs;
59+ qmlArgs.setSize(parser.windowGeometry());
59
60
60 // The testability driver is only loaded by QApplication but not by QGuiApplication.
61 // The testability driver is only loaded by QApplication but not by QGuiApplication.
61 // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.
62 // However, QApplication depends on QWidget which would add some unneeded overhead => Let's load the testability driver on our own.
@@ -90,10 +91,6 @@ int main(int argc, const char *argv[])
90 }
91 }
91 TouchRegistry touchRegistry;
92 TouchRegistry touchRegistry;
92 view->installEventFilter(&touchRegistry);
93 view->installEventFilter(&touchRegistry);
93− if (parser.windowGeometry().isValid()) {
94− view->setWidth(parser.windowGeometry().width());
95− view->setHeight(parser.windowGeometry().height());
96− }
97
94
98 // You will need this if you want to interact with touch-only components using a mouse
95 // You will need this if you want to interact with touch-only components using a mouse
99 // Needed only when manually testing on a desktop.
96 // Needed only when manually testing on a desktop.