Access to QChart

  • Hi,
    I need accessing to object QChart from few methods. Defining QChart *tempChart = new QChart(); in main file, not in method, do fall program due "Segmentation fault". Is there any solution?

  • Lifetime Qt Champion


    How are you accessing that object in the rest of your code ?

  • Moderators

    @Milori The solution is: do not access it from many different places! It should be managed at one place. All other places can provide changes/data/what ever via signals/slots. You should describe better what you want to achieve.

  • I need periodically to render chart with new data. Staying code called over timer by each loop also add new axis with legends to chart a bit shifted to center of chart. After few loops chart shows only axisses and legends. I trying remove axis, hidding legend, destruct chart object, without effect.

  • Lifetime Qt Champion

    Then you really should have only one central place that manages your QChart and handle the new data/remove the old etc.

Log in to reply