Is is possible to have labels in a QToolBar
? Something like the green text I draw on top of the app screenshot.
I would like to have a set of actions in a toolbar, all them retated to some a system. Then another toolbar with another set of actions related to another system. So each toolbar would have a label named accordingly to the specific system.
QApplication a(argc, argv);
QMainWindow *w = new QMainWindow;
QToolBar *barA = new QToolBar;
barA->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
QAction *actOnA = new QAction("OnA");
actOnA->setIcon(QIcon("../../../on.png"));
barA->addAction(actOnA);
QAction *actOffA = new QAction("OffA");
actOffA->setIcon(QIcon("../../../off.png"));
barA->addAction(actOffA);
w->addToolBar(barA);
QToolBar *barB = new QToolBar;
barB->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
QAction *actOnB = new QAction("OnB");
actOnB->setIcon(QIcon("../../../on.png"));
barB->addAction(actOnB);
QAction *actOffB = new QAction("OffB");
actOffB->setIcon(QIcon("../../../off.png"));
barB->addAction(actOffB);
w->addToolBar(barB);
w->show();
return a.exec();
I think I saw similar labels in a Microsoft MFC project.