20a40035fa
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> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |