forked from qt-creator/qt-creator
QmlDesigner: Open TextureEditor by double-clicking a texture
Change-Id: I58645f31f244cf4e5909b35f1cae224a55f4e9a4 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
This commit is contained in:
@@ -34,6 +34,8 @@ Rectangle {
|
||||
else if (mouse.button === Qt.RightButton)
|
||||
root.showContextMenu()
|
||||
}
|
||||
|
||||
onDoubleClicked: materialBrowserTexturesModel.openTextureEditor();
|
||||
}
|
||||
|
||||
Image {
|
||||
|
@@ -3,13 +3,12 @@
|
||||
|
||||
#include "materialbrowsertexturesmodel.h"
|
||||
|
||||
#include <bindingproperty.h>
|
||||
#include <designmodewidget.h>
|
||||
#include <qmldesignerplugin.h>
|
||||
#include <qmlobjectnode.h>
|
||||
#include <variantproperty.h>
|
||||
#include <qmltimelinekeyframegroup.h>
|
||||
#include "utils/qtcassert.h"
|
||||
#include "designmodewidget.h"
|
||||
#include "qmldesignerplugin.h"
|
||||
#include "qmlobjectnode.h"
|
||||
#include "variantproperty.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
@@ -264,4 +263,9 @@ void MaterialBrowserTexturesModel::applyToSelectedModel(qint64 internalId)
|
||||
}
|
||||
}
|
||||
|
||||
void MaterialBrowserTexturesModel::openTextureEditor()
|
||||
{
|
||||
QmlDesignerPlugin::instance()->mainWidget()->showDockWidget("TextureEditor", true);
|
||||
}
|
||||
|
||||
} // namespace QmlDesigner
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <modelnode.h>
|
||||
#include "modelnode.h"
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QObject>
|
||||
@@ -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();
|
||||
|
Reference in New Issue
Block a user