Results 1 to 6 of 6

Thread: How can I find Qt's message loop?

  1. #1
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default How can I find Qt's message loop?

    Where does Qt read the tasks queue and perform them?
    It would save me two threads and make the code a lot easier to maintain, read, etc.
    Please I need some help
    Thanks in advance!

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I find Qt's message loop?

    What are you trying to accomplish?

    Qt doesn't schedule threads. The OS does.

  3. #3
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I find Qt's message loop?

    Its not about how threads are managed.
    I want is to process other functions inside the main loop, like reading global hotkeys and managing a simple task scheduler I've made. It would be so much easier this way...
    Thanks for the answer!

  4. #4
    Join Date
    Apr 2010
    Location
    Porto Alegre, RS, Brazil
    Posts
    37
    Thanks
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I find Qt's message loop?

    Hi
    I dont know if I understood your question, sorry if I didn't.
    Keybord shortcuts can be managed using signal and slots. Maybe a task scheduler could be created using a Timer and signal/slots...
    This link might help you to find how to use keyboard shotrcuts - it contains several Qt videos:
    http://www.google.com.br/search?q=QT...ed=0CD4QqwQwAw

  5. #5
    Join Date
    Apr 2009
    Posts
    10
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I find Qt's message loop?

    I do not manage my own program's hotkey, they are global, registered using RegisterHotkey()... so I need to check their message callback.

  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I find Qt's message loop?

    That depends on what window handle you provided to the OS. You can subclass the widget you used and overwrite the message handler, and then look for your message.

Similar Threads

  1. infinite loop
    By zakis in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2009, 17:52
  2. main loop
    By dusza in forum Qt Programming
    Replies: 10
    Last Post: 6th June 2009, 17:29
  3. while loop question..
    By b1 in forum Qt Programming
    Replies: 3
    Last Post: 25th May 2009, 10:48
  4. Event Loop
    By node_ex in forum Qt Programming
    Replies: 1
    Last Post: 12th December 2008, 07:52
  5. Replies: 4
    Last Post: 12th October 2008, 13:47

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.