[Qt-interest] text under widget on toolbar
Daniel Franke
franke.daniel at gmail.com
Mon Feb 28 14:12:07 CET 2011
Hi all.
in a toolbar, I'd like to have text under icons for normal actions and
a single spinbox widget, aligned with the other icons and some text
underneath the spinbox. At first, I though it should be as simple as:
// here, w is a QMainWindow
toolBar = w->addToolBar("My Toolbar");
toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
mySpinBox = new QSpinBox(w);
QAction *actionSpinBox = toolBar->addWidget(mySpinBox);
actionSpinBox->setText("Description of mySpinBox");
But it is not. The spinbox is shown vertically centered between the
icons and the icon text of the other actions, without its descriptive
text.
There's an equivalent question on stackoverflow [1], but the answer is
far from satisfactory. Does anyone have an idea how to accomplish
this?
Thanks
Daniel
[1] http://stackoverflow.com/questions/1771437/text-under-a-widget-added-with-qtoolbar-addwidget
More information about the Qt-interest-old
mailing list