Commit ba69c69a authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann
Browse files

QmlDesigner: Add interface to add custom form editor tools



Change-Id: Iae3d4b5db84c4a5f59ff8b4b1208b02b895df00f
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 7c9b1d6d
......@@ -90,6 +90,7 @@ FormEditorView::~FormEditorView()
delete m_dragTool;
m_dragTool = 0;
qDeleteAll(m_toolList);
// delete scene after tools to prevent double deletion
// of items
......@@ -406,6 +407,11 @@ void FormEditorView::changeToTransformTools()
changeToSelectionTool();
}
void FormEditorView::registerTool(AbstractFormEditorTool *tool)
{
m_toolList.append(tool);
}
void FormEditorView::nodeSlidedToIndex(const NodeListProperty &listProperty, int /*newIndex*/, int /*oldIndex*/)
{
QList<ModelNode> newOrderModelNodeList = listProperty.toModelNodeList();
......
......@@ -98,6 +98,8 @@ public:
void changeToResizeTool();
void changeToTransformTools();
void registerTool(AbstractFormEditorTool *tool);
void nodeSlidedToIndex(const NodeListProperty &listProperty, int newIndex, int oldIndex);
void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data);
......@@ -136,6 +138,7 @@ private: //functions
private: //variables
QWeakPointer<FormEditorWidget> m_formEditorWidget;
QWeakPointer<FormEditorScene> m_scene;
QList<AbstractFormEditorTool*> m_toolList;
MoveTool *m_moveTool;
SelectionTool *m_selectionTool;
ResizeTool *m_resizeTool;
......
......@@ -69,6 +69,7 @@ public:
void setNodeInstanceViewQtPath(const QString & qtPath);
void resetPropertyEditorView();
void resisterFormEditorTool(AbstractFormEditorTool *tool); // takes ownership
QWidget *formEditorWidget();
QWidget *propertyEditorWidget();
......
......@@ -82,6 +82,11 @@ void ViewManager::resetPropertyEditorView()
m_propertyEditorView.resetView();
}
void ViewManager::resisterFormEditorTool(AbstractFormEditorTool *tool)
{
m_formEditorView.registerTool(tool);
}
void ViewManager::detachViewsExceptRewriterAndComponetView()
{
switchStateEditorViewToBaseState();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment