Important: Please read the Qt Code of Conduct -

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

  • 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":, "Landscape mode":

    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;

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


    #if defined(Q_WS_S60)
    return app.exec();

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

    Best regards,

  • Hello Vasyl,

    I just wrote "an article": 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.


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

Log in to reply