|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QEvent
com.trolltech.qt.gui.QInputEvent
com.trolltech.qt.gui.QContextMenuEvent
public class QContextMenuEvent
The 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.
Nested Class Summary | |
---|---|
static class |
QContextMenuEvent.Reason
This enum describes the reason why the event was sent. |
Nested classes/interfaces inherited from class com.trolltech.qt.core.QEvent |
---|
QEvent.Type |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QContextMenuEvent(QContextMenuEvent.Reason reason,
QPoint pos)
Constructs a context menu event object with the accept parameter flag set to false. |
|
QContextMenuEvent(QContextMenuEvent.Reason reason,
QPoint pos,
QPoint globalPos)
Constructs a context menu event object with the accept parameter flag set to false. |
Method Summary | |
---|---|
static QContextMenuEvent |
fromNativePointer(QNativePointer nativePointer)
This function returns the QContextMenuEvent instance pointed to by nativePointer |
QPoint |
globalPos()
Returns the global position of the mouse pointer at the time of the event. |
int |
globalX()
Returns the global x position of the mouse pointer at the time of the event. |
int |
globalY()
Returns the global y position of the mouse pointer at the time of the event. |
QPoint |
pos()
Returns the position of the mouse pointer relative to the widget that received the event. |
QContextMenuEvent.Reason |
reason()
Returns the reason for this context event. |
int |
x()
Returns the x position of the mouse pointer, relative to the widget that received the event. |
int |
y()
Returns the y position of the mouse pointer, relative to the widget that received the event. |
Methods inherited from class com.trolltech.qt.gui.QInputEvent |
---|
modifiers, setModState |
Methods inherited from class com.trolltech.qt.core.QEvent |
---|
accept, ignore, isAccepted, setAccepted, setT, spontaneous, t, type |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QContextMenuEvent(QContextMenuEvent.Reason reason, 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.
public QContextMenuEvent(QContextMenuEvent.Reason reason, QPoint pos, 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.
Method Detail |
---|
public final QPoint globalPos()
Returns the global position of the mouse pointer at the time of the event.
public final int globalX()
Returns the global x position of the mouse pointer at the time of the event.
public final int globalY()
Returns the global y position of the mouse pointer at the time of the event.
public final QPoint pos()
Returns the position of the mouse pointer relative to the widget that received the event.
public final QContextMenuEvent.Reason reason()
Returns the reason for this context event.
public final int x()
Returns the x position of the mouse pointer, relative to the widget that received the event.
public final int y()
Returns the y position of the mouse pointer, relative to the widget that received the event.
public static QContextMenuEvent fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |