Go to file
Richard Moe Gustavsen 20a40035fa QTableView: set correct clip on QPainter when using spans
As it stood, QTableView would sometimes show drawing
artifacts when sections (rows or columns) where
rearranged, in combination with spans.

The reason is that the current code would go through the
currently visible cells in the viewport to check if any of
them where affected by a span. But the stored spans (in
QSpanCollection) is kept in sync with the column layout in
the model, and doesn't know anything about the rearranged
columns in the view. But a column with spans that is moved
to the left of the viewport can affect the painting of
the viewport as well, and needs to be taken into consideration.
For that reason, the current solution that uses
QSpanCollection::spanAt(x, y), will in that case fail.

Since it seems sensible that QSpanCollection is kept in sync with
the model (it makes model changes that affect spans easier to
handle), this patch will not change QSpanCollection. Instead, it
will iterate through all the spans (which is assumed to normally be
a limited size), convert them to the column layout of the view
(visual instead of logical), and find the ones that overlap.
Overlapping spans will, like before, be added as clip rects
to the QPainter.

Fixes: QTBUG-91896
Pick-to: 6.4 6.3 6.2
Change-Id: Iabe20df13cbd41a68f1104d3d9e24b89c4b88913
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-20 14:03:26 +02:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin CMake: Automatically use Xcode generator in qt-cmake + iOS 2022-05-20 13:06:00 +02:00
cmake CMake: Mark chosen C++ standard as required for building Qt 2022-06-19 14:45:07 +08:00
coin Try to consolidate Unix/Windows libexec directory in coin configs 2022-06-15 23:58:16 +02:00
config.tests CMake: Test the linker too for -mno-direct-extern-access 2022-05-25 16:29:31 -07:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
examples Fix typos in docs and comments 2022-06-15 21:31:02 +02:00
lib Purge all fonts 2015-08-18 19:59:14 +00:00
libexec Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
LICENSES Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
mkspecs wasm: don't enable specialHTMLTargets by default 2022-06-01 13:52:47 +02:00
qmake Teach qmake about digit-grouping apostrophes in numeric literals 2022-06-17 00:05:53 +02:00
src QTableView: set correct clip on QPainter when using spans 2022-06-20 14:03:26 +02:00
tests tst_qthread: Fix compilation under ubsan 2022-06-20 12:12:07 +02:00
util sanitizer-testrunner: enforce line buffering 2022-06-16 21:04:48 +02:00
.cmake.conf Bump version to 6.5.0 2022-06-06 13:23:59 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt Use REALPATH based check for symbolic links on Windows 2022-01-07 14:31:38 +01:00
conanfile.py Conan: Don't add 'qt_host_path' automatically when cross-building 2022-06-02 08:33:21 +03:00
config_help.txt C++23/c++2b support 2022-06-08 19:43:34 +02:00
configure Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.bat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.cmake CMake: Fix typos 2022-06-13 15:37:36 +02:00
dependencies.yaml Re-add dependencies.yaml now that qt5.git wip/qt6 builds fine 2019-09-18 13:19:31 +02:00
qt_cmdline.cmake C++23/c++2b support 2022-06-08 19:43:34 +02:00
sync.profile Remove deprecated qgl.h from sync.profile 2022-06-11 00:42:13 +02:00