0

MainWindow -> centralWidget -> stackedWidget -> page_startScreen -> gridLayout_StartScreen -> (page elements go in here)

I have learned how to center elements in QT Creator using layouts and spacers, but when trying to do the same inside of a stackedWidget page, I can't. I put in a gridLayout for centering, but the gridLayout itself does not dynamically take all available room. It won't change with window resizing.

Screenshot from the QT Creator project of the Form and the object tree.

I'm surprised I can't find this information online. If you found it online, please tell me how so I can see what I did wrong.

Pingus
  • 13
  • 2
  • Your `page_startScreen` widget has no layout. You have put a QGridLayout inside it, but it's not assigned to a widget. – Alexey May 11 '22 at 19:49
  • So the same way I made centralwidget have a grid layout, I can do the exact same to the pages. I incorrectly assumed that was only possible at the top level. Thank you. – Pingus May 11 '22 at 20:12

0 Answers0