aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols2/qquickstyleselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickcontrols2/qquickstyleselector.cpp')
-rw-r--r--src/quickcontrols2/qquickstyleselector.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quickcontrols2/qquickstyleselector.cpp b/src/quickcontrols2/qquickstyleselector.cpp
index cd89ba95..93249192 100644
--- a/src/quickcontrols2/qquickstyleselector.cpp
+++ b/src/quickcontrols2/qquickstyleselector.cpp
@@ -144,11 +144,15 @@ QString QQuickStyleSelector::select(const QString &fileName) const
const QString selectedPath = selectionHelper(stylePath, fileName, allSelectors(false));
if (selectedPath.startsWith(QLatin1Char(':')))
return QLatin1String("qrc") + selectedPath;
- return QUrl::fromLocalFile(selectedPath).toString();
+ return QUrl::fromLocalFile(QFileInfo(selectedPath).absoluteFilePath()).toString();
}
}
- QUrl url(d->baseUrl.toString() + QLatin1Char('/') + fileName);
+ QString base = d->baseUrl.toString();
+ if (!base.isEmpty() && !base.endsWith(QLatin1Char('/')))
+ base += QLatin1Char('/');
+
+ QUrl url(base + fileName);
if (isLocalScheme(url.scheme())) {
QString equivalentPath = QLatin1Char(':') + url.path();
QString selectedPath = d->select(equivalentPath);