Results 1 to 4 of 4

Thread: Plot does not refresh

  1. #1
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Plot does not refresh

    Hi everyone !

    I'm developing an app which plots data using Qwt (5.2.0) and Qt 4.5.3.

    My data is contained in two "vector<vector<double> >" matrixes.

    I have a QMainWindow, with QSubWindows containing each a QwtPlot and some QComboBoxes to set the combination of line/column to plot (fixed line or fixed column etc).

    The matrixes are in a class which is only instanciated once.
    So I have created a class, which inherits QwtData and uses the data in the matrixes for the output of "double x(size_t i)" and "double y(size_t i)". Now if I change a parameter in my data class, I want the plot to redraw/refresh.

    I tried "QwtPlot::replot()", "QwtPlotItem::itemChanged()" but it doesn't work.

    Thanks in advance,
    M.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Plot does not refresh

    Depends on the implementation of YourData::copy. If it is implemented as deep copy you have to call curve->setData() after each value change. Otherwise QwtPlot::replot should do what you want. ( QwtPlotItem::itemChanged() has only an effect, for auto-replotting ).

    Uwe

  3. #3
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plot does not refresh

    Hi Uwe,

    Thank you for your reply.

    My implementation of QwtData::copy is indeed a deep copy.
    Even after resetting the Data (QwtPlotCurve::setData), replotting (QwtPlot::replot), detaching and reattaching the QwtPlotCurve, nothing changes, the plot remains the same (the state of my data class is taken account of the first time, but then changing it doesn't yield the replot).

    I'll try coding something quickly to show you,

    Thanks,
    M.

  4. #4
    Join Date
    Oct 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plot does not refresh

    Hi again,

    Ok check the attachment out.

    It should double both scales at each button press.

    If i understand why this small code doesn't work, i think i understand why my code doesn't work.

    Thanks again,
    M.
    Attached Files Attached Files

Similar Threads

  1. Put plot axis out of the plot
    By KosyakOFF in forum Qwt
    Replies: 7
    Last Post: 21st June 2013, 13:36
  2. Embedding Qwt plot High Resolution
    By giusepped in forum Qwt
    Replies: 7
    Last Post: 21st April 2009, 09:44
  3. Spectrogram Plot Hints
    By shargath in forum Qwt
    Replies: 2
    Last Post: 25th February 2009, 11:11
  4. Replies: 7
    Last Post: 22nd September 2008, 22:05
  5. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 13:43

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.