Hi Robin, Thanks for the response.
I already have the connect/slot statement. I am trying to call the c++ function from the middle of the slot procedure for the fileDialog. I will check with the qt-interest mailing list. -Anu -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Robin Krahl Sent: Tuesday, April 13, 2010 4:09 PM To: [email protected] Subject: Re: [Qt-creator] Calling c++ procedure in Qt Hi Anu! On 13.04.2010 22:54, Anu Ramachandra wrote: > I have a Qt application with a fileDialog. When a file is selected, I > would like to call a c++ procedure. > > The procedure is defined in a separate .cpp file which I added to the > 'Sources' section of the Qt project. > > How can the C++ procedure be called? That's done via signals and slots, a central Qt feature. [1] This is very basic Qt; so I'd recommend you to read the tutorials, documentation, help, examples, demonstrations and so on provided with Qt and Qt Creator - they're really great! You could e. g. start with the Adressbook Tutorial [2]. Basically, the code would look like this: connect(fileDialog, SIGNAL(fileSelected(QString)), this, SLOT(slotFileSelected(QString))); Furthermore, this is the Qt Creator mailing list - for general questions on Qt (like this one), please use qt-interest. Thanks! I hope this helps you. Regards, Robin [1] http://doc.trolltech.com/4.6/signalsandslots.html [2] http://doc.trolltech.com/4.6/tutorials-addressbook.html -- Robin Krahl <[email protected]> http://rkrahl.de plain text & open source ftw! _______________________________________________ Qt-creator mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-creator
