Search code examples
c++qtqt-creatorqtoolbar

Add some text to a QToolBar


I am having trouble adding some text in a QToolBar. I can only add Actions. Also I have two actions with their rerspectives icons in my QToolBar but I want to separate them and I can´t either.

My newbie approach was to add empty actions to simulate blank spaces between the icons. But the user can click on the blank spaces.

I am using the Design function of QT Creator. Some help would be really apreciated.


Solution

  • It looks like you can't do it from within Designer:

    https://bugreports.qt.io/browse/QTBUG-1267

    That's an oooold suggestion, too, with a low priority to boot, so it probably won't get fixed any time soon.

    You can get your hands dirty and do it in code, however.