diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2011-07-20 12:32:06 +0200 |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2011-07-20 13:39:15 +0200 |
commit | 5e87539d14ae53c1e56130a5a7ba39e902bb26e5 (patch) | |
tree | 80d98b2cf13571791c9c2d21ef6a9fa6ac0b5f07 /src/plugins/qmldesigner/components | |
parent | 02cd2c71038a9a241b1d3b1901ca3f31a29debf5 (diff) | |
download | qt-creator-5e87539d14ae53c1e56130a5a7ba39e902bb26e5.tar.gz |
QmlDesigner: enable F2 to go into a component
Change-Id: I23b298b184a9a17e19206db6086fce073b12a592
Reviewed-on: http://codereview.qt.nokia.com/1876
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Diffstat (limited to 'src/plugins/qmldesigner/components')
-rw-r--r-- | src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp | 14 | ||||
-rw-r--r-- | src/plugins/qmldesigner/components/integration/designdocumentcontroller.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp index 214a6c67ac..52757cb1e0 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp @@ -56,6 +56,7 @@ #include <nodelistproperty.h> #include <variantproperty.h> #include <rewritingexception.h> +#include <model/modelnodecontextmenu.h> #include <utils/fileutils.h> @@ -451,6 +452,19 @@ void DesignDocumentController::changeCurrentModelTo(const ModelNode &componentNo m_d->componentView->setComponentNode(componentNode); } +void DesignDocumentController::goIntoComponent() +{ + if (!m_d->model) + return; + + QList<ModelNode> selectedNodes; + if (m_d->formEditorView) + selectedNodes = m_d->formEditorView->selectedModelNodes(); + + if (selectedNodes.count() == 1) + ModelNodeAction::goIntoComponent(selectedNodes.first()); +} + void DesignDocumentController::loadCurrentModel() { QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); diff --git a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.h b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.h index 533c5a14c2..ea6dcb89ca 100644 --- a/src/plugins/qmldesigner/components/integration/designdocumentcontroller.h +++ b/src/plugins/qmldesigner/components/integration/designdocumentcontroller.h @@ -126,6 +126,7 @@ public slots: void redo(); void activeQtVersionChanged(); void changeCurrentModelTo(const ModelNode &node); + void goIntoComponent(); #ifdef ENABLE_TEXT_VIEW void showText(); |