In my opinion make ur own window class...
from main call the mainwindow. In the window class, keep a function to get input from the user as u expect. from the mainwindow constructor, call the function using QTimer::singleShot() .
This will display ur main window and also pop up the input dialog. After the input u can call some function to initialize ur data. This approach will help in case u later dont want to call the input dialog . You can still show the window without it.
Pseudo code :
main()
{
...
MainWindow window;
window.show();
return app.exec();
}
// mainwindow
{
MainWindow()
{
...
QTimer::singleshot(getInput
(),
0);
// call the input function using timer }
};
void MainWindow::getInput()
{
// pop dialog
// initialize variables
}
main()
{
...
MainWindow window;
window.show();
return app.exec();
}
// mainwindow
class MainWindow:public QMainWindow
{
MainWindow()
{
...
QTimer::singleshot(getInput(),0); // call the input function using timer
}
};
void MainWindow::getInput()
{
// pop dialog
// initialize variables
}
To copy to clipboard, switch view to plain text mode
Bookmarks