Hello,

The following code doesn't if it is built with Qt 4.5.0-rc1:

#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)

{

    showMaximized();


    QToolBar *tool_bar = new QToolBar(this);

    addToolBar(tool_bar);

    QAction *action = new QAction("Action", this);

    tool_bar->addAction(action);

}

The soft will be built and will run without any problem, but the ToolBar
won't be displayed.

The problem comes from showMaximized(), that's because it is placed before
the ToolBar declaration.

The following code works well:

#include "mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)

{

    QToolBar *tool_bar = new QToolBar(this);

    addToolBar(tool_bar);

    QAction *action = new QAction("Action", this);

    tool_bar->addAction(action);


    showMaximized();

}

With Qt 4.4.3, both codes are working well

Is it due to a bug in Qt 4.5.0?

Thanks,

Regards,

Julien
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to