Well, no idea how it is on Harmattan, but judging from my experience with Qt on Maemo5, one should listen to QDesktopWidget::resized signal and decide on current orientation. You have CSSU with forced rotation enabled, so h-d rotates applications no matter if they want to be rotated. Don't rely on that. The correct way is: in you MainWindow::MainWindow() you should: Code: setAttribute(Qt::WA_Maemo5AutoOrientation, true); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged())); and in orientationChanged() slot Code: QRect screenGeometry = QApplication::desktop()->screenGeometry(); setUpdatesEnabled(false); if (screenGeometry.width() > screenGeometry.height()) { /* Do landscape stuff */ } else { /* Do portrait stuff */ } setUpdatesEnabled(true);
setAttribute(Qt::WA_Maemo5AutoOrientation, true); connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
QRect screenGeometry = QApplication::desktop()->screenGeometry(); setUpdatesEnabled(false); if (screenGeometry.width() > screenGeometry.height()) { /* Do landscape stuff */ } else { /* Do portrait stuff */ } setUpdatesEnabled(true);