Hello, I'm confused about why the axisclick signal and slot isn't working within my code. Currently, I'm embedding my customplot (with multiple axis rectangles / plots) within a scroll area. If I click on an axis label, an axis, or axis ticks, I see it being selected/highlighted, however, I don't see the signal/slot connecting to a function which is just a print statement. I am able to connect the signals and slots of other mouse event fine, but I don't know why it doesn't for axisClick. Any ideas?
customPlot->setInteraction(QCP::iSelectAxes, true); connect(customPlot, SIGNAL(axisClick(QCPAxis*,QCPAxis::SelectablePart,QMouseEvent*)), this, SLOT(changeYScale(QCPAxis*,QCPAxis::SelectablePart))); connect(customPlot, SIGNAL(mouseWheel(QWheelEvent*)), this, SLOT(mouseWheel(QWheelEvent*))); connect(customPlot, SIGNAL(mouseDoubleClick(QMouseEvent*)), this, SLOT(mouseDoubleClickEvent(QMouseEvent*))); connect(customPlot, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoveEvent(QMouseEvent*)));
Note my customPlot is implemented as a subclass of QCustomPlot (for the time being nothing special yet).
class myQCustomPlot : public QCustomPlot { Q_OBJECT public: explicit myQCustomPlot(QWidget *parent = 0); ~myQCustomPlot(); protected: void mouseWheelEvent(QWheelEvent *mouse_event); void mousePressEvent(QMouseEvent *event); signals: void sendMouseMovement(int&); void sendDropEvent(QDropEvent* event); };