I need to add two buttons on the right side of QMenuBar (in the left normal menu items) and change the icons from time to time. Is it possible?
I need to add two buttons on the right side of QMenuBar (in the left normal menu items)
This question may have an answer on how to add buttons to the right side of the menu bar: Laying QPushButtons on the other side of the QMenuBar .
and change the icons from time to time
You can use QTimer to run the slot periodically. Inside the slot, use QPushBtton :: setIcon () to change the icon.
You can use the "layout direction":
QMainWindow mainW; mainW.show(); QMenuBar* menu = new QMenuBar(); menu->addAction( "action 1" ); menu->addAction( "action 2" ); mainW.setMenuBar( menu ); menu->setLayoutDirection( Qt::RightToLeft); // Display menu bar to the right