Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12.1
-
None
Description
Looks like painting of empty item views with QGraphicsOpacityEffect is broken. When at least one item is added, it is all ok. In more complex applications it causes a significant elevation of CPU/GPU usage. I know, that Qt 5.9.6 was not affected by this bug.
Appears that this issue have a workaround. We can add a header and set it's height to 0 to "hide" it. The main thing is that item view must have something drawn inside, to bring it's painting loop back to normal and do not repaint recursively.
ui->treeWidget->setHeaderHidden( false ); QHeaderView *headerView = ui->treeWidget->header(); headerView->setSectionsClickable( false ); headerView->setSectionsMovable( false ); headerView->setSectionResizeMode( QHeaderView::Fixed ); headerView->setMaximumHeight( 0 );