Results 1 to 2 of 2

Thread: Qwt setSamples() throws runtime error

  1. #1
    Join Date
    May 2021
    Posts
    4
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Question Qwt setSamples() throws runtime error

    Hi, I ran into a runtime error while calling setSamples function from my app.
    Its like this -

    Qt Code:
    1. m_scatter.curves[0].setSamples(&m_scatter.vx[0],&m_scatter.vy[0][0],NumIndicatorsFound);
    To copy to clipboard, switch view to plain text mode 

    where m_scatter is like this -

    Qt Code:
    1. PlotInfo m_scatter; //private variable
    To copy to clipboard, switch view to plain text mode 

    And PlotInfo is defined as -

    Qt Code:
    1. struct PlotInfo {
    2. QwtPlot plot;
    3. QwtPlotCurve curves[4];
    4. QwtPlotMarker highlightMarker[4];
    5. std::vector<double> vx;
    6. std::vector<double> vy[4];
    7. std::vector<int> mIndexToEllipse;
    8. };
    To copy to clipboard, switch view to plain text mode 

    The runtime error is pointing to line 1508 in <vector>. BTW my platform is Qt 5.15, Kit is MSVC2019, Qwt lib v6.2.

    Any help is appreciated.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt setSamples() throws runtime error

    Have you actually initialized curves, vx, and vy to contain anything? You haven't shown enough of your code to give any idea what you might be doing wrong.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. component->loadUrl throws error
    By ChriD in forum Qt Quick
    Replies: 4
    Last Post: 1st February 2016, 14:02
  2. Qt 5 QSystemTrayIcon throws error message on Mac OS X
    By janusz in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2013, 15:55
  3. Replies: 3
    Last Post: 5th May 2012, 06:03
  4. Replies: 7
    Last Post: 3rd December 2010, 06:02
  5. Replies: 1
    Last Post: 25th September 2010, 09:20

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.