QGraphicsSceneContextMenuEvent Class Reference

[ QtGui module]

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework. 更多...

继承 QGraphicsSceneEvent .

类型

方法


详细描述

The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.

A QContextMenuEvent received by a QGraphicsView is translated into a QGraphicsSceneContextMenuEvent. The QContextMenuEvent.globalPos () is translated into item, scene, and screen coordinates ( pos (), scenePos (),和 screenPos ()).


类型文档编制

QGraphicsSceneContextMenuEvent.Reason

This enum describes the reason why the context event was sent.

常量 描述
QGraphicsSceneContextMenuEvent.Mouse 0 The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked.
QGraphicsSceneContextMenuEvent.Keyboard 1 The keyboard caused this event to be sent. On Windows and Mac OS X, this means the menu button was pressed.
QGraphicsSceneContextMenuEvent.Other 2 The event was sent by some other means (i.e. not by the mouse or keyboard).

方法文档编制

Qt.KeyboardModifiers QGraphicsSceneContextMenuEvent.modifiers ( self )

Returns the keyboard modifiers in use when the context menu was requested.

QPointF QGraphicsSceneContextMenuEvent.pos ( self )

Returns the position of the mouse cursor in item coordinates at the moment the context menu was requested.

另请参阅 scenePos () 和 screenPos ().

Reason QGraphicsSceneContextMenuEvent.reason ( self )

Returns the reason for the context menu event.

另请参阅 QGraphicsSceneContextMenuEvent.Reason .

QPointF QGraphicsSceneContextMenuEvent.scenePos ( self )

Returns the position of the mouse cursor in scene coordinates at the moment the the context menu was requested.

另请参阅 pos () 和 screenPos ().

QPoint QGraphicsSceneContextMenuEvent.screenPos ( self )

Returns the position of the mouse cursor in screen coordinates at the moment the the context menu was requested.

另请参阅 pos () 和 scenePos ().