Implement drag-and-drop from Assets View to Texture Editor

The asset (i.e. image) can now be dragged to the "Source" property of
the Texture Editor.

Task-number: QDS-8341
Change-Id: I2d30bdf245a8328a864c116c727d3faaaad347cc
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Samuel Ghinet
2022-11-24 14:54:22 +02:00
parent 3321261cf3
commit 45c7a6b8e6
3 changed files with 30 additions and 1 deletions

View File

@@ -42,6 +42,8 @@ class TextureEditorContextObject : public QObject
Q_PROPERTY(QQmlPropertyMap *backendValues READ backendValues WRITE setBackendValues NOTIFY backendValuesChanged)
Q_PROPERTY(QString activeDragSuffix READ activeDragSuffix NOTIFY activeDragSuffixChanged)
public:
TextureEditorContextObject(QQmlContext *context, QObject *parent = nullptr);
@@ -95,6 +97,9 @@ public:
bool hasSingleModelSelection() const;
void setHasSingleModelSelection(bool b);
QString activeDragSuffix() const;
void setActiveDragSuffix(const QString &suffix);
bool hasAliasExport() const { return m_aliasExport; }
void setSelectedMaterial(const ModelNode &matNode);
@@ -126,6 +131,7 @@ signals:
void hasQuick3DImportChanged();
void hasMaterialLibraryChanged();
void hasSingleModelSelectionChanged();
void activeDragSuffixChanged();
private:
QUrl m_specificsUrl;
@@ -152,6 +158,8 @@ private:
bool m_hasSingleModelSelection = false;
ModelNode m_selectedTexture;
QString m_activeDragSuffix;
};
} // QmlDesigner