How to add radio button in menu bar, qt 5 c++ -


i making qt gui based application demonstration of algorithms, want select 1 algorithm @ time menu bar.

for have 2 approaches in mind,

one make qaction checkable , loop through each , check 1 clicked , uncheck others.

the other add radio button in menubar.

which approach more better ?

if second 1 better how do ?

you can use qactiongroup , use setexclusive(true) allow 1 checkable qaction checked @ time, don't have manually.


Comments