on xenial help sign in
Keep the way window geometry was being used before
commit1efe4de73725bbd7d9c1cc29c009fd4b813f94ef authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 15 Apr 2015, 12:20 (12 years ago) parentf455422
3 files changed+4−8
src/ApplicationArguments.h+2−3 src/Dash/main.cpp+1−1 src/main.cpp+1−4
src/ApplicationArguments.h+2−3
@@ -29,9 +29,8 @@ class ApplicationArguments : public QObject
2929 Q_OBJECT
3030public:
3131 // Not exposed to the app as setSize isn't invokable
32− void setSize(int width, int height) {
33− m_size.rwidth() = width;
34− m_size.rheight() = height;
32+ void setSize(const QSize &size) {
33+ m_size = size;
3534 }
3635
3736 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[])
6565 parser.value(windowGeometryOption).split('x').size() == 2)
6666 {
6767 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()));
6969 }
7070
7171 if (getenv("QT_LOAD_TESTABILITY")) {
src/main.cpp+1−4
@@ -56,6 +56,7 @@ int main(int argc, const char *argv[])
5656 }
5757
5858 ApplicationArguments qmlArgs;
59+ qmlArgs.setSize(parser.windowGeometry());
5960
6061 // The testability driver is only loaded by QApplication but not by QGuiApplication.
6162 // 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[])
9091 }
9192 TouchRegistry touchRegistry;
9293 view->installEventFilter(&touchRegistry);
93− if (parser.windowGeometry().isValid()) {
94− view->setWidth(parser.windowGeometry().width());
95− view->setHeight(parser.windowGeometry().height());
96− }
9794
9895 // You will need this if you want to interact with touch-only components using a mouse
9996 // Needed only when manually testing on a desktop.