X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fview%2Ftrace.cpp;h=87d3dc1dc095fa7ebd7b1dd2b7dba0bf5c255c8e;hp=ea443f23b91cebf4ddb141b64ae3ef4af705b357;hb=e300444978bad69c104ce49c862da53dbe682e50;hpb=cc9a7898ee7afc32e03dbcc991ed7ba722ed8f1b diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index ea443f23..87d3dc1d 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -224,10 +224,14 @@ void Trace::create_popup_form() // Clear the layout // Transfer the layout and the child widgets to a temporary widget - // which then goes out of scope destroying the layout and all the child - // widgets. - if (popup_form_) - QWidget().setLayout(popup_form_); + // which we delete after the event was handled. This way, the layout + // and all widgets contained therein are deleted after the event was + // handled, leaving the parent popup_ time to handle the change. + if (popup_form_) { + QWidget *suicidal = new QWidget(); + suicidal->setLayout(popup_form_); + suicidal->deleteLater(); + } // Repopulate the popup popup_form_ = new QFormLayout(popup_);