Hi
in my application i like to invoke method only after the window on the QMainWindow is fully loaded ,
how can i check this ? is there any onLoad callback/signal ? ( i checked and didn't found any thing )
Thanks
Printable View
Hi
in my application i like to invoke method only after the window on the QMainWindow is fully loaded ,
how can i check this ? is there any onLoad callback/signal ? ( i checked and didn't found any thing )
Thanks
What do you mean by "fully loaded"?
You can trigger some activity when the program returns to the Qt event loop with a single-shot timer at the end of the constructor:
Code:
#include <QtGui> #include <QDebug> Q_OBJECT QLabel *label1; QLabel *label2; public: layout->addWidget(label1); layout->addWidget(label2); central->setLayout(layout); setCentralWidget(central); } public slots: void doLater() { // Executes when event loop reached (after show in this case) label2->setText("I've been changed"); } private: }; int main(int argc, char *argv[]) { MainWindow m; m.show(); return app.exec(); } #include "main.moc"
also try showEvent()
umen do you mean Form.OnLoad method ala .NET environment? No I think things run differently here. But if you want it that way you can definitely use signals and slots to come up with something similar in no time..:)