Add a signal in class that inherited from The QplainTextEdit
-
I have this class that inherited from QplainTextEdit and I Want to implement a signal function this is the class
#ifndef PLAINTEXTEDIT_H #define PLAINTEXTEDIT_H #include <QPlainTextEdit> #include <QDebug> #include <QObject> class PlainTextEdit : public QPlainTextEdit { Q_OBJECT public: PlainTextEdit(QWidget *parent=0); bool event(QEvent *event); signals: void CursorChange(int n); public: void SetString(QString s); private: QString str; };but i got many undefined reference pointing to function constructor and emit signal part first I got an error so I add the Q_OBJECT to the class but when i add it i got this error
-
I have this class that inherited from QplainTextEdit and I Want to implement a signal function this is the class
#ifndef PLAINTEXTEDIT_H #define PLAINTEXTEDIT_H #include <QPlainTextEdit> #include <QDebug> #include <QObject> class PlainTextEdit : public QPlainTextEdit { Q_OBJECT public: PlainTextEdit(QWidget *parent=0); bool event(QEvent *event); signals: void CursorChange(int n); public: void SetString(QString s); private: QString str; };but i got many undefined reference pointing to function constructor and emit signal part first I got an error so I add the Q_OBJECT to the class but when i add it i got this error
-
I have this class that inherited from QplainTextEdit and I Want to implement a signal function this is the class
#ifndef PLAINTEXTEDIT_H #define PLAINTEXTEDIT_H #include <QPlainTextEdit> #include <QDebug> #include <QObject> class PlainTextEdit : public QPlainTextEdit { Q_OBJECT public: PlainTextEdit(QWidget *parent=0); bool event(QEvent *event); signals: void CursorChange(int n); public: void SetString(QString s); private: QString str; };but i got many undefined reference pointing to function constructor and emit signal part first I got an error so I add the Q_OBJECT to the class but when i add it i got this error