Results 1 to 2 of 2

Thread: Setting pen width in mm/inches instead of in pixels

  1. #1
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Setting pen width in mm/inches instead of in pixels

    I have data in mm/inches and I need to set pen width in mm/inch units and not in terms of pixels. The functions in QPen(setWidth and setWidthF works on pixels). Is there any conversion from mm/inch value to pixel(e.g., when i say 1mm, the line drawn should be 1 pixel wide) or is there any way to set pen width in mm/inch units.

    Thanks,
    Mangesh

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Setting pen width in mm/inches instead of in pixels

    It depends on where you use the painter. If it is on a "paper" for printing, you know the resolution in ppi. Some simple math lead you then to how many pixels are a mm.

Similar Threads

  1. Replies: 9
    Last Post: 13th June 2012, 15:42
  2. Replies: 1
    Last Post: 13th August 2010, 06:28
  3. Setting cell width in QHBoxLayout
    By EricF in forum Qt Programming
    Replies: 5
    Last Post: 13th December 2007, 15:42
  4. By default TreeWidget width setting in DockWidget
    By santosh.kumar in forum Qt Programming
    Replies: 0
    Last Post: 31st May 2007, 05:55
  5. Replies: 11
    Last Post: 21st February 2007, 11:26

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.