Results 1 to 3 of 3

Thread: QwtPlot->axisScaleDiv does not update after detaching curve

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2015
    Posts
    36
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QwtPlot->axisScaleDiv does not update after detaching curve

    So, my code is like this there:

    Qt Code:
    1. qDebug()<< "Lower bound before detach: " << this->axisScaleDiv(0).lowerBound() << " Upper bound before detach: " << this->axisScaleDiv(0).upperBound();
    2.  
    3. curves[signalID]->detach();
    4.  
    5. this->updateAxes();
    6.  
    7. qDebug()<< "Lower bound after detach: " << this->axisScaleDiv(0).lowerBound() << " Upper bound after detach: " << this->axisScaleDiv(0).upperBound();
    To copy to clipboard, switch view to plain text mode 

    Lower bound before detach: -50 Upper bound before detach: 300
    Lower bound after detach: -50 Upper bound after detach: 300

    curves is a vector of plot curve pointers, as I can have very large number of these.

    And here is algorithm causing that bug:

    1. I use my own zoomer class inheriting QwtPlotZoomer, but there is nothing else than overriding mouse event, which actually does nothing at all (pushes event to default).
    2. I order my plot to show me two curves like this:
    plots.jpg
    3. I use zoomer to zoom plot (zoomer is supposed to update it's zoomBase from lower and upper bounds of QwtPlot->axisScaleDiv every time new curve is added and axes are updated, and it does that).
    4. I click RMB to get back to previous state.
    5. Now I want to hide one of the curves again so I click my checkbox meaning, that I want this curve to detach. And it detaches, but scale is not recalculated:

    Plot2.jpg

    I thought at first, that zoomer is causing it with having old zoomerBase. But even if I set base manually to 0,0,1,1 before detaching nothing changes. Base has no meaning at all because I don't click RMB on plot.

    Bug(?) does not appear when I don't use zoomer (it rescales correctly). I can attach and detach any curve and left scale will always rescale itself. If I attach new curve to current plot after going back to zoomBase - it will still recalculate scales (if scale of new curve is bigger than others). It appears ONLY when I detach curve after returning to zoom base. If I click any checkbox again after "bug" appears program will start to behave like zoomer was never used until I do everything above again.

    Also if I detach curve while zoomed - return to base works incorrectly (I have to manually return to base before detaching, scale is still wrong, but at least visible as it should be)
    Last edited by Khaine; 30th March 2016 at 18:45.

Similar Threads

  1. qwtplot curve orientation problem
    By tangtao_xp in forum Qwt
    Replies: 2
    Last Post: 27th April 2013, 15:27
  2. Qwtplot curve not shown
    By claudiacrb in forum Qwt
    Replies: 1
    Last Post: 9th June 2012, 08:56
  3. how to create a curve in qwtplot?
    By ethanfeng in forum Qwt
    Replies: 1
    Last Post: 27th March 2011, 09:05
  4. Replies: 1
    Last Post: 13th March 2010, 08:55
  5. Replies: 1
    Last Post: 9th December 2009, 17:14

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.