[solved] qtoolbar: one under the other
-
I did something like this:
@
QWidget* widget = new QWidget();
QVBoxLayout* widgetLayout = new QVBoxLayout();QToolBar* widgetToolbar1 = new QToolBar(widget);
QAction* newAction = new QAction(QIcon(":/File/new-icon64.png"), tr("New"), widgetToolbar1);
newAction->setToolTip(tr("Create a New Page"));
widgetToolbar1->addAction(newAction);
connect(newAction, SIGNAL(triggered()), this, SLOT(onClickNew()));//add more actions
QToolBar* widgetToolbar2 = new QToolBar(widget);
QAction* boldAction = new QAction(QIcon(":/Text_Format/bold-icon64.png"), "Bold", widgetToolbar2);
boldAction->setToolTip(tr("Toggle the Current Selection 'bold' Property"));
widgetToolbar2->addAction(boldAction);
connect(boldAction, SIGNAL(triggered()), this, SLOT(onClickBold()));//add more actions
widgetLayout->setContentsMargins(0, 0, 0, 0);
widgetLayout->setSpacing(0);
widgetLayout->addWidget(widgetToolbar1);
widgetLayout->addWidget(widgetToolbar2);
widget->setLayout(widgetLayout);
@