Skip to content
Snippets Groups Projects
Commit 0418e6dc authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Making the QmlApplicationViewer Qt5 compatible


This patch makes a "QmlApplicationViewer" based application from
the Qt Quick app wizard buildable and runnable with Qt5. Note,
that this is still QtQuick 1.1. We are still missing a QtQuick 2.0
based pendant of QmlApplicationViewer.

In addition (separate patch), we may want to tweak the wizard
flags in a way that the wizard allows to create a "Qt Quick 1"
application for a Qt5 target. (Or perhaps we explicitly do not
want that, because we want the developer to use QtQuick 2 with
Qt5?)

Change-Id: Ie3fc8a77a1ff4fba3244f2047d2685c570014356
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@nokia.com>
parent 6887d28e
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,7 @@ void QmlApplicationViewer::addImportPath(const QString &path)
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
{
#if QT_VERSION < 0x050000
#if defined(Q_OS_SYMBIAN)
// If the version of Qt on the device is < 4.7.2, that attribute won't work
if (orientation != ScreenOrientationAuto) {
......@@ -155,6 +156,9 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
#endif // QT_VERSION < 0x040702
};
setAttribute(attribute, true);
#else // QT_VERSION < 0x050000
Q_UNUSED(orientation)
#endif // QT_VERSION < 0x050000
}
void QmlApplicationViewer::showExpanded()
......
......@@ -4,7 +4,11 @@
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
QT += declarative
equals(QT_MAJOR_VERSION, 5) {
QT += quick1
} else {
QT += declarative
}
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
......
......@@ -463,7 +463,7 @@ QString QtQuickApp::componentSetDir(ComponentSet componentSet) const
}
}
const int QtQuickApp::StubVersion = 21;
const int QtQuickApp::StubVersion = 22;
} // namespace Internal
} // namespace Qt4ProjectManager
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment