[SOLVED] getting notified that the app has started
-
what is the simplest way to get notified the application has started running and the message loop is getting processed?
so if i want to be notified in one of my windows, like a QWidget or QMainWindow, how can i do this?
-
Hi,
If you are using Qt Creator to develop your program then you can spot the "3. Application Output" button in the bottom-most row called Locator in the GUI. If you're not using the IDE then you could insert this line to test
@
qDebug() << "Application Started" ;
@Hope this helps.
-
one other question, where do i find a list of of ALL events a qt widget gets sent? i don't see this in the API docs???
-
amban i don't understand your answer.
-
i want to be notified when my window object gets initialized for the 1st time, how do i do this?
-
the app object, does it send off an event to say it's started that i can hook/listen too?
-
-
Maybe "QWidget::showEvent":http://doc.qt.nokia.com/latest/qwidget.html#showEvent is what are you looking for.
-
i was thinking about showEvent, but that gets called every time a show happen correct?
what i want is something that is called once during initialization, i was hoping there was something like an oninit message or event
-
You could always set up a "QTimer::singleShot()":http://doc.qt.nokia.com/4.7/qtimer.html#singleShot call with a timeout of 0 before you start your main loop. It will then get processed early on as the eventloop starts up.
-
mlong that's the solution we went with after a search, thanks!
Q: so that i understand this correctly, a timer event is posted to the message queue and then QApplication starts up and process the timer queued message.
-
[quote author="ryadav" date="1311363814"]
Q: so that i understand this correctly, a timer event is posted to the message queue and then QApplication starts up and process the timer queued message.[/quote]Exactly!
-
Got it mlong, thanks!