i am using QT4 for my c++ programme i want to enable a SIGNAL automatically when my window is open so please tell me how do i enable a SIGNAL when my programme window open.
i am new to QT so please give a detail description.
Thanks
i am using QT4 for my c++ programme i want to enable a SIGNAL automatically when my window is open so please tell me how do i enable a SIGNAL when my programme window open.
i am new to QT so please give a detail description.
Thanks
Hi.
You may rewrite public function show in you class, for example:
mainwindow.h
class MainWindow : public QMainWindow {
Q_OBJECT;
public:
MainWindow();
void myShow() {
activateWindow();
show();
emit mySignalFunc();
}
signals:
void mySignalFunc() {
qDebug() << "Here is my signal!!!";
};
};
main.cpp in main() function:
MainWindow wnd;
wnd.myShow();
Good luck!