PDA

View Full Version : How can I find Qt's message loop?



Cayan
3rd August 2010, 18:24
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!

squidge
3rd August 2010, 21:39
What are you trying to accomplish?

Qt doesn't schedule threads. The OS does.

Cayan
4th August 2010, 17:35
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!

leoalvesmachado
4th August 2010, 18:21
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+keyboard&hl=pt-BR&client=firefox-a&hs=Px2&rls=org.mozilla:en-US:official&prmd=vdf&source=univ&tbs=vid:1&tbo=u&ei=4qBZTLGdOoaEnQf1s_G7CQ&sa=X&oi=video_result_group&ct=title&resnum=4&ved=0CD4QqwQwAw

Cayan
4th August 2010, 20:03
I do not manage my own program's hotkey, they are global, registered using RegisterHotkey()... so I need to check their message callback.

squidge
4th August 2010, 21:04
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.