-
Removing Legend
Is there a way to remove or hide a Legend once it has been added to a QwtPlot?
I looked at the documentation, but couldn't find anything that did the trick. setHidden(bool) and setVisible(bool) also don't work for this...
Am I being a little slow and missing something simple?
Cheers
-
Re: Removing Legend
plot->insertLegend(NULL). Guess "delete plot->legend()" will also work, but I havn't checked this.
Uwe
-
Re: Removing Legend
Hi again Uwe,
I can't seem to get either of these options to work. Both create a crash in the program.
As soon as I issue the plot->insertLegend(NULL) it crashes, it does compile though
Any thoughts?
-
Re: Removing Legend
Start the debugger and check where it crashes ( something everyone should do before reporting ).
QwtPlot::insertLegend deletes the legend, that was previously inserted. When you also delete it in your application it might be the reason for the crash.
Uwe
-
Re: Removing Legend
Hi Uwe,
Yep, I was running it in debugger and it was crashing. Turns out that the debugger was corrupted and not debugging properly. Fixed now, as is the Legend hiding.
Thanks.