Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80794

Endless Loop with QTreeView and QGraphicsView

    XMLWordPrintable

    Details

    • Platform/s:
      All
    • Commits:
       4422a9bd88602c8dfde8648ad39692d968295cfc

      Description

      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.

       

      Other Notes:

      ==========

      • 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.

        Attachments

        1. main.cpp
          0.3 kB
        2. test_tree_view.py
          0.4 kB

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                chehrlic Christian Ehrlicher
                Reporter:
                rvinluan Robert Vinluan
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes