QCustomPlot Discussion and Comments

Beautiful Powers BugReturn to overview

I set the number format on my QCustomPlot instances to use the so called beautiful powers mode for the tick labels, but I've never managed to actually make it work. I did a little investigation and it turns out the problem is that the various bits of code that parse the label text search for 'e' as the exponential character. The exponential character is locale dependent, in my case (en_GB) it's 'E'. It would probably be better to use QLocale::system().exponential() instead of statically using 'e'.

Thank you for reporting this bug!

It is fixed in the next release.

Note that instead of using the system locale, it's better to use the parent QCustomPlot widget's locale, since it might differ. (And QCPAxis::setupTickVectors uses the mParentPlot->locale() to generate the tick label strings).