I am working on the same problem. Why doesn't the canvas respect the axis widget's minimumWidth()? Is this a bug?
Also, QwtPlot::updateLayout is not a slot, so I can't just do:
connect(m_ui
->qwtPlot
->axisWidget
(QwtPlot::yLeft),
SIGNAL(scaleDivChanged
()),
m_ui->qwtPlot, SLOT(updateLayout()));
connect(m_ui->qwtPlot->axisWidget(QwtPlot::yLeft), SIGNAL(scaleDivChanged()),
m_ui->qwtPlot, SLOT(updateLayout()));
To copy to clipboard, switch view to plain text mode
to work around this.
Added after 1 6 minutes:
This seems to do the trick:
m_ui
->qwtPlot
->axisWidget
(QwtPlot::xBottom)->setMinBorderDist
(90,
20);
m_ui->qwtPlot->plotLayout()->setAlignCanvasToScales(true);
m_ui->qwtPlot->axisWidget(QwtPlot::xBottom)->setMinBorderDist(90, 20);
m_ui->qwtPlot->plotLayout()->setAlignCanvasToScales(true);
To copy to clipboard, switch view to plain text mode
This has some side effects I don't really like (the canvas doesn't stretch to the edge on the top and right) but it helps with a lot of the flickering when axis labels change.
Bookmarks