Commit 1a0bed27 authored by El Mehdi Fekari's avatar El Mehdi Fekari Committed by Nicolas Arnaud-Cormos

QNX: Use QtQuick2ApplicationViewer for BB Quick 2 app templates

Change-Id: I7b5029856bcba23e89a5ff83a5ae62906d1dbbe1
Reviewed-by: default avatarFabian Bumberger <fbumberger@rim.com>
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent fe10c7aa
......@@ -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();
......
#include <QGuiApplication>
#include <QQuickView>
#include <QQmlEngine>
#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
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
......
......@@ -42,5 +42,8 @@
<file source="qml/main.qml" openeditor="true"/>
<file source="bar-descriptor.xml" openeditor="true"/>
<file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
<file source="../../qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.h" target="qtquick2applicationviewer/qtquick2applicationviewer.h" />
<file source="../../qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.cpp" target="qtquick2applicationviewer/qtquick2applicationviewer.cpp" />
<file source="../../qtquick2app/qtquick2applicationviewer/qtquick2applicationviewer.pri" target="qtquick2applicationviewer/qtquick2applicationviewer.pri" />
</files>
</wizard>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment