summaryrefslogtreecommitdiff
path: root/src/corelib/statemachine/qstate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r--src/corelib/statemachine/qstate.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 62dd4f0284..f641d25a96 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -146,7 +146,7 @@ QT_BEGIN_NAMESPACE
QStatePrivate::QStatePrivate()
: QAbstractStatePrivate(StandardState),
- errorState(0), initialState(0), childMode(QState::ExclusiveStates),
+ errorState(nullptr), initialState(nullptr), childMode(QState::ExclusiveStates),
childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true)
{
}
@@ -293,11 +293,11 @@ QAbstractState *QState::errorState() const
void QState::setErrorState(QAbstractState *state)
{
Q_D(QState);
- if (state != 0 && qobject_cast<QStateMachine*>(state)) {
+ if (state != nullptr && qobject_cast<QStateMachine*>(state)) {
qWarning("QStateMachine::setErrorState: root state cannot be error state");
return;
}
- if (state != 0 && (!state->machine() || ((state->machine() != machine()) && !qobject_cast<QStateMachine*>(this)))) {
+ if (state != nullptr && (!state->machine() || ((state->machine() != machine()) && !qobject_cast<QStateMachine*>(this)))) {
qWarning("QState::setErrorState: error state cannot belong "
"to a different state machine");
return;
@@ -360,15 +360,15 @@ QSignalTransition *QState::addTransition(const QObject *sender, const char *sign
{
if (!sender) {
qWarning("QState::addTransition: sender cannot be null");
- return 0;
+ return nullptr;
}
if (!signal) {
qWarning("QState::addTransition: signal cannot be null");
- return 0;
+ return nullptr;
}
if (!target) {
qWarning("QState::addTransition: cannot add transition to null state");
- return 0;
+ return nullptr;
}
int offset = (*signal == '0'+QSIGNAL_CODE) ? 1 : 0;
const QMetaObject *meta = sender->metaObject();
@@ -376,7 +376,7 @@ QSignalTransition *QState::addTransition(const QObject *sender, const char *sign
if (meta->indexOfSignal(QMetaObject::normalizedSignature(signal+offset)) == -1) {
qWarning("QState::addTransition: no such signal %s::%s",
meta->className(), signal+offset);
- return 0;
+ return nullptr;
}
}
QSignalTransition *trans = new QSignalTransition(sender, signal);
@@ -409,7 +409,7 @@ QAbstractTransition *QState::addTransition(QAbstractState *target)
{
if (!target) {
qWarning("QState::addTransition: cannot add transition to null state");
- return 0;
+ return nullptr;
}
UnconditionalTransition *trans = new UnconditionalTransition(target);
addTransition(trans);
@@ -438,7 +438,7 @@ void QState::removeTransition(QAbstractTransition *transition)
QStateMachinePrivate *mach = QStateMachinePrivate::get(d->machine());
if (mach)
mach->unregisterTransition(transition);
- transition->setParent(0);
+ transition->setParent(nullptr);
}
/*!
@@ -544,7 +544,7 @@ bool QState::event(QEvent *e)
d->childStatesListNeedsRefresh = true;
d->transitionsListNeedsRefresh = true;
if ((e->type() == QEvent::ChildRemoved) && (static_cast<QChildEvent *>(e)->child() == d->initialState))
- d->initialState = 0;
+ d->initialState = nullptr;
}
return QAbstractState::event(e);
}