qt5base-lts/tests/auto
Volker Hilsheimer 71aaf831d1 QAbstractItemView: auto-scroll with selection rectangle
Some item views, such as QListView in icon mode, implement a selection
rectangle with which the user can "lasso" items. So far, dragging that
rectangle did not trigger auto scroll, so unless an item near the edge
was selected, the user had to stop the lassoing and scroll manually to
reach more items.

Since QAbtractItemView implements auto scrolling for drag'n'drop, we can
use that mechanism also when the selection rectangle is dragged. This
requires some modifications:

We need to make sure that scrolling the view during a drag-selection
generates mouse move events so that the selection is extended and the
rectangle is updated in subclasses.
And we need to stop using QCursor::pos to get the position of the mouse
pointer, as this makes the auto-scrolling untestable. Instead, record
the mouse position last seen during a mouseMove or dragMoveEvent in
content-coordinates (identical to pressedPosition).

As a drive-by, fix some coding-style issues in nearby code.

Done-with: Zhang Hao <zhanghao@uniontech.com>
Fixes: QTBUG-96124
Change-Id: I426f786e5842ae9f9fb04e9d34dc6d3379a6207f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-10-22 09:43:53 +02:00
..
bic/data Add binary compatibility files for 6.1 2021-09-03 13:41:25 +00:00
cmake CMake: Bump almost all cmake_minimum_required calls to 3.16 2021-09-22 19:36:49 +02:00
concurrent Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
corelib Consistently restore threadpool limit at end of tests 2021-10-22 09:43:42 +02:00
dbus tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
gui Fix inconsistencies between advanceWidth and bounding rects 2021-10-21 12:37:22 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network QNI: Add supportedFeatures getter 2021-10-22 09:40:45 +02:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Fix autotest public API compilation for INTEGRITY 2021-10-15 11:00:25 +03:00
printsupport Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
testlib Rename command-option to generate_expected_output.py 2021-10-01 19:24:31 +02:00
tools uic: Fix missing Python import when setting tab orders 2021-10-20 11:34:03 +02:00
widgets QAbstractItemView: auto-scroll with selection rectangle 2021-10-22 09:43:53 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt Don't build tests/auto/tools when cross-compiling 2021-10-07 08:03:40 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00