From e4b49acf391c38995cc0b17c8212bee6e8d6b6d3 Mon Sep 17 00:00:00 2001
From: Alessandro Portale <alessandro.portale@nokia.com>
Date: Fri, 30 Jul 2010 12:16:11 +0200
Subject: [PATCH] Let Qml scene define the window size on Desktop

And also prevent a 0-size if the Qml document does not specify
width/height.
---
 src/plugins/qmlprojectmanager/wizards/templates/cpp/main.cpp     | 1 -
 .../wizards/templates/cpp/qmlapplicationview.cpp                 | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/plugins/qmlprojectmanager/wizards/templates/cpp/main.cpp b/src/plugins/qmlprojectmanager/wizards/templates/cpp/main.cpp
index 9e0f56038aa..d5ad9864ab9 100644
--- a/src/plugins/qmlprojectmanager/wizards/templates/cpp/main.cpp
+++ b/src/plugins/qmlprojectmanager/wizards/templates/cpp/main.cpp
@@ -16,7 +16,6 @@ int main(int argc, char *argv[])
 #elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
     qmlApp.showMaximized();
 #else
-    qmlApp.setGeometry(QRect(100, 100, 360, 640));
     qmlApp.show();
 #endif
     return app.exec();
diff --git a/src/plugins/qmlprojectmanager/wizards/templates/cpp/qmlapplicationview.cpp b/src/plugins/qmlprojectmanager/wizards/templates/cpp/qmlapplicationview.cpp
index d9a24eebfb3..fe7b19a67bb 100644
--- a/src/plugins/qmlprojectmanager/wizards/templates/cpp/qmlapplicationview.cpp
+++ b/src/plugins/qmlprojectmanager/wizards/templates/cpp/qmlapplicationview.cpp
@@ -33,6 +33,7 @@ QmlApplicationView::QmlApplicationView(const QString &mainQmlFile, QWidget *pare
     setSource(QUrl(m_d->mainQmlFile));
     connect(engine(), SIGNAL(quit()), SLOT(close()));
     setResizeMode(QDeclarativeView::SizeRootObjectToView);
+    setMinimumSize(10, 10); // Prevent size of 0 if Qml document does not specify width/height
 }
 
 QmlApplicationView::~QmlApplicationView()
-- 
GitLab