Here is my guess:
I create an object and I define a method. I link the action (signal) to the method (slot). The method, in this case, should contain a command launched on a system's shell.
Is that - at least in part - right?!
Printable View
Here is my guess:
I create an object and I define a method. I link the action (signal) to the method (slot). The method, in this case, should contain a command launched on a system's shell.
Is that - at least in part - right?!
basically yes, the slot is not the shell command, but rather executes it.
Code:
{ Q_OBJECT public: ClassA(); signals: void someSignale(); }; { Q_OBJECT public: ClassB(); public slots: someSlot() { system("some shell command"); } }; // somewhere else ClassA a; ClassB b; b.connect(&a, SIGNAL(someSignal()), SLOT(someSlot())); somewhere in ClassA: emit someSignal();
When ClassA emits this signal, all the slots connected to it will be executed (in an undefined order).
In a slot you may execute any code you like, e.g. call some shell command.
Read up the tutorials etc in the excellent Qt docs!
HTH.
Very helpfull! Thank you very much.