[Solved]Align scrollbar
-
The code where I set Up the plot
@ ui->qwtPlot->setAxisScale(0,0,310,50);
ui->qwtPlot->setCanvasBackground(QBrush(Qt::white));ui->qwtPlot->setTitle("Power"); ui->qwtPlot->setAxisMaxMinor(2,0); //ui->qwtPlot->plotLayout()->setAlignCanvasToScales(true); ui->qwtPlot->setAxisTitle(0,"[kw]"); ui->qwtPlot->setAxisTitle(2,"Time [Sec]");
// panner = new QwtPanner(ui->qwtPlot->canvas());
ui->qwtPlot->canvas()->setPaintAttribute(QwtPlotCanvas::BackingStore,false);ui->qwtPlot->canvas()->setBaseSize(490,271); scrollArea = new QScrollArea(); scrollArea->setBackgroundRole(QPalette::Window); scrollArea->setWidget(ui->qwtPlot->canvas()); scrollArea->setAlignment(Qt::AlignBottom);
@
-
Qwt comes with a set of examples. In the realtime example you find a class ScrollZoomer, that adds scrollbars depending on the zoom base and the current zoom rectangle.
Adopting this class shoudln't be too difficult, but the code above that will never work as it breaks the layout code of QwtPlot and changes the parent/child relation of QwtPlot and its canvas.
Uwe