Eneboo - Documentación para desarrolladores
|
The QContextMenuEvent class contains parameters that describe a context menu event. Más...
#include <qevent.h>
Tipos públicos | |
enum | Reason { Mouse, Keyboard, Other, Mouse, Keyboard, Other } |
enum | Reason { Mouse, Keyboard, Other, Mouse, Keyboard, Other } |
Métodos públicos | |
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 |
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 |
Atributos protegidos | |
QPoint | p |
QPoint | gp |
bool | accpt |
bool | consum |
uint | reas:8 |
ushort | s |
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.
This enum describes the reason the ContextMenuEvent was sent. The values are:
Mouse The mouse caused the event to be sent. Normally this means the right mouse button was clicked, but this is platform specific.
Keyboard The keyboard caused this event to be sent. On Windows this means the menu button was pressed.
Other The event was sent by some other means (i.e. not by the mouse or keyboard).
QContextMenuEvent::QContextMenuEvent | ( | Reason | reason, |
const QPoint & | pos, | ||
const QPoint & | globalPos, | ||
int | state | ||
) | [inline] |
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. state is the ButtonState at the time of the event.
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. 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.
QContextMenuEvent::QContextMenuEvent | ( | Reason | reason, |
const QPoint & | pos, | ||
const QPoint & | globalPos, | ||
int | state | ||
) | [inline] |
void QContextMenuEvent::accept | ( | ) | [inline] |
void QContextMenuEvent::accept | ( | ) | [inline] |
void QContextMenuEvent::consume | ( | ) | [inline] |
void QContextMenuEvent::consume | ( | ) | [inline] |
const QPoint& QContextMenuEvent::globalPos | ( | ) | const [inline] |
const QPoint & QContextMenuEvent::globalPos | ( | ) | const [inline] |
int QContextMenuEvent::globalX | ( | ) | const [inline] |
int QContextMenuEvent::globalX | ( | ) | const [inline] |
Returns the global x-position of the mouse pointer at the time of the event.
int QContextMenuEvent::globalY | ( | ) | const [inline] |
int QContextMenuEvent::globalY | ( | ) | const [inline] |
Returns the global y-position of the mouse pointer at the time of the event.
void QContextMenuEvent::ignore | ( | ) | [inline] |
void QContextMenuEvent::ignore | ( | ) | [inline] |
bool QContextMenuEvent::isAccepted | ( | ) | const [inline] |
bool QContextMenuEvent::isAccepted | ( | ) | const [inline] |
bool QContextMenuEvent::isConsumed | ( | ) | const [inline] |
bool QContextMenuEvent::isConsumed | ( | ) | const [inline] |
const QPoint & QContextMenuEvent::pos | ( | ) | const [inline] |
Returns the position of the mouse pointer relative to the widget that received the event.
const QPoint& QContextMenuEvent::pos | ( | ) | const [inline] |
Reason QContextMenuEvent::reason | ( | ) | const [inline] |
QContextMenuEvent::Reason QContextMenuEvent::reason | ( | ) | const [inline] |
Returns the reason for this context event.
ButtonState QContextMenuEvent::state | ( | ) | const [inline] |
ButtonState QContextMenuEvent::state | ( | ) | const [inline] |
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.
int QContextMenuEvent::x | ( | ) | const [inline] |
int QContextMenuEvent::x | ( | ) | const [inline] |
int QContextMenuEvent::y | ( | ) | const [inline] |
int QContextMenuEvent::y | ( | ) | const [inline] |
bool QContextMenuEvent::accpt [protected] |
bool QContextMenuEvent::consum [protected] |
QPoint QContextMenuEvent::gp [protected] |
QPoint QContextMenuEvent::p [protected] |
uint QContextMenuEvent::reas [protected] |
ushort QContextMenuEvent::s [protected] |