Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Atributos protegidos
Referencia de la Clase QContextMenuEvent

The QContextMenuEvent class contains parameters that describe a context menu event. Más...

#include <qevent.h>

Diagrama de herencias de QContextMenuEvent
QEvent QEvent Qt Qt Qt Qt

Lista de todos los miembros.

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 QPointpos () const
const QPointglobalPos () 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 QPointpos () const
const QPointglobalPos () 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

Descripción detallada

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.

Ver también:
QPopupMenu

Documentación de las enumeraciones miembro de la clase

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).

Valores de enumeraciones:
Mouse 
Keyboard 
Other 
Mouse 
Keyboard 
Other 
Valores de enumeraciones:
Mouse 
Keyboard 
Other 
Mouse 
Keyboard 
Other 

Documentación del constructor y destructor

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.

QContextMenuEvent::QContextMenuEvent ( Reason  reason,
const QPoint pos,
int  state 
)

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]
QContextMenuEvent::QContextMenuEvent ( Reason  reason,
const QPoint pos,
int  state 
)

Documentación de las funciones miembro

void QContextMenuEvent::accept ( ) [inline]

Sets the accept flag of the context event object.

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 consumed.

The accept flag is not set by default.

Ver también:
ignore() consume()
void QContextMenuEvent::accept ( ) [inline]
void QContextMenuEvent::consume ( ) [inline]

Sets the consume flag of the context event object.

Setting the consume flag indicates that the receiver of this event does not want the event to be propagated further (i.e. not sent to parent classes.)

The consumed flag is not set by default.

Ver también:
ignore() accept()
void QContextMenuEvent::consume ( ) [inline]
const QPoint& QContextMenuEvent::globalPos ( ) const [inline]
const QPoint & QContextMenuEvent::globalPos ( ) const [inline]

Returns the global position of the mouse pointer at the time of the event.

Ver también:
x(), y(), pos()
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.

Ver también:
globalY(), globalPos()
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.

Ver también:
globalX(), globalPos()
void QContextMenuEvent::ignore ( ) [inline]

Clears the accept flag of the context event object.

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.

Ver también:
accept() consume()
void QContextMenuEvent::ignore ( ) [inline]
bool QContextMenuEvent::isAccepted ( ) const [inline]

Returns TRUE if the receiver has processed the event; otherwise returns FALSE.

Ver también:
accept(), ignore(), consume()
bool QContextMenuEvent::isAccepted ( ) const [inline]
bool QContextMenuEvent::isConsumed ( ) const [inline]

Returns TRUE (which stops propagation of the event) if the receiver has blocked the event; otherwise returns FALSE.

Ver también:
accept(), ignore(), consume()
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.

Ver también:
x(), y(), globalPos()
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]

Returns the x-position of the mouse pointer, relative to the widget that received the event.

Ver también:
y(), pos()
int QContextMenuEvent::x ( ) const [inline]
int QContextMenuEvent::y ( ) const [inline]
int QContextMenuEvent::y ( ) const [inline]

Returns the y-position of the mouse pointer, relative to the widget that received the event.

Ver también:
x(), pos()

Documentación de los datos miembro


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'