Question

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?

Was it helpful?

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.

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top