Hello, I have a question about the itemClick signal. I have a QCPItemRect on the "main" layer and a QCPItemText on a layer which is just above the "main" layer. Sometimes, text is just over the rect. I have set setSelectable property to false on the QCPItemText.

When I connect the QCustomPlot itemClick to my own slot, I enter it when clicking on the QCPItemText. Since it is not selectable, I would have expected to receive signal from the QCPItemRect which is just below the QCPItemText only.

Do I misunderstand the way it works ?

Here is my own slot code where I would not expect to enter from a QCPItemText :

void test(QCPAbstractItem * item, QMouseEvent * event) {
    if(QCPItemRect * slot = qobject_cast<QCPItemRect *>(item)) {
    else {
        std::cout << "error: entering with wrong type" << std::endl;

Thanks in advance !