cl90
4th March 2015, 10:22
Hi!
What i'm trying to do should be pretty easy. But somehow it doesn't work.
All i'm trying to do is to add a qwtPlot to an qt application, without launching the plot in its own application.
Every time i try, i end up with 2 application windows (one for the application and one for the plot) or with no application (because it crashes).
I tired this for quiet some time without any progress, so maybe you can help me out.
If i run this somewhere in my code i end up with 2 application windows. (not what i want)
QwtPlot* plot = new QwtPlot();
plot->setTitle( "Plot Demo" );
plot->setCanvasBackground( Qt::white );
plot->setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
plot->insertLegend( new QwtLegend() );
[...]
plot->show();
What i want is to add a plot to a specified layout inside my application.
every time i try to add a qwtPlot as a widget, my application crashes.
QwtPlot* plot = new QwtPlot();
[...]
ui->horizontalLayout->addWidget(plot);
Is this even Possible? i cant even find anything about this.
What i'm trying to do should be pretty easy. But somehow it doesn't work.
All i'm trying to do is to add a qwtPlot to an qt application, without launching the plot in its own application.
Every time i try, i end up with 2 application windows (one for the application and one for the plot) or with no application (because it crashes).
I tired this for quiet some time without any progress, so maybe you can help me out.
If i run this somewhere in my code i end up with 2 application windows. (not what i want)
QwtPlot* plot = new QwtPlot();
plot->setTitle( "Plot Demo" );
plot->setCanvasBackground( Qt::white );
plot->setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
plot->insertLegend( new QwtLegend() );
[...]
plot->show();
What i want is to add a plot to a specified layout inside my application.
every time i try to add a qwtPlot as a widget, my application crashes.
QwtPlot* plot = new QwtPlot();
[...]
ui->horizontalLayout->addWidget(plot);
Is this even Possible? i cant even find anything about this.