diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-18 17:01:26 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-11-20 19:43:38 +0100 |
commit | af2daafde72db02454d24b7d691aa6861525ab99 (patch) | |
tree | b59c47baf8af94a6ace5cbf4338944272e40e32b /src/plugins/platforms/xcb | |
parent | 8bc4ea1e97c138034d08c705a75f75763361400b (diff) |
Deprecate constructing QFlags from a pointer
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.
Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 8 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbdrag.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbdrag.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index e51c3d0502..cbc930387f 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -455,7 +455,7 @@ void QXcbConnection::printXcbError(const char *message, xcb_generic_error_t *err static Qt::MouseButtons translateMouseButtons(int s) { - Qt::MouseButtons ret = 0; + Qt::MouseButtons ret; if (s & XCB_BUTTON_MASK_1) ret |= Qt::LeftButton; if (s & XCB_BUTTON_MASK_2) diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index a894944096..62c5e5d79e 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -294,7 +294,7 @@ private: int deviceId = 0; QTabletEvent::PointerType pointerType = QTabletEvent::UnknownPointer; QTabletEvent::TabletDevice tool = QTabletEvent::Stylus; - Qt::MouseButtons buttons = 0; + Qt::MouseButtons buttons; qint64 serialId = 0; bool inProximity = false; struct ValuatorClassInfo { @@ -318,8 +318,8 @@ private: int horizontalIndex = 0; double verticalIncrement = 0; double horizontalIncrement = 0; - Qt::Orientations orientations = 0; - Qt::Orientations legacyOrientations = 0; + Qt::Orientations orientations; + Qt::Orientations legacyOrientations; QPointF lastScrollPosition; }; QHash<int, ScrollingDevice> m_scrollingDevices; @@ -360,7 +360,7 @@ private: WindowMapper m_mapper; - Qt::MouseButtons m_buttonState = nullptr; + Qt::MouseButtons m_buttonState; Qt::MouseButton m_button = Qt::NoButton; QXcbWindow *m_focusWindow = nullptr; diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4639185416..fdf59c5ef4 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -424,7 +424,7 @@ QXcbConnection::TouchDeviceData *QXcbConnection::touchDeviceForId(int id) QXcbConnection::TouchDeviceData *QXcbConnection::populateTouchDevices(void *info) { auto *deviceinfo = reinterpret_cast<xcb_input_xi_device_info_t *>(info); - QTouchDevice::Capabilities caps = 0; + QTouchDevice::Capabilities caps; int type = -1; int maxTouchPoints = 1; bool isTouchDevice = false; diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 3d525598ca..eb5b8f808e 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -883,7 +883,7 @@ void QXcbDrag::handleLeave(QPlatformWindow *w, const xcb_client_message_event_t event->data.data32[0], xdnd_dragsource); } - QWindowSystemInterface::handleDrag(w->window(), nullptr, QPoint(), Qt::IgnoreAction, 0, 0); + QWindowSystemInterface::handleDrag(w->window(), nullptr, QPoint(), Qt::IgnoreAction, { }, { }); } void QXcbDrag::send_leave() diff --git a/src/plugins/platforms/xcb/qxcbdrag.h b/src/plugins/platforms/xcb/qxcbdrag.h index 1388e68acc..7bef7a818a 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.h +++ b/src/plugins/platforms/xcb/qxcbdrag.h @@ -86,7 +86,7 @@ public: void handlePosition(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleLeave(QPlatformWindow *w, const xcb_client_message_event_t *event); void handleDrop(QPlatformWindow *, const xcb_client_message_event_t *event, - Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); + Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handleStatus(const xcb_client_message_event_t *event); void handleSelectionRequest(const xcb_selection_request_event_t *event); @@ -109,7 +109,7 @@ private: void init(); void handle_xdnd_position(QPlatformWindow *w, const xcb_client_message_event_t *event, - Qt::MouseButtons b = nullptr, Qt::KeyboardModifiers mods = nullptr); + Qt::MouseButtons b = { }, Qt::KeyboardModifiers mods = { }); void handle_xdnd_status(const xcb_client_message_event_t *event); void send_leave(); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 76d3545d35..840bcfd3bb 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -927,7 +927,7 @@ void QXcbWindow::setWindowFlags(Qt::WindowFlags flags) xcb_change_window_attributes(xcb_connection(), xcb_window(), mask, values); - QXcbWindowFunctions::WmWindowTypes wmWindowTypes = 0; + QXcbWindowFunctions::WmWindowTypes wmWindowTypes; if (window()->dynamicPropertyNames().contains(wm_window_type_property_id)) { wmWindowTypes = static_cast<QXcbWindowFunctions::WmWindowTypes>( window()->property(wm_window_type_property_id).value<int>()); |