QCustomPlot Discussion and Comments

Cannot receive single click on legendReturn to overview

I have slots in my code that are registered like so:

connect(ui->graphingView, SIGNAL(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*)), this, SLOT(legendDoubleClick(QCPLegend*,QCPAbstractLegendItem*)));

connect(ui->graphingView, SIGNAL(legendClick(QCPLegend*,QCPAbstractLegendItem*,QMouseEvent*)), this, SLOT(legendSingleClick(QCPLegend*,QCPAbstractLegendItem*)));

The double click version gets called when I double click on an item in the legend. The single click version is never called. I'd really like it to be. Is there a known incompatibility with registering both or what could I be doing wrong? The items in the legend are the auto generated ones when I set up the graph. I'm using the 2.0 beta version. The single clicking did work in the previous version (1.3.x?)

do you have your qcustomplot set to only allow click signals on selected items? if so, you would have to click once and then a bit later click again (so that it doesnt do double click).

I just checked your suggestion and even slowly clicking on the same legend item over and over does nothing. It does select the item but no click events ever happen. I tried clicking slowly like 10 times and no click events come through. Double clicking still works fine.

As it turns out, I had disabled some code during the upgrade of qcustomplot and figuring that out allowed me to do what I wanted to do which was select the graph that corresponds to the legend when you click the legend. It appears that the legend getting selected causes no click even but does cause a selection changed event so I'm going with that. I still think that perhaps the click event should fire so maybe this is still a bug. But, if it is a bug it's not a bug that affects me any longer.