hallo,
ist es möglich, einen RadioButton (bzw. zwei) in ein Menü einzubauen.
diese sollten dann auch voneinander abhängig sein. (sind sie aber sowieso glaub ich)
vielen dank für eure hilfe.
mfg stash
RadioButton in Menü
Du darfst auch nicht die ActionGroup dem Menu hinzufügen sondern weiterhin nur die QAction sebst! Die ActionGroup managed nur die einzelnen Actions. Also z.B.:
Grüße
Franz
Code: Alles auswählen
QActionGroup *group = new QActionGroup( this );
group->setExclusive(true); // brauchen wir für deinen RadioButton
QAction *action1 = new QAction( tr("action 1"), this );
action1->setCheckable( true );
QAction *action2 = new QAction( tr("action 2"), this );
action2->setCheckable( true );
action2->setChecked( true );
// Die Actions der ActionGroup hinzufügen
group->addAction( action1 );
group->addAction( action2 );
// Und jetzt ab ins Menu
menu->addAction( action1 );
menu->addAction( action2 );Franz