Dear all,
I'm trying to inherite QwtPlot and using signals/slots. So, my header file looks like:
#pragma once
#include "qwt_plot.h"
#include <QtGui>
class MyQwtCurvePlot :
public QwtPlot
{
Q_OBJECT
public:
MyQwtCurvePlot(QWidget *p = 0);
~MyQwtCurvePlot(void);
public slots:
void highlight(const QVector<QPointF> &pa);
};
But, while compiling this with the Q_OBJECT macro, the compiler (MSVC2008) gives an error, namely:
1>Generating Code...
1>Compiling...
1>moc_MyQwtCurvePlot.cpp
1>Linking...
1> Creating library K:\TEST\Qt\test\Debug\test.lib and object K:\TEST\Qt\test\Debug\test.exp
1>moc_MyQwtCurvePlot.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)
1>K:\TEST\Qt\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://k:\TEST\Qt\test\test\Debug\BuildLog.htm"
Does anyone have an idea where this comes from? The class compiles perfectly with Q_OBJECT removed, but then the signal/slot system doesn't work.
Thanks for replies in advance,
Martijn
Bookmarks