Results 1 to 2 of 2

Thread: Auto scale of QwtPoltItem.

  1. #1
    Join Date
    Jun 2012
    Posts
    173
    Thanks
    48
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Auto scale of QwtPoltItem.

    I'm sub classing QwtPlotItem, and when i attached it to the plot, im trying to auto scale myPlotItem and the Y and X-Axis

    so the the item that i attached will be in the visible area of the plot and I don't need to zoom out and pan around to find it.

    so I'm doing :

    Qt Code:
    1. myItem->setItemAttribute(QwtPlotItem::AutoScale,true);
    2. myPlot->setAxisAutoScale(QwtPlot::xBottom);
    3. myPlot->setAxisAutoScale(QwtPlot::yLeft);
    To copy to clipboard, switch view to plain text mode 

    but its still not working and still need to zoom out to find my item.

    what else i need to do to achieve this ??

    Thanks

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

    Default Re: Auto scale of QwtPoltItem.

    You have to return a valid bounding rectangle ( see QwtPlotItem::boundingRect() ).

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    jesse_mark (24th June 2013)

Similar Threads

  1. qwt log scale Y and linear scale X
    By Annihilator in forum Qwt
    Replies: 1
    Last Post: 31st December 2012, 10:01
  2. Axis Auto Scale
    By gkarthick5 in forum Qwt
    Replies: 3
    Last Post: 13th July 2011, 13:57
  3. Auto scale a QGraphicsView
    By niluje in forum Qt Programming
    Replies: 4
    Last Post: 5th July 2011, 23:43
  4. QwtPlot: how to auto-scale two Y scales?
    By paradiza in forum Qwt
    Replies: 4
    Last Post: 24th March 2009, 01:28
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 01:12

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.