forked from qt-creator/qt-creator
QmlDesigner.formEditor: wire up instancesCompleted() to tools
This commit is contained in:
@@ -77,6 +77,8 @@ public:
|
||||
|
||||
virtual void formEditorItemsChanged(const QList<FormEditorItem*> &itemList) = 0;
|
||||
|
||||
virtual void instancesCompleted(const QList<FormEditorItem*> &itemList) = 0;
|
||||
|
||||
void setItems(const QList<FormEditorItem*> &itemList);
|
||||
QList<FormEditorItem*> items() const;
|
||||
|
||||
|
||||
@@ -213,6 +213,10 @@ void AnchorTool::formEditorItemsChanged(const QList<FormEditorItem*> &)
|
||||
m_anchorIndicator.updateItems(view()->scene()->allFormEditorItems());
|
||||
}
|
||||
|
||||
void AnchorTool::instancesCompleted(const QList<FormEditorItem*> &itemList)
|
||||
{
|
||||
}
|
||||
|
||||
AnchorLineHandleItem* AnchorTool::topAnchorLineHandleItem(const QList<QGraphicsItem*> & itemList)
|
||||
{
|
||||
foreach (QGraphicsItem *item, itemList) {
|
||||
|
||||
@@ -70,6 +70,8 @@ public:
|
||||
|
||||
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
static AnchorLineHandleItem* topAnchorLineHandleItem(const QList<QGraphicsItem*> & itemList);
|
||||
|
||||
private slots:
|
||||
|
||||
@@ -206,6 +206,10 @@ void DragTool::formEditorItemsChanged(const QList<FormEditorItem*> & itemList)
|
||||
}
|
||||
}
|
||||
|
||||
void DragTool::instancesCompleted(const QList<FormEditorItem*> &itemList)
|
||||
{
|
||||
}
|
||||
|
||||
void DragTool::clearMoveDelay()
|
||||
{
|
||||
m_blockMove = false;
|
||||
|
||||
@@ -100,6 +100,8 @@ public:
|
||||
|
||||
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void clearMoveDelay();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -437,6 +437,15 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const QString &
|
||||
|
||||
void FormEditorView::instancesCompleted(const QVector<ModelNode> &completedNodeList)
|
||||
{
|
||||
QList<FormEditorItem*> itemNodeList;
|
||||
foreach (const ModelNode &node, completedNodeList) {
|
||||
QmlItemNode qmlItemNode(node);
|
||||
if (qmlItemNode.isValid() && scene()->hasItemForQmlItemNode(qmlItemNode)) {
|
||||
scene()->synchronizeParent(qmlItemNode);
|
||||
itemNodeList.append(scene()->itemForQmlItemNode(qmlItemNode));
|
||||
}
|
||||
}
|
||||
currentTool()->instancesCompleted(itemNodeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "formeditorview.h"
|
||||
|
||||
#include <metainfo.h>
|
||||
#include <itemlibrary.h>
|
||||
#include <itemlibrarywidget.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
@@ -139,6 +139,10 @@ void ItemCreatorTool::formEditorItemsChanged(const QList<FormEditorItem*> &/*ite
|
||||
{
|
||||
}
|
||||
|
||||
void ItemCreatorTool::instancesCompleted(const QList<FormEditorItem*> &/*itemList*/)
|
||||
{
|
||||
}
|
||||
|
||||
void ItemCreatorTool::setItemString(const QString &itemString)
|
||||
{
|
||||
m_itemString = itemString;
|
||||
|
||||
@@ -67,6 +67,8 @@ public:
|
||||
|
||||
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void setItemString(const QString &itemString);
|
||||
|
||||
FormEditorItem* calculateContainer(const QPointF &point);
|
||||
|
||||
@@ -233,6 +233,10 @@ void MoveTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList)
|
||||
updateMoveManipulator();
|
||||
}
|
||||
|
||||
void MoveTool::instancesCompleted(const QList<FormEditorItem*> &itemList)
|
||||
{
|
||||
}
|
||||
|
||||
bool MoveTool::haveSameParent(const QList<FormEditorItem*> &itemList)
|
||||
{
|
||||
if (itemList.isEmpty())
|
||||
|
||||
@@ -64,10 +64,10 @@ public:
|
||||
|
||||
void selectedItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &/*itemList*/);
|
||||
|
||||
void updateMoveManipulator();
|
||||
|
||||
|
||||
|
||||
void beginWithPoint(const QPointF &beginPoint);
|
||||
|
||||
void clear();
|
||||
|
||||
@@ -180,4 +180,8 @@ void ResizeTool::formEditorItemsChanged(const QList<FormEditorItem*> &itemList)
|
||||
m_resizeIndicator.updateItems(itemList);
|
||||
}
|
||||
|
||||
void ResizeTool::instancesCompleted(const QList<FormEditorItem*> &/*itemList*/)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,6 +65,8 @@ public:
|
||||
|
||||
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
private:
|
||||
SelectionIndicator m_selectionIndicator;
|
||||
ResizeIndicator m_resizeIndicator;
|
||||
|
||||
@@ -261,6 +261,10 @@ void SelectionTool::formEditorItemsChanged(const QList<FormEditorItem*> &itemLis
|
||||
m_resizeIndicator.updateItems(itemList);
|
||||
}
|
||||
|
||||
void SelectionTool::instancesCompleted(const QList<FormEditorItem*> &/*itemList*/)
|
||||
{
|
||||
}
|
||||
|
||||
void SelectionTool::selectUnderPoint(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
m_singleSelectionManipulator.begin(event->scenePos());
|
||||
|
||||
@@ -76,6 +76,8 @@ public:
|
||||
|
||||
void formEditorItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void instancesCompleted(const QList<FormEditorItem*> &itemList);
|
||||
|
||||
void selectUnderPoint(QGraphicsSceneMouseEvent *event);
|
||||
|
||||
void setSelectOnlyContentItems(bool selectOnlyContentItems);
|
||||
|
||||
Reference in New Issue
Block a user