QContextMenuEvent Class ReferenceThe QContextMenuEvent class contains parameters that describe a context menu event. More... #include <QContextMenuEvent> Inherits QInputEvent. Public Types
Public Functions
Additional Inherited MembersDetailed DescriptionThe QContextMenuEvent class contains parameters that describe a context menu event. Context menu events are sent to widgets when a user performs an action associated with opening a context menu. The actions required to open context menus vary between platforms; for example, on Windows, pressing the menu button or clicking the right mouse button will cause this event to be sent. When this event occurs it is customary to show a QMenu with a context menu, if this is relevant to the context. Context menu events contain a special accept flag that indicates whether the receiver accepted the event. If the event handler does not accept the event then, if possible, whatever triggered the event will be handled as a regular input event. Member Type Documentationenum QContextMenuEvent::ReasonThis enum describes the reason why the event was sent.
Member Function DocumentationQContextMenuEvent::QContextMenuEvent ( Reason reason, const QPoint & pos, const QPoint & globalPos, Qt::KeyboardModifiers modifiers )Constructs a context menu event object with the accept parameter flag set to false. The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard. The pos parameter specifies the mouse position relative to the receiving widget. globalPos is the mouse position in absolute coordinates. The modifiers holds the keyboard modifiers. QContextMenuEvent::QContextMenuEvent ( Reason reason, const QPoint & pos, const QPoint & globalPos )Constructs a context menu event object with the accept parameter flag set to false. The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard. The pos parameter specifies the mouse position relative to the receiving widget. globalPos is the mouse position in absolute coordinates. QContextMenuEvent::QContextMenuEvent ( Reason reason, const QPoint & pos )Constructs a context menu event object with the accept parameter flag set to false. The reason parameter must be QContextMenuEvent::Mouse or QContextMenuEvent::Keyboard. The pos parameter specifies the mouse position relative to the receiving widget. The globalPos() is initialized to QCursor::pos(), which may not be appropriate. Use the other constructor to specify the global position explicitly. const QPoint & QContextMenuEvent::globalPos () constReturns the global position of the mouse pointer at the time of the event. int QContextMenuEvent::globalX () constReturns the global x position of the mouse pointer at the time of the event. See also globalY() and globalPos(). int QContextMenuEvent::globalY () constReturns the global y position of the mouse pointer at the time of the event. See also globalX() and globalPos(). const QPoint & QContextMenuEvent::pos () constReturns the position of the mouse pointer relative to the widget that received the event. See also x(), y(), and globalPos(). Reason QContextMenuEvent::reason () constReturns the reason for this context event. int QContextMenuEvent::x () constReturns the x position of the mouse pointer, relative to the widget that received the event. int QContextMenuEvent::y () constReturns the y position of the mouse pointer, relative to the widget that received the event. X
|
Попытка перевода Qt документации. Если есть желание присоединиться, или если есть замечания или пожелания, то заходите на форум: Перевод Qt документации на русский язык... Люди внесшие вклад в перевод: Команда переводчиков |