- Qt 6.7
- Qt Widgets
- C++ Classes
- QGraphicsSceneMoveEvent
- Qt 6.7.1 Reference Documentation

# QGraphicsSceneMoveEvent Class

The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework. More...

Header: | #include <QGraphicsSceneMoveEvent>
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: | QT += widgets
Inherits: | QGraphicsSceneEvent

- List of all members, including inherited members

## Public Functions

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

## Detailed Description

A QGraphicsWidget sends itself a QGraphicsSceneMoveEvent immediately when its local position changes. The delivery is implemented as part of QGraphicsItem::itemChange().

It's similar to QMoveEvent, but its positions, oldPos() and newPos(), use QPointF instead of QPoint.

See also QGraphicsItem::setPos(), QGraphicsItem::ItemPositionChange, and QGraphicsItem::ItemPositionHasChanged.

## Member Function Documentation

### QGraphicsSceneMoveEvent::QGraphicsSceneMoveEvent()

Constructs a QGraphicsSceneMoveEvent.

### `[virtual noexcept]` QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent()

Destroys the QGraphicsSceneMoveEvent.

### QPointF QGraphicsSceneMoveEvent::newPos() const

Returns the new position (i.e., the current position).

See also oldPos() and QGraphicsItem::setPos().

### QPointF QGraphicsSceneMoveEvent::oldPos() const

Returns the old position (i.e., the position immediately before the widget was moved).

See also newPos() and QGraphicsItem::setPos().