#include class Loop : public QObject // required public inheritance to QObject { Q_OBJECT // Mandatory macro to create custom signals and slots public: // Constructor with a specific required signature Loop(QObject* parent=0) : QObject(parent) {} public slots: // start of slot declarations void setIterations(int n); // gives the number of iterations to perform signals: // start of signals declarations void newIteration(int i); // signal emitted at each iteration void sendToken(QString s); // signal emitted at the end of the loop }; class DisplayInt : public QObject { Q_OBJECT public: DisplayInt(QObject* parent=0) : QObject(parent) {} public slots: void display(int i); // slot that will display the integer passed as a parameter };