Qt: Don't fill in the packet diagram if it's not visible.

Don't bother filling in our scene if the widget isn't visible.
This commit is contained in:
Gerald Combs 2020-09-14 15:20:58 -07:00 committed by Ronnie Sahlberg
parent adfded498a
commit 3b9656780b
1 changed files with 5 additions and 1 deletions

View File

@ -364,8 +364,12 @@ PacketDiagram::~PacketDiagram()
void PacketDiagram::setRootNode(proto_node *root_node)
{
scene()->clear();
root_node_ = root_node;
if (!isVisible()) {
return;
}
scene()->clear();
selected_field_ = nullptr;
y_pos_ = 0;