Search code examples
c++qtqt5qmenubar

How to set buttons in QMenuBar at right corner in Qt5?


I need to add two buttons at right side of QMenuBar (in left usual menu items) and change it icons time by time. Is it possible?


Solution

  • I need to add two buttons at right side of QMenuBar (in left usual menu items)

    This question might have an answer on how to add the buttons to the right side of a menu bar: Stacking QPushButtons on the other side of a QMenuBar.

    and change it icons time by time

    You can use a QTimer to trigger a slot periodically. Inside the slot, use QPushBtton::setIcon() to change the icon.