Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.8.6, 5.11
-
None
-
all
-
0e2dae902b316a40a1d861198da55118d2155964
Description
I have noticed the following performance issue with QTreeWidget:
when asterisk is pressed and at least one child of current item is visible, interface freezes for several seconds (for large tree);
but if no child of current item is visible (item is collapsed), expanding all nodes after pressing asterisk is instantaneous.
Simple workaround for asterisk performance issue in user code:
// class TreeWidget : public QTreeWidget void TreeWidget::keyPressEvent(QKeyEvent * const event) { if (event->key() == Qt::Key_Asterisk) currentItem()->setExpanded(false); QTreeView::keyPressEvent(event); }
I would guess that the following simple workaround is possible in Qt code:
void QTreeView::keyPressEvent(QKeyEvent *event)
{ ...
case Qt::Key_Asterisk: {
[+] collapse(current);
...
}
EDIT: this issue is only present with
tree->header()->setStretchLastSection(false);