Let Qml scene define the window size on Desktop

And also prevent a 0-size if the Qml document does not specify
width/height.
This commit is contained in:
Alessandro Portale
2010-07-30 12:16:11 +02:00
parent 7bcbf65ad6
commit e4b49acf39
2 changed files with 1 additions and 1 deletions

View File

@@ -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();

View File

@@ -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()