diff --git a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml index b0861aa882e..a666354b832 100644 --- a/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml +++ b/share/qtcreator/qmldesigner/materialBrowserQmlSource/TextureItem.qml @@ -34,6 +34,8 @@ Rectangle { else if (mouse.button === Qt.RightButton) root.showContextMenu() } + + onDoubleClicked: materialBrowserTexturesModel.openTextureEditor(); } Image { diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp index b7851157ee4..781b43622fd 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.cpp @@ -3,13 +3,12 @@ #include "materialbrowsertexturesmodel.h" -#include -#include -#include -#include -#include -#include -#include "utils/qtcassert.h" +#include "designmodewidget.h" +#include "qmldesignerplugin.h" +#include "qmlobjectnode.h" +#include "variantproperty.h" + +#include namespace QmlDesigner { @@ -264,4 +263,9 @@ void MaterialBrowserTexturesModel::applyToSelectedModel(qint64 internalId) } } +void MaterialBrowserTexturesModel::openTextureEditor() +{ + QmlDesignerPlugin::instance()->mainWidget()->showDockWidget("TextureEditor", true); +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.h b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.h index 3f5a59ea54f..34e4fb23647 100644 --- a/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.h +++ b/src/plugins/qmldesigner/components/materialbrowser/materialbrowsertexturesmodel.h @@ -3,7 +3,7 @@ #pragma once -#include +#include "modelnode.h" #include #include @@ -49,6 +49,7 @@ public: Q_INVOKABLE void deleteTexture(int idx); Q_INVOKABLE void applyToSelectedMaterial(qint64 internalId); Q_INVOKABLE void applyToSelectedModel(qint64 internalId); + Q_INVOKABLE void openTextureEditor(); signals: void isEmptyChanged();