Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions | ![]() |
The QContextMenuEvent class contains parameters that describe a context menu event. More...
#include <qevent.h>
Inherits QEvent.
Context events are sent to widgets when a user triggers a menu. What triggers this is platform dependent. On windows, for example, pressing the menu button or releasing the right mouse button will cause this event to be sent. It is customary to use this to show a QPopupMenu when this event is triggered if you have a relevant context menu.
ContextMenu events contain a special accept flag that indicates whether the receiver accepted the contextMenu. If the event handler does not accept the event, then whatever triggered the event will be handled as a regular input event if possible.
See also QPopupMenu and Event Classes.
This enum describes the reason the ContextMenuEvent was sent. The values are:
Constructs a context 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. state is the ButtonState at the time of the event.
Constructs a context 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. state is the ButtonState at the time of the event.
The globalPos() is initialized to QCursor::pos(), which may not be appropriate. Use the other constructor to specify the global position explicitly.
Setting the accept flag indicates that the receiver of this event has processed the event. Processing the event means you did something with it and it will be implicitly consume().
The accept flag is not set by default.
See also ignore() and consume().
Setting the consume flag indicates that the receiver of this event asked that the event not be propagated further (to parent classes).
The consumed flag is not set by default.
See also ignore() and accept().
Returns the global position of the mouse pointer at the time of the event.
Returns the global X position of the mouse pointer at the time of the event.
See also globalY() and globalPos().
Returns the global Y position of the mouse pointer at the time of the event.
See also globalX() and globalPos().
Clearing the accept flag indicates that the receiver of this event does not need to show a context menu. This will implicitly remove the consumed flag as well.
The accept flag is not set by default.
See also accept() and consume().
See also accept(), ignore() and consume().
See also accept(), ignore() and consume().
Returns the position of the mouse pointer relative to the widget that received the event.
See also x(), y() and globalPos().
Returns the button state (a combination of mouse buttons and keyboard modifiers), i.e., what buttons and keys were being pressed immediately before the event was generated.
The returned value is LeftButton, RightButton, MidButton, ShiftButton, ControlButton and AltButton OR'ed together.
Returns the X position of the mouse pointer, relative to the widget that received the event.
Returns the Y position of the mouse pointer, relative to the widget that received the event.
This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.
Copyright © 2002 Trolltech | Trademarks | Qt version 3.0.3
|