How to get mousePressEvent by parent widget?

  • I placed QCommnadLinkButton on the parent widget.
    But I can't make the parent widget to get mousePressEvent at QCommnadLinkButton.
    Is is impossible?

  • @(QCommandLinkButton object)->installEventFilter(parent widget object);

    bool Parent Widget Object::eventFilter(QObject *obj, QEvent *event)
    //add here event handlet
    return QObject::eventFilter(obj, event);

    But, why do you want to do this?

  • Thank you very much!

    Your suggestion is very helpful.
    And I should reconsider my approach.

    I want to move QCommnadLinkButton by drag.
    But I should define the change of location in subclass inherited from QCommnadLinkButton, shouldn't you?

    I will try and apologize for my poor skill.

Log in to reply