diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-21 10:34:44 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-21 10:37:19 (GMT) |
commit | 161b86b962f3bfb3e9663eaf3e00bd6849f03211 (patch) | |
tree | ad1f2f0a860dde2f3ca56a0bb939e0461ad164de | |
parent | d2bdb1f0e12a289c0be7ef720b12d1f4b5287a02 (diff) | |
download | Qt-161b86b962f3bfb3e9663eaf3e00bd6849f03211.zip Qt-161b86b962f3bfb3e9663eaf3e00bd6849f03211.tar.gz Qt-161b86b962f3bfb3e9663eaf3e00bd6849f03211.tar.bz2 |
rename QEventTransition::eventObject to eventSource
eventObject was a horrible name. The documentation already used the
term "event source", so let's call it that.
Agreed with Eskil.
-rw-r--r-- | src/corelib/statemachine/qeventtransition.cpp | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.h | 6 | ||||
-rw-r--r-- | tests/auto/qstatemachine/tst_qstatemachine.cpp | 16 |
3 files changed, 14 insertions, 14 deletions
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index e2d1f69..89dabde 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE */ /*! - \property QEventTransition::eventObject + \property QEventTransition::eventSource \brief the event source that this event transition is associated with */ @@ -205,7 +205,7 @@ void QEventTransition::setEventType(QEvent::Type type) /*! Returns the event source associated with this event transition. */ -QObject *QEventTransition::eventObject() const +QObject *QEventTransition::eventSource() const { Q_D(const QEventTransition); return d->object; @@ -215,7 +215,7 @@ QObject *QEventTransition::eventObject() const Sets the event source associated with this event transition to be the given \a object. */ -void QEventTransition::setEventObject(QObject *object) +void QEventTransition::setEventSource(QObject *object) { Q_D(QEventTransition); if (d->object == object) diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h index 6cf6a96..941bfa5 100644 --- a/src/corelib/statemachine/qeventtransition.h +++ b/src/corelib/statemachine/qeventtransition.h @@ -57,15 +57,15 @@ class QEventTransitionPrivate; class Q_CORE_EXPORT QEventTransition : public QAbstractTransition { Q_OBJECT - Q_PROPERTY(QObject* eventObject READ eventObject WRITE setEventObject) + Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource) Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType) public: QEventTransition(QState *sourceState = 0); QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = 0); ~QEventTransition(); - QObject *eventObject() const; - void setEventObject(QObject *object); + QObject *eventSource() const; + void setEventSource(QObject *object); QEvent::Type eventType() const; void setEventType(QEvent::Type type); diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 9fd6b5d..56b5f02 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -2066,7 +2066,7 @@ void tst_QStateMachine::eventTransitions() QPushButton button2; machine.start(); QCoreApplication::processEvents(); - trans->setEventObject(&button2); + trans->setEventSource(&button2); QTest::mousePress(&button2, Qt::LeftButton); QTRY_COMPARE(finishedSpy.count(), 4); } @@ -2078,16 +2078,16 @@ void tst_QStateMachine::eventTransitions() QEventTransition *trans; if (x == 0) { trans = new QEventTransition(); - QCOMPARE(trans->eventObject(), (QObject*)0); + QCOMPARE(trans->eventSource(), (QObject*)0); QCOMPARE(trans->eventType(), QEvent::None); - trans->setEventObject(&button); + trans->setEventSource(&button); trans->setEventType(QEvent::MouseButtonPress); trans->setTargetState(s1); } else if (x == 1) { trans = new QEventTransition(&button, QEvent::MouseButtonPress); trans->setTargetState(s1); } - QCOMPARE(trans->eventObject(), (QObject*)&button); + QCOMPARE(trans->eventSource(), (QObject*)&button); QCOMPARE(trans->eventType(), QEvent::MouseButtonPress); QCOMPARE(trans->targetState(), (QAbstractState*)s1); s0->addTransition(trans); @@ -2108,10 +2108,10 @@ void tst_QStateMachine::eventTransitions() QFinalState *s1 = new QFinalState(&machine); QMouseEventTransition *trans = new QMouseEventTransition(); - QCOMPARE(trans->eventObject(), (QObject*)0); + QCOMPARE(trans->eventSource(), (QObject*)0); QCOMPARE(trans->eventType(), QEvent::None); QCOMPARE(trans->button(), Qt::NoButton); - trans->setEventObject(&button); + trans->setEventSource(&button); trans->setEventType(QEvent::MouseButtonPress); trans->setButton(Qt::LeftButton); trans->setTargetState(s1); @@ -2155,10 +2155,10 @@ void tst_QStateMachine::eventTransitions() QFinalState *s1 = new QFinalState(&machine); QKeyEventTransition *trans = new QKeyEventTransition(); - QCOMPARE(trans->eventObject(), (QObject*)0); + QCOMPARE(trans->eventSource(), (QObject*)0); QCOMPARE(trans->eventType(), QEvent::None); QCOMPARE(trans->key(), 0); - trans->setEventObject(&button); + trans->setEventSource(&button); trans->setEventType(QEvent::KeyPress); trans->setKey(Qt::Key_A); trans->setTargetState(s1); |