Hi folks,
I recently started (again) playing around with Qt (last time was 3.3 I guess). And I have come across an issue I would like to confirm with you.
This is what I did initially:
- Create a Qt Jambi Project in Eclipse (3.4)
- Create a Qt Jambi Design Form (MainWindow)
- Created a simple UI (with Eclipse Designer Interface)
Now I understand that I need to connect the button (pushButton_add) to a slot. This is where I am facing the issue. I do not seem to be able to do so.
After a bit of googling I tried to hard code the connection in the TestMain.java file that has been generated buy the designer (TestJava.jui). The problem is now, when I change my UI, the Designer generates a new TestMain.java, overwriting my edits (inconvenient to say the least!). I am now required to rely on TestMainImpl.java for slot definition?
TestMain ui = new TestMain();
public static void main (String[] args) {
...initialize();
...
...exec();
}
public TestMain() {
ui.setupUi(this);
//is this the right place for that?!?!?!?!
ui.pushbutton_add.clicked.connect(this, "pushButton_add_clicked()");
}
public class TestMainImpl extends QMainWindow {
TestMain ui = new TestMain();
public static void main (String[] args) {
...initialize();
...
...exec();
}
public TestMain() {
ui.setupUi(this);
//is this the right place for that?!?!?!?!
ui.pushbutton_add.clicked.connect(this, "pushButton_add_clicked()");
}
To copy to clipboard, switch view to plain text mode
That is sad but ok, if it has to be like this, I can deal with it. What is the Signal/Slot editor for then anyways? Am I doing something wrong; did I misunderstand a concept? Please help me out here, your help is greatly appreciated.
Good day
Ronny
Bookmarks