Hi @d_stranz,
I was also in impression that constructors don't take much time, But In my current application I am seeing it. So to give you clear Idea I have profiled time taken by each window constructor alone.
// Time taken by each screen constructor in ms
Elapsed time Screen1 1609
Elapsed time Screen2 0
Elapsed time Screen3 343
Elapsed time Screen4 2178
Elapsed time Screen5 44
Elapsed time Screen6 2916
Elapsed time Screen7 179
Elapsed time Screen8 563
Elapsed time Screen9 26077
Elapsed time Screen10 1790
TOTAL: 35699ms
// Time to add all these objects to mainMenuWindow stacked widget
Total Stacked widgets: 10
Elapsed time to stack all widgets 15761
My MainMenuWindow constructor is as follows:
Qt Code:
LoginScreen = new LoginWindow(this); welcomewindow = new Welcomewindow(this); AutoControlScreen = new AutoControl(this); AdjScreen = new Adjustment(this); HeatScreen = new Heat(this); InfoScreen = new Information(this); IntensityScreen = new Intensity(this); ManualScreen = new Manualcontrol(this); SettingsScreen = new Settings(this); UsersScreen = new UsersMemory(this); #ifdef DEBUG if(welcomewindow == NULL) qDebug() << "Dummy Welcome window Object is Null \n"; if(LoginScreen == NULL) qDebug() << "Login screen object is Null \n"; if(AutoControlScreen == NULL) qDebug() << "AutoControl screen object is Null \n"; if(AdjScreen == NULL) qDebug() << "Adj screen object is Null \n"; if(HeatScreen == NULL) qDebug() << "HeatScreen object is Null \n"; if(InfoScreen == NULL) qDebug() << "InfoScreen object is Null \n"; if(IntensityScreen == NULL) qDebug() << "IntensityScreen object is Null \n"; if(ManualScreen == NULL) qDebug() << "ManualScreen object is Null \n"; if(SettingsScreen == NULL) qDebug() << "SettingsScreen object is Null \n"; if(UsersScreen == NULL) qDebug() << "UsersScreen object is Null \n"; #endif if(welcomewindow == NULL || LoginScreen == NULL || AutoControlScreen == NULL || AdjScreen == NULL || \ HeatScreen == NULL || InfoScreen == NULL || IntensityScreen == NULL || ManualScreen == NULL || \ SettingsScreen == NULL || UsersScreen == NULL) { qDebug() << "Windows creation Failed, Exiting the Application\n"; exit(1); } //******************************************************************* // Setting All Mainscreen as stackable objects to MainMenu Screens //******************************************************************* ui->stackedWidget->insertWidget(S_Welcome,welcomewindow); ui->stackedWidget->insertWidget(S_Auto,AutoControlScreen); ui->stackedWidget->insertWidget(S_Manual,ManualScreen); ui->stackedWidget->insertWidget(S_Settings,SettingsScreen); ui->stackedWidget->insertWidget(S_Info,InfoScreen); ui->stackedWidget->insertWidget(S_Heat,HeatScreen); ui->stackedWidget->insertWidget(S_Adj,AdjScreen); ui->stackedWidget->insertWidget(S_Intensity,IntensityScreen); ui->stackedWidget->insertWidget(S_Users,UsersScreen); qDebug() << "Total Stacked widgets: " << ui->stackedWidget->count();To copy to clipboard, switch view to plain text mode
Please Suggest how can I improve the timeline.
Bookmarks