Important: Please read the Qt Code of Conduct -

QWT: qwtplotmarker error

  • Good day to you all.
    I'm developing a program that outputs a vector diagram. For that i'm using qwtplotmarkers, along with qwtplot. Everything is working smooth and fine, until i'm closing my application. It throws memory error on this string:

         #ifndef QWT_NO_SVG
            delete svg.renderer;

    I don't understand, what's going wrong. I was trying to detach items before closing, deleting arrays, which contain them (QwtPlotMarker markers_array[1024];) Still, nothing helps. Can you please answer, how i can delete this markers? Thank you

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You should show the code you are using.

    Note that Qwt is not part of Qt and they also have their own mailing list that you might want to check.

  • Well, my code is looking like that:

    QwtPlotMarker markers_array[1024];
    QwtSymbol sym;
    /*part where i create symbol for markers*/
    sym.setSize(QSize (1,1)); 
    /*part where i plot markers*/
    for (int counter = 0; counter < size; counter++)/
    markers_array[counter+filler_count].setValue(QPointF(I[counter], Q[counter]));
    /*part of the code, where application is closing*/
    for (int i = 0; i < 1024; i++)
    	ui.vector_plot->detachItems(QwtPlotItem::Rtti_PlotMarker, false);

    Problem appears, when i'm trying to close application.

  • Lifetime Qt Champion

    Why are you calling the destructor of your sim variable ?

    And aren't you detaching the markers twice ?

Log in to reply