|
|
||||||||||
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
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 QObjects.
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.
Nested Class Summary | |
---|---|
static class |
QEvent.Type
This enum type defines the valid event types in Qt. |
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 | |
---|---|
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 callign setAccepted(true). |
static QEvent |
fromNativePointer(QNativePointer nativePointer)
This function returns the QEvent instance pointed to by nativePointer |
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 Setting the accept parameter indicates that the event receiver wants the event. |
void |
setAccepted(boolean accepted)
the accept flag of the event object Setting the accept parameter indicates that the event receiver wants the event. |
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. |
QEvent.Type |
type()
Returns the event 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 QEvent(QEvent.Type type)
Contructs an event object of type type.
Method Detail |
---|
public final void accept()
Sets the accept flag of the event object, the equivalent of callign setAccepted(true).
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.
public final void ignore()
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propgated to the parent widget.
public final boolean isAccepted()
the accept flag of the event object
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)
the accept flag of the event object
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()
Returns true if the event originated outside the application (a system event); otherwise returns false.
The return value of this function is not defined for paint events.
public final QEvent.Type type()
Returns the event type.
protected final void setT(char t)
protected final char t()
public static QEvent 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 |