[Qt-interest] customised signals and slots in qt

Malyushytsky, Alex alex at wai.com
Thu Jul 7 20:49:24 CEST 2011


>> Am I missing something here??



What is the problem?



Since you don’t provide a real code it is tough to check it.

It seems that you emit signal, connect signal to some slot, but there might be always small details

which can’t be checked if you present the code the way you do.

For example  “void funct()” must be a member function of class A.



I would also recommend always check what “connect” returns.

It helps to avoid silly problems.



Regards,



Alex


From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Sahana Bhaskar
Sent: Thursday, July 07, 2011 6:23 AM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] customised signals and slots in qt


Hi all,



I am trying to implement a customized signal and slot functionality. I have 2 classes say A and B. Now on some event (say when a certain method is called) I want object of A to send signals to object of B and other objects of A itself. I want to know the steps. My IDE is visual studio. Also B  is derived from   QFileDialog. So in essence I have to send a signal from object of class A to another class B(a filedialog object).



I have done these things so far

1)   In the header of A(a.h) I have declared the signals as



Class A : public QObject, public<someotherclass>

{



Q_OBJECT

...



Signal:

Void signal1( );



}



2) written a connect statement in A.c as:



Connect(object_a, SIGNAL( signal1()),object_b, SLOT(slot1()));



Void funct()

{

Emit signal1();

}





3) defined and declared the slot in B.c and B.h



Am I missing something here??



Thanks,

Sahana




















**************** CAUTION - Disclaimer *****************

This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely

for the use of the addressee(s). If you are not the intended recipient, please

notify the sender by e-mail and delete the original message. Further, you are not

to copy, disclose, or distribute this e-mail or its contents to any other person and

any such actions are unlawful. This e-mail may contain viruses. Infosys has taken

every reasonable precaution to minimize this risk, but is not liable for any damage

you may sustain as a result of any virus in this e-mail. You should carry out your

own virus checks before opening the e-mail or attachment. Infosys reserves the

right to monitor and review the content of all messages sent to or from this e-mail

address. Messages sent to or from this e-mail address may be stored on the

Infosys e-mail system.

***INFOSYS******** End of Disclaimer ********INFOSYS***




---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”

“Please consider our environment before printing this email.”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110707/b267fd42/attachment.html 


More information about the Qt-interest-old mailing list