diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-09-18 00:45:47 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-11-30 13:01:48 +0000 |
commit | 259197d8df913e115f9d21c8f08201fb3c9f2dbc (patch) | |
tree | 694ad82b06321316317265929d988ef168729618 /src/dbus/qdbusabstractadaptor.h | |
parent | bdcbbd7d5ba41ef3aeb24c12ef22ad2fdb7aac90 (diff) |
QTreeWidget::setHeaderItem: fix off-by-one in signal emissions
When setting a header item (that is, the item that provides the
QTreeWidget's column) the widget needs to manipulate the underlying
tree model and add or remove columns. This requires calling
the right QAbstractItemModel APIs for structural model changes.
The calculations done resulted in a off-by-one error:
* if the model had N columns and needs to grow to M(>N), then
one needs to begin insertion from N to M-1 (and not M);
* if the model had N columns and needs to shrink to L(<N), then
one needs to begin removal from L to N-1 (and not N).
Add the -1s needed.
Change-Id: Ic669788825a1c480376a08df0d7c9c10f91552ef
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/dbus/qdbusabstractadaptor.h')
0 files changed, 0 insertions, 0 deletions