Commit fef85f74 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.PropertyEditor: Adding lookup rules for different versions

The property editor will now try to find a pane for the specific
version first.


If we have a QtQuick.Item 2.0

We first look for: QtQuick/ItemPane_2_0.qml
And then fallback to: QtQuick/ItemPane.qml

The same does apply for the specifics file.

Task-number: QTCREATORBUG-8681
Change-Id: If210998780073295f168169d2fc424288d3bd6a0
Reviewed-by: default avatarThomas Hartmann <>
parent 4acece6d
......@@ -1087,6 +1087,22 @@ QString PropertyEditor::locateQmlFile(const NodeMetaInfo &info, const QString &r
static QDir resourcesDir(resourcePropertyEditorPath);
QDir importDir(info.importDirectoryPath() + QLatin1String(Constants::QML_DESIGNER_SUBFOLDER));
const QString versionString = QLatin1String("_") + QString::number(info.majorVersion())
+ QLatin1String("_")
+ QString::number(info.minorVersion());
QString relativePathWithoutEnding = relativePath;
const QString relativePathWithVersion = relativePathWithoutEnding + versionString + QLatin1String(".qml");
//Check for qml files with versions first
if (importDir.exists(relativePathWithVersion))
return importDir.absoluteFilePath(relativePathWithVersion);
if (fileSystemDir.exists(relativePathWithVersion))
return fileSystemDir.absoluteFilePath(relativePathWithVersion);
if (resourcesDir.exists(relativePathWithVersion))
return resourcesDir.absoluteFilePath(relativePathWithVersion);
if (importDir.exists(relativePath))
return importDir.absoluteFilePath(relativePath);
if (fileSystemDir.exists(relativePath))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment