PDA

View Full Version : Doubts on signal and slots



divanshu
27th June 2011, 10:20
Hi all,

I am working with JAVA build of QT. here when i searching in this forum all queries related to c and c++. so i am finding it difficult to understand it.

QObject::connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(function(int, bool)));

can any 1 explains me the meaning of this statement. and can help me how i can implement same thing into java. can any1 temme what is the equivalent classes in JAVA.

Thanks in advance!!

mcosta
27th June 2011, 10:29
Hi


I am working with JAVA build of QT
Are you using QtJambi??

If Yes read here (http://doc.qt.nokia.com/qtjambi-4.5.2_01/com/trolltech/qt/qtjambi-signalsandslots.html)

Santosh Reddy
27th June 2011, 10:32
QObject::connect(http, SIGNAL(requestFinished(int, bool)), this, SLOT(function(int, bool)));

Read it like this
- makes a connection between object http and object this
- the connection is made between http's signal requestFinished(int, bool), and this's slot function(int, bool)
- when ever requestFinished() is emitted function() is called automatically

Note: Both http and this should have QObject as base class, either directly or indirectly.

Documentation (http://doc.qt.nokia.com/)