Results 1 to 2 of 2

Thread: how to call parent widget's event ?

  1. #1
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up how to call parent widget's event ?

    I want to call parent widget's event from child widget .

    I am having eventfilter in QDialog , in that i am checking keypress event and if it is up key i am doing some actions , i am having my own widget placed in that QDialog , from my child widget i want to call the up event explicitly ,

    This is like sendMessage() in VC++.

    How to do this in qt?

    can we use emit() forthis ? if yes , how to call events using emit()?
    Thanks,
    Rajesh.S

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to call parent widget's event ?

    QCoreApplication::postEvent() or QCoreApplication::sendEvent() are used to hmm... post or send events. If you are inside an event handler and you only want to propagate the event to parent, simply QEvent::ignore() the event.

  3. The following user says thank you to wysota for this useful post:

    bunjee (20th December 2007)

Similar Threads

  1. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28
  2. Call on Parent Object
    By hufgardm in forum Newbie
    Replies: 1
    Last Post: 7th September 2006, 15:11
  3. Replies: 1
    Last Post: 28th July 2006, 14:10
  4. initialize child widgets within parent?
    By ucomesdag in forum Newbie
    Replies: 6
    Last Post: 6th June 2006, 08:11
  5. Passing event to parent
    By QPissedOff in forum Newbie
    Replies: 1
    Last Post: 26th April 2006, 16:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.