这两天遇到一个
QWT使用的怪问题,解决不掉,请各位帮忙呀
程序很简单,就是继承一个QwtPlot的子类,编绎成功,但是运行总是失败.
子类如下:
myploter.h
- #ifndef MYPLOTER_H
- #define MYPLOTER_H
- #include <qwt_plot.h>
- class myPloter : public QwtPlot
- {
- Q_OBJECT
- public:
- myPloter(QWidget *parent = 0);
- ~myPloter();
- private:
- };
- #endif // MYPLOTER_H
myploter.cpp
- #include "myploter.h"
- myPloter::myPloter(QWidget *parent)
- : QwtPlot(parent)
- {
- // resize(400,300);
- }
- myPloter::~myPloter()
- {
- }
然后主程序中,new这个类,可是根本不管这个类.
- #include "qex1.h"
- //#include "myploter.h"
- #include <qwt_plot.h>
- qex1::qex1(QWidget *parent)
- : QWidget(parent)
- {
- // myPloter *ploter=new myPloter(this);
- QwtPlot *plot=new QwtPlot(this);
- plot->resize(400,300);
- }
- qex1::~qex1()
- {
- }
编绎通过,但是运行时出现
的错误对话框.
怎么试都不行,把继承的QwtPlot改成QPushButton又可以了,真是受不了它了
附上我的全部代码,大有帮我看一看吧,谢谢
qex1.rar (13 K) 下载次数:6