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:

        ~PrivateData()
        {
         #ifndef QWT_NO_SVG
            delete svg.renderer;
         #endif
        }
    

    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:

    /**********variables**********/
    QwtPlotMarker markers_array[1024];
    QwtSymbol sym;
    /*****************************/
    /*part where i create symbol for markers*/
    sym.setSize(QSize (1,1)); 
    sym.setColor(Qt::black);
    sym.setStyle(QwtSymbol::Ellipse);
    /*part where i plot markers*/
    for (int counter = 0; counter < size; counter++)/
    {			
    markers_array[counter+filler_count].setSymbol(&sym);
    markers_array[counter+filler_count].setValue(QPointF(I[counter], Q[counter]));
    markers_array[counter+filler_count].attach(ui.vector_plot);
    }
    /*part of the code, where application is closing*/
    app::~app()
    {
    for (int i = 0; i < 1024; i++)
    {
    	markers_array[i].detach();
    }
    	ui.vector_plot->detachItems(QwtPlotItem::Rtti_PlotMarker, false);
    	ui.vector_plot->replot();
    	sym.~QwtSymbol();
    }
    

    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
 

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