Qt: Fix packet diagram cleanup

After selecting field values to be shown or not shown
residues of the former diagram may reside until the next
scroll event. This updates the viewport to trigger the
paintEvent earlier.

Fixes #17997
This commit is contained in:
Roland Knall 2022-05-17 11:37:33 +02:00 committed by Roland Knall
parent fc89ddcdcf
commit b4e041a619
1 changed files with 3 additions and 0 deletions

View File

@ -525,6 +525,7 @@ void PacketDiagram::resetScene(bool reset_root)
if (scene()) {
delete scene();
}
viewport()->update();
QGraphicsScene *new_scene = new QGraphicsScene();
setScene(new_scene);
connect(new_scene, &QGraphicsScene::selectionChanged, this, &PacketDiagram::sceneSelectionChanged);
@ -753,6 +754,8 @@ void PacketDiagram::showFieldsToggled(bool checked)
{
layout_->setShowFields(checked);
setRootNode(root_node_);
/* Viewport needs to be update to avoid residues being shown */
viewport()->update();
}
// XXX - We have similar code in tcp_stream_dialog and io_graph_dialog. Should this be a common routine?