diff --git a/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp index f8e98afc749..3b19047fb2a 100644 --- a/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/share/qtcreator/templates/qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -26,6 +26,9 @@ QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_QNX) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); #elif defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) const QString pathInInstallDir = QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); @@ -65,7 +68,7 @@ void QtQuick2ApplicationViewer::addImportPath(const QString &path) void QtQuick2ApplicationViewer::showExpanded() { -#if defined(Q_WS_SIMULATOR) +#if defined(Q_WS_SIMULATOR) || defined(Q_OS_QNX) showFullScreen(); #else show(); diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp b/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp index bfa891a896e..ec44f30cf92 100644 --- a/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp +++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/main.cpp @@ -1,18 +1,13 @@ #include -#include -#include +#include "qtquick2applicationviewer.h" -int main( int argc, char** argv ) +int main(int argc, char *argv[]) { - QGuiApplication app( argc, argv ); + QGuiApplication app(argc, argv); - QQuickView view; - view.setResizeMode( QQuickView::SizeRootObjectToView ); - view.setSource( QUrl( "app/native/qml/main.qml" ) ); - - QObject::connect( view.engine(), SIGNAL( quit() ), - QCoreApplication::instance(), SLOT( quit() ) ); - view.show(); + QtQuick2ApplicationViewer viewer; + viewer.setMainQmlFile(QLatin1String("qml/main.qml")); // MAINQML + viewer.showExpanded(); return app.exec(); -} +} \ No newline at end of file diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro b/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro index b55dddd24fc..622209b2abd 100644 --- a/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro +++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/project.pro @@ -1,5 +1,8 @@ TEMPLATE = app +# Please do not modify the following line. +include(qtquick2applicationviewer/qtquick2applicationviewer.pri) + QT += qml quick # Additional import path used to resolve QML modules in Creator's code model diff --git a/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml b/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml index bf339251658..d8e5618ae09 100644 --- a/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml +++ b/share/qtcreator/templates/wizards/bb-qt5-quick2app/wizard.xml @@ -42,5 +42,8 @@ + + +