aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-12-13 21:15:35 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-14 14:44:17 +0000
commit3e3c57188c868d2c3d434c2e3b876ac89b40ae2f (patch)
tree282772a95de19ce7fc17e0af7eff8a69e9c49f1c
parent8e4b91030fa73a84dd4704d2d0073e63e4646fed (diff)
Fix QQuickStyle::setFallbackStyle() in static builds
Use QQmlFile::urlToLocalFileOrQrc() instead of QUrl::toLocalFile() to avoid assuming a local file path. In static builds, QML files are in QRC. Task-number: QTBUG-65016 Change-Id: Ide36e5269d8692620f352574c726fbd1997c0a77 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quickcontrols2/qquickstyle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp
index 80ed5ea9..64289d46 100644
--- a/src/quickcontrols2/qquickstyle.cpp
+++ b/src/quickcontrols2/qquickstyle.cpp
@@ -211,7 +211,7 @@ struct QQuickStyleSpec
for (const QString &path : stylePaths) {
QString stylePath = findStyle(path, style);
if (!stylePath.isEmpty()) {
- custom = !stylePath.startsWith(baseUrl.toLocalFile());
+ custom = !stylePath.startsWith(QQmlFile::urlToLocalFileOrQrc(baseUrl));
style = stylePath;
resolved = true;
break;
@@ -292,7 +292,7 @@ void QQuickStylePrivate::init(const QUrl &baseUrl)
spec->resolve(baseUrl);
if (!spec->fallbackStyle.isEmpty()) {
- QString fallbackStyle = spec->findStyle(baseUrl.toLocalFile(), spec->fallbackStyle);
+ QString fallbackStyle = spec->findStyle(QQmlFile::urlToLocalFileOrQrc(baseUrl), spec->fallbackStyle);
if (fallbackStyle.isEmpty()) {
if (spec->fallbackStyle.compare(QStringLiteral("Default")) != 0) {
qWarning() << "ERROR: unable to locate fallback style" << spec->fallbackStyle;