Fix mouse cursor behavior for QMainWindow splitters
authorMiikka Heikkinen <miikka.heikkinen@digia.com>
Tue, 13 Nov 2012 12:10:32 +0000 (14:10 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 15 Nov 2012 09:56:52 +0000 (10:56 +0100)
commit90de0c417883aa515a694fa56b0e84c8969971fe
tree76e408cc36fda6c7af8c3c31548ba18f1d586e51
parentaa309b967745506c5221e4d26e312ee492172059
Fix mouse cursor behavior for QMainWindow splitters

The cursor handling has changed in Qt5 somewhat, which made old cursor
logic for splitters invalid, causing the splitter resize cursor to
persist after hovering over splitter, as well as cursor flicker
during splitter drag.

Since the cursor is changed always in dispatchEnterLeave, CursorChange
event can now come for QMainWindow when cursor hasn't actually changed,
so we now check if the cursor is still our adjusted cursor before
updating the old stored cursor. We also ensure that our adjusted cursor
stays visible if cursor is in fact changed - the changed cursor will
be shown when we no longer need adjusted cursor.

Additionally, we skip cursor adjustments while we are dragging the
splitter to avoid cursor flicker, which is caused by splitter actually
moving asynchronously after the mouse event is handled.

Task-number: QTBUG-27970
Change-Id: Id9f6a0e9653563e09b883f21396de056a88f78a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/widgets/widgets/qmainwindow.cpp