Results 1 to 3 of 3

Thread: Getting width and height of plot in pixels?

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

    Default Getting width and height of plot in pixels?

    How can I get information about width and height of actual plot? NOT including scales, only real drawing region. I want to know how many values in X and Y axis it actually stores or rather can store (which would be size in pixels of plot widget in each direction). Is size of canvas in QRect size I am looking for?

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

    Default Re: Getting width and height of plot in pixels?

    Qt Code:
    1. ... = plot->canvas()->contentsRect().size();
    To copy to clipboard, switch view to plain text mode 
    When being inside the render cycle and you are overloading a method having a parameter canvasRect, you can take its size as well.

    Uwe

  3. #3
    Join Date
    Sep 2015
    Posts
    36
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Getting width and height of plot in pixels?

    Thanks for replying. I assume, that it's EXACT number of samples that will be displayed? I want to manually create function picking samples to display using multiple threads. Currently I overrided resizeEvent from QwtPlot and I want to do basic (I mean changing size of window itself) selection there.

Similar Threads

  1. how to get image height and width in qt
    By iswaryasenthilkumar in forum Newbie
    Replies: 1
    Last Post: 31st March 2015, 07:52
  2. Replies: 9
    Last Post: 13th June 2012, 16:42
  3. Setting pen width in mm/inches instead of in pixels
    By mangeshj in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2011, 07:41
  4. get exact height of a QString in pixels
    By zack in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2010, 14:16
  5. width and height of QTabWidget
    By chikkireddi in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 14:53

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.