×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    17

    Auto Orientation with stacked windows do not work

    Hi all,

    I have an application that support auto orientation and use stacked window to transfer between pages. However, if it in portrait mode for first window , and then I switch to second window. The orientation is reseted! It will back to landscape mode.

    How can I make it work?

    Thx

    Example code:
    Code:
    #include <QApplication>
    #include <QMainWindow>
    #include <QPushButton>
    #include <QLabel>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
    
        QPushButton button1("Click here to open a new stacked window");
         button1.setAttribute(Qt::WA_Maemo5StackedWindow);
         button1.setAttribute(Qt::WA_Maemo5AutoOrientation, true); // The first window
    
         QPushButton button2("Click here to open another stacked window", &button1);
         button2.setAttribute(Qt::WA_Maemo5StackedWindow);
         button2.setWindowFlags(button2.windowFlags() | Qt::Window);
         button2.setAttribute(Qt::WA_Maemo5AutoOrientation, true); // The second window
    
         QLabel label("<p align=\"center\">This is the last stacked window. "
                      "Press the back arrow on the top-right corner to go back.",
                      &button2, Qt::Window);
         label.setAttribute(Qt::WA_Maemo5StackedWindow);
         label.setWordWrap(true);
    
         QObject::connect(&button1, SIGNAL(clicked()), &button2, SLOT(show()));
         QObject::connect(&button2, SIGNAL(clicked()), &label, SLOT(show()));
    
         button1.show();
    
        return a.exec();
    }
    Last edited by benlaud; 2010-06-24 at 14:04. Reason: Thx

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Auto Orientation with stacked windows do not work

    Automatic orientation at the moment doesn't check device orientation at the moment of window showing and windows appear in landscape mode.

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    17

    Re: Auto Orientation with stacked windows do not work

    hmm... What if I set landscape and portrait mode to the next window before it is shown? I have tested , but seem that it is not working...

Similar Threads

  1. Replies: 1
    Last Post: 2010-04-25, 23:03
  2. Auto-launch does not work in some cases
    By shchuka in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2009-10-15, 13:09
  3. Screen Orientation detection doesnt work on GT-i8910
    By crazysoft in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-08-14, 19:00
  4. Auto start application will not work
    By xhoust00 in forum Symbian
    Replies: 10
    Last Post: 2009-03-07, 05:39
  5. Changing orientation does not work!
    By FrankTheFox in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-12-12, 10:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×