Hi
I have a my Curve class derived from QwtPlotCurve as shown
Q_OBJECT;
public:
virtual ~Curve();
float* plotData;
int size;
signals:
void doPlotUpdate();
};
plotData(new float[size]),
size(size)
{
QObject::connect(this
->checkBox,
SIGNAL(stateChanged
(int)),parent,
SLOT(updatePlots
()));
}
class Curve :public QwtPlotCurve {
Q_OBJECT;
public:
Curve(QWidget* parent, QString s,QColor colour,int size);
virtual ~Curve();
QCheckBox* checkBox;
float* plotData;
int size;
signals:
void doPlotUpdate();
};
Curve::Curve(QWidget* parent,QString s,QColor color,int size):
QwtPlotCurve(s),
checkBox(new QCheckBox(s)),
plotData(new float[size]),
size(size)
{
setPen(QPen(color));
QObject::connect(this->checkBox,SIGNAL(stateChanged(int)),parent, SLOT(updatePlots()));
}
To copy to clipboard, switch view to plain text mode
My intention is to connect the signal from the checkbox to the slot updatePlots so that when the checkbox is enabled the plot is displayed. I am getting the following linking error
debug\moc_QwtSeahawkPlot.cpp:42: error: `staticMetaObject' is not a member of `QwtPlotCurve'
debug\moc_QwtSeahawkPlot.cpp: In member function `virtual void* Curve::qt_metacast(const char*)':
debug\moc_QwtSeahawkPlot.cpp:56: error: `qt_metacast' is not a member of `QwtPlotCurve'
debug\moc_QwtSeahawkPlot.cpp: In member function `virtual int Curve::qt_metacall(QMetaObject::Call, int, void**)':
debug\moc_QwtSeahawkPlot.cpp:61: error: `qt_metacall' is not a member of `QwtPlotCurve'
debug\moc_QwtSeahawkPlot.cpp: In member function `void Curve::doPlotUpdate()':
Also when I call attach I get the following compilation error.
mycurve=new Curve(this,"Input Data","yellow",1024);
mycurve->attach(plot);
mycurve=new Curve(this,"Input Data","yellow",1024);
mycurve->attach(plot);
To copy to clipboard, switch view to plain text mode
c:/Qt/4.5.0/include/qwt./qwt_plot_item.h: In member function `void QwtSeahawkPlot::updatePlots()':
c:/Qt/4.5.0/include/qwt./qwt_plot_item.h:117: error: `void QwtPlotItem::attach(QwtPlot*)' is inaccessible
SeaHawkDebug\QwtSeahawkPlot.cpp:127: error: within this context
SeaHawkDebug\QwtSeahawkPlot.cpp:127: error: `QwtPlotItem' is not an accessible base of `Curve'
mingw32-make[1]: *** [debug/QwtSeahawkPlot.o] Error 1
Could someone help me out
Regards
Bookmarks