Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Does QStackedWidget load all its indexes at once?



  • We are planning to have a StackedWidget at our program's mainwindow. This means that this widget will be loaded every time our program is being launched, and this actually means that we care a lot about the time that it takes so as to launch. So, the question is, does StackedWidget load automatically all of its indexes or it loads only on demand? ( I would prefer the latter ).

    If it automatically loads all of the indexes, how would I make it to load only on index demand (e.g. when it is asked for the index No 1 then to load the corresponding UI elements etc).

    Thanks in advance for any answers!



  • TBH, id reccommend a different line of thought: try it and see. Often times, premature optimization is a waste of time.



  • Hm, maybe, but our computers are fast enough not to spot the difference. Our users' computers may be slower and the difference to be spot-able.

    Do you recommend an other way so as to realize what's going on?


Log in to reply