From c2c50268912bc49d104a8d04a54f2e9d5e35d6f8 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 2 May 2017 16:08:41 +0200 Subject: cleanup: remove redundant QGuiApplicationPrivate::buttons This variable was introducing during Qt 5.0 Q{Gui}Application refactoring days (2011 or even before) and since then has been used interchangeably with QGuiApplicationPrivate::mouse_buttons. This patch removes the duplicate member variable as it is redundant and could be a source of potential errors. Initially I was thinking that ::buttons might be used for the purpose of QTestLib, but it is not. QTestLib delivers mouse events directly via qApp->notify() (mouse button state is update via QGuiApplicationPrivate::mouse_buttons from notify()), or via window system interface QWindowSystemInterface::handleMouseEvent (which goes through QGuiApplication::processMouseEvent). Looking at QGuiApplication, it is clear that ::buttons and ::mouse_buttons always have the same value, as there is only one assignment to these members in QGuiApplication: mouse_buttons = buttons = e->buttons; And there are no other places that would assign to QGuiApplicationPrivate::buttons. Change-Id: Ib60d366bf056a98b15bb4538a569693e7bd022e2 Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge --- src/gui/kernel/qguiapplication_p.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gui/kernel/qguiapplication_p.h') diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 3804667ef3..014ed861df 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -201,7 +201,6 @@ public: virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; virtual bool popupActive() { return false; } - static Qt::MouseButtons buttons; static ulong mousePressTime; static Qt::MouseButton mousePressButton; static int mousePressX; -- cgit v1.2.3