forked from qt-creator/qt-creator
QmlDesigner.formEditor: use pure virtuel instead of assert
Asserting because of unexpected mouse events is evil. Task-number: QTCREATORBUG-6042 Change-Id: Idc21b1cb6bfebead4eab80f6526235164b3f8d54 Reviewed-on: http://codereview.qt-project.org/5090 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -184,16 +184,6 @@ void AbstractFormEditorTool::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractFormEditorTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * /* event */)
|
|
||||||
{
|
|
||||||
Q_ASSERT(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AbstractFormEditorTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /* event */)
|
|
||||||
{
|
|
||||||
Q_ASSERT(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool checkIfNodeIsAView(const ModelNode &node)
|
static inline bool checkIfNodeIsAView(const ModelNode &node)
|
||||||
{
|
{
|
||||||
return node.metaInfo().isValid() &&
|
return node.metaInfo().isValid() &&
|
||||||
|
@@ -66,8 +66,8 @@ public:
|
|||||||
|
|
||||||
virtual void dropEvent(QGraphicsSceneDragDropEvent * event);
|
virtual void dropEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
|
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent * event) = 0;
|
||||||
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent * event) = 0;
|
||||||
|
|
||||||
virtual void keyPressEvent(QKeyEvent *event) = 0;
|
virtual void keyPressEvent(QKeyEvent *event) = 0;
|
||||||
virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
|
virtual void keyReleaseEvent(QKeyEvent *keyEvent) = 0;
|
||||||
|
@@ -190,6 +190,16 @@ void AnchorTool::keyReleaseEvent(QKeyEvent *)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnchorTool::dragLeaveEvent(QGraphicsSceneDragDropEvent *)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void AnchorTool::dragMoveEvent(QGraphicsSceneDragDropEvent *)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void AnchorTool::itemsAboutToRemoved(const QList<FormEditorItem*> &removedItems)
|
void AnchorTool::itemsAboutToRemoved(const QList<FormEditorItem*> &removedItems)
|
||||||
{
|
{
|
||||||
QList<FormEditorItem*> newItemList = items().toSet().subtract(removedItems.toSet()).toList();
|
QList<FormEditorItem*> newItemList = items().toSet().subtract(removedItems.toSet()).toList();
|
||||||
|
@@ -65,6 +65,9 @@ public:
|
|||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *keyEvent);
|
void keyReleaseEvent(QKeyEvent *keyEvent);
|
||||||
|
|
||||||
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
|
||||||
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
||||||
|
|
||||||
void selectedItemsChanged(const QList<FormEditorItem*> &itemList);
|
void selectedItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||||
|
@@ -123,6 +123,16 @@ void ItemCreatorTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ItemCreatorTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ItemCreatorTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void ItemCreatorTool::itemsAboutToRemoved(const QList<FormEditorItem*> &/*itemList*/)
|
void ItemCreatorTool::itemsAboutToRemoved(const QList<FormEditorItem*> &/*itemList*/)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -62,6 +62,9 @@ public:
|
|||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *keyEvent);
|
void keyReleaseEvent(QKeyEvent *keyEvent);
|
||||||
|
|
||||||
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
|
||||||
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
@@ -203,6 +203,16 @@ void MoveTool::keyReleaseEvent(QKeyEvent *keyEvent)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void MoveTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
void MoveTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent *event)
|
QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
@@ -63,6 +63,9 @@ public:
|
|||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *keyEvent);
|
void keyReleaseEvent(QKeyEvent *keyEvent);
|
||||||
|
|
||||||
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
|
||||||
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
||||||
|
|
||||||
void selectedItemsChanged(const QList<FormEditorItem*> &itemList);
|
void selectedItemsChanged(const QList<FormEditorItem*> &itemList);
|
||||||
|
@@ -112,6 +112,17 @@ void ResizeTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ResizeTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ResizeTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ResizeTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
void ResizeTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent *event)
|
QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
|
@@ -57,6 +57,10 @@ public:
|
|||||||
QGraphicsSceneMouseEvent *event);
|
QGraphicsSceneMouseEvent *event);
|
||||||
void hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
void hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
|
||||||
QGraphicsSceneMouseEvent *event);
|
QGraphicsSceneMouseEvent *event);
|
||||||
|
|
||||||
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *keyEvent);
|
void keyReleaseEvent(QKeyEvent *keyEvent);
|
||||||
|
|
||||||
|
@@ -225,6 +225,14 @@ void SelectionTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SelectionTool::dragLeaveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void SelectionTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /*event*/)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void SelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
|
void SelectionTool::setSelectOnlyContentItems(bool selectOnlyContentItems)
|
||||||
{
|
{
|
||||||
m_selectOnlyContentItems = selectOnlyContentItems;
|
m_selectOnlyContentItems = selectOnlyContentItems;
|
||||||
|
@@ -66,6 +66,9 @@ public:
|
|||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent *event);
|
||||||
void keyReleaseEvent(QKeyEvent *keyEvent);
|
void keyReleaseEvent(QKeyEvent *keyEvent);
|
||||||
|
|
||||||
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
void dragMoveEvent(QGraphicsSceneDragDropEvent * event);
|
||||||
|
|
||||||
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
void itemsAboutToRemoved(const QList<FormEditorItem*> &itemList);
|
||||||
// QVariant itemChange(const QList<QGraphicsItem*> &itemList,
|
// QVariant itemChange(const QList<QGraphicsItem*> &itemList,
|
||||||
// QGraphicsItem::GraphicsItemChange change,
|
// QGraphicsItem::GraphicsItemChange change,
|
||||||
|
Reference in New Issue
Block a user