From ece0c0a5e7e0b18beb58ccd868bde54c7be64f78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 22 Nov 2019 14:46:58 +0100 Subject: Tidy nullptr usage Move away from using 0 as pointer literal. Done using clang-tidy. This is not complete as run-clang-tidy can't handle all of qtbase in one go. Change-Id: I1076a21f32aac0dab078af6f175f7508145eece0 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/gui/kernel/qshortcutmap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui/kernel/qshortcutmap.cpp') diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 9ed450b031..a7ea20266b 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -65,11 +65,11 @@ Q_LOGGING_CATEGORY(lcShortcutMap, "qt.gui.shortcutmap") struct QShortcutEntry { QShortcutEntry() - : keyseq(0), context(Qt::WindowShortcut), enabled(false), autorepeat(1), id(0), owner(0), contextMatcher(0) + : keyseq(0), context(Qt::WindowShortcut), enabled(false), autorepeat(1), id(0), owner(nullptr), contextMatcher(nullptr) {} QShortcutEntry(const QKeySequence &k) - : keyseq(k), context(Qt::WindowShortcut), enabled(false), autorepeat(1), id(0), owner(0), contextMatcher(0) + : keyseq(k), context(Qt::WindowShortcut), enabled(false), autorepeat(1), id(0), owner(nullptr), contextMatcher(nullptr) {} QShortcutEntry(QObject *o, const QKeySequence &k, Qt::ShortcutContext c, int i, bool a, QShortcutMap::ContextMatcher m) @@ -184,7 +184,7 @@ int QShortcutMap::removeShortcut(int id, QObject *owner, const QKeySequence &key { Q_D(QShortcutMap); int itemsRemoved = 0; - bool allOwners = (owner == 0); + bool allOwners = (owner == nullptr); bool allKeys = key.isEmpty(); bool allIds = id == 0; @@ -228,7 +228,7 @@ int QShortcutMap::setShortcutEnabled(bool enable, int id, QObject *owner, const { Q_D(QShortcutMap); int itemsChanged = 0; - bool allOwners = (owner == 0); + bool allOwners = (owner == nullptr); bool allKeys = key.isEmpty(); bool allIds = id == 0; @@ -264,7 +264,7 @@ int QShortcutMap::setShortcutAutoRepeat(bool on, int id, QObject *owner, const Q { Q_D(QShortcutMap); int itemsChanged = 0; - bool allOwners = (owner == 0); + bool allOwners = (owner == nullptr); bool allKeys = key.isEmpty(); bool allIds = id == 0; @@ -638,7 +638,7 @@ void QShortcutMap::dispatchEvent(QKeyEvent *e) d->prevSequence = curKey; } // Find next - const QShortcutEntry *current = 0, *next = 0; + const QShortcutEntry *current = nullptr, *next = nullptr; int i = 0, enabledShortcuts = 0; QVector ambiguousShortcuts; while(i < d->identicals.size()) { -- cgit v1.2.3