summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-04-29 10:20:11 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-04-29 10:20:11 (GMT)
commit6ca9c87235b057bc635576b0c414ca789afaf592 (patch)
tree3ba290fc3edabbb1372dba253cbe5d3526f80f14 /src/corelib/statemachine/qstatemachine.cpp
parent35f353f16f696a7362d3e899c9a7e2066dc09c65 (diff)
downloadQt-6ca9c87235b057bc635576b0c414ca789afaf592.zip
Qt-6ca9c87235b057bc635576b0c414ca789afaf592.tar.gz
Qt-6ca9c87235b057bc635576b0c414ca789afaf592.tar.bz2
rename QBoundEvent to QWrappedEvent and make it public
Result of API review.
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp58
1 files changed, 56 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 0ddeac9..b0f6cd6 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -62,7 +62,7 @@
#ifndef QT_NO_STATEMACHINE_EVENTFILTER
#include "qeventtransition.h"
#include "qeventtransition_p.h"
-#include "qboundevent_p.h"
+#include "qwrappedevent.h"
#endif
#ifndef QT_NO_ANIMATION
@@ -1827,7 +1827,7 @@ bool QStateMachine::eventFilter(QObject *watched, QEvent *event)
Q_D(QStateMachine);
Q_ASSERT(d->qobjectEvents.contains(watched));
if (d->qobjectEvents[watched].contains(event->type()))
- postEvent(new QBoundEvent(watched, d->handler->cloneEvent(event)));
+ postEvent(new QWrappedEvent(watched, d->handler->cloneEvent(event)));
return false;
}
#endif
@@ -2140,6 +2140,60 @@ QSignalEvent::~QSignalEvent()
Returns the arguments of the signal.
*/
+
+/*!
+ \class QWrappedEvent
+
+ \brief The QWrappedEvent class holds a clone of an event associated with a QObject.
+
+ \since 4.6
+ \ingroup statemachine
+
+ A wrapped event is generated by a QStateMachine in response to a Qt
+ event. The QEventTransition class provides a transition associated with a
+ such an event. QWrappedEvent is part of \l{The State Machine Framework}.
+
+ The object() function returns the object that generated the event. The
+ event() function returns a clone of the original event.
+
+ \sa QEventTransition
+*/
+
+/*!
+ \internal
+
+ Constructs a new QWrappedEvent object with the given \a object
+ and \a event.
+*/
+QWrappedEvent::QWrappedEvent(QObject *object, QEvent *event)
+#ifdef QT_STATEMACHINE_SOLUTION
+ : QEvent(QEvent::Type(QEvent::User-3))
+#else
+ : QEvent(QEvent::Wrapped)
+#endif
+ , m_object(object), m_event(event)
+{
+}
+
+/*!
+ Destroys this QWrappedEvent.
+*/
+QWrappedEvent::~QWrappedEvent()
+{
+}
+
+/*!
+ \fn QWrappedEvent::object() const
+
+ Returns the object that the event is associated with.
+*/
+
+/*!
+ \fn QWrappedEvent::event() const
+
+ Returns a clone of the original event.
+*/
+
QT_END_NAMESPACE
#include "moc_qstatemachine.cpp"