Hi,
my latest problem refers to QActionGroup. In my application I Have a
separate Ui_blahblah.java file for code generated with the Designer and
the MainWindow.java file in which I have most of the program logic. Now,
I created two Actions with the Designer, and set the preferences for
both to be checkable. I add them to a tool bar. So far so good. Sice
there is no way of specifying an Action Group within the Designer, and
adding these two actions to a group, I move to the MainWindow.java.
There I have a something like this:
" Ui_blahblah ui = new Ui_blahblah();
QActionGroup gr;
public MainWindow(){
ui.setupUi(this);
mm();
}
public void mm(){
gr = new QActionGroup(this);
mono_stereoGroup.addAction(ui.action_Stereo);
mono_stereoGroup.addAction(ui.action_Mono);
//ui.toolBar.addActions(gr.actions());
}
"
where as you can see I create a group and add the two actions that I
created in with the Designer and which declarations are in Ui_blahblah.java.
The problem now is that the behavior is not what you'd expect from a
group, when one is checked the other is also checked sometimes, ore none
is chcecked, or in some constelation it is even right.. Does someone
know what could be causing this chaotic behaviour?
I only add that I know how to overcome this problem, by placing all, the
declaration + logic inside the MainWindow.java, but this way i cant see
the actions within the Designer which is annoying:
"
public void mm(){
QActionGroup gr = new QActionGroup(this);
QAction a1 = new QAction("a1",gr);
QAction a2 = new QAction("a2",gr);
a1.setCheckable(true);
a2.setCheckable(true);
ui.toolBar.addActions(gr.actions());
}
"
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest