QCustomPlot Discussion and Comments

rangeChanged signal on axis->setRange callReturn to overview

Hi community,

I am currently evaluating this wonderfull library.
I am facing to a problem.
I would like to emit the signal "rangeChanged" when i call the setRange function on the corresponding axis.
I have of course connected the signal to the axis.
--> connect(chartAxisX, SIGNAL(rangeChanged(QCPRange)), this, SLOT(slotOnChartXaxisRangeChanged(QCPRange)));
The problem is that the signal is not emitted.
It is emited only when i am draging the axis with the mouse.

Is this normal and how can i achiev this?

Thank-you for help.

As you can see in the implementation of QCPAxis::setRange, the signal rangeChanged is emitted. So I assume there is something else wrong in your code.
Note that the signal is only emitted, if the range has actually changed. If you call setRange with the current range, nothing happens.


thank-you for your reply.
I have found my error.
I am calling setRange in a dedicated thread (not the same as main).
So, i have to call an internal signal to make the setRange call in the main thread.