Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to get mousePressEvent by parent widget?
Forum Update on Monday, May 27th 2025

How to get mousePressEvent by parent widget?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jackbauer24
    wrote on last edited by
    #1

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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      @(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?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jackbauer24
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved