Important: Please read the Qt Code of Conduct -

Adding Checkboxes for every graph in the legend ?

  • Hello, I am using QCustomPlot library for QT. If anyone has any experience with it I would love your slightest help on this one :)
    I am trying to add checkbox for every QCPGraph in the legend so that I can do operations on them such as hide/show , add , etc. I looked up previous threads and found out that you need to either subclass QCPPlottableLegendItem or create a new QCPLayoutElement with just checkbox in it.
    I am totally blank about doing it the first way, and for 2nd way, it turned out to be pretty complex with my approach. I am not sure how to draw and connect the checkbox with selectionChanged signal and then fill the checkbox upon selecting it.
    Any suggestions/help would be much appreciated with some code if possible.
    Thanks :)

Log in to reply