forked from qt-creator/qt-creator
Enable common keyboard hotkey actions for the Edit View 3D
Clicking undo, redo, delete, or save keyboard hotkeys while the Edit View 3D has focus is working now. Additionally this commit introduces a generic command for carrying any variant data from puppet to creator side. This significantly simplifies and avoids the boiler plate work of sending actions from puppet to creator side. Current commands can be ported to use this generic command but this is not part of this commit. Also a similar command to work the other way around could be implemented. Task-number: QDS-1266 Change-Id: I40fdf6b215ce77402250a791ea49cbdcd2a9d6eb Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -31,6 +31,7 @@ HEADERS += $$PWD/drop3dlibraryitemcommand.h
|
|||||||
HEADERS += $$PWD/update3dviewstatecommand.h
|
HEADERS += $$PWD/update3dviewstatecommand.h
|
||||||
HEADERS += $$PWD/enable3dviewcommand.h
|
HEADERS += $$PWD/enable3dviewcommand.h
|
||||||
HEADERS += $$PWD/view3dclosedcommand.h
|
HEADERS += $$PWD/view3dclosedcommand.h
|
||||||
|
HEADERS += $$PWD/puppettocreatorcommand.h
|
||||||
|
|
||||||
SOURCES += $$PWD/synchronizecommand.cpp
|
SOURCES += $$PWD/synchronizecommand.cpp
|
||||||
SOURCES += $$PWD/debugoutputcommand.cpp
|
SOURCES += $$PWD/debugoutputcommand.cpp
|
||||||
@@ -63,3 +64,4 @@ SOURCES += $$PWD/drop3dlibraryitemcommand.cpp
|
|||||||
SOURCES += $$PWD/update3dviewstatecommand.cpp
|
SOURCES += $$PWD/update3dviewstatecommand.cpp
|
||||||
SOURCES += $$PWD/enable3dviewcommand.cpp
|
SOURCES += $$PWD/enable3dviewcommand.cpp
|
||||||
SOURCES += $$PWD/view3dclosedcommand.cpp
|
SOURCES += $$PWD/view3dclosedcommand.cpp
|
||||||
|
SOURCES += $$PWD/puppettocreatorcommand.cpp
|
||||||
|
@@ -0,0 +1,55 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "puppettocreatorcommand.h"
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
// A generic command that can hold a variant data from puppet to creator
|
||||||
|
|
||||||
|
PuppetToCreatorCommand::PuppetToCreatorCommand(Type type, const QVariant &data)
|
||||||
|
: m_type(type)
|
||||||
|
, m_data(data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const PuppetToCreatorCommand &command)
|
||||||
|
{
|
||||||
|
out << qint32(command.type());
|
||||||
|
out << command.data();
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command)
|
||||||
|
{
|
||||||
|
qint32 type;
|
||||||
|
in >> type;
|
||||||
|
command.m_type = PuppetToCreatorCommand::Type(type);
|
||||||
|
in >> command.m_data;
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
@@ -0,0 +1,56 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2020 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <qmetatype.h>
|
||||||
|
#include <QDataStream>
|
||||||
|
|
||||||
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
class PuppetToCreatorCommand
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
enum Type { Key_Pressed, None };
|
||||||
|
|
||||||
|
PuppetToCreatorCommand(Type type, const QVariant &data);
|
||||||
|
PuppetToCreatorCommand() = default;
|
||||||
|
|
||||||
|
Type type() const { return m_type; }
|
||||||
|
QVariant data() const { return m_data; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
Type m_type = None;
|
||||||
|
QVariant m_data;
|
||||||
|
|
||||||
|
friend QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);
|
||||||
|
};
|
||||||
|
|
||||||
|
QDataStream &operator<<(QDataStream &out, const PuppetToCreatorCommand &command);
|
||||||
|
QDataStream &operator>>(QDataStream &in, PuppetToCreatorCommand &command);
|
||||||
|
|
||||||
|
} // namespace QmlDesigner
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(QmlDesigner::PuppetToCreatorCommand)
|
@@ -72,6 +72,7 @@
|
|||||||
#include "changeselectioncommand.h"
|
#include "changeselectioncommand.h"
|
||||||
#include "drop3dlibraryitemcommand.h"
|
#include "drop3dlibraryitemcommand.h"
|
||||||
#include "view3dclosedcommand.h"
|
#include "view3dclosedcommand.h"
|
||||||
|
#include "puppettocreatorcommand.h"
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
@@ -262,6 +263,11 @@ void NodeInstanceClientProxy::library3DItemDropped(const Drop3DLibraryItemComman
|
|||||||
writeCommand(QVariant::fromValue(command));
|
writeCommand(QVariant::fromValue(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeInstanceClientProxy::handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command)
|
||||||
|
{
|
||||||
|
writeCommand(QVariant::fromValue(command));
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command)
|
void NodeInstanceClientProxy::view3DClosed(const View3DClosedCommand &command)
|
||||||
{
|
{
|
||||||
writeCommand(QVariant::fromValue(command));
|
writeCommand(QVariant::fromValue(command));
|
||||||
|
@@ -60,6 +60,7 @@ class ChangeNodeSourceCommand;
|
|||||||
class EndPuppetCommand;
|
class EndPuppetCommand;
|
||||||
class ChangeSelectionCommand;
|
class ChangeSelectionCommand;
|
||||||
class Drop3DLibraryItemCommand;
|
class Drop3DLibraryItemCommand;
|
||||||
|
class PuppetToCreatorCommand;
|
||||||
class View3DClosedCommand;
|
class View3DClosedCommand;
|
||||||
|
|
||||||
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
|
class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterface
|
||||||
@@ -81,6 +82,7 @@ public:
|
|||||||
void puppetAlive(const PuppetAliveCommand &command);
|
void puppetAlive(const PuppetAliveCommand &command);
|
||||||
void selectionChanged(const ChangeSelectionCommand &command) override;
|
void selectionChanged(const ChangeSelectionCommand &command) override;
|
||||||
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
|
void library3DItemDropped(const Drop3DLibraryItemCommand &command) override;
|
||||||
|
void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override;
|
||||||
void view3DClosed(const View3DClosedCommand &command) override;
|
void view3DClosed(const View3DClosedCommand &command) override;
|
||||||
|
|
||||||
void flush() override;
|
void flush() override;
|
||||||
|
@@ -43,6 +43,7 @@ class PuppetAliveCommand;
|
|||||||
class ChangeSelectionCommand;
|
class ChangeSelectionCommand;
|
||||||
class Drop3DLibraryItemCommand;
|
class Drop3DLibraryItemCommand;
|
||||||
class View3DClosedCommand;
|
class View3DClosedCommand;
|
||||||
|
class PuppetToCreatorCommand;
|
||||||
|
|
||||||
class NodeInstanceClientInterface
|
class NodeInstanceClientInterface
|
||||||
{
|
{
|
||||||
@@ -59,6 +60,7 @@ public:
|
|||||||
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
|
virtual void selectionChanged(const ChangeSelectionCommand &command) = 0;
|
||||||
virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0;
|
virtual void library3DItemDropped(const Drop3DLibraryItemCommand &command) = 0;
|
||||||
virtual void view3DClosed(const View3DClosedCommand &command) = 0;
|
virtual void view3DClosed(const View3DClosedCommand &command) = 0;
|
||||||
|
virtual void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) = 0;
|
||||||
|
|
||||||
virtual void flush() {}
|
virtual void flush() {}
|
||||||
virtual void synchronizeWithClientProcess() {}
|
virtual void synchronizeWithClientProcess() {}
|
||||||
|
@@ -64,6 +64,7 @@
|
|||||||
#include "debugoutputcommand.h"
|
#include "debugoutputcommand.h"
|
||||||
#include "puppetalivecommand.h"
|
#include "puppetalivecommand.h"
|
||||||
#include "view3dclosedcommand.h"
|
#include "view3dclosedcommand.h"
|
||||||
|
#include "puppettocreatorcommand.h"
|
||||||
|
|
||||||
#include <enumeration.h>
|
#include <enumeration.h>
|
||||||
|
|
||||||
@@ -209,6 +210,12 @@ void NodeInstanceServerInterface::registerCommands()
|
|||||||
|
|
||||||
qRegisterMetaType<View3DClosedCommand>("View3DClosedCommand");
|
qRegisterMetaType<View3DClosedCommand>("View3DClosedCommand");
|
||||||
qRegisterMetaTypeStreamOperators<View3DClosedCommand>("View3DClosedCommand");
|
qRegisterMetaTypeStreamOperators<View3DClosedCommand>("View3DClosedCommand");
|
||||||
|
|
||||||
|
qRegisterMetaType<PuppetToCreatorCommand>("PuppetToCreatorCommand");
|
||||||
|
qRegisterMetaTypeStreamOperators<PuppetToCreatorCommand>("PuppetToCreatorCommand");
|
||||||
|
|
||||||
|
qRegisterMetaType<QPair<int, int>>("QPairIntInt");
|
||||||
|
qRegisterMetaTypeStreamOperators<QPair<int, int>>("QPairIntInt");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -61,6 +61,7 @@
|
|||||||
#include "removesharedmemorycommand.h"
|
#include "removesharedmemorycommand.h"
|
||||||
#include "objectnodeinstance.h"
|
#include "objectnodeinstance.h"
|
||||||
#include "drop3dlibraryitemcommand.h"
|
#include "drop3dlibraryitemcommand.h"
|
||||||
|
#include "puppettocreatorcommand.h"
|
||||||
#include "view3dclosedcommand.h"
|
#include "view3dclosedcommand.h"
|
||||||
|
|
||||||
#include "dummycontextobject.h"
|
#include "dummycontextobject.h"
|
||||||
@@ -102,6 +103,13 @@ bool Qt5InformationNodeInstanceServer::eventFilter(QObject *, QEvent *event)
|
|||||||
nodeInstanceClient()->view3DClosed(View3DClosedCommand());
|
nodeInstanceClient()->view3DClosed(View3DClosedCommand());
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case QEvent::KeyPress: {
|
||||||
|
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
|
||||||
|
QPair<int, int> data = {keyEvent->key(), keyEvent->modifiers()};
|
||||||
|
nodeInstanceClient()->handlePuppetToCreatorCommand({PuppetToCreatorCommand::Key_Pressed,
|
||||||
|
QVariant::fromValue(data)});
|
||||||
|
} break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -143,6 +143,7 @@ extend_qtc_plugin(QmlDesigner
|
|||||||
update3dviewstatecommand.cpp update3dviewstatecommand.h
|
update3dviewstatecommand.cpp update3dviewstatecommand.h
|
||||||
enable3dviewcommand.cpp enable3dviewcommand.h
|
enable3dviewcommand.cpp enable3dviewcommand.h
|
||||||
view3dclosedcommand.cpp view3dclosedcommand.h
|
view3dclosedcommand.cpp view3dclosedcommand.h
|
||||||
|
puppettocreatorcommand.cpp puppettocreatorcommand.h
|
||||||
)
|
)
|
||||||
|
|
||||||
extend_qtc_plugin(QmlDesigner
|
extend_qtc_plugin(QmlDesigner
|
||||||
|
@@ -147,6 +147,8 @@ public:
|
|||||||
void mainWindowActiveChanged(bool active, bool hasPopup);
|
void mainWindowActiveChanged(bool active, bool hasPopup);
|
||||||
void enable3DView(bool enable);
|
void enable3DView(bool enable);
|
||||||
|
|
||||||
|
void handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void timerEvent(QTimerEvent *event) override;
|
void timerEvent(QTimerEvent *event) override;
|
||||||
|
|
||||||
@@ -198,12 +200,13 @@ private: // functions
|
|||||||
void restartProcess();
|
void restartProcess();
|
||||||
void delayedRestartProcess();
|
void delayedRestartProcess();
|
||||||
|
|
||||||
private:
|
|
||||||
void handleCrash();
|
void handleCrash();
|
||||||
void startPuppetTransaction();
|
void startPuppetTransaction();
|
||||||
void endPuppetTransaction();
|
void endPuppetTransaction();
|
||||||
|
|
||||||
private: //variables
|
// puppet to creator command handlers
|
||||||
|
void handlePuppetKeyPress(int key, Qt::KeyboardModifiers modifiers);
|
||||||
|
|
||||||
NodeInstance m_rootNodeInstance;
|
NodeInstance m_rootNodeInstance;
|
||||||
NodeInstance m_activeStateInstance;
|
NodeInstance m_activeStateInstance;
|
||||||
|
|
||||||
|
@@ -45,6 +45,7 @@
|
|||||||
#include <changenodesourcecommand.h>
|
#include <changenodesourcecommand.h>
|
||||||
#include <changeselectioncommand.h>
|
#include <changeselectioncommand.h>
|
||||||
#include <drop3dlibraryitemcommand.h>
|
#include <drop3dlibraryitemcommand.h>
|
||||||
|
#include <puppettocreatorcommand.h>
|
||||||
#include <view3dclosedcommand.h>
|
#include <view3dclosedcommand.h>
|
||||||
|
|
||||||
#include <informationchangedcommand.h>
|
#include <informationchangedcommand.h>
|
||||||
@@ -286,6 +287,7 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
|
|||||||
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
|
static const int puppetAliveCommandType = QMetaType::type("PuppetAliveCommand");
|
||||||
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
static const int changeSelectionCommandType = QMetaType::type("ChangeSelectionCommand");
|
||||||
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
|
static const int drop3DLibraryItemCommandType = QMetaType::type("Drop3DLibraryItemCommand");
|
||||||
|
static const int puppetToCreatorCommand = QMetaType::type("PuppetToCreatorCommand");
|
||||||
static const int view3DClosedCommand = QMetaType::type("View3DClosedCommand");
|
static const int view3DClosedCommand = QMetaType::type("View3DClosedCommand");
|
||||||
|
|
||||||
if (m_destructing)
|
if (m_destructing)
|
||||||
@@ -314,6 +316,8 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command, PuppetStr
|
|||||||
nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>());
|
nodeInstanceClient()->selectionChanged(command.value<ChangeSelectionCommand>());
|
||||||
} else if (command.userType() == drop3DLibraryItemCommandType) {
|
} else if (command.userType() == drop3DLibraryItemCommandType) {
|
||||||
nodeInstanceClient()->library3DItemDropped(command.value<Drop3DLibraryItemCommand>());
|
nodeInstanceClient()->library3DItemDropped(command.value<Drop3DLibraryItemCommand>());
|
||||||
|
} else if (command.userType() == puppetToCreatorCommand) {
|
||||||
|
nodeInstanceClient()->handlePuppetToCreatorCommand(command.value<PuppetToCreatorCommand>());
|
||||||
} else if (command.userType() == view3DClosedCommand) {
|
} else if (command.userType() == view3DClosedCommand) {
|
||||||
nodeInstanceClient()->view3DClosed(command.value<View3DClosedCommand>());
|
nodeInstanceClient()->view3DClosed(command.value<View3DClosedCommand>());
|
||||||
} else if (command.userType() == puppetAliveCommandType) {
|
} else if (command.userType() == puppetAliveCommandType) {
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#include <metainfo.h>
|
#include <metainfo.h>
|
||||||
#include <nodehints.h>
|
#include <nodehints.h>
|
||||||
#include <rewriterview.h>
|
#include <rewriterview.h>
|
||||||
|
#include "qmldesignerplugin.h"
|
||||||
#include "abstractproperty.h"
|
#include "abstractproperty.h"
|
||||||
#include "variantproperty.h"
|
#include "variantproperty.h"
|
||||||
#include "bindingproperty.h"
|
#include "bindingproperty.h"
|
||||||
@@ -42,7 +42,10 @@
|
|||||||
#include "qmltimeline.h"
|
#include "qmltimeline.h"
|
||||||
#include "qmltimelinekeyframegroup.h"
|
#include "qmltimelinekeyframegroup.h"
|
||||||
#include "qmlvisualnode.h"
|
#include "qmlvisualnode.h"
|
||||||
|
#include "coreplugin/actionmanager/actionmanager.h"
|
||||||
|
#include "coreplugin/editormanager/editormanager.h"
|
||||||
|
#include "coreplugin/documentmanager.h"
|
||||||
|
#include "plugins/qmldesigner/qmldesignerconstants.h"
|
||||||
#include "createscenecommand.h"
|
#include "createscenecommand.h"
|
||||||
#include "createinstancescommand.h"
|
#include "createinstancescommand.h"
|
||||||
#include "clearscenecommand.h"
|
#include "clearscenecommand.h"
|
||||||
@@ -71,6 +74,7 @@
|
|||||||
#include "removesharedmemorycommand.h"
|
#include "removesharedmemorycommand.h"
|
||||||
#include "debugoutputcommand.h"
|
#include "debugoutputcommand.h"
|
||||||
#include "nodeinstanceserverproxy.h"
|
#include "nodeinstanceserverproxy.h"
|
||||||
|
#include "puppettocreatorcommand.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -1454,6 +1458,40 @@ void NodeInstanceView::library3DItemDropped(const Drop3DLibraryItemCommand &comm
|
|||||||
QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {});
|
QmlVisualNode::createQmlVisualNode(this, itemLibraryEntry, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeInstanceView::handlePuppetToCreatorCommand(const PuppetToCreatorCommand &command)
|
||||||
|
{
|
||||||
|
if (command.type() == PuppetToCreatorCommand::Key_Pressed) {
|
||||||
|
QPair<int, int> data = qvariant_cast<QPair<int, int>>(command.data());
|
||||||
|
int key = data.first;
|
||||||
|
Qt::KeyboardModifiers modifiers = Qt::KeyboardModifiers(data.second);
|
||||||
|
|
||||||
|
handlePuppetKeyPress(key, modifiers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// puppet to creator command handlers
|
||||||
|
void NodeInstanceView::handlePuppetKeyPress(int key, Qt::KeyboardModifiers modifiers)
|
||||||
|
{
|
||||||
|
// TODO: optimal way to handle key events is to just pass them on. This is done
|
||||||
|
// using the code below but it is so far not working, if someone could get it to work then
|
||||||
|
// it should be utilized and the rest of the method deleted
|
||||||
|
// QCoreApplication::postEvent([receiver], new QKeyEvent(QEvent::KeyPress, key, modifiers));
|
||||||
|
|
||||||
|
// handle common keyboard actions coming from puppet
|
||||||
|
if (Core::ActionManager::command(Core::Constants::UNDO)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
QmlDesignerPlugin::instance()->currentDesignDocument()->undo();
|
||||||
|
else if (Core::ActionManager::command(Core::Constants::REDO)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
QmlDesignerPlugin::instance()->currentDesignDocument()->redo();
|
||||||
|
else if (Core::ActionManager::command(Core::Constants::SAVE)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
Core::EditorManager::saveDocument();
|
||||||
|
else if (Core::ActionManager::command(Core::Constants::SAVEAS)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
Core::EditorManager::saveDocumentAs();
|
||||||
|
else if (Core::ActionManager::command(Core::Constants::SAVEALL)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
Core::DocumentManager::saveAllModifiedDocuments();
|
||||||
|
else if (Core::ActionManager::command(QmlDesigner::Constants::C_DELETE)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
|
||||||
|
QmlDesignerPlugin::instance()->currentDesignDocument()->deleteSelected();
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInstanceView::view3DClosed(const View3DClosedCommand &command)
|
void NodeInstanceView::view3DClosed(const View3DClosedCommand &command)
|
||||||
{
|
{
|
||||||
Q_UNUSED(command)
|
Q_UNUSED(command)
|
||||||
|
@@ -177,6 +177,8 @@ Project {
|
|||||||
"commands/enable3dviewcommand.h",
|
"commands/enable3dviewcommand.h",
|
||||||
"commands/view3dclosedcommand.cpp",
|
"commands/view3dclosedcommand.cpp",
|
||||||
"commands/view3dclosedcommand.h",
|
"commands/view3dclosedcommand.h",
|
||||||
|
"commands/puppettocreatorcommand.cpp",
|
||||||
|
"commands/puppettocreatorcommand.h",
|
||||||
"container/addimportcontainer.cpp",
|
"container/addimportcontainer.cpp",
|
||||||
"container/addimportcontainer.h",
|
"container/addimportcontainer.h",
|
||||||
"container/idcontainer.cpp",
|
"container/idcontainer.cpp",
|
||||||
|
@@ -49,6 +49,7 @@ extend_qtc_executable(qml2puppet
|
|||||||
update3dviewstatecommand.cpp update3dviewstatecommand.h
|
update3dviewstatecommand.cpp update3dviewstatecommand.h
|
||||||
enable3dviewcommand.cpp enable3dviewcommand.h
|
enable3dviewcommand.cpp enable3dviewcommand.h
|
||||||
view3dclosedcommand.cpp view3dclosedcommand.h
|
view3dclosedcommand.cpp view3dclosedcommand.h
|
||||||
|
puppettocreatorcommand.cpp puppettocreatorcommand.h
|
||||||
valueschangedcommand.cpp
|
valueschangedcommand.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -103,6 +103,8 @@ QtcTool {
|
|||||||
"commands/enable3dviewcommand.h",
|
"commands/enable3dviewcommand.h",
|
||||||
"commands/view3dclosedcommand.cpp",
|
"commands/view3dclosedcommand.cpp",
|
||||||
"commands/view3dclosedcommand.h",
|
"commands/view3dclosedcommand.h",
|
||||||
|
"commands/puppettocreatorcommand.cpp",
|
||||||
|
"commands/puppettocreatorcommand.h",
|
||||||
"container/addimportcontainer.cpp",
|
"container/addimportcontainer.cpp",
|
||||||
"container/addimportcontainer.h",
|
"container/addimportcontainer.h",
|
||||||
"container/idcontainer.cpp",
|
"container/idcontainer.cpp",
|
||||||
|
Reference in New Issue
Block a user