QT charts use 50% of CPU



  • Hi,
    I am using Qt 5.8 on window 8.
    Running a basic qt chart example of Dynamicspline chart given by qt but when i am running this dynamicspline application in release mode still it takes 50% of my cpu usage.
    What can be the issue ,if any and what can i do to reduce the cpu usage .

    thank u.
    1_1516097592656_chart_running.jpg 0_1516097592655_before_chart.jpg


  • Lifetime Qt Champion

    Hi,

    The first idea that comes to mind is to update to a more recent version of Qt.



  • You could use the QML-version of QT-Charts, that one uses the GPU to calculate and display QtChart-objects.



  • @J.Hilk
    i tried qml qmlf1legends chart example in qt but same the cpu gradually increases with one line drawing .



  • Use Qwt (or QCustomPlot) instead, as QtCharts it is not good choose, IMHO (you can find similar issues on this forum).



  • I'd recommend using https://doc.qt.io/qt-5.10/qxyseries.html#replace-5

    Replacing points one by one destroys a cpu. The metrics for me was just not even worth measuring - it was just an immediate hell no - forget that - I need faster updates. I like declarative QML for gui as a preference but calling replace on a single point fires way too many signals and takes way too long.

    I throw my QML LineSeries to a QXYSeries and call replace in c++

    In the future I'll probably just declare my series in C++. I wish I could have a better supported hybrid of c++ and QML charts but I have this working very fast using useOpenGL : true; (you can also c++ setUseOpenGL(true) )


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.