Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QChart z-values not respected when using openGL acceleration?

I'm trying to do something almost exactly the same as the Qt5 callout example, but I've discovered that if you call setUseOpenGL(true) on the series, then the callout appears under the line instead of above it.

This is true no matter what zValue is set to, including m_tooltip->setZValue(std::numeric_limits<qreal>::max());

Is there a workaround for this?

enter image description here

like image 888
Nicolas Holthaus Avatar asked Jan 17 '26 19:01

Nicolas Holthaus


1 Answers

This happens because OpenGL accelerated series works by creating an QOpenGLWidget on top of the actual QGraphicsView, as noted in the documentation of the useOpenGL property:

If you draw any graphics items on top of a chart containing an accelerated series, the accelerated series is drawn over those items.

Basically, as the Callout is rendered inside the QGraphicsView, when OpenGL is enabled a QOpenGLWidget is created on top of that QGraphicsView and because that the callout appears below the line.

like image 193
Fernando Jorge Mota Avatar answered Jan 19 '26 08:01

Fernando Jorge Mota



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!