Sur cette page

QGraphicsSceneHelpEvent Class

La classe QGraphicsSceneHelpEvent fournit des événements lorsqu'une infobulle est demandée. Plus d'informations...

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

Fonctions publiques

virtual ~QGraphicsSceneHelpEvent()
QPointF scenePos() const
QPoint screenPos() const

Description détaillée

Lorsqu'un QGraphicsView reçoit un QEvent de type QEvent::ToolTip, il crée un QGraphicsSceneHelpEvent, qui est transmis à la scène. Vous pouvez définir une infobulle sur un QGraphicsItem avec setToolTip() ; par défaut, QGraphicsScene affiche l'infobulle du QGraphicsItem ayant la valeur z la plus élevée (c'est-à-dire l'élément le plus haut) sous la position de la souris.

QGraphicsView ne transmet pas d'événements lorsque l'aide de "What's This" et status tip est demandée. Si vous en avez besoin, vous pouvez réimplémenter QGraphicsView::viewportEvent() et transmettre les événements QStatusTipEvent et QEvents de type QEvent::WhatsThis à la scène.

Voir également QEvent.

Documentation des fonctions membres

[virtual noexcept] QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent()

Détruit l'événement.

QPointF QGraphicsSceneHelpEvent::scenePos() const

Renvoie la position du curseur de la souris en coordonnées de scène au moment où l'événement d'aide a été envoyé.

Voir aussi screenPos().

QPoint QGraphicsSceneHelpEvent::screenPos() const

Renvoie la position du curseur de la souris en coordonnées d'écran au moment où l'événement d'aide a été envoyé.

Voir aussi scenePos().

© 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.