diff --git a/src/plugins/platforms/wayland/qwaylandclipboard_p.h b/src/plugins/platforms/wayland/qwaylandclipboard_p.h index 28336202241..42202285967 100644 --- a/src/plugins/platforms/wayland/qwaylandclipboard_p.h +++ b/src/plugins/platforms/wayland/qwaylandclipboard_p.h @@ -78,7 +78,7 @@ public: bool ownsMode(QClipboard::Mode mode) const override; private: - QWaylandDisplay *mDisplay; + QWaylandDisplay *mDisplay = nullptr; QMimeData m_emptyData; }; diff --git a/src/plugins/platforms/wayland/qwaylandcursor_p.h b/src/plugins/platforms/wayland/qwaylandcursor_p.h index 916a464e455..b7b1c2a75e0 100644 --- a/src/plugins/platforms/wayland/qwaylandcursor_p.h +++ b/src/plugins/platforms/wayland/qwaylandcursor_p.h @@ -119,8 +119,8 @@ private: struct wl_cursor* requestCursor(WaylandCursor shape); void initCursorMap(); - QWaylandDisplay *mDisplay; - struct wl_cursor_theme *mCursorTheme; + QWaylandDisplay *mDisplay = nullptr; + struct wl_cursor_theme *mCursorTheme = nullptr; QPoint mLastPos; QMap mCursors; QMultiMap mCursorNamesMap; diff --git a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp index 4411ba65ccd..300c9de0aa8 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevice.cpp +++ b/src/plugins/platforms/wayland/qwaylanddatadevice.cpp @@ -203,7 +203,7 @@ void QWaylandDataDevice::data_device_motion(uint32_t time, wl_fixed_t x, wl_fixe m_dragPoint = calculateDragPosition(x, y, m_dragWindow); - QMimeData *dragData; + QMimeData *dragData = nullptr; Qt::DropActions supportedActions; if (drag) { dragData = drag->mimeData(); diff --git a/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h b/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h index 3daf780aaa9..10df1bca912 100644 --- a/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h +++ b/src/plugins/platforms/wayland/qwaylanddatadevicemanager_p.h @@ -76,7 +76,7 @@ public: QWaylandDisplay *display() const; private: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; }; } diff --git a/src/plugins/platforms/wayland/qwaylanddataoffer_p.h b/src/plugins/platforms/wayland/qwaylanddataoffer_p.h index c9b9c21f17d..932506bf51a 100644 --- a/src/plugins/platforms/wayland/qwaylanddataoffer_p.h +++ b/src/plugins/platforms/wayland/qwaylanddataoffer_p.h @@ -98,8 +98,8 @@ protected: private: int readData(int fd, QByteArray &data) const; - mutable QWaylandDataOffer *m_dataOffer; - QWaylandDisplay *m_display; + mutable QWaylandDataOffer *m_dataOffer = nullptr; + QWaylandDisplay *m_display = nullptr; mutable QStringList m_types; mutable QHash m_data; }; diff --git a/src/plugins/platforms/wayland/qwaylanddatasource_p.h b/src/plugins/platforms/wayland/qwaylanddatasource_p.h index bba003f561b..a79cdcbfa1a 100644 --- a/src/plugins/platforms/wayland/qwaylanddatasource_p.h +++ b/src/plugins/platforms/wayland/qwaylanddatasource_p.h @@ -86,8 +86,8 @@ protected: void data_source_target(const QString &mime_type) override; private: - QWaylandDisplay *m_display; - QMimeData *m_mime_data; + QWaylandDisplay *m_display = nullptr; + QMimeData *m_mime_data = nullptr; }; } diff --git a/src/plugins/platforms/wayland/qwaylanddisplay_p.h b/src/plugins/platforms/wayland/qwaylanddisplay_p.h index 0a7ea427a5d..dbcc2112f46 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay_p.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay_p.h @@ -149,7 +149,7 @@ public: uint32_t id; QString interface; uint32_t version; - struct ::wl_registry *registry; + struct ::wl_registry *registry = nullptr; RegistryGlobal(uint32_t id_, const QString &interface_, uint32_t version_, struct ::wl_registry *registry_) : id(id_), interface(interface_), version(version_), registry(registry_) { } }; @@ -191,17 +191,17 @@ private: void requestWaylandSync(); struct Listener { - RegistryListener listener; - void *data; + RegistryListener listener = nullptr; + void *data = nullptr; }; - struct wl_display *mDisplay; + struct wl_display *mDisplay = nullptr; QtWayland::wl_compositor mCompositor; QScopedPointer mShm; QList mScreens; QList mInputDevices; QList mRegistryListeners; - QWaylandIntegration *mWaylandIntegration; + QWaylandIntegration *mWaylandIntegration = nullptr; #if QT_CONFIG(wayland_datadevice) QScopedPointer mDndSelectionHandler; #endif @@ -212,7 +212,7 @@ private: QScopedPointer mWindowManagerIntegration; QScopedPointer mTextInputManager; QScopedPointer mHardwareIntegration; - QSocketNotifier *mReadNotifier; + QSocketNotifier *mReadNotifier = nullptr; int mFd; int mWritableNotificationFd; QList mGlobals; diff --git a/src/plugins/platforms/wayland/qwaylanddnd_p.h b/src/plugins/platforms/wayland/qwaylanddnd_p.h index 8a1d7f1f1ef..0f14eb00be2 100644 --- a/src/plugins/platforms/wayland/qwaylanddnd_p.h +++ b/src/plugins/platforms/wayland/qwaylanddnd_p.h @@ -84,7 +84,7 @@ protected: private: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; }; #endif } diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h b/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h index 02700b2901d..dffd04281f6 100644 --- a/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandextendedsurface_p.h @@ -83,7 +83,7 @@ private: void extended_surface_set_generic_property(const QString &name, wl_array *value) override; void extended_surface_close() override; - QWaylandWindow *m_window; + QWaylandWindow *m_window = nullptr; QVariantMap m_properties; }; diff --git a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h index a554f23011c..cbb2e18dc75 100644 --- a/src/plugins/platforms/wayland/qwaylandinputcontext_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputcontext_p.h @@ -107,7 +107,7 @@ protected: private: Qt::KeyboardModifiers modifiersToQtModifiers(uint32_t modifiers); - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; QWaylandInputMethodEventBuilder m_builder; QVector m_modifiersMap; @@ -155,7 +155,7 @@ public: private: QWaylandTextInput *textInput() const; - QWaylandDisplay *mDisplay; + QWaylandDisplay *mDisplay = nullptr; QPointer mCurrentWindow; }; diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h index 8a02769e3bb..2c7d2cffd61 100644 --- a/src/plugins/platforms/wayland/qwaylandinputdevice_p.h +++ b/src/plugins/platforms/wayland/qwaylandinputdevice_p.h @@ -143,13 +143,13 @@ public: private: void setCursor(Qt::CursorShape cursor, QWaylandScreen *screen); - QWaylandDisplay *mQDisplay; - struct wl_display *mDisplay; + QWaylandDisplay *mQDisplay = nullptr; + struct wl_display *mDisplay = nullptr; int mVersion; uint32_t mCaps = 0; - struct wl_surface *pointerSurface; + struct wl_surface *pointerSurface = nullptr; #if QT_CONFIG(wayland_datadevice) QWaylandDataDevice *mDataDevice = nullptr; @@ -207,7 +207,7 @@ public: uint32_t mods_locked, uint32_t group) override; - QWaylandInputDevice *mParent; + QWaylandInputDevice *mParent = nullptr; QPointer mFocus; #if QT_CONFIG(xkbcommon_evdev) xkb_context *mXkbContext = nullptr; @@ -262,7 +262,7 @@ public: void releaseButtons(); - QWaylandInputDevice *mParent; + QWaylandInputDevice *mParent = nullptr; QPointer mFocus; uint32_t mEnterSerial = 0; #if QT_CONFIG(cursor) @@ -302,7 +302,7 @@ public: bool allTouchPointsReleased(); void releasePoints(); - QWaylandInputDevice *mParent; + QWaylandInputDevice *mParent = nullptr; QPointer mFocus; QList mTouchPoints; QList mPrevTouchPoints; diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h b/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h index c83180c0995..3de80eb6ac4 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface_p.h @@ -85,7 +85,7 @@ public: QFunctionPointer platformFunction(const QByteArray &resource) const override; private: - QWaylandIntegration *m_integration; + QWaylandIntegration *m_integration = nullptr; QHash m_windowProperties; static void setSync(QWindow *window); diff --git a/src/plugins/platforms/wayland/qwaylandqtkey_p.h b/src/plugins/platforms/wayland/qwaylandqtkey_p.h index 3374b907a44..9091cf81935 100644 --- a/src/plugins/platforms/wayland/qwaylandqtkey_p.h +++ b/src/plugins/platforms/wayland/qwaylandqtkey_p.h @@ -68,7 +68,7 @@ public: QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id); private: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; void key_extension_qtkey(struct wl_surface *surface, uint32_t time, diff --git a/src/plugins/platforms/wayland/qwaylandshellsurface_p.h b/src/plugins/platforms/wayland/qwaylandshellsurface_p.h index 06d92ba086a..3a725d822f8 100644 --- a/src/plugins/platforms/wayland/qwaylandshellsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandshellsurface_p.h @@ -104,7 +104,7 @@ protected: virtual void setMinimized() {} private: - QWaylandWindow *m_window; + QWaylandWindow *m_window = nullptr; friend class QWaylandWindow; }; diff --git a/src/plugins/platforms/wayland/qwaylandsubsurface_p.h b/src/plugins/platforms/wayland/qwaylandsubsurface_p.h index 36a92a7559e..a9fd76a887d 100644 --- a/src/plugins/platforms/wayland/qwaylandsubsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandsubsurface_p.h @@ -86,8 +86,8 @@ private: // to keep track of the sync state void set_sync(); void set_desync(); - QWaylandWindow *m_window; - QWaylandWindow *m_parent; + QWaylandWindow *m_window = nullptr; + QWaylandWindow *m_parent = nullptr; bool m_synchronized = false; QMutex m_syncLock; diff --git a/src/plugins/platforms/wayland/qwaylandtouch_p.h b/src/plugins/platforms/wayland/qwaylandtouch_p.h index 7d909769d8a..93a829e2115 100644 --- a/src/plugins/platforms/wayland/qwaylandtouch_p.h +++ b/src/plugins/platforms/wayland/qwaylandtouch_p.h @@ -73,7 +73,7 @@ public: private: void registerDevice(int caps); - QWaylandDisplay *mDisplay; + QWaylandDisplay *mDisplay = nullptr; void touch_extension_touch(uint32_t time, uint32_t id, @@ -95,15 +95,15 @@ private: QList mTouchPoints; QList mPrevTouchPoints; - QTouchDevice *mTouchDevice; + QTouchDevice *mTouchDevice = nullptr; uint32_t mTimestamp; int mPointsLeft; uint32_t mFlags; int mMouseSourceId; QPointF mLastMouseLocal; QPointF mLastMouseGlobal; - QWindow *mTargetWindow; - QWaylandInputDevice *mInputDevice; + QWindow *mTargetWindow = nullptr; + QWaylandInputDevice *mInputDevice = nullptr; }; } diff --git a/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp index 785a0a44d7c..17ae8a5ae85 100644 --- a/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindowmanagerintegration.cpp @@ -61,7 +61,7 @@ class QWaylandWindowManagerIntegrationPrivate { public: QWaylandWindowManagerIntegrationPrivate(QWaylandDisplay *waylandDisplay); bool m_blockPropertyUpdates = false; - QWaylandDisplay *m_waylandDisplay; + QWaylandDisplay *m_waylandDisplay = nullptr; QHash m_queuedProperties; bool m_showIsFullScreen = false; }; diff --git a/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h b/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h index 708c6f1132b..b0e677951cd 100644 --- a/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandwlshellsurface_p.h @@ -104,7 +104,7 @@ private: void updateTransientParent(QWindow *parent); void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, uint serial); - QWaylandWindow *m_window; + QWaylandWindow *m_window = nullptr; bool m_maximized = false; bool m_fullscreen = false; QSize m_size; diff --git a/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h b/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h index 85bd589bf7e..74c0dca2679 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgpopup_p.h @@ -81,7 +81,7 @@ protected: private: QWaylandExtendedSurface *m_extendedWindow = nullptr; - QWaylandWindow *m_window; + QWaylandWindow *m_window = nullptr; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h b/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h index 122beed0c8c..e59a67d69d8 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgshellv6_p.h @@ -106,7 +106,7 @@ private: QVarLengthArray states; } m_configureState; - QWaylandXdgSurfaceV6 *m_xdgSurface; + QWaylandXdgSurfaceV6 *m_xdgSurface = nullptr; }; class Popup : public QtWayland::zxdg_popup_v6 { @@ -117,14 +117,14 @@ private: void applyConfigure(); void zxdg_popup_v6_popup_done() override; - QWaylandXdgSurfaceV6 *m_xdgSurface; + QWaylandXdgSurfaceV6 *m_xdgSurface = nullptr; }; void setToplevel(); void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial, bool grab); - QWaylandXdgShellV6 *m_shell; - QWaylandWindow *m_window; + QWaylandXdgShellV6 *m_shell = nullptr; + QWaylandWindow *m_window = nullptr; Toplevel *m_toplevel = nullptr; Popup *m_popup = nullptr; bool m_configured = false; diff --git a/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h b/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h index fa79632068a..42846c665fa 100644 --- a/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h +++ b/src/plugins/platforms/wayland/qwaylandxdgsurface_p.h @@ -110,8 +110,8 @@ private: void updateTransientParent(QWaylandWindow *parent); private: - QWaylandWindow *m_window; - QWaylandXdgShell* m_shell; + QWaylandWindow *m_window = nullptr; + QWaylandXdgShell* m_shell = nullptr; bool m_maximized = false; bool m_minimized = false; bool m_fullscreen = false; diff --git a/src/plugins/platforms/wayland/shared/qwaylandsharedmemoryformathelper_p.h b/src/plugins/platforms/wayland/shared/qwaylandsharedmemoryformathelper_p.h index 7f2f77cc3c8..e5b5faf02e3 100644 --- a/src/plugins/platforms/wayland/shared/qwaylandsharedmemoryformathelper_p.h +++ b/src/plugins/platforms/wayland/shared/qwaylandsharedmemoryformathelper_p.h @@ -63,7 +63,7 @@ private: , data(data) { } const size_t size; - const wl_shm_format *data; + const wl_shm_format *data = nullptr; }; static const Array getData() diff --git a/src/plugins/platforms/wayland/shellintegration/qwaylandshellintegration_p.h b/src/plugins/platforms/wayland/shellintegration/qwaylandshellintegration_p.h index ab9b736bbca..7f3a2cefcfd 100644 --- a/src/plugins/platforms/wayland/shellintegration/qwaylandshellintegration_p.h +++ b/src/plugins/platforms/wayland/shellintegration/qwaylandshellintegration_p.h @@ -81,7 +81,7 @@ public: } protected: - QWaylandDisplay *m_display; + QWaylandDisplay *m_display = nullptr; }; } diff --git a/tests/auto/wayland/client/tst_client.cpp b/tests/auto/wayland/client/tst_client.cpp index 8ee52d7364f..4eb85818c76 100644 --- a/tests/auto/wayland/client/tst_client.cpp +++ b/tests/auto/wayland/client/tst_client.cpp @@ -170,7 +170,7 @@ private slots: void glWindow(); private: - MockCompositor *compositor; + MockCompositor *compositor = nullptr; }; void tst_WaylandClient::primaryScreen() diff --git a/tests/auto/wayland/shared/mockcompositor.h b/tests/auto/wayland/shared/mockcompositor.h index c6de12376a3..c0c3c884f34 100644 --- a/tests/auto/wayland/shared/mockcompositor.h +++ b/tests/auto/wayland/shared/mockcompositor.h @@ -141,7 +141,7 @@ private: friend class Impl::Compositor; friend class Impl::Surface; - Impl::Surface *m_surface; + Impl::Surface *m_surface = nullptr; }; Q_DECLARE_METATYPE(QSharedPointer) @@ -151,7 +151,7 @@ public: Impl::Output *handle() const { return m_output; } MockOutput(Impl::Output *output); private: - Impl::Output *m_output; + Impl::Output *m_output = nullptr; }; Q_DECLARE_METATYPE(QSharedPointer) @@ -201,7 +201,7 @@ private: typedef void (*Callback)(void *target, const QList ¶meters); Callback callback; - void *target; + void *target = nullptr; QList parameters; }; diff --git a/tests/auto/wayland/shared/mockinput.h b/tests/auto/wayland/shared/mockinput.h index 5760ab40c63..d9adb3621f2 100644 --- a/tests/auto/wayland/shared/mockinput.h +++ b/tests/auto/wayland/shared/mockinput.h @@ -60,7 +60,7 @@ protected: void seat_get_touch(Resource *resource, uint32_t id) override; private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; QScopedPointer m_keyboard; QScopedPointer m_pointer; @@ -83,7 +83,7 @@ protected: void keyboard_destroy_resource(wl_keyboard::Resource *resource) override; private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; Resource *m_focusResource = nullptr; Surface *m_focus = nullptr; @@ -106,7 +106,7 @@ protected: void pointer_destroy_resource(wl_pointer::Resource *resource) override; private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; Resource *m_focusResource = nullptr; Surface *m_focus = nullptr; @@ -121,7 +121,7 @@ public: void sendMotion(Surface *surface, const QPoint &position, int id); void sendFrame(Surface *surface); private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; }; class DataOffer : public QtWaylandServer::wl_data_offer @@ -145,7 +145,7 @@ protected: void data_device_start_drag(Resource *resource, struct ::wl_resource *source, struct ::wl_resource *origin, struct ::wl_resource *icon, uint32_t serial) override; private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; QtWaylandServer::wl_data_offer *m_dataOffer = nullptr; Surface* m_focus = nullptr; }; @@ -162,7 +162,7 @@ protected: void data_device_manager_create_data_source(Resource *resource, uint32_t id) override; private: - Compositor *m_compositor; + Compositor *m_compositor = nullptr; QScopedPointer m_data_device; }; diff --git a/tests/auto/wayland/shared/mocksurface.h b/tests/auto/wayland/shared/mocksurface.h index 8bf6eb755a2..68fe9b94ce4 100644 --- a/tests/auto/wayland/shared/mocksurface.h +++ b/tests/auto/wayland/shared/mocksurface.h @@ -65,7 +65,7 @@ protected: private: wl_resource *m_buffer = nullptr; - Compositor *m_compositor; + Compositor *m_compositor = nullptr; QSharedPointer m_mockSurface; QList m_frameCallbackList; bool m_mapped = false; diff --git a/tests/auto/wayland/xdgshellv6/tst_xdgshellv6.cpp b/tests/auto/wayland/xdgshellv6/tst_xdgshellv6.cpp index 5aac336f272..9e4aa8c07a1 100644 --- a/tests/auto/wayland/xdgshellv6/tst_xdgshellv6.cpp +++ b/tests/auto/wayland/xdgshellv6/tst_xdgshellv6.cpp @@ -82,7 +82,7 @@ private slots: void createDestroyWindow(); private: - MockCompositor *m_compositor; + MockCompositor *m_compositor = nullptr; }; void tst_WaylandClientXdgShellV6::createDestroyWindow()