Hi,
Thank you, Eskill.
Here, the source of my program:
*package default;
import com.trolltech.qt.gui.*;
public class Program extends QMainWindow { //here eclipse has used
QWidget, but it reported a errror
Ui_Program ui = new Ui_Program();
public static void main(String[] args) {
QApplication.initialize(args);
**Program** test**Program** = new **Program**();
test**Program**.initSignals(); // I don't know if this is the
right place....
test**Program**.show();
QApplication.exec();
}
public void initSignals(){
ui.IniciarBuscaButton.clicked.connect(QApplication.instance(),
"myfunction()"); // myfunction is declared on Ui_Program
}
public **Program**() {
ui.setupUi(this);
}
public **Program**(QWidget parent) {
super(parent);
ui.setupUi(this);
}
}
*
Regards,
Fábio
On Tue, Sep 22, 2009 at 9:09 AM, Eskil Abrahamsen Blomfeldt <
[email protected]> wrote:
> Fábio J. Bertinatto skrev:
>
> First all, sorry for my limited English...
>> I created a project with Eclipse and drew a interface with Designer.
>> On a pushButton I did this:
>> ui.pushButton.clicked.connect(QApplication.instance(), "quit()");
>> And it worked fine, but when I tried to call a function that I have
>> declared it don't compile.
>> I tried to declare the function on the main file and on the Ui file, but
>> it don't work.
>> Anyone can help me?
>>
>
> Hi,
>
> We would have to see the code that doesn't compile in order to help you.
> Slots are ordinary Java methods, and when you pass them to the connect()
> statement, you should put the signature (minus the return type) in quotes,
> just like you have done above. Mistyping the signature will not cause your
> code to fail in compilation, as the slot signature is interpreted at
> run-time, so if your code does not compile, there has to be something else
> that's wrong with it.
>
>
> -- Eskil
>
>
--
Fábio J. Bertinatto
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest