Unsolved QT widget load time on first click
-
Hey,
Is there a reason why a widget would take time to load on the first click? Like shown here: https://streamable.com/7lba5
I have made sure that the object gets created when the app opens but it didn't help, It's something that is not that important since it's only the first time but it still bothers me somewhat.
Here is the relevant code:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , state(Nothing) { ui->setupUi(this); // . . . abtApp =new AboutApplication(this); abtApp->hide(); } void MainWindow::on_actionAbout_triggered() { if(state != windowState::About){ this->centralWidget()->layout()->addWidget(abtApp); ui->UAIcon->hide(); abtApp->show(); state = windowState::About; } else if(state == windowState::About){ this->centralWidget()->layout()->removeWidget(abtApp); abtApp->hide(); ui->UAIcon->show(); state = windowState::Nothing; } }
-
Hi,
What version of Qt ?
On what platform ?
Do you do anything special in your main function ? -
Just loads a background Image that's it and its QT 5.14.1
-
-
1920x1080 , it loads when the application starts thought not when clicking the new window which is where the slow down is
-
Then try to not display the image to see if it helps. If so try to create a small reproducer or check it by yourself with valgrind (callgrind) to see where the cpu time is spent.