qcontextmenuevent3qt
Parameters that describe a context menu event
Usage
#include <qevent.h>
Inherits QEvent.
Public Members
enum Reason { Mouse, Keyboard, Other }
QContextMenuEvent ( Reason reason, const QPoint & pos, const QPoint & globalPos, int state )
QContextMenuEvent ( Reason reason, const QPoint & pos, int state )
int x () const
int y () const
int globalX () const
int globalY () const
const QPoint & pos () const
const QPoint & globalPos () const
ButtonState state () const
bool isAccepted () const
bool isConsumed () const
void consume ()
void accept ()
void ignore ()
Reason reason () const
Overview
The QContextMenuEvent class contains parameters that describe a context menu event.
Context menu events are sent to widgets when a user triggers a context menu. What triggers this is platform dependent. For example, on Windows, pressing the menu button or releasing the right mouse button will cause this event to be sent.
When this event occurs it is customary to show a QPopupMenu 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 whatever triggered the event will be handled as a regular input event if possible.
See also QPopupMenu and Event Classes.
Member Type Documentation
Member function documentation
Releases
5 releases since Debian 3.0 (Woody); the text changed 3 times.