diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-21 10:41:54 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-02-26 07:13:18 +0000 |
commit | 499ec43937e926e4f2fa57a9baa455fcb3862262 (patch) | |
tree | 206c90d47387f8322b68f5e3db613189397e1af3 /src/quick/accessible | |
parent | 53d1e9ed21d25e65a2f13606af479838f5f21fe7 (diff) |
use nullptr consistently (clang-tidy)
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/accessible')
-rw-r--r-- | src/quick/accessible/qaccessiblequickitem.cpp | 12 | ||||
-rw-r--r-- | src/quick/accessible/qaccessiblequickview.cpp | 4 | ||||
-rw-r--r-- | src/quick/accessible/qquickaccessiblefactory.cpp | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp index 2d6bb02af4..87e581384b 100644 --- a/src/quick/accessible/qaccessiblequickitem.cpp +++ b/src/quick/accessible/qaccessiblequickitem.cpp @@ -92,7 +92,7 @@ QAccessibleInterface *QAccessibleQuickItem::childAt(int x, int y) const { if (item()->clip()) { if (!rect().contains(x, y)) - return 0; + return nullptr; } const QList<QQuickItem*> kids = accessibleUnignoredChildren(item(), true); @@ -106,14 +106,14 @@ QAccessibleInterface *QAccessibleQuickItem::childAt(int x, int y) const } } - return 0; + return nullptr; } QAccessibleInterface *QAccessibleQuickItem::parent() const { QQuickItem *parent = item()->parentItem(); QQuickWindow *window = item()->window(); - QQuickItem *ci = window ? window->contentItem() : 0; + QQuickItem *ci = window ? window->contentItem() : nullptr; while (parent && !QQuickItemPrivate::get(parent)->isAccessible && parent != ci) parent = parent->parentItem(); @@ -131,7 +131,7 @@ QAccessibleInterface *QAccessibleQuickItem::parent() const return QAccessible::queryAccessibleInterface(parent); } } - return 0; + return nullptr; } QAccessibleInterface *QAccessibleQuickItem::child(int index) const @@ -139,7 +139,7 @@ QAccessibleInterface *QAccessibleQuickItem::child(int index) const QList<QQuickItem *> children = childItems(); if (index < 0 || index >= children.count()) - return 0; + return nullptr; QQuickItem *child = children.at(index); return QAccessible::queryAccessibleInterface(child); @@ -458,7 +458,7 @@ QTextDocument *QAccessibleQuickItem::textDocument() const QQuickTextDocument *qqdoc = docVariant.value<QQuickTextDocument*>(); return qqdoc->textDocument(); } - return 0; + return nullptr; } int QAccessibleQuickItem::characterCount() const diff --git a/src/quick/accessible/qaccessiblequickview.cpp b/src/quick/accessible/qaccessiblequickview.cpp index b3d1b6fc0f..3bb40546be 100644 --- a/src/quick/accessible/qaccessiblequickview.cpp +++ b/src/quick/accessible/qaccessiblequickview.cpp @@ -78,7 +78,7 @@ QAccessibleInterface *QAccessibleQuickWindow::child(int index) const const QList<QQuickItem*> &kids = rootItems(); if (index >= 0 && index < kids.count()) return QAccessible::queryAccessibleInterface(kids.at(index)); - return 0; + return nullptr; } QAccessibleInterface *QAccessibleQuickWindow::focusChild() const @@ -133,7 +133,7 @@ QAccessibleInterface *QAccessibleQuickWindow::childAt(int x, int y) const return childIface; } } - return 0; + return nullptr; } int QAccessibleQuickWindow::indexOfChild(const QAccessibleInterface *iface) const diff --git a/src/quick/accessible/qquickaccessiblefactory.cpp b/src/quick/accessible/qquickaccessiblefactory.cpp index a1fa695e5a..1aacf8e8bd 100644 --- a/src/quick/accessible/qquickaccessiblefactory.cpp +++ b/src/quick/accessible/qquickaccessiblefactory.cpp @@ -55,11 +55,11 @@ QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject Q_ASSERT(item); QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); if (!itemPrivate->isAccessible) - return 0; + return nullptr; return new QAccessibleQuickItem(item); } - return 0; + return nullptr; } #endif |