How to add a QWidget to a QMenuBar?

与世无争的帅哥 提交于 2019-12-12 03:49:59

问题


I want to add a QLabel to a QMenuBar. I was able to add a QLabel to a QMenu using QActionWidget, but I want the QLabel to sit on the QMenuBar (as a substitute for a QMenu) at the right end of my application. I intend to add a movie to this QLabel in order to simulate a loading circle to indicate that the application is running. How can I add a QWidget to a QMenuBar, or is there some alternative to my ultimate goal? I am using Qt 5.6 with Qt Designer


回答1:


A widget can be added to the end of the menu-bar with QMenuBar::setCornerWidget.



来源:https://stackoverflow.com/questions/38832699/how-to-add-a-qwidget-to-a-qmenubar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!