Skip to content

Commit

Permalink
fix: clear flamegraph background in 5.15.12
Browse files Browse the repository at this point in the history
In QT 5.15.12 the background of the flamegraph is not cleared correctly
which creates phantom entries. This problem does not exists in 5.15.10
and after 5.15.13.

fix: #624
  • Loading branch information
lievenhey committed May 6, 2024
1 parent bdf6ba8 commit 204deac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/flamegraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,12 @@ void FlameGraph::selectItem(FrameGraphicsItem* item)
// then layout all items below the selected on
layoutItems(item);

#if QT_VERSION <= QT_VERSION_CHECK(5, 15, 12) && QT_VERSION > QT_VERSION_CHECK(5, 15, 10)
// the scene background doesn't get cleared correctly when using qt 5.15.12
// this doesn't happen in 5.15.10 and 5.15.13
m_scene->setBackgroundBrush(QBrush());
#endif

// Triggers a refresh of the scene's bounding rect without going via the
// event loop. This makes the centerOn call below work as expected in all cases.
m_scene->sceneRect();
Expand Down

0 comments on commit 204deac

Please sign in to comment.