Hi, I am going crazy. I making app where I turn on Auto Orientation of n900 device. And I have found a graphical glitch I cant resolve. I am new to Qt and c++ for that matter so probably why. But here is the description.

App starts and rotating device switches between landscape and portrait. So if I am in landscape and open another ui form from a menu, it opens and the new form is portrait as I set its orientation to be portrait only. Also I should mention I put into stackedwindow mode. So from the 2nd form I push the back button to return to main screen, still holding n900 in portrait mode. But now the main screen shows the left half of landscape orientated main widget in the top half of the actual screen (since n900 is held in portrait). If I shake the device it will auto rotate the main widget into portrait but if you hold the n900 still and not move it wont auto correct. How do I solve this. How do I call it properly or how do I trigger a resize event? Here is my code;

from cpp
Code:
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
#ifdef Q_WS_MAEMO_5
    // Set stacked window attribute to the main window.
    setAttribute(Qt::WA_Maemo5StackedWindow);
    // Allow portrait mode.
    setAttribute(Qt::WA_Maemo5AutoOrientation, true);
#endif
    // Call the setup of context menu of workoutsList QListWidget
    setupWorkoutsListContextMenu();

    // Setup SIGNAL to SLOT for detecting device rotation.
    connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));

   statusBar()->showMessage("Begin");
}

void MainWindow::on_actionOpen_Timer_triggered()
{
    /* Dont forget to add the frmtimer form header to this source file (e.g. #include <ui_frmtimer.h>).
       And dont forget to add the frmtimer form header to the header of this source file (e.g. add
        #include <frmtimer.h> to the mainwindow.h file.*/
    setWindowFlags(windowFlags() | Qt::Window);
    frmTimer *myTimerWindow = new frmTimer(this);
    //setAttribute(Qt::WA_Maemo5AutoOrientation, false);
    //setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
    myTimerWindow->show();
    //QMaemo5InformationBox::information(0, tr("called update orientation"));
}

void MainWindow::orientationChanged()
{
    QRect screenGeometry = QApplication::desktop()->screenGeometry();
    if (screenGeometry.width() > screenGeometry.height())
    {
        //label->setText("<p align=\"center\">In Landscape Mode</p>");
        ui->statusBar->showMessage("Device in Landscape Mode");
        deviceLandscape = true;
        //ui->centralWidget->setLayoutDirection(Qt::WA_Maemo5LandscapeOrientation);
    }
    else
    {
        //label->setText("<p align=\"center\">In Portrait Mode</p>");
        ui->statusBar->showMessage("Device in Portrait Mode");
        deviceLandscape = false;
        //ui->centralWidget->setLayoutDirection(Qt::WA_Maemo5PortraitOrientation);
    }

}
code from 2nd form cpp
Code:
frmTimer::frmTimer(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::frmTimer)
{
    ui->setupUi(this);
#ifdef Q_WS_MAEMO_5
    setAttribute(Qt::WA_Maemo5StackedWindow);
    setAttribute(Qt::WA_Maemo5AutoOrientation, false);
    setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
#endif
   // myMainWindow->orientationChanged();
}

frmTimer::~frmTimer()
{
    delete ui;
}