forked from qt-creator/qt-creator
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:
@@ -1087,6 +1087,22 @@ QString PropertyEditor::locateQmlFile(const NodeMetaInfo &info, const QString &r
|
|||||||
static QDir resourcesDir(resourcePropertyEditorPath);
|
static QDir resourcesDir(resourcePropertyEditorPath);
|
||||||
QDir importDir(info.importDirectoryPath() + QLatin1String(Constants::QML_DESIGNER_SUBFOLDER));
|
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))
|
if (importDir.exists(relativePath))
|
||||||
return importDir.absoluteFilePath(relativePath);
|
return importDir.absoluteFilePath(relativePath);
|
||||||
if (fileSystemDir.exists(relativePath))
|
if (fileSystemDir.exists(relativePath))
|
||||||
|
|||||||
Reference in New Issue
Block a user