Hello Uwe,
First of all, thank you very much for your reply, that's very kind of you.
This workaround won't work. I have already tried it : calling updateLayout before replot won't fix the replot issue. However, I will use the condition to avoid updating the layout after the replot uselessly. I will try the second workaround another time (soon).
if ( !d_plot->isVisible() )
d_plot->updateLayout(); // does not cause expensive operation, when being done before the replot
if ( !d_plot->isVisible() )
d_plot->updateLayout(); // does not cause expensive operation, when being done before the replot
To copy to clipboard, switch view to plain text mode
Otherwise (in the same subject), I have an issue reploting the QwtPlotSpectrogram with a slider (screenshot in my second post) : I use the slider to rescale the data range and I am doing this :
// dLower, dUpper are double variables (new data range)
m_plot
->setAxisScale
(QwtPlot::yRight, dLower, dUpper
);
axis->setColorMap(QwtInterval(dLower, dUpper), new LinearColorMapRGB()); // I need to do this, otherwise, the color bar will change
//axis->setColorBarEnabled(true); // already done elsewhere
RawPlotData* spectroData = static_cast<RawPlotData*>(m_spectrogram.data());
if (spectroData)
{
spectroData->SetZRange(dLower, dUpper); // here I'm just calling setInterval(Qt::ZAxis, QwtInterval(dLower, dUpper) on the QwtMatrixRasterData object
}
m_plot->replot(); // I tried also to call repaint after it etc...
// dLower, dUpper are double variables (new data range)
m_plot->setAxisScale(QwtPlot::yRight, dLower, dUpper);
QwtScaleWidget* axis = m_plot->axisWidget( QwtPlot::yRight );
axis->setColorMap(QwtInterval(dLower, dUpper), new LinearColorMapRGB()); // I need to do this, otherwise, the color bar will change
//axis->setColorBarEnabled(true); // already done elsewhere
RawPlotData* spectroData = static_cast<RawPlotData*>(m_spectrogram.data());
if (spectroData)
{
spectroData->SetZRange(dLower, dUpper); // here I'm just calling setInterval(Qt::ZAxis, QwtInterval(dLower, dUpper) on the QwtMatrixRasterData object
}
m_plot->replot(); // I tried also to call repaint after it etc...
To copy to clipboard, switch view to plain text mode
But the replot with or without updateLayout and/or repaint, doesn't update the shown result. Only resizing the window, replots the data with the new data range.
Bookmarks