Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#include "plotting.h"
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
plotting::plotting(QWidget *parent, Qt::WFlags flags)
: QDialog(parent, flags)
{
ui.setupUi(this);
QwtPlot *qwtPlot;
double x[100], y1[100], y2[100]; // x and y values
qwtPlot = new QwtPlot("Two Curves",parent); // [ <----- error here ]
// add curves
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
//getSomeValues(x, y1, y2);
// copy the data into the curves
curve1->setData(x, y1, 100);
curve2->setData(x, y2, 100);
curve1->attach(qwtPlot);
curve2->attach(qwtPlot);
// finally, refresh the plot
qwtPlot->replot();
}
plotting::~plotting()
{
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
#ifndef PLOTTING_H
#define PLOTTING_H
#include <QtGui/QDialog>
#include "ui_plotting.h"
#include <qwt_plot.h>
class plotting : public QDialog
{
Q_OBJECT
public:
plotting(QWidget *parent = 0, Qt::WFlags flags = 0);
~plotting();
private:
Ui::plottingClass ui;
};
#endif // PLOTTING_H
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 |
#include <QtGui/QApplication>
#include "plotting.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
plotting w;
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
return a.exec();
}
|
|
|
Source code |
1 2 3 |
1>.plotting.cpp(11) : error C2664: 'QwtPlot::QwtPlot(const QwtText &,QWidget *)' : cannot convert parameter 1 from 'const char [11]' to 'const QwtText &' 1> Reason: cannot convert from 'const char [11]' to 'const QwtText' 1> No constructor could take the source type, or constructor overload resolution was ambiguous |
|
|
Source code |
1 2 3 4 5 6 7 8 |
1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlot::QwtPlot(class QWidget *)" (??0QwtPlot@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_plottingClass::setupUi(class QDialog *)" (?setupUi@Ui_plottingClass@@QAEXPAVQDialog@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::~QwtText(void)" (??1QwtText@@QAE@XZ) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotItem::attach(class QwtPlot *)" (?attach@QwtPlotItem@@QAEXPAVQwtPlot@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotCurve::setData(double const *,double const *,int)" (?setData@QwtPlotCurve@@QAEXPBN0H@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlotCurve::QwtPlotCurve(class QString const &)" (??0QwtPlotCurve@@QAE@ABVQString@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlot::QwtPlot(class QwtText const &,class QWidget *)" (??0QwtPlot@@QAE@ABVQwtText@@PAVQWidget@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::QwtText(class QString const &,enum QwtText::TextFormat)" (??0QwtText@@QAE@ABVQString@@W4TextFormat@0@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>C:\Qt\4.3.3\QWT\qwt-5.0.2\qwt-5.0.2\examples\plotting\Release\plotting.exe : fatal error LNK1120: 7 unresolved externals |
|
|
Source code |
1 2 3 4 5 6 7 |
error LNK2019: unresolved external symbol "public: __thiscall QwtPlot::QwtPlot(class QWidget *)" (??0QwtPlot@@QAE@PAVQWidget@@@Z) referenced in function "public: void __thiscall Ui_plottingClass::setupUi(class QDialog *)" (?setupUi@Ui_plottingClass@@QAEXPAVQDialog@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::~QwtText(void)" (??1QwtText@@QAE@XZ) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotItem::attach(class QwtPlot *)" (?attach@QwtPlotItem@@QAEXPAVQwtPlot@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: void __thiscall QwtPlotCurve::setData(double const *,double const *,int)" (?setData@QwtPlotCurve@@QAEXPBN0H@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlotCurve::QwtPlotCurve(class QString const &)" (??0QwtPlotCurve@@QAE@ABVQString@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtPlot::QwtPlot(class QwtText const &,class QWidget *)" (??0QwtPlot@@QAE@ABVQwtText@@PAVQWidget@@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>plotting.obj : error LNK2019: unresolved external symbol "public: __thiscall QwtText::QwtText(class QString const &,enum QwtText::TextFormat)" (??0QwtText@@QAE@ABVQString@@W4TextFormat@0@@Z) referenced in function "public: __thiscall plotting::plotting(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0plotting@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) |