Sur cette page

QGraphicsSceneMoveEvent Class

La classe `QGraphicsSceneMoveEvent` fournit des événements liés au déplacement des widgets dans le framework de vue graphique. En savoir plus...

En-tête : #include <QGraphicsSceneMoveEvent>
CMake : find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake : QT += widgets
Hérite de : QGraphicsSceneEvent

Fonctions publiques

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

Description détaillée

Un ` QGraphicsWidget ` envoie immédiatement un `QGraphicsSceneMoveEvent` dès que sa position locale change. L'envoi est implémenté dans la méthode ` QGraphicsItem::itemChange()`.

Elle est similaire à ` QMoveEvent`, mais ses méthodes `positions`, ` oldPos()` et ` newPos()` utilisent ` QPointF ` au lieu de ` QPoint`.

Voir également QGraphicsItem::setPos(), QGraphicsItem::ItemPositionChange et QGraphicsItem::ItemPositionHasChanged.

Documentation sur les fonctions membres

QGraphicsSceneMoveEvent::QGraphicsSceneMoveEvent()

Crée un objet `QGraphicsSceneMoveEvent`.

[virtual noexcept] QGraphicsSceneMoveEvent::~QGraphicsSceneMoveEvent()

Supprime le fichier « QGraphicsSceneMoveEvent ».

QPointF QGraphicsSceneMoveEvent::newPos() const

Renvoie la nouvelle position (c'est-à-dire la position actuelle).

Voir également oldPos() et QGraphicsItem::setPos().

QPointF QGraphicsSceneMoveEvent::oldPos() const

Renvoie l'ancienne position (c'est-à-dire la position immédiatement avant le déplacement du widget).

Voir aussi newPos() et QGraphicsItem::setPos().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.