Results 1 to 3 of 3

Thread: Disabling autoscale is not wirking

  1. #1
    Join Date
    Jun 2011
    Posts
    38
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default Disabling autoscale is not wirking

    Hi Everyone,

    in my program I want to be able to disable the autoscale for the y-axis and reenable it later.
    I use a checkbox for this:

    Qt Code:
    1. //std::vector<QwtPlot*> plots_;
    2. void MainWindow::on_freezeScaleBox_toggled(bool on)
    3. {
    4. for(int i = 0; i < plots_.size(); ++i)
    5. {
    6. plots_[i]->setAxisAutoScale(QwtPlot::yLeft, on);
    7. }
    8. }
    To copy to clipboard, switch view to plain text mode 

    When I first disable the autoaxisscale and then add some curves and some data, it is autoscaled anyway...
    Any suggestions?

  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: Disabling autoscale is not wirking

    It doesn't matter when you attach your plot items - the only situation, where the flag is processed is QwtPlot::replot. If you want to exclude plot items individually from autoscaling do

    Qt Code:
    1. item->setItemAttribute( QWtPlot::Item::AutoScale, false );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. #3
    Join Date
    Jun 2011
    Posts
    38
    Thanks
    8
    Thanked 1 Time in 1 Post

    Default Re: Disabling autoscale is not wirking

    Thx for your help.
    The problem was somewhat simpler

    I just had to replace
    "on" with "!on"

    Because otherwise the semantics were wrong.

Similar Threads

  1. Replies: 2
    Last Post: 8th July 2011, 00:06
  2. Autoscale QTableWidget columns on resize
    By genjix in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2011, 21:09
  3. axis autoscale: 2 user case scenarios
    By fatecasino in forum Qwt
    Replies: 1
    Last Post: 19th January 2011, 02:11
  4. autoScale doesn't work
    By Braunstein in forum Qwt
    Replies: 4
    Last Post: 12th November 2010, 18:22
  5. Disabling Mouse in Qt?
    By ashukla in forum Qt Programming
    Replies: 12
    Last Post: 4th December 2007, 18:18

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.