2a1772a649
When a table view adds its first row, QHeaderView::initializeSections() is called. It initializes the vertical header view with the number of added sections. Subsequently QHeaderView::sectionsInserted() is called with the same amount of newly added rows/sections. That leads to the initial amount of sections being 2x the number of rows added in the first go. In other words, the table view will display at least one row more than the underlying table model has. This patch adds an OR condition to the early return check at the beginning of QHeaderView::sectionsInserted(). The method returns early if the number of sections equals the number of respective sections (rows in this case) in the model. An autotest is added in tst_QTableView::rowsInVerticalHeader(). Fixes: QTBUG-114225 Pick-to: 6.6 6.5 Change-Id: I895444f025591981965562e54e2335391db52357 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> |
||
---|---|---|
.. | ||
bic/data | ||
cmake | ||
concurrent | ||
corelib | ||
dbus | ||
gui | ||
guiapplauncher | ||
network | ||
opengl | ||
other | ||
printsupport | ||
shared | ||
sql | ||
testlib | ||
tools | ||
wasm | ||
widgets | ||
xml | ||
CMakeLists.txt | ||
network-settings.h |