summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2020-01-07 16:17:42 +0100
committerChristian Stenger <christian.stenger@qt.io>2020-01-08 05:44:57 +0000
commitcd5f070844c4224e646e30f6edcfb83a7deaa662 (patch)
tree5b2728b9d515987674ad4b90f45fb15347fb688a
parenta163bcd8b0f2426585dc5d48a77b2451d473b76b (diff)
downloadqt-creator-cd5f070844c4224e646e30f6edcfb83a7deaa662.tar.gz
Fix build of qmldesigner tests
NodeInstanceView is build as part of the the test and cannot have depedencies on core or qmldesigner when build in test mode. Change-Id: I5f04ec7ff42fdd0704552c3e791dfabd20fc9317 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
index 92806065af..01605e16b5 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp
@@ -30,7 +30,6 @@
#include <metainfo.h>
#include <nodehints.h>
#include <rewriterview.h>
-#include "qmldesignerplugin.h"
#include "abstractproperty.h"
#include "variantproperty.h"
#include "bindingproperty.h"
@@ -73,9 +72,13 @@
#include "nodeinstanceserverproxy.h"
#include "puppettocreatorcommand.h"
+#ifndef QMLDESIGNER_TEST
+#include <qmldesignerplugin.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/documentmanager.h>
+#endif
+
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -1477,6 +1480,7 @@ void NodeInstanceView::handlePuppetKeyPress(int key, Qt::KeyboardModifiers modif
// it should be utilized and the rest of the method deleted
// QCoreApplication::postEvent([receiver], new QKeyEvent(QEvent::KeyPress, key, modifiers));
+#ifndef QMLDESIGNER_TEST
// handle common keyboard actions coming from puppet
if (Core::ActionManager::command(Core::Constants::UNDO)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
QmlDesignerPlugin::instance()->currentDesignDocument()->undo();
@@ -1490,6 +1494,10 @@ void NodeInstanceView::handlePuppetKeyPress(int key, Qt::KeyboardModifiers modif
Core::DocumentManager::saveAllModifiedDocuments();
else if (Core::ActionManager::command(QmlDesigner::Constants::C_DELETE)->keySequence().matches(key + modifiers) == QKeySequence::ExactMatch)
QmlDesignerPlugin::instance()->currentDesignDocument()->deleteSelected();
+#else
+ Q_UNUSED(key);
+ Q_UNUSED(modifiers);
+#endif
}
void NodeInstanceView::view3DClosed(const View3DClosedCommand &command)