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. If parent and child are of same type how can we propagate the event to a parent widget?

If parent and child are of same type how can we propagate the event to a parent widget?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.1k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    pratik041
    wrote on last edited by
    #1

    Suppose my parent is of QWidget type and child is also QWidget type. In child event if i will write QWidget::event(e); how we can distinguish whether the event is propagated to parent or child.

    Pratik Agrawal

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If you get an event and call your base class, you call your base class. no other object. The propagation to the parent is done in the very base class itself and then always from child to parent, as the event is send to the child with the focus.

      If you are talking about custom events, they will never be propagated to another widget.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • BilbonSacquetB Offline
        BilbonSacquetB Offline
        BilbonSacquet
        wrote on last edited by
        #3

        First the parent (and the parent of the parent until the QCoreApplication) dispacths it, but if the child (which has the focus or it is the destination) doesn't 'accept' it, it will be handled by the parent (and from the parent of the parent, ...).

        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