When I embed a QTreeView in a QGraphicsView and call .setHeaderHidden(true) on the tree view then when the graphics view is shown, the CPU usage indefinitely spikes to 100% and Qt appears to be in an endless loop of painting.
Steps to reproduce:
I used PySide2 in Python to reproduce the bug but I believe the same can be done in C++.
1) Download the attached test_tree_view.py.
2) Run "python test_tree_view.py" in a terminal to execute the script.
3) Hover the mouse over the opened PySide2/Qt window.
4) Python will now use 100% CPU for an indefinite period of time.
- Commenting out the `.setHeaderHidden(True)` line in the script avoids the bug.
- From my initial debugging it appeared to be an endless loop where QGraphicsView would paint, which caused the QTreeView to re-layout, which triggered the QGraphicsView to paint again, which caused the QTreeView to re-layout again, etc.
- The bug only occurs if QTreeView is embedded in a QGraphicsView.