Why mousePressEvent is not called when I click MiddleButton of mouse on Combobox popup?

250 Views Asked by At

I am using Qt Creator and C++ for my code. I have a checkable combobox for multiselection. I want to select the unchecked checkbox using mouse Middlebuton from popup. I tried to override the mousePressEvent but didn't work. Below is the snippet of my code:

void GCheckEditCombobox::mousePressEvent(QMouseEvent *event)
{
     if (event->button() == Qt::MiddleButton && currentItem())
     {
        // doe the stuff you have to 
     }
     else
     {
        QComboBox::mousePressEvent(event);
     }
} 
0

There are 0 best solutions below