|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.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 context 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, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
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. |
|
QContextMenuEvent(QContextMenuEvent.Reason reason,
QPoint pos,
QPoint globalPos,
Qt.KeyboardModifier[] modifiers)
Constructs a context menu event object with the accept parameter flag set to false. |
|
QContextMenuEvent(QContextMenuEvent.Reason reason,
QPoint pos,
QPoint globalPos,
Qt.KeyboardModifiers modifiers)
Constructs a context menu event object with the accept parameter flag set to false. |
Method Summary | |
---|---|
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. |
java.lang.String |
toString()
|
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, modState, setModState |
Methods inherited from class com.trolltech.qt.core.QEvent |
---|
accept, ignore, isAccepted, registerEventType, registerEventType, setAccepted, setT, spontaneous, t, type |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, 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)
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)
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.
public QContextMenuEvent(QContextMenuEvent.Reason reason, QPoint pos, QPoint globalPos, Qt.KeyboardModifier[] modifiers)
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. The modifiers holds the keyboard modifiers.
public QContextMenuEvent(QContextMenuEvent.Reason reason, QPoint pos, QPoint globalPos, Qt.KeyboardModifiers modifiers)
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. The modifiers holds the keyboard modifiers.
Method Detail |
---|
public final QPoint globalPos()
x()
, y()
, and pos()
.
public final int globalX()
globalY()
, and globalPos()
.
public final int globalY()
globalX()
, and globalPos()
.
public final QPoint pos()
x()
, y()
, and globalPos()
.
public final QContextMenuEvent.Reason reason()
public final int x()
y()
, and pos()
.
public final int y()
x()
, and pos()
.
public java.lang.String toString()
toString
in class QInputEvent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |