Calling setupUi() won't work because it won't have any code to take account of the screen geometry. You need to set the geometry or position of the widgets by calling the appropriate methods. You can access the widgets by calling ui->objectName (the objectNames can be set in Qt Designer), so if you have a QPushButton with objectName "pushButton", you can access it using ui->pushButton. Let's say this QPushbutton has x = 50, y = 50, width = 300, height = 70 when in landscape. To change the geometry to x = 100, y = 100, width = 200, height = 70 when in portrait, you would do: Code: void MyWindow::portraitLayout() { ui->pushButton->setGeometry(100, 100, 200, 70); } and to restore the geometry: Code: void MyWindow::landscapeLayout() { ui->pushButton->setGeometry(50, 50, 300, 70); } If you are careful with the layouts, you shouldn't need to set the geometry/position of every widget individually.
void MyWindow::portraitLayout() { ui->pushButton->setGeometry(100, 100, 200, 70); }
void MyWindow::landscapeLayout() { ui->pushButton->setGeometry(50, 50, 300, 70); }