PDA

View Full Version : qt Signal and slots for plainly C++ class objects



Pereubu2018
15th August 2018, 18:25
We have a kind of:

connect(socket, SIGNAL(readyRead()), this, SLOT(readyReadImp()))

where let say slot ReadyReadImp() is implemented by using qtcpsocket class. Let say that I want to implement Same code in plainly C++ object. Let say that I have an old code in C++ only, so I wish to incorporate old code. Can I do it? How? And still to use benefits of signal and slots...

high_flyer
16th August 2018, 10:16
Of course you can still incorporate non Qt C++ in A Qt project.
The only limitation is that the non Qt code on its self will not play with (Qt( signal and slots (you could use boost signals and slots and mix them with Qt's however).
You can still use it in Qt slots however.
That is, you can have a Qt wrapper to your plain C++ code, the wrapper will provide the signals/slots and call within it the plain C++ code.

wysota
17th August 2018, 10:25
You can connect Qt signals to lambdas or static methods that can invoke your non-Qt C++ code.

Mirtexx
17th August 2018, 17:43
Hi to all!
Tell me please, what slot of the form shoud I use to make something, when this form tsarts?
Thanks for all.

wysota
18th August 2018, 12:56
Hi to all!
Tell me please, what slot of the form shoud I use to make something, when this form tsarts?
Thanks for all.

Please don't try to hijack the thread. Start a new one instead.