I have the following lines:

Qt Code:
  1. QVector<QwtPlotCurve*> pMyPlotCurve;
  2. pMyPlotCurve[channelwidget]->setVisible(true); //or false depending on the 'checkbox' toogling of each channel.
To copy to clipboard, switch view to plain text mode 

In total, I have 3 channelwidgets (each having a ComboBox with two items in it) and a color associated with each channelwidget (red, blue, black)

Now I would also like to show or hide the legend of the correspodning curve when I toggle the checkbox 'on' or 'off' along with the visibility of the curve (as mentioned above).
In other words, when i set the curve as visible, its corresponding legend should also be visible and vise versa.

Also, I have two Y-axes (left and right). So, I would like to correspond the legends according to the Y-axis the selected curve uses.

For example,
In the combobox if I choose 'itemleft', then its legend should appear on the left of leftYaxis and when I choose 'itemright' from the ComboBox, then its legend show appear on the right of rightYaxis.

Please help.
Thanks! :-)