QGraphicsSceneMoveEvent 類

QGraphicsSceneMoveEvent 類提供用於在圖形視圖框架中移動 Widget 的事件。 更多...

頭: #include <QGraphicsSceneMoveEvent>
qmake: QT += widgets
Since: Qt 4.4
繼承: QGraphicsSceneEvent

該類在 Qt 4.4 引入。

公共函數

QGraphicsSceneMoveEvent ()
virtual ~QGraphicsSceneMoveEvent ()
QPointF newPos () const
QPointF oldPos () const

詳細描述

A QGraphicsWidget 立即嚮自己發送 QGraphicsSceneMoveEvent,當其本地位置改變時。因為實現交付屬於 QGraphicsItem::itemChange ().

它類似於 QMoveEvent ,但其位置 oldPos () 和 newPos (),使用 QPointF 而不是 QPoint .

另請參閱 QGraphicsItem::setPos (), QGraphicsItem::ItemPositionChange ,和 QGraphicsItem::ItemPositionHasChanged .

成員函數文檔編製

QGraphicsSceneMoveEvent:: QGraphicsSceneMoveEvent ()

構造 QGraphicsSceneMoveEvent。

[虛擬] QGraphicsSceneMoveEvent:: ~QGraphicsSceneMoveEvent ()

銷毀 QGraphicsSceneMoveEvent .

QPointF QGraphicsSceneMoveEvent:: newPos () const

返迴新位置 (即:當前位置)。

另請參閱 oldPos () 和 QGraphicsItem::setPos ().

QPointF QGraphicsSceneMoveEvent:: oldPos () const

返迴舊位置 (即:Widget 被移動之前的即時位置)。

另請參閱 newPos () 和 QGraphicsItem::setPos ().