QCustomPlot Discussion and Comments

[Suggestion] emit beforeReplot after updateLayoutReturn to overview

Hello!

I have implemented the logic of recalculation of some coordinates in the method connected to the QCustomPlot::beforeReplot signal. Now the QCustomPlot::replot method looks like this:

void QCustomPlot::replot(QCustomPlot::RefreshPriority refreshPriority)
{
...
  emit beforeReplot();
  
  updateLayout();
...
}

If the position of the axes was not valid, the coordinates will be recalculated incorrectly.
I suggest calling the updateLayout() method before the signal beforeReplot()

Hmm, I understand your use case but many people use beforeReplot to adjust things that require the layout update afterwards (e.g. changing axis ranges which might make tick labels have different lengths and thus change axis rect sizes).

Instead of breaking backward-compatibility by moving beforeReplot, I will consider adding another signal after the layout.