Skip to content

Commit

Permalink
fix: broken flamegraph
Browse files Browse the repository at this point in the history
Apparently when running X11 the flamgraph doesn't clear the background
correctly. This patch resets the background brush which clears the
background correctly.

fixes: #624
  • Loading branch information
lievenhey authored and milianw committed Nov 18, 2024
1 parent eb3b7b2 commit c945f43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/flamegraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,8 @@ FlameGraph::FlameGraph(QWidget* parent, Qt::WindowFlags flags)

connect(Settings::instance(), &Settings::collapseDepthChanged, this, updateHelper);

m_scene->setBackgroundBrush(QBrush());

m_scene->setItemIndexMethod(QGraphicsScene::NoIndex);
m_view->setScene(m_scene);
m_view->viewport()->installEventFilter(this);
Expand Down Expand Up @@ -1189,12 +1191,6 @@ 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 c945f43

Please sign in to comment.