Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User benlaud's Avatar
    Join Date
    Feb 2010
    Posts
    17
    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
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    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 benlaud's Avatar
    Join Date
    Feb 2010
    Posts
    17
    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 C++
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved