{
ui.setupUi(this);
ui.
qwtPlot->setAxisScale
(QwtPlot::xBottom,
-10,
10);
ui.
qwtPlot->setAxisScale
(QwtPlot::yLeft,
-10,
10);
painter = new QwtPlotDirectPainter();
std::vector<double> times1;
std::vector<double> times2;
std::vector<double> data1;
std::vector<double> data2;
times1.push_back(-5);
times1.push_back(8);
data1.push_back(5);
data1.push_back(7);
curve1->setSamples(×1.front(), &data1.front(), data1.size());
times2.push_back(0);
times2.push_back(3);
data2.push_back(2);
data2.push_back(3);
painter->drawSeries(curve1, 0, 1);
}
testQwt::testQwt(QWidget *parent, Qt::WFlags flags) : QMainWindow(parent, flags)
{
ui.setupUi(this);
ui.qwtPlot->setAxisScale(QwtPlot::xBottom, -10, 10);
ui.qwtPlot->setAxisScale(QwtPlot::yLeft, -10, 10);
painter = new QwtPlotDirectPainter();
curve1 = new QwtPlotCurve;
curve1->attach(ui.qwtPlot);
std::vector<double> times1;
std::vector<double> times2;
std::vector<double> data1;
std::vector<double> data2;
times1.push_back(-5);
times1.push_back(8);
data1.push_back(5);
data1.push_back(7);
curve1->setSamples(×1.front(), &data1.front(), data1.size());
times2.push_back(0);
times2.push_back(3);
data2.push_back(2);
data2.push_back(3);
painter->drawSeries(curve1, 0, 1);
}
To copy to clipboard, switch view to plain text mode
Bookmarks