diff --git a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 547602d..b58190f 100644 --- a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -1,4 +1,4 @@ -// checksum 0x56a9 version 0x80001 +// checksum 0xc01f version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific @@ -23,15 +23,28 @@ class QtQuick2ApplicationViewerPrivate QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) { -#if defined(Q_OS_MAC) +#if defined(Q_OS_IOS) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_MAC) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(Q_OS_UNIX) - const QString pathInInstallDir = +#elif defined(Q_OS_BLACKBERRY) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); +#elif !defined(Q_OS_ANDROID) + QString pathInInstallDir = QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; + pathInInstallDir = + QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#elif defined(Q_OS_ANDROID_NO_SDK) + return QLatin1String("/data/user/qt/") + path; #endif return path; } @@ -52,7 +65,11 @@ QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) { d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); +#else setSource(QUrl::fromLocalFile(d->mainQmlFile)); +#endif } void QtQuick2ApplicationViewer::addImportPath(const QString &path) @@ -62,7 +79,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/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h index baf67f2..cf66f14 100644 --- a/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h +++ b/demos/quick2chart/qtquick2applicationviewer/qtquick2applicationviewer.h @@ -1,4 +1,4 @@ -// checksum 0xfde6 version 0x80001 +// checksum 0xfde6 version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific diff --git a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 547602d..b58190f 100644 --- a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -1,4 +1,4 @@ -// checksum 0x56a9 version 0x80001 +// checksum 0xc01f version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific @@ -23,15 +23,28 @@ class QtQuick2ApplicationViewerPrivate QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) { -#if defined(Q_OS_MAC) +#if defined(Q_OS_IOS) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_MAC) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(Q_OS_UNIX) - const QString pathInInstallDir = +#elif defined(Q_OS_BLACKBERRY) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); +#elif !defined(Q_OS_ANDROID) + QString pathInInstallDir = QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; + pathInInstallDir = + QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#elif defined(Q_OS_ANDROID_NO_SDK) + return QLatin1String("/data/user/qt/") + path; #endif return path; } @@ -52,7 +65,11 @@ QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) { d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); +#else setSource(QUrl::fromLocalFile(d->mainQmlFile)); +#endif } void QtQuick2ApplicationViewer::addImportPath(const QString &path) @@ -62,7 +79,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/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h index baf67f2..cf66f14 100644 --- a/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h +++ b/demos/quick2oscilloscope/qtquick2applicationviewer/qtquick2applicationviewer.h @@ -1,4 +1,4 @@ -// checksum 0xfde6 version 0x80001 +// checksum 0xfde6 version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific diff --git a/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.cpp b/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.cpp index 547602d..b58190f 100644 --- a/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.cpp +++ b/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.cpp @@ -1,4 +1,4 @@ -// checksum 0x56a9 version 0x80001 +// checksum 0xc01f version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific @@ -23,15 +23,28 @@ class QtQuick2ApplicationViewerPrivate QString QtQuick2ApplicationViewerPrivate::adjustPath(const QString &path) { -#if defined(Q_OS_MAC) +#if defined(Q_OS_IOS) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("%1/%2") + .arg(QCoreApplication::applicationDirPath(), path); +#elif defined(Q_OS_MAC) if (!QDir::isAbsolutePath(path)) return QString::fromLatin1("%1/../Resources/%2") .arg(QCoreApplication::applicationDirPath(), path); -#elif defined(Q_OS_UNIX) - const QString pathInInstallDir = +#elif defined(Q_OS_BLACKBERRY) + if (!QDir::isAbsolutePath(path)) + return QString::fromLatin1("app/native/%1").arg(path); +#elif !defined(Q_OS_ANDROID) + QString pathInInstallDir = QString::fromLatin1("%1/../%2").arg(QCoreApplication::applicationDirPath(), path); if (QFileInfo(pathInInstallDir).exists()) return pathInInstallDir; + pathInInstallDir = + QString::fromLatin1("%1/%2").arg(QCoreApplication::applicationDirPath(), path); + if (QFileInfo(pathInInstallDir).exists()) + return pathInInstallDir; +#elif defined(Q_OS_ANDROID_NO_SDK) + return QLatin1String("/data/user/qt/") + path; #endif return path; } @@ -52,7 +65,11 @@ QtQuick2ApplicationViewer::~QtQuick2ApplicationViewer() void QtQuick2ApplicationViewer::setMainQmlFile(const QString &file) { d->mainQmlFile = QtQuick2ApplicationViewerPrivate::adjustPath(file); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile)); +#else setSource(QUrl::fromLocalFile(d->mainQmlFile)); +#endif } void QtQuick2ApplicationViewer::addImportPath(const QString &path) @@ -62,7 +79,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/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.h b/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.h index baf67f2..cf66f14 100644 --- a/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.h +++ b/tests/quick2chartproperties/qtquick2applicationviewer/qtquick2applicationviewer.h @@ -1,4 +1,4 @@ -// checksum 0xfde6 version 0x80001 +// checksum 0xfde6 version 0x90005 /* This file was generated by the Qt Quick 2 Application wizard of Qt Creator. QtQuick2ApplicationViewer is a convenience class containing mobile device specific