QmlDesigner: adding a distinguished context for the form editor

Since Actions like copy/paste and delete interfiere
with controls like LineEdit, I added a special context
for the form editor. Now copy/paste/delete on the Qml items
are only registered for the form editor context and copying the contens
of a LineEdit will not lead to copy an item instead, anymore.

Reviewed-by: Kai Koehne
This commit is contained in:
Thomas Hartmann
2010-11-17 12:59:08 +01:00
parent 9f824f4165
commit 71d98970cf
7 changed files with 90 additions and 21 deletions

View File

@@ -30,6 +30,7 @@
#include "designmodewidget.h"
#include "qmldesignerconstants.h"
#include "styledoutputpaneplaceholder.h"
#include "designmodecontext.h"
#include <model.h>
#include <rewriterview.h>
@@ -685,6 +686,9 @@ void DesignModeWidget::setup()
//### we now own these here
rightLayout->addWidget(m_statesEditorWidget.data());
FormEditorContext *context = new FormEditorContext(m_formEditorView->widget());
Core::ICore::instance()->addContextObject(context);
// editor and output panes
m_outputPlaceholderSplitter->addWidget(m_formEditorView->widget());
m_outputPlaceholderSplitter->addWidget(m_outputPanePlaceholder);