PDA

View Full Version : how to set the QToolBar's actions to multiple rows



fly542
22nd July 2011, 10:26
hi, when I use QToolBar add many QAction , how to make the actions into two or three rows, like the picture follows:
:) :)
:) :)

mcosta
22nd July 2011, 11:13
use multiple toolbars.

it's more convenient because you can grop action by functionality and allow users to hide some toolbars

fly542
25th July 2011, 03:00
thank you very much!
I found the solution, in the QMainWindow there is a funtion "addToolBarBreak" to add a new row.
but first as you write use multiple toolbars ,as follows

QToolBar * barTest = addToolBar(tr("aaaa"));
.....// some actions in the first row
this->addToolBarBreak();
QToolBar * barTest2 = addToolBar(tr("bbbb"));
.....// some other actions in the second row