|
|||||||||
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
public class QEvent
The QEvent
class is the base class of all event classes. Event objects contain event parameters. Qt's main event loop (QCoreApplication::exec()
) fetches native window system events from the event queue, translates them into QEvents, and sends the translated events to QObject
s.
In general, events come from the underlying window system (spontaneous()
returns true), but it is also possible to manually send events using QCoreApplication::sendEvent()
and QCoreApplication::postEvent()
(spontaneous()
returns false).
QObjects receive events by having their QObject::event()
function called. The function can be reimplemented in subclasses to customize event handling and add additional event types; QWidget::event()
is a notable example. By default, events are dispatched to event handlers like QObject::timerEvent()
and QWidget::mouseMoveEvent()
. QObject::installEventFilter()
allows an object to intercept events destined for another object.
The basic QEvent
contains only an event type parameter and an "accept" flag. The accept flag set with accept()
, and cleared with ignore()
. It is set by default, but don't rely on this as subclasses may choose to clear it in their constructor.
Subclasses of QEvent
contain additional parameters that describe the particular event.
QObject::event()
, QObject::installEventFilter()
, QWidget::event()
, QCoreApplication::sendEvent()
, QCoreApplication::postEvent()
, and QCoreApplication::processEvents()
.
Nested Class Summary | |
---|---|
static class |
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 | |
---|---|
QEvent(QEvent.Type type)
Contructs an event object of type type. |
Method Summary | |
---|---|
void |
accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). |
void |
ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). |
boolean |
isAccepted()
the accept flag of the event object |
static int |
registerEventType()
Registers and returns a custom event type. |
static int |
registerEventType(int hint)
Registers and returns a custom event type. |
void |
setAccepted(boolean accepted)
the accept flag of the event object |
protected void |
setT(char t)
Sets the type of this QEvent to t. |
boolean |
spontaneous()
Returns true if the event originated outside the application (a system event); otherwise returns false. |
protected char |
t()
Returns the type of this QEvent. |
java.lang.String |
toString()
|
QEvent.Type |
type()
Returns the event 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 QEvent(QEvent.Type type)
Method Detail |
---|
public final void accept()
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.
ignore()
.
public final void ignore()
Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propgated to the parent widget.
accept()
.
public final boolean isAccepted()
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted()
is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept()
, and cleared with ignore()
.
public final void setAccepted(boolean accepted)
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted()
is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept()
, and cleared with ignore()
.
public final boolean spontaneous()
The return value of this function is not defined for paint events.
public final QEvent.Type type()
public static int registerEventType()
QEvent::User
and QEvent::MaxUser
that has not yet been registered. The hint is ignored if its value is not between QEvent::User
and QEvent::MaxUser
.
public static int registerEventType(int hint)
QEvent::User
and QEvent::MaxUser
that has not yet been registered. The hint is ignored if its value is not between QEvent::User
and QEvent::MaxUser
.
protected final void setT(char t)
protected final char t()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |