summaryrefslogtreecommitdiffstats
path: root/src/widgets/util/qundostack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/util/qundostack.cpp')
-rw-r--r--src/widgets/util/qundostack.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp
index 8788c42252..f188b8298a 100644
--- a/src/widgets/util/qundostack.cpp
+++ b/src/widgets/util/qundostack.cpp
@@ -128,7 +128,7 @@ QUndoCommand::QUndoCommand(const QString &text, QUndoCommand *parent)
QUndoCommand::QUndoCommand(QUndoCommand *parent)
{
d = new QUndoCommandPrivate;
- if (parent != 0)
+ if (parent != nullptr)
parent->d->child_list.append(this);
}
@@ -336,7 +336,7 @@ int QUndoCommand::childCount() const
const QUndoCommand *QUndoCommand::child(int index) const
{
if (index < 0 || index >= d->child_list.count())
- return 0;
+ return nullptr;
return d->child_list.at(index);
}
@@ -559,7 +559,7 @@ QUndoStack::~QUndoStack()
{
#if QT_CONFIG(undogroup)
Q_D(QUndoStack);
- if (d->group != 0)
+ if (d->group != nullptr)
d->group->removeStack(this);
#endif
clear();
@@ -640,7 +640,7 @@ void QUndoStack::push(QUndoCommand *cmd)
bool macro = !d->macro_stack.isEmpty();
- QUndoCommand *cur = 0;
+ QUndoCommand *cur = nullptr;
if (macro) {
QUndoCommand *macro_cmd = d->macro_stack.constLast();
if (!macro_cmd->d->child_list.isEmpty())
@@ -654,7 +654,7 @@ void QUndoStack::push(QUndoCommand *cmd)
d->clean_index = -1; // we've deleted the clean state
}
- bool try_merge = cur != 0
+ bool try_merge = cur != nullptr
&& cur->id() != -1
&& cur->id() == cmd->id()
&& (macro || d->index != d->clean_index);
@@ -1225,7 +1225,7 @@ const QUndoCommand *QUndoStack::command(int index) const
Q_D(const QUndoStack);
if (index < 0 || index >= d->command_list.count())
- return 0;
+ return nullptr;
return d->command_list.at(index);
}
@@ -1305,11 +1305,11 @@ void QUndoStack::setActive(bool active)
#else
Q_D(QUndoStack);
- if (d->group != 0) {
+ if (d->group != nullptr) {
if (active)
d->group->setActiveStack(this);
else if (d->group->activeStack() == this)
- d->group->setActiveStack(0);
+ d->group->setActiveStack(nullptr);
}
#endif
}
@@ -1320,7 +1320,7 @@ bool QUndoStack::isActive() const
return true;
#else
Q_D(const QUndoStack);
- return d->group == 0 || d->group->activeStack() == this;
+ return d->group == nullptr || d->group->activeStack() == this;
#endif
}