diff options
author | Andre Somers <andre.somers@kdab.com> | 2016-02-02 14:40:29 +0100 |
---|---|---|
committer | Andre Somers <andre@familiesomers.nl> | 2016-02-12 19:32:05 +0000 |
commit | 0df5c366e50b9533fd8ea3f31c4c360ae7f4c5b6 (patch) | |
tree | 301cb4fa308fb306f65ca2fa55a157ab6a46798d /src/plugins/platforms/xcb/qxcbconnection.h | |
parent | c5d49725779292a04fed599eb7f508d334ffc5c3 (diff) |
Use QFlags::setFlag where prudent in qtbase
QFlags::setFlag is most useful to replace explicit constructs like
if (condition) {
someFlags |= TheConditionFlag;
} else {
someFlags &= ~TheConditionFlag;
}
with
someFlags.setFlag(TheConditionFlag, condition);
Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection.h')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 6a2ecacd77..02dc95e852 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -472,7 +472,7 @@ public: xcb_window_t getSelectionOwner(xcb_atom_t atom) const; xcb_window_t getQtSelectionOwner(); - void setButton(Qt::MouseButton button, bool down) { if (down) m_buttons |= button; else m_buttons &= ~button; } + void setButton(Qt::MouseButton button, bool down) { m_buttons.setFlag(button, down); } Qt::MouseButtons buttons() const { return m_buttons; } Qt::MouseButton translateMouseButton(xcb_button_t s); |