Results 1 to 5 of 5

Thread: get coordinates of plottings area

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: get coordinates of plottings area

    HI,..
    How can i get bounding rect of plotting area? I mean how to get x,y,w,h of plotting area ?


    Added after 5 minutes:


    i've found something like canvasRect in qwt source code but i don't know how to get it
    Last edited by alizadeh91; 12th August 2012 at 09:35.

  2. #2
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: get coordinates of plottings area

    What are you trying to do? If you want to translate pixels to the plot scale you can use QwtScaleMap QwtPlot::canvasMap ( int axisId )

  3. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: get coordinates of plottings area

    No i just want width and x coordinates of plotting area


    Added after 58 minutes:


    i've uploaded following snapshot for better underestanding:
    Untitled-1.jpg

    I want to get the x and width which have shown on the above image
    Last edited by alizadeh91; 14th August 2012 at 11:15.

  4. #4
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: get coordinates of plottings area

    I think it's pretty easy!! but i can't find that. no one knows how to do that?????!!!!


    Added after 1 52 minutes:


    I've found that it must be width of canvas. but when i get width of canvas is not actually equal to width of canvas. so i'm guessing that it's because it is in layout so the width is wrong. Plz someone guide me how to get width of plotting area
    Last edited by alizadeh91; 15th August 2012 at 11:22.

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

    Default Re: get coordinates of plottings area

    plot->canvas()->contentsRect() gives you the coordinates in pixel coordinates, by QwtPlot::axisScaleDiv() you have the corresponding plot coordinates.

    Uwe

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

    alizadeh91 (20th August 2012)

Similar Threads

  1. cut image using coordinates
    By druvraj in forum Qt Programming
    Replies: 1
    Last Post: 13th June 2012, 20:23
  2. Scroll bars in scroll area not comming in scroll area
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 06:50
  3. GPS coordinates via SMS
    By radeknati in forum Qt Programming
    Replies: 0
    Last Post: 20th April 2010, 12:56
  4. Replies: 4
    Last Post: 18th March 2010, 10:11
  5. Coordinates in millimeters
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2008, 01:29

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
  •  
Qt is a trademark of The Qt Company.