Q_OBJECT_example

#ifndef COMMUNICATE_H

#define COMMUNICATE_H

#include <QWidget>

#include <QApplication>

#include <QPushButton>

#include <QLabel>

class Communicate : public QWidget

{

  Q_OBJECT

  /*

    Whenever you use the Q_OBJECT macro, you must use Qt's moc command on that file to generate

    a new cpp file which should also be included in the files to be compiled with your project.

          $ moc Communicate.h -o moc_Communicate.cpp

    Then include the file moc_Communicate.cpp in the project as well.

  */

    public:

        Communicate(QWidget *parent = 0);

        virtual ~Communicate();

    protected:

    private slots:

        void OnPlus();

        void OnMinus();

    private:

        QLabel *label;

};

#endif // COMMUNICATE_H