Results 1 to 2 of 2

Thread: "QObjects receive events by having QObject::event() function called" but who calls it

  1. #1
    Join Date
    Jan 2018
    Location
    India, Delhi
    Posts
    10
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default "QObjects receive events by having QObject::event() function called" but who calls it

    My question is, according to line
    "QObjects receive events by having their QObject::event() function called"
    the doubt here is, who is calling this function for each and every instance of type QObject ?

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: "QObjects receive events by having QObject::event() function called" but who call

    The Qt event loop is responsible for receiving hardware generated and other interrupts from the operating system and mapping them into events sent to QObjects. QObject-based classes themselves can generate software events, which are also handled by the event loop.

    The app's QApplication instance starts its event loop when QApplication::exec() is called. Model QDialog and thread classes also start an event loop when their exec() or run() functions are called. Modal event loops usually take control from the main event loop, whereas thread event loops run in parallel.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 12th April 2017, 11:03
  2. Replies: 6
    Last Post: 30th December 2015, 11:36
  3. Replies: 2
    Last Post: 27th January 2012, 17:29
  4. Replies: 8
    Last Post: 24th February 2011, 13:22
  5. Replies: 0
    Last Post: 4th October 2010, 21:53

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.