summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-02-20 13:35:03 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-02-20 14:15:08 +0000
commit1ebb4e0d64bf27dfc6c38b9770ae744fad87fb82 (patch)
treef92eb1649a32785f93fe6af8df82c8d0611b21e0 /examples
parentabfdf34f510b64439c85cc54f47b41c4ce3f9c61 (diff)
Use nullptr instead of 0 or NULL
Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some manual cleanup to prevent QFlag macros to be affected. Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/compositor/customextension.h2
-rw-r--r--examples/wayland/minimal-cpp/compositor.h2
-rw-r--r--examples/wayland/minimal-cpp/window.cpp2
-rw-r--r--examples/wayland/qwindow-compositor/compositor.cpp4
-rw-r--r--examples/wayland/qwindow-compositor/window.cpp10
5 files changed, 10 insertions, 10 deletions
diff --git a/examples/wayland/custom-extension/compositor/customextension.h b/examples/wayland/custom-extension/compositor/customextension.h
index de7df6acb..dc44dfc2a 100644
--- a/examples/wayland/custom-extension/compositor/customextension.h
+++ b/examples/wayland/custom-extension/compositor/customextension.h
@@ -65,7 +65,7 @@ class CustomExtension : public QWaylandCompositorExtensionTemplate<CustomExtens
{
Q_OBJECT
public:
- CustomExtension(QWaylandCompositor *compositor = 0);
+ CustomExtension(QWaylandCompositor *compositor = nullptr);
void initialize() override;
signals:
diff --git a/examples/wayland/minimal-cpp/compositor.h b/examples/wayland/minimal-cpp/compositor.h
index d20ccb3c9..76af25ecb 100644
--- a/examples/wayland/minimal-cpp/compositor.h
+++ b/examples/wayland/minimal-cpp/compositor.h
@@ -64,7 +64,7 @@ class View : public QWaylandView
{
Q_OBJECT
public:
- View() : m_texture(0) {}
+ View() : m_texture(nullptr) {}
QOpenGLTexture *getTexture();
bool isCursor() const;
private:
diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp
index a66a33d58..9de81e5f4 100644
--- a/examples/wayland/minimal-cpp/window.cpp
+++ b/examples/wayland/minimal-cpp/window.cpp
@@ -58,7 +58,7 @@
#include <QRandomGenerator>
Window::Window()
- : m_compositor(0)
+ : m_compositor(nullptr)
{
}
diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index 64f468262..11516a182 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -69,7 +69,7 @@
View::View(Compositor *compositor)
: m_compositor(compositor)
, m_textureTarget(GL_TEXTURE_2D)
- , m_texture(0)
+ , m_texture(nullptr)
, m_wlShellSurface(nullptr)
, m_xdgSurface(nullptr)
, m_xdgPopup(nullptr)
@@ -502,7 +502,7 @@ void Compositor::startDrag()
void Compositor::handleDrag(View *target, QMouseEvent *me)
{
QPointF pos = me->localPos();
- QWaylandSurface *surface = 0;
+ QWaylandSurface *surface = nullptr;
if (target) {
pos -= target->position();
surface = target->surface();
diff --git a/examples/wayland/qwindow-compositor/window.cpp b/examples/wayland/qwindow-compositor/window.cpp
index c795f70a1..9d5b4395e 100644
--- a/examples/wayland/qwindow-compositor/window.cpp
+++ b/examples/wayland/qwindow-compositor/window.cpp
@@ -60,10 +60,10 @@
#include <QtWaylandCompositor/qwaylandseat.h>
Window::Window()
- : m_backgroundTexture(0)
- , m_compositor(0)
+ : m_backgroundTexture(nullptr)
+ , m_compositor(nullptr)
, m_grabState(NoGrab)
- , m_dragIconView(0)
+ , m_dragIconView(nullptr)
{
}
@@ -162,7 +162,7 @@ void Window::paintGL()
View *Window::viewAt(const QPointF &point)
{
- View *ret = 0;
+ View *ret = nullptr;
Q_FOREACH (View *view, m_compositor->views()) {
if (view == m_dragIconView)
continue;
@@ -226,7 +226,7 @@ void Window::mouseReleaseEvent(QMouseEvent *e)
View *view = viewAt(e->localPos());
m_compositor->handleDrag(view, e);
}
- m_mouseView = 0;
+ m_mouseView = nullptr;
m_grabState = NoGrab;
}
}