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 authored and milianw committed May 6, 2024
1 parent 492b89e commit 8e54107
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 8e54107

Please sign in to comment.