Undefined reference to 'vtable to FocusWatcher'
Unsolved
General and Desktop
-
I found this script on the internet but when I try to build it i got this error: "Undefined reference to 'vtable to FocusWatcher' ".
#include<QEvent> #include<QObject> class FocusWatcher : public QObject { Q_OBJECT public: explicit FocusWatcher(QObject* parent = nullptr) : QObject(parent) { if (parent) parent->installEventFilter(this); } virtual bool eventFilter(QObject *obj, QEvent *event) override { Q_UNUSED(obj) if (event->type() == QEvent::FocusIn) emit focusChanged(true); else if (event->type() == QEvent::FocusOut) emit focusChanged(false); return false; } virtual ~FocusWatcher() {} Q_SIGNALS: void focusChanged(bool in); };
-
Hi,
How are you compiling it ?