[Qt-interest] can not create the slot in the main()

go canal gocanal at yahoo.com
Sat Nov 13 10:09:10 CET 2010


Java does not declare method;

I think I figure out the problem, I need to create the Main class:
Main m = new Main();
then I can connect the signal:

netty.receivedURL.connect(m, "start()");
 thanks,
canal




________________________________
From: Scott Aron Bloom <Scott.Bloom at onshorecs.com>
To: go canal <gocanal at yahoo.com>; qt-interest at trolltech.com
Sent: Sat, November 13, 2010 10:36:04 AM
Subject: RE: [Qt-interest] can not create the slot in the main()


Don’t know about Java+Jami, but in C++, you have to declare the method as a 
slot.
 
So my bet is that its not recognizing your start function as a slot

Scott
 
From:qt-interest-bounces at trolltech.com 
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of go canal
Sent: Friday, November 12, 2010 6:22 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] can not create the slot in the main()
 
Hello,
I got an error: 
"
Exception in thread "main" com.trolltech.qt.QNoSuchSlotException: 
Could not find slot with signature: start()
"
 
I am using Jambi 4.5.2
 
Here is my main class -  it starts the Netty network server then goes into the 
event loop:
-----------------------
public class Main extends QObject {
  public static void main(String[] args) {
  QApplication.initialize(args);
  // start the Netty server
  NettyServer netty = new NettyServer();
  netty.receivedURL.connect(Main.class, "start()");
  netty.run();
 
  // Qt event loop
  QApplication.exec();
  }
 
  private void start() {
    // do something
  }
}
 
The error message happened when trying to establish the connection,
 
Any idea? Appreciate your help very much.
 
thanks,
canal


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101113/9db7cb50/attachment.html 


More information about the Qt-interest-old mailing list