QGraphicsSceneHelpEvent Class

QGraphicsSceneHelpEvent 类提供请求工具提示时的事件。更多

Header: #include <QGraphicsSceneHelpEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QGraphicsSceneEvent

公共函数

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

详细说明

QGraphicsView 接收到QEvent::ToolTip 类型的QEvent 时,它会创建一个 QGraphicsSceneHelpEvent,并将其转发给场景。您可以使用setToolTip() 在QGraphicsItem 上设置工具提示;默认情况下,QGraphicsScene 显示鼠标位置下 Z 值最高(即最顶端的项目)的QGraphicsItem 的工具提示。

QGraphicsView 当 和 请求帮助时,不会转发事件。如果需要,可以重新实现 () 并将 事件和 类型的 转发到场景。"What's This" status tip QGraphicsView::viewportEvent QStatusTipEvent QEvents QEvent::WhatsThis

另请参阅 QEvent

成员函数文档

[virtual noexcept] QGraphicsSceneHelpEvent::~QGraphicsSceneHelpEvent()

摧毁事件。

QPointF QGraphicsSceneHelpEvent::scenePos() const

返回发送帮助事件时鼠标光标在场景坐标中的位置。

另请参阅 screenPos().

QPoint QGraphicsSceneHelpEvent::screenPos() const

返回发送帮助事件时鼠标光标在屏幕坐标中的位置。

另请参阅 scenePos().

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