In the designer add a plain widget and promote it to Plot, Right click on widget and then prommote, here give the Plot class details.
Then your code should look like this
#include "mainwindow.h"
#include "plot.h"
#include <qwt_scale_engine.h>
#include <qlabel.h>
#include <qlayout.h>
#include "ui_plot.h"
MainWindow
::MainWindow( QWidget *parent
): ui(new Ui::Plot())
{
const double intervalLength = 10.0; // seconds
setupUi(this);
ui->plot->setIntervalLength( intervalLength );
}
void MainWindow::start()
{
ui->plot->start();
}
#include "mainwindow.h"
#include "plot.h"
#include <qwt_scale_engine.h>
#include <qlabel.h>
#include <qlayout.h>
#include "ui_plot.h"
MainWindow::MainWindow( QWidget *parent ):
QWidget( parent ),
ui(new Ui::Plot())
{
const double intervalLength = 10.0; // seconds
setupUi(this);
ui->plot->setIntervalLength( intervalLength );
}
void MainWindow::start()
{
ui->plot->start();
}
To copy to clipboard, switch view to plain text mode
Bookmarks