Results 1 to 11 of 11

Thread: widget qgraphicsview scaling

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    16
    Platforms
    Windows
    Thanks
    1

    Default Re: widget qgraphicsview scaling


  2. #2
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 38 Times in 30 Posts

    Default Re: widget qgraphicsview scaling

    You can very easily scale a path, but it's usually wrong; scaling the view is the right thing to do in most cases.

    To scale a path, simply call QMatrix::map(). So, something like:

    Qt Code:
    1. QMatrix matrix;
    2. matrix.scale(2, 1);
    3. QPainterPath scaledPath = matrix.map(originalPath);
    To copy to clipboard, switch view to plain text mode 

    In Qt 4.3, you can also use QTransform.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

Similar Threads

  1. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  2. Pin/Unpin Dock Widget
    By charlesD in forum Newbie
    Replies: 1
    Last Post: 21st June 2006, 06:57
  3. Replies: 4
    Last Post: 24th March 2006, 22:50
  4. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 14:16
  5. advanced split widget
    By vitaly in forum Qt Programming
    Replies: 10
    Last Post: 24th January 2006, 20:00

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.