Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QWT: qwtplotmarker error
Forum Updated to NodeBB v4.3 + New Features

QWT: qwtplotmarker error

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
4 Posts 2 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Taras_Kolesko
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Taras_Kolesko
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Why are you calling the destructor of your sim variable ?

          And aren't you detaching the markers twice ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved