简体   繁体   English

向QToolBar添加一些文本

[英]Add some text to a QToolBar

I am having trouble adding some text in a QToolBar. 我在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. 另外,我在QToolBar中有两个动作及其相应的图标,但是我想将它们分开,但我不能。

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. 我正在使用QT Creator的设计功能。 Some help would be really apreciated. 确实会有一些帮助。

It looks like you can't do it from within Designer: 看来您无法在Designer中执行此操作:

https://bugreports.qt.io/browse/QTBUG-1267 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. 但是,您可以弄脏双手并用代码进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM