Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QMainWindow layout bug in landscape mode on Symbian S60v5 and Symbian^3

QMainWindow layout bug in landscape mode on Symbian S60v5 and Symbian^3

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 3 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vasylp
    wrote on last edited by
    #1

    When I put many widgets in QMainWindow, it shows them normal in portrait mode, but in landscape mode these widgets are stretching out of the screen and become inaccessible. I've reproduced it on Nokia 5800ExpressMusic and Nokia N8 with the same result. Qt version is 4.6.3.

    Here some screenshots of the sample application: "Portrait mode":http://pixelpipe.com/item/b2199b75-27c6-4338-9247-d3247b51b5f3, "Landscape mode":http://pixelpipe.com/item/4481ea68-2499-4a21-9d85-565e4f88d12e

    Here is the code:

    @
    #include <QApplication>
    #include <QVBoxLayout>
    #include <QPushButton>
    #include <QCheckBox>
    #include <QTextEdit>
    #include <QMainWindow>

    int main (int argc, char * argv[])
    {
    QApplication app(argc, argv);
    QMainWindow wnd;
    QWidget* window = new QWidget;
    QVBoxLayout* layout = new QVBoxLayout(window);
    QPushButton* optsButton = new QPushButton("Options");
    QPushButton* exitButton = new QPushButton("Exit");
    QCheckBox* chkBox = new QCheckBox("Checkbox");
    QTextEdit* textEd1 = new QTextEdit;
    QTextEdit* textEd2 = new QTextEdit;
    layout->addWidget(textEd1);
    layout->addWidget(textEd2);
    layout->addWidget(chkBox);
    layout->addWidget(optsButton);
    layout->addWidget(exitButton);

    QObject::connect(exitButton, SIGNAL(clicked()), &app, SLOT(quit()));

    wnd.setCentralWidget(window);

    #if defined(Q_WS_S60)
    wnd.showMaximized();
    #else
    wnd.show();
    #endif
    return app.exec();
    }
    @

    Is it bug or maybe I'm doing something wrong?

    --
    Best regards,
    VP

    1 Reply Last reply
    0
    • J Offline
      J Offline
      johnk
      wrote on last edited by
      #2

      Hello Vasyl,

      I just wrote "an article":http://developer.symbian.org/wiki/index.php/Apps:About_Qt_List_User_Interfaces about lists on Symbian devices. While the focus is on customizing lists, it also addresses handling a resize event for orientation and laying the widgets properly. You might check it out.

      -hth
      John

      1 Reply Last reply
      0
      • K Offline
        K Offline
        khris
        wrote on last edited by
        #3

        Use setLayout() method after add widgets to layout. If not, window can't use layout as a layout manager.

        Let it be, let it be, let it be, walk your way.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved