From 58c14c4a7edcecdd9d58b682a9360c83e2274ec5 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 18 Sep 2017 11:49:52 +0200 Subject: Replace Q_NULLPTR with nullptr where possible Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen Reviewed-by: Lars Knoll Reviewed-by: Olivier Goffart (Woboq GmbH) --- .../xcb/gl_integrations/qxcbglintegration.h | 2 +- .../gl_integrations/qxcbnativeinterfacehandler.cpp | 12 ++--- .../gl_integrations/xcb_egl/qxcbeglintegration.cpp | 2 +- .../xcb_egl/qxcbeglnativeinterfacehandler.cpp | 10 ++-- .../xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp | 2 +- .../gl_integrations/xcb_glx/qglxintegration.cpp | 4 +- .../gl_integrations/xcb_glx/qxcbglxintegration.cpp | 2 +- .../xcb_glx/qxcbglxnativeinterfacehandler.cpp | 2 +- .../xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp | 4 +- .../xcb/nativepainting/qbackingstore_x11.cpp | 6 +-- .../platforms/xcb/nativepainting/qpixmap_x11_p.h | 2 +- .../xcb/nativepainting/qxcbnativepainting.cpp | 4 +- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 6 +-- src/plugins/platforms/xcb/qxcbconnection.cpp | 16 +++---- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 2 +- src/plugins/platforms/xcb/qxcbcursor.cpp | 2 +- src/plugins/platforms/xcb/qxcbdrag.cpp | 6 +-- src/plugins/platforms/xcb/qxcbintegration.cpp | 8 ++-- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 54 +++++++++++----------- src/plugins/platforms/xcb/qxcbscreen.cpp | 2 +- src/plugins/platforms/xcb/qxcbscreen.h | 2 +- src/plugins/platforms/xcb/qxcbwindow.cpp | 28 +++++------ 22 files changed, 89 insertions(+), 89 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h index 926e5e22df..07e983a499 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h @@ -69,7 +69,7 @@ public: #endif virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; - virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return Q_NULLPTR; } + virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp index ac992b859d..e18656c6ec 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbnativeinterfacehandler.cpp @@ -56,37 +56,37 @@ QXcbNativeInterfaceHandler::~QXcbNativeInterfaceHandler() QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForIntegration(const QByteArray &resource) const { Q_UNUSED(resource); - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForContext(const QByteArray &resource) const { Q_UNUSED(resource); - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForScreen(const QByteArray &resource) const { Q_UNUSED(resource); - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForWindow(const QByteArray &resource) const { Q_UNUSED(resource); - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterfaceHandler::nativeResourceFunctionForBackingStore(const QByteArray &resource) const { Q_UNUSED(resource); - return Q_NULLPTR; + return nullptr; } QFunctionPointer QXcbNativeInterfaceHandler::platformFunction(const QByteArray &function) const { Q_UNUSED(function); - return Q_NULLPTR; + return nullptr; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp index 7aa1d631df..fe18bc24db 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglintegration.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QXcbEglIntegration::QXcbEglIntegration() - : m_connection(Q_NULLPTR) + : m_connection(nullptr) , m_egl_display(EGL_NO_DISPLAY) { qCDebug(lcQpaGl) << "Xcb EGL gl-integration created"; diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp index 30f5e3a00d..c0e3f820fe 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp @@ -77,7 +77,7 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbEglNativeInte default: break; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForContextFunction QXcbEglNativeInterfaceHandler::nativeResourceFunctionForContext(const QByteArray &resource) const @@ -90,7 +90,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbEglNativeInterfac default: break; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForWindowFunction QXcbEglNativeInterfaceHandler::nativeResourceFunctionForWindow(const QByteArray &resource) const @@ -101,7 +101,7 @@ QPlatformNativeInterface::NativeResourceForWindowFunction QXcbEglNativeInterface default: break; } - return Q_NULLPTR; + return nullptr; } void *QXcbEglNativeInterfaceHandler::eglDisplay() @@ -114,11 +114,11 @@ void *QXcbEglNativeInterfaceHandler::eglDisplay() void *QXcbEglNativeInterfaceHandler::eglDisplayForWindow(QWindow *window) { Q_ASSERT(window); - if (window->supportsOpenGL() && window->handle() == Q_NULLPTR) + if (window->supportsOpenGL() && window->handle() == nullptr) return eglDisplay(); else if (window->supportsOpenGL()) return static_cast(window->handle())->glIntegration()->eglDisplay(); - return Q_NULLPTR; + return nullptr; } void *QXcbEglNativeInterfaceHandler::eglContextForContext(QOpenGLContext *context) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp index 9c3fd26d49..65beac227c 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglwindow.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE QXcbEglWindow::QXcbEglWindow(QWindow *window, QXcbEglIntegration *glIntegration) : QXcbWindow(window) , m_glIntegration(glIntegration) - , m_config(Q_NULLPTR) + , m_config(nullptr) , m_surface(EGL_NO_SURFACE) { } diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index 3bc8590d36..56a737e882 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -321,7 +321,7 @@ void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share) if (!m_context && m_shareContext) { // re-try without a shared glx context m_shareContext = 0; - m_context = glXCreateContext(m_display, visualInfo, Q_NULLPTR, true); + m_context = glXCreateContext(m_display, visualInfo, nullptr, true); } // Create a temporary window so that we can make the new context current @@ -470,7 +470,7 @@ static QXcbScreen *screenForPlatformSurface(QPlatformSurface *surface) } else if (surfaceClass == QSurface::Offscreen) { return static_cast(static_cast(surface)->screen()); } - return Q_NULLPTR; + return nullptr; } QVariant QGLXContext::nativeHandle() const diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp index 377066df61..13f03f8bf3 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp @@ -87,7 +87,7 @@ QT_BEGIN_NAMESPACE #endif QXcbGlxIntegration::QXcbGlxIntegration() - : m_connection(Q_NULLPTR) + : m_connection(nullptr) , m_glx_first_event(0) { qCDebug(lcQpaGl) << "Xcb GLX gl-integration created"; diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp index 638fdd46b5..e9bb4460ff 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxnativeinterfacehandler.cpp @@ -72,7 +72,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbGlxNativeInterfac default: break; } - return Q_NULLPTR; + return nullptr; } void *QXcbGlxNativeInterfaceHandler::glxContextForContext(QOpenGLContext *context) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp index 145a11a5e3..d682ea87fb 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxwindow.cpp @@ -58,7 +58,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual() { QXcbScreen *scr = xcbScreen(); if (!scr) - return Q_NULLPTR; + return nullptr; qDebug(lcQpaGl) << "Requested format before FBConfig/Visual selection:" << m_format; @@ -74,7 +74,7 @@ const xcb_visualtype_t *QXcbGlxWindow::createVisual() XVisualInfo *visualInfo = qglx_findVisualInfo(dpy, scr->screenNumber(), &m_format, GLX_WINDOW_BIT, flags); if (!visualInfo) { qWarning() << "No XVisualInfo for format" << m_format; - return Q_NULLPTR; + return nullptr; } const xcb_visualtype_t *xcb_visualtype = scr->visualForId(visualInfo->visualid); XFree(visualInfo); diff --git a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp index 2dd2cdd9e3..cb2bbafee1 100644 --- a/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qbackingstore_x11.cpp @@ -115,7 +115,7 @@ void QXcbNativeBackingStore::flush(QWindow *window, const QRegion ®ion, const else #endif { - GC gc = XCreateGC(display(), wid, 0, Q_NULLPTR); + GC gc = XCreateGC(display(), wid, 0, nullptr); if (clipRects.size() != 1) XSetClipRectangles(display(), gc, 0, 0, clipRects.data(), clipRects.size(), YXBanded); @@ -155,7 +155,7 @@ void QXcbNativeBackingStore::resize(const QSize &size, const QRegion &staticCont QRect br = staticContents.boundingRect().intersected(QRect(QPoint(0, 0), size)); if (!br.isEmpty()) { - GC gc = XCreateGC(display(), to, 0, Q_NULLPTR); + GC gc = XCreateGC(display(), to, 0, nullptr); XCopyArea(display(), from, to, gc, br.x(), br.y(), br.width(), br.height(), br.x(), br.y()); XFreeGC(display(), gc); } @@ -172,7 +172,7 @@ bool QXcbNativeBackingStore::scroll(const QRegion &area, int dx, int dy) QRect rect = area.boundingRect(); Pixmap pix = qt_x11PixmapHandle(m_pixmap); - GC gc = XCreateGC(display(), pix, 0, Q_NULLPTR); + GC gc = XCreateGC(display(), pix, 0, nullptr); XCopyArea(display(), pix, pix, gc, rect.x(), rect.y(), rect.width(), rect.height(), rect.x()+dx, rect.y()+dy); diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h index 098ccaf1d9..79e607c6f8 100644 --- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h +++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11_p.h @@ -123,7 +123,7 @@ inline QX11PlatformPixmap *qt_x11Pixmap(const QPixmap &pixmap) { return (pixmap.handle() && pixmap.handle()->classId() == QPlatformPixmap::X11Class) ? static_cast(pixmap.handle()) - : Q_NULLPTR; + : nullptr; } inline Picture qt_x11PictureHandle(const QPixmap &pixmap) diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp index ccb421d868..7731f6c806 100644 --- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp @@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE -QXcbX11Data *qt_x11Data = Q_NULLPTR; +QXcbX11Data *qt_x11Data = nullptr; void qt_xcb_native_x11_info_init(QXcbConnection *conn) { @@ -122,7 +122,7 @@ class QXcbX11InfoData : public QSharedData, public QX11InfoData {}; QXcbX11Info::QXcbX11Info() - : d(Q_NULLPTR) + : d(nullptr) {} QXcbX11Info::~QXcbX11Info() diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 17927af3e3..0369ef4d9f 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -145,7 +145,7 @@ private: QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QImage::Format format) : QXcbObject(screen->connection()) - , m_graphics_buffer(Q_NULLPTR) + , m_graphics_buffer(nullptr) , m_gc(0) , m_gc_drawable(0) , m_xcb_pixmap(0) @@ -265,7 +265,7 @@ void QXcbShmImage::destroy() if (m_gc) xcb_free_gc(xcb_connection(), m_gc); delete m_graphics_buffer; - m_graphics_buffer = Q_NULLPTR; + m_graphics_buffer = nullptr; if (m_xcb_pixmap) { xcb_free_pixmap(xcb_connection(), m_xcb_pixmap); @@ -565,7 +565,7 @@ QImage QXcbBackingStore::toImage() const QPlatformGraphicsBuffer *QXcbBackingStore::graphicsBuffer() const { - return m_image ? m_image->graphicsBuffer() : Q_NULLPTR; + return m_image ? m_image->graphicsBuffer() : nullptr; } void QXcbBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 536c709dbe..d53a961b85 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -369,7 +369,7 @@ void QXcbConnection::destroyScreen(QXcbScreen *screen) // If there are no other screens on the same virtual desktop, // then transform the physical screen into a fake screen. const QString nameWas = screen->name(); - screen->setOutput(XCB_NONE, Q_NULLPTR); + screen->setOutput(XCB_NONE, nullptr); qCDebug(lcQpaScreen) << "transformed" << nameWas << "to fake" << screen; } else { // There is more than one screen on the same virtual desktop, remove the screen @@ -395,7 +395,7 @@ void QXcbConnection::initializeScreens() { xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); int xcbScreenNumber = 0; // screen number in the xcb sense - QXcbScreen *primaryScreen = Q_NULLPTR; + QXcbScreen *primaryScreen = nullptr; while (it.rem) { // Each "screen" in xcb terminology is a virtual desktop, // potentially a collection of separate juxtaposed monitors. @@ -415,7 +415,7 @@ void QXcbConnection::initializeScreens() qWarning("failed to get the current screen resources"); } else { xcb_timestamp_t timestamp = 0; - xcb_randr_output_t *outputs = Q_NULLPTR; + xcb_randr_output_t *outputs = nullptr; int outputCount = xcb_randr_get_screen_resources_current_outputs_length(resources_current.get()); if (outputCount) { timestamp = resources_current->config_timestamp; @@ -487,7 +487,7 @@ void QXcbConnection::initializeScreens() while (it.rem) { xcb_xinerama_screen_info_t *screen_info = it.data; QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, - XCB_NONE, Q_NULLPTR, + XCB_NONE, nullptr, screen_info, it.index); siblings << screen; m_screens << screen; @@ -498,7 +498,7 @@ void QXcbConnection::initializeScreens() if (siblings.isEmpty()) { // If there are no XRandR outputs or XRandR extension is missing, // then create a fake/legacy screen. - QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR); + QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, nullptr); qCDebug(lcQpaScreen) << "created fake screen" << screen; m_screens << screen; if (m_primaryScreenNumber == xcbScreenNumber) { @@ -631,7 +631,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra if (m_glIntegration && !m_glIntegration->initialize(this)) { qCDebug(lcQpaGl) << "Failed to initialize xcb gl-integration" << glIntegrationNames.at(i); delete m_glIntegration; - m_glIntegration = Q_NULLPTR; + m_glIntegration = nullptr; } } if (!m_glIntegration) @@ -689,7 +689,7 @@ QXcbScreen *QXcbConnection::primaryScreen() const return m_screens.first(); } - return Q_NULLPTR; + return nullptr; } void QXcbConnection::addWindowEventListener(xcb_window_t id, QXcbWindowEventListener *eventListener) @@ -1413,7 +1413,7 @@ void QXcbConnection::setFocusWindow(QWindow *w) void QXcbConnection::setMouseGrabber(QXcbWindow *w) { m_mouseGrabber = w; - m_mousePressWindow = Q_NULLPTR; + m_mousePressWindow = nullptr; } void QXcbConnection::setMousePressWindow(QXcbWindow *w) { diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 58e99ef3de..d97c532b67 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -1333,7 +1333,7 @@ QXcbConnection::TabletData *QXcbConnection::tabletDataForDevice(int id) if (m_tabletData.at(i).deviceId == id) return &m_tabletData[i]; } - return Q_NULLPTR; + return nullptr; } #endif // QT_CONFIG(tabletevent) diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index da63360333..bfa3eccdf8 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -660,7 +660,7 @@ QPoint QXcbCursor::pos() const void QXcbCursor::setPos(const QPoint &pos) { - QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR; + QXcbVirtualDesktop *virtualDesktop = nullptr; queryPointer(connection(), &virtualDesktop, 0); xcb_warp_pointer(xcb_connection(), XCB_NONE, virtualDesktop->root(), 0, 0, 0, 0, pos.x(), pos.y()); xcb_flush(xcb_connection()); diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index d4521de8e0..18f5ff4f0d 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -208,7 +208,7 @@ void QXcbDrag::startDrag() setScreen(current_virtual_desktop->screens().constFirst()->screen()); initiatorWindow = QGuiApplicationPrivate::currentMouseWindow; QBasicDrag::startDrag(); - if (connection()->mouseGrabber() == Q_NULLPTR) + if (connection()->mouseGrabber() == nullptr) shapedPixmapWindow()->setMouseGrabEnabled(true); } @@ -308,7 +308,7 @@ void QXcbDrag::move(const QPoint &globalPos) if (source_sameanswer.contains(globalPos) && source_sameanswer.isValid()) return; - QXcbVirtualDesktop *virtualDesktop = Q_NULLPTR; + QXcbVirtualDesktop *virtualDesktop = nullptr; QPoint cursorPos; QXcbCursor::queryPointer(connection(), &virtualDesktop, &cursorPos); QXcbScreen *screen = virtualDesktop->screenAt(cursorPos); @@ -317,7 +317,7 @@ void QXcbDrag::move(const QPoint &globalPos) if (virtualDesktop != current_virtual_desktop) { setUseCompositing(virtualDesktop->compositingActive()); recreateShapedPixmapWindow(static_cast(screen)->screen(), deviceIndependentPos); - if (connection()->mouseGrabber() == Q_NULLPTR) + if (connection()->mouseGrabber() == nullptr) shapedPixmapWindow()->setMouseGrabEnabled(true); current_virtual_desktop = virtualDesktop; diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 72d31060db..6afa7bc934 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -121,7 +121,7 @@ static bool runningUnderDebugger() #endif } -QXcbIntegration *QXcbIntegration::m_instance = Q_NULLPTR; +QXcbIntegration *QXcbIntegration::m_instance = nullptr; QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char **argv) : m_services(new QGenericUnixServices) @@ -222,7 +222,7 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char QXcbIntegration::~QXcbIntegration() { qDeleteAll(m_connections); - m_instance = Q_NULLPTR; + m_instance = nullptr; } QPlatformPixmap *QXcbIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const @@ -274,7 +274,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont QXcbGlIntegration *glIntegration = screen->connection()->glIntegration(); if (!glIntegration) { qWarning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled"); - return Q_NULLPTR; + return nullptr; } return glIntegration->createPlatformOpenGLContext(context); } @@ -296,7 +296,7 @@ QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffs QXcbGlIntegration *glIntegration = screen->connection()->glIntegration(); if (!glIntegration) { qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled"); - return Q_NULLPTR; + return nullptr; } return glIntegration->createPlatformOffscreenSurface(surface); } diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index caa9499c45..d989761297 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -101,7 +101,7 @@ QXcbNativeInterface::QXcbNativeInterface() : static inline QXcbSystemTrayTracker *systemTrayTracker(const QScreen *s) { if (!s) - return Q_NULLPTR; + return nullptr; return static_cast(s->handle())->connection()->systemTrayTracker(); } @@ -194,7 +194,7 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr { if (!screen) { qWarning("nativeResourceForScreen: null screen"); - return Q_NULLPTR; + return nullptr; } QByteArray lowerCaseResource = resourceString.toLower(); @@ -236,7 +236,7 @@ void *QXcbNativeInterface::nativeResourceForScreen(const QByteArray &resourceStr break; case CompositingEnabled: if (QXcbVirtualDesktop *vd = xcbScreen->virtualDesktop()) - result = vd->compositingActive() ? this : Q_NULLPTR; + result = vd->compositingActive() ? this : nullptr; break; default: break; @@ -294,7 +294,7 @@ void *QXcbNativeInterface::nativeResourceForCursor(const QByteArray &resource, c } } } - return Q_NULLPTR; + return nullptr; } #endif // !QT_NO_CURSOR @@ -323,7 +323,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface:: QPlatformNativeInterface::NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(lowerCaseResource); if (func) return func; - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::nativeResourceFunctionForScreen(const QByteArray &resource) @@ -390,13 +390,13 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier()) return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(QXcbScreen::virtualDesktopNumberStatic)); - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::appTime(const QXcbScreen *screen) { if (!screen) - return Q_NULLPTR; + return nullptr; return reinterpret_cast(quintptr(screen->connection()->time())); } @@ -404,7 +404,7 @@ void *QXcbNativeInterface::appTime(const QXcbScreen *screen) void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen) { if (!screen) - return Q_NULLPTR; + return nullptr; return reinterpret_cast(quintptr(screen->connection()->netWmUserTime())); } @@ -412,7 +412,7 @@ void *QXcbNativeInterface::appUserTime(const QXcbScreen *screen) void *QXcbNativeInterface::getTimestamp(const QXcbScreen *screen) { if (!screen) - return Q_NULLPTR; + return nullptr; return reinterpret_cast(quintptr(screen->connection()->getTimestamp())); } @@ -452,7 +452,7 @@ void *QXcbNativeInterface::display() if (defaultConnection) return defaultConnection->xlib_display(); #endif - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::connection() @@ -525,10 +525,10 @@ QXcbScreen *QXcbNativeInterface::qPlatformScreenForWindow(QWindow *window) QXcbScreen *screen; if (window) { QScreen *qs = window->screen(); - screen = static_cast(qs ? qs->handle() : Q_NULLPTR); + screen = static_cast(qs ? qs->handle() : nullptr); } else { QScreen *qs = QGuiApplication::primaryScreen(); - screen = static_cast(qs ? qs->handle() : Q_NULLPTR); + screen = static_cast(qs ? qs->handle() : nullptr); } return screen; } @@ -537,23 +537,23 @@ void *QXcbNativeInterface::displayForWindow(QWindow *window) { #if QT_CONFIG(xcb_xlib) QXcbScreen *screen = qPlatformScreenForWindow(window); - return screen ? screen->connection()->xlib_display() : Q_NULLPTR; + return screen ? screen->connection()->xlib_display() : nullptr; #else Q_UNUSED(window); - return Q_NULLPTR; + return nullptr; #endif } void *QXcbNativeInterface::connectionForWindow(QWindow *window) { QXcbScreen *screen = qPlatformScreenForWindow(window); - return screen ? screen->xcb_connection() : Q_NULLPTR; + return screen ? screen->xcb_connection() : nullptr; } void *QXcbNativeInterface::screenForWindow(QWindow *window) { QXcbScreen *screen = qPlatformScreenForWindow(window); - return screen ? screen->screen() : Q_NULLPTR; + return screen ? screen->screen() : nullptr; } void QXcbNativeInterface::addHandler(QXcbNativeInterfaceHandler *handler) @@ -575,7 +575,7 @@ QPlatformNativeInterface::NativeResourceForIntegrationFunction QXcbNativeInterfa if (result) return result; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface::handlerNativeResourceFunctionForContext(const QByteArray &resource) const @@ -586,7 +586,7 @@ QPlatformNativeInterface::NativeResourceForContextFunction QXcbNativeInterface:: if (result) return result; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::handlerNativeResourceFunctionForScreen(const QByteArray &resource) const @@ -597,7 +597,7 @@ QPlatformNativeInterface::NativeResourceForScreenFunction QXcbNativeInterface::h if (result) return result; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::handlerNativeResourceFunctionForWindow(const QByteArray &resource) const @@ -608,7 +608,7 @@ QPlatformNativeInterface::NativeResourceForWindowFunction QXcbNativeInterface::h if (result) return result; } - return Q_NULLPTR; + return nullptr; } QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterface::handlerNativeResourceFunctionForBackingStore(const QByteArray &resource) const @@ -619,7 +619,7 @@ QPlatformNativeInterface::NativeResourceForBackingStoreFunction QXcbNativeInterf if (result) return result; } - return Q_NULLPTR; + return nullptr; } QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(const QByteArray &function) const @@ -630,7 +630,7 @@ QFunctionPointer QXcbNativeInterface::handlerPlatformFunction(const QByteArray & if (func) return func; } - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::handlerNativeResourceForIntegration(const QByteArray &resource) const @@ -638,7 +638,7 @@ void *QXcbNativeInterface::handlerNativeResourceForIntegration(const QByteArray NativeResourceForIntegrationFunction func = handlerNativeResourceFunctionForIntegration(resource); if (func) return func(); - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::handlerNativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) const @@ -646,7 +646,7 @@ void *QXcbNativeInterface::handlerNativeResourceForContext(const QByteArray &res NativeResourceForContextFunction func = handlerNativeResourceFunctionForContext(resource); if (func) return func(context); - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::handlerNativeResourceForScreen(const QByteArray &resource, QScreen *screen) const @@ -654,7 +654,7 @@ void *QXcbNativeInterface::handlerNativeResourceForScreen(const QByteArray &reso NativeResourceForScreenFunction func = handlerNativeResourceFunctionForScreen(resource); if (func) return func(screen); - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::handlerNativeResourceForWindow(const QByteArray &resource, QWindow *window) const @@ -662,7 +662,7 @@ void *QXcbNativeInterface::handlerNativeResourceForWindow(const QByteArray &reso NativeResourceForWindowFunction func = handlerNativeResourceFunctionForWindow(resource); if (func) return func(window); - return Q_NULLPTR; + return nullptr; } void *QXcbNativeInterface::handlerNativeResourceForBackingStore(const QByteArray &resource, QBackingStore *backingStore) const @@ -670,7 +670,7 @@ void *QXcbNativeInterface::handlerNativeResourceForBackingStore(const QByteArray NativeResourceForBackingStoreFunction func = handlerNativeResourceFunctionForBackingStore(resource); if (func) return func(backingStore); - return Q_NULLPTR; + return nullptr; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index ec0f9ba561..45a0f19d98 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -140,7 +140,7 @@ QXcbScreen *QXcbVirtualDesktop::screenAt(const QPoint &pos) const if (screen->virtualDesktop() == this && screen->geometry().contains(pos)) return screen; } - return Q_NULLPTR; + return nullptr; } void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 842738b622..4a9b1bd209 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -140,7 +140,7 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, - const xcb_xinerama_screen_info_t *xineramaScreenInfo = Q_NULLPTR, int xineramaScreenIdx = -1); + const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index affc2a0dd6..a97b951935 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -287,7 +287,7 @@ static inline XTextProperty* qstringToXTP(Display *dpy, const QString& s) if (!mapper || errCode < 0) { mapper = QTextCodec::codecForName("latin1"); if (!mapper || !mapper->canEncode(s)) - return Q_NULLPTR; + return nullptr; #endif static QByteArray qcs; qcs = s.toLatin1(); @@ -322,7 +322,7 @@ static QWindow *childWindowAt(QWindow *win, const QPoint &p) && win->geometry().contains(win->parent()->mapFromGlobal(p))) { return win; } - return Q_NULLPTR; + return nullptr; } static const char *wm_window_type_property_id = "_q_xcb_wm_window_type"; @@ -418,7 +418,7 @@ void QXcbWindow::create() resolveFormat(platformScreen->surfaceFormatFor(window()->requestedFormat())); - const xcb_visualtype_t *visual = Q_NULLPTR; + const xcb_visualtype_t *visual = nullptr; if (connection()->hasDefaultVisualId()) { visual = platformScreen->visualForId(connection()->defaultVisualId()); @@ -641,7 +641,7 @@ void QXcbWindow::destroy() if (connection()->focusWindow() == this) doFocusOut(); if (connection()->mouseGrabber() == this) - connection()->setMouseGrabber(Q_NULLPTR); + connection()->setMouseGrabber(nullptr); if (m_syncCounter && m_usingSyncProtocol) xcb_sync_destroy_counter(xcb_connection(), m_syncCounter); @@ -877,12 +877,12 @@ void QXcbWindow::hide() xcb_flush(xcb_connection()); if (connection()->mouseGrabber() == this) - connection()->setMouseGrabber(Q_NULLPTR); + connection()->setMouseGrabber(nullptr); if (QPlatformWindow *w = connection()->mousePressWindow()) { // Unset mousePressWindow when it (or one of its parents) is unmapped while (w) { if (w == this) { - connection()->setMousePressWindow(Q_NULLPTR); + connection()->setMousePressWindow(nullptr); break; } w = w->parent(); @@ -900,7 +900,7 @@ void QXcbWindow::hide() // Find the top level window at cursor position. // Don't use QGuiApplication::topLevelAt(): search only the virtual siblings of this window's screen - QWindow *enterWindow = Q_NULLPTR; + QWindow *enterWindow = nullptr; const auto screens = xcbScreen()->virtualSiblings(); for (QPlatformScreen *screen : screens) { if (screen->geometry().contains(cursorPos)) { @@ -2227,7 +2227,7 @@ void QXcbWindow::handleButtonReleaseEvent(int event_x, int event_y, int root_x, } if (connection()->buttonState() == Qt::NoButton) - connection()->setMousePressWindow(Q_NULLPTR); + connection()->setMousePressWindow(nullptr); handleMouseEvent(timestamp, local, global, modifiers, source); } @@ -2252,7 +2252,7 @@ static inline bool doCheckUnGrabAncestor(QXcbConnection *conn) return true; } -static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn = Q_NULLPTR) +static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn = nullptr) { return ((doCheckUnGrabAncestor(conn) && mode == XCB_NOTIFY_MODE_GRAB && detail == XCB_NOTIFY_DETAIL_ANCESTOR) @@ -2261,7 +2261,7 @@ static bool ignoreLeaveEvent(quint8 mode, quint8 detail, QXcbConnection *conn = || detail == XCB_NOTIFY_DETAIL_NONLINEAR_VIRTUAL); } -static bool ignoreEnterEvent(quint8 mode, quint8 detail, QXcbConnection *conn = Q_NULLPTR) +static bool ignoreEnterEvent(quint8 mode, quint8 detail, QXcbConnection *conn = nullptr) { return ((doCheckUnGrabAncestor(conn) && mode == XCB_NOTIFY_MODE_UNGRAB && detail == XCB_NOTIFY_DETAIL_ANCESTOR) @@ -2338,11 +2338,11 @@ void QXcbWindow::handleMotionNotifyEvent(int event_x, int event_y, int root_x, i // "mousePressWindow" can be NULL i.e. if a window will be grabbed or unmapped, so set it again here. // Unset "mousePressWindow" when mouse button isn't pressed - in some cases the release event won't arrive. const bool isMouseButtonPressed = (connection()->buttonState() != Qt::NoButton); - const bool hasMousePressWindow = (connection()->mousePressWindow() != Q_NULLPTR); + const bool hasMousePressWindow = (connection()->mousePressWindow() != nullptr); if (isMouseButtonPressed && !hasMousePressWindow) connection()->setMousePressWindow(this); else if (hasMousePressWindow && !isMouseButtonPressed) - connection()->setMousePressWindow(Q_NULLPTR); + connection()->setMousePressWindow(nullptr); handleMouseEvent(timestamp, local, global, modifiers, source); } @@ -2524,7 +2524,7 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev m_lastWindowStateEvent = newState; m_windowState = newState; if ((m_windowState & Qt::WindowMinimized) && connection()->mouseGrabber() == this) - connection()->setMouseGrabber(Q_NULLPTR); + connection()->setMouseGrabber(nullptr); } return; } else if (event->atom == atom(QXcbAtom::_NET_FRAME_EXTENTS)) { @@ -2592,7 +2592,7 @@ bool QXcbWindow::setKeyboardGrabEnabled(bool grab) bool QXcbWindow::setMouseGrabEnabled(bool grab) { if (!grab && connection()->mouseGrabber() == this) - connection()->setMouseGrabber(Q_NULLPTR); + connection()->setMouseGrabber(nullptr); #if QT_CONFIG(xinput2) if (connection()->hasXInput2() && !connection()->xi2MouseEventsDisabled()) { -- cgit v1.2.3