Results 1 to 3 of 3

Thread: pure virtual Runtime Error in qwt_plot_curve.cpp

  1. #1
    Join Date
    Nov 2010
    Posts
    10
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default pure virtual Runtime Error in qwt_plot_curve.cpp

    Hi guys, I'm using 4.7.0 and qwt 6.0.1 with vs 2008 (note problem also happens on vs 2010 or with qwt 6.0.0). I'm basically drawing a sine graph with my own class that extends qwtplot. Theres a producer class creating the sine data in its own thread and the gui thread renders it at a set replot() rate. After a few arbritrary seconds (not at the same time on each run) vs aborts with:

    R6025 -pure virtual function call

    with the call stack always breaking out at

    double x = xMap.transform( sample.x() );

    in qwt_plot_curve.cpp (line 397)

    I have no idea whats going on. Any ideas?

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: pure virtual Runtime Error in qwt_plot_curve.cpp

    How do you set the data on the curve?
    Is the data you set available during the life of the curve object?

    My guess would be that you're discarding the data while curve want's to access it.
    From documentation:
    Initialize the data by pointing to memory blocks which are not managed by QwtPlotCurve.

    setRawSamples is provided for efficiency. It is important to keep the pointers during the lifetime of the underlying QwtCPointerData class.

  3. #3
    Join Date
    Nov 2010
    Posts
    10
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: pure virtual Runtime Error in qwt_plot_curve.cpp

    I've solved this. The data was not being discarded and was correctly accessed using boost mutexes (the producer thread is a boost thread). I was able to resolve the issue by using the boost thread to trigger qt events rather than running qt code on a boost thread. It appears that in some cases boost threads and qt threads don't play nice together.

Similar Threads

  1. the pure virtual method "abort" in QNetworkReply
    By mavenlin in forum Qt Programming
    Replies: 2
    Last Post: 9th July 2011, 11:01
  2. Replies: 1
    Last Post: 25th September 2010, 09:20
  3. Replies: 16
    Last Post: 13th March 2008, 18:46
  4. Cost of pure virtual
    By ShaChris23 in forum General Programming
    Replies: 4
    Last Post: 4th November 2007, 19:20
  5. inheritance, pure virtual
    By TheKedge in forum General Programming
    Replies: 2
    Last Post: 18th January 2007, 12:20

Tags for this Thread

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.