But what is a reason to not support show()/hide()? QwtAbstractLegend inherits QWidget, where show()/hide() are public methods. Ignoring show()/hide() breaks expected behavior. I am assuming this is due to QwtPlotLayout, which is not a QLayout.
Qwt looks designed very well with high level of customization/flexibility. And there is so-called "naked" interface, where a component provides direct access to its subcomponents, rather then expose only subcomponents properties (and so have full cotrol over side effects). Being "naked", a component must fully observe its subcomponents (via signals, eventFilter(), weak pointers, etc.).
So, one would expect
legend->setParent(NULL)
legend->setParent(NULL)
To copy to clipboard, switch view to plain text mode
acts the same as
plot->insertLegend( NULL );
plot->insertLegend( NULL );
To copy to clipboard, switch view to plain text mode
Is it OK, or breaks the code?
Note: In the first case QwtPlot must observe its legend (e.g. via handling ChildRemoved events).
Does Qwt have such observation everywhere in its code?
Thanks, Alex
Bookmarks