Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
4.3.0
-
None
Description
It would be nice if QToolBar would the ability to automatically wrap to multiple lines like it did in Qt 3.
To see how it behaves differently in Qt 4.x and Qt 3.x run this example.
#include <qapplication.h>
#include <qmainwindow.h>
#include <qtextedit.h>
#include <qpixmap.h>
#include <qstyle.h>
#include <qtoolbar.h>
#include <qstring.h>
#include <qtoolbutton.h>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QMainWindow mw;
mw.setCentralWidget(new QTextEdit(&mw));
#if QT_VERSION >= 0x040000
const QPixmap icon = mw.style()->standardPixmap(QStyle::SP_TitleBarCloseButton);
#else
const QPixmap icon = mw.style().stylePixmap(QStyle::SP_TitleBarCloseButton);
#endif
for (int i=0; i<10; ++i) {
QToolBar *tb = new QToolBar(QString("Toolbar number %1").arg(i + 1), &mw);
for (int j=0; j<5; ++j)
mw.addToolBar(tb);
}
mw.show();
return a.exec();
}
When implementing this functionality it would be nice to have something like a QToolBar::shrinkable flag as well. When set to "no", all Items of a toolbar must always be visible
(like it worked in Qt3), "yes" would imply the now implemented behaviour.