QmlDesigner: Simply property type name check

Move some repetitive pattern to PropertyMetaInfo

Change-Id: Iba8722d3d95881c1db85c12cbc2b2b8c4b629f2c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Marco Bubke
2022-06-30 18:04:32 +02:00
parent 87dfe4725a
commit fe50af151d
7 changed files with 16 additions and 10 deletions

View File

@@ -139,7 +139,7 @@ void MaterialEditorView::changeValue(const QString &name)
bool propertyTypeUrl = false;
if (metaInfo.isValid() && metaInfo.hasProperty(propertyName)) {
if (metaInfo.property(propertyName).hasPropertyTypeName("QUrl", "url")) {
if (metaInfo.property(propertyName).propertyTypeNameIsUrl()) {
// turn absolute local file paths into relative paths
propertyTypeUrl = true;
QString filePath = castedValue.toUrl().toString();