内容表

上一话题

QGraphicsScene

下一话题

QGraphicsSceneDragDropEvent

QGraphicsSceneContextMenuEvent

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

Inheritance diagram of PySide2.QtWidgets.QGraphicsSceneContextMenuEvent

概要

函数

详细描述

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

class QGraphicsSceneContextMenuEvent ( [ type=None ] )
param type

Type

Constructs a graphics scene context menu event of the specified type .

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. Reason

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

常量

描述

QGraphicsSceneContextMenuEvent.Mouse

The mouse caused the event to be sent. On most platforms, this means the right mouse button was clicked.

QGraphicsSceneContextMenuEvent.Keyboard

The keyboard caused this event to be sent. On Windows and macOS, this means the menu button was pressed.

QGraphicsSceneContextMenuEvent.Other

The event was sent by some other means (i.e. not by the mouse or keyboard).

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. modifiers ( )
返回类型

KeyboardModifiers

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

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. pos ( )
返回类型

QPointF

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

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. reason ( )
返回类型

Reason

Returns the reason for the context menu event.

另请参阅

Reason

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. scenePos ( )
返回类型

QPointF

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

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. screenPos ( )
返回类型

QPoint

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

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. setModifiers ( modifiers )
参数

modifiers KeyboardModifiers

Sets the keyboard modifiers associated with the context menu to the modifiers 指定。

另请参阅

modifiers()

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. setPos ( pos )
参数

pos QPointF

另请参阅

pos()

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. setReason ( reason )
参数

reason Reason

Sets the reason for the context menu event to reason .

另请参阅

reason()

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. setScenePos ( pos )
参数

pos QPointF

另请参阅

scenePos()

PySide2.QtWidgets.QGraphicsSceneContextMenuEvent. setScreenPos ( pos )
参数

pos QPoint

另请参阅

screenPos()