Important: Please read the Qt Code of Conduct -

Mouse events and filter

  • i've a problem with getting mouse release event in a specific situation. i capture child widgets events via "installEventFilter" and point them to their parent ("this")
    bool mywidget::eventFilter(QObject *obj, QEvent event)
    case QEvent::MouseButtonPress:

    return QObject::eventFilter(obj, event);


    as the code says, the pressed child gets hidden after the event has forwarded to the parent. now the mouse event has destroyed cuz the child's visibility went to false.
    The problem is here where i need to get the mouse release event but i don't get anything out.
    how can i transfer the event to the parent ("this") just like it is occurred for the parent? (keep it pressed)
    simply say getting the mousePressEvent() by child and mouseReleaseEvent() by parent

Log in to reply