QmlDesigner.PropertyEditor: Adding lookup rules for different versions

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

Example:

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: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Thomas Hartmann
2013-06-05 11:57:24 +02:00
parent 4acece6d9e
commit fef85f745f

View File

@@ -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;
relativePathWithoutEnding.chop(4);
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))