Hello,
I'm using QwtLegend to insert legends in my plot area, I setted my legend as CheckableItem and I added a connection:
connect(plot.
at(iPlotCounter
),
SIGNAL(legendChecked
(QwtPlotItem *,
bool)),
this,
connect(plot.at(iPlotCounter), SIGNAL(legendChecked(QwtPlotItem *, bool)),this,
SLOT(setConfig(QwtPlotItem *, bool)));
To copy to clipboard, switch view to plain text mode
Normally my plot has 8 curves and there is a possibility that two curves have the same legend name (the same title). I know it's possible to get the name when I click on one legend:
{
if (ta==true)
{
qDebug() << te->title().text() << "\n";
qDebug() << te-> << "\n";
}
}
void MainWindow::setConfig(QwtPlotItem * te, bool ta)
{
if (ta==true)
{
qDebug() << te->title().text() << "\n";
qDebug() << te-> << "\n";
}
}
To copy to clipboard, switch view to plain text mode
But because of the problem that I can have two legends with the same name, get the name doesn't help me so much. So, I was wondering if there is a possibility to get an ID, for example, when I add each legend, maybe there is a value for each, in my case 8, maybe an ID that comes from 0 to 7, I don't know.
Anyone knows if is there an ID, a specific number for each legend or the only possibility is using the name?
Thanks in advance
Best Regards
Bookmarks