diff options
-rw-r--r-- | src/controls/Styles/Android/qquickandroidstyle.cpp | 6 | ||||
-rw-r--r-- | src/controls/Styles/Android/qquickandroidstyle_p.h | 3 | ||||
-rw-r--r-- | src/controls/plugin.cpp | 20 |
3 files changed, 19 insertions, 10 deletions
diff --git a/src/controls/Styles/Android/qquickandroidstyle.cpp b/src/controls/Styles/Android/qquickandroidstyle.cpp index 0c57d795..36fe0e82 100644 --- a/src/controls/Styles/Android/qquickandroidstyle.cpp +++ b/src/controls/Styles/Android/qquickandroidstyle.cpp @@ -85,11 +85,11 @@ QByteArray QQuickAndroidStyle1::data() const return m_data; } -QString QQuickAndroidStyle1::filePath(const QString &fileName) const +QUrl QQuickAndroidStyle1::filePath(const QString &fileName) const { if (!fileName.isEmpty()) - return m_path + QFileInfo(fileName).fileName(); - return QString(); + return QUrl::fromLocalFile(m_path + QFileInfo(fileName).fileName()); + return {}; } QColor QQuickAndroidStyle1::colorValue(uint value) const diff --git a/src/controls/Styles/Android/qquickandroidstyle_p.h b/src/controls/Styles/Android/qquickandroidstyle_p.h index 6911eb8d..856b5753 100644 --- a/src/controls/Styles/Android/qquickandroidstyle_p.h +++ b/src/controls/Styles/Android/qquickandroidstyle_p.h @@ -41,6 +41,7 @@ #define QQUICKANDROIDSTYLE_P_H #include <QtCore/qobject.h> +#include <QtCore/qurl.h> #include <QtGui/qcolor.h> QT_BEGIN_NAMESPACE @@ -57,7 +58,7 @@ public: QByteArray data() const; Q_INVOKABLE QColor colorValue(uint value) const; - Q_INVOKABLE QString filePath(const QString &fileName) const; + Q_INVOKABLE QUrl filePath(const QString &fileName) const; enum Gravity { NO_GRAVITY = 0x0000, diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 82eef800..6d34f285 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -239,30 +239,38 @@ void QtQuickControls1Plugin::initializeEngine(QQmlEngine *engine, const char *ur QString QtQuickControls1Plugin::fileLocation() const { -#ifndef QT_STATIC +#ifdef Q_OS_ANDROID + return "qrc:/android_rcc_bundle/qml/QtQuick/Controls"; +#else +# ifndef QT_STATIC if (isLoadedFromResource()) return "qrc:/QtQuick/Controls"; return baseUrl().toString(); -#else +# else return "qrc:/qt-project.org/imports/QtQuick/Controls"; +# endif #endif } bool QtQuickControls1Plugin::isLoadedFromResource() const { -#ifdef QT_STATIC +#ifdef Q_OS_ANDROID + return true; +#else +# ifdef QT_STATIC // When static it is included automatically // for us. return false; -#endif -#if defined(ALWAYS_LOAD_FROM_RESOURCES) +# endif +# if defined(ALWAYS_LOAD_FROM_RESOURCES) return true; -#else +# else // If one file is missing, it will load all the files from the resource QFile file(baseUrl().toLocalFile() + "/ApplicationWindow.qml"); if (!file.exists()) return true; return false; +# endif #endif } |