treeview: fix build without accessibility

Amend 6a4afebc5ce8db69a6c9fb398cada31e6bad5e3c and add ifdefs around
use of Accessibility.

Change-Id: Ib40132dabeec9c3cff2f71dd5182eb1715b9c76a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 84e6d89c1b07830da82da1073930c094f6b99a81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Samuli Piippo 2023-05-24 08:45:37 +03:00 committed by Qt Cherry-pick Bot
parent 362f7ccb39
commit 5688afc2fd

View File

@ -3325,6 +3325,7 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit
return;
}
#if QT_CONFIG(accessibility)
// QAccessibleTree's rowCount implementation uses viewItems.size(), so
// we need to invalidate any cached accessibility data structures if
// that value changes during the run of this function.
@ -3334,6 +3335,7 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit
QAccessible::updateAccessibility(&event);
}
});
#endif
int count = 0;
if (model->hasChildren(parent)) {