Qt World Summit: Register Today!

Custom item goes below line series

  • Hi.
    I want to add additional items on top of QChart series. I checked callout example and created a custom graphics item. Even setting zValue of item to a high number (e.g. 1000) does not bring item to top.
    I use QChartView with multiple line series (QVector<QLineSeries*>). What's the problem? how can I bring the items to top?

  • I found out that setUseOpenGL(true) on QLineSeries causes the problem.
    What can I do now? :-(

  • I found the cause, but I think there is not solution to my problem.
    According to docs (QAbstractSeries):

    When a chart contains any series that are drawn with OpenGL, a transparent QOpenGLWidget is created on top of the chart plot area. The accelerated series are not drawn on the underlying QGraphicsView, but are instead drawn on the created QOpenGLWidget.

    So there is no way to draw something on top of it :|

    But I have another question, can I update plot manually? adding point to series updates chart automatically. I want to update it at specific intervals (constant FPS)

    Setting viewportUpdateMode to NoViewportUpdate has no effect


Log in to reply