Results 1 to 2 of 2

Thread: How can we scale the pen's width

  1. #1
    Join Date
    Sep 2008
    Posts
    93
    Thanks
    6
    Thanked 1 Time in 1 Post

    Default How can we scale the pen's width

    I draw a line with the default pen in QGraphicsScene with the function
    QGraphicsScene::addLine ( const QLineF & line, const QPen & pen = QPen() );

    but when I scale this with the function: QGraphicsView::scale().
    The line's length can be scale very well, but the width of the line always keeps the same.
    Are there some solutions to do it?

    Thanks!

  2. #2
    Join Date
    May 2008
    Posts
    155
    Thanked 15 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How can we scale the pen's width

    Quote Originally Posted by learning_qt View Post
    I draw a line with the default pen in QGraphicsScene with the function
    QGraphicsScene::addLine ( const QLineF & line, const QPen & pen = QPen() );

    but when I scale this with the function: QGraphicsView::scale().
    The line's length can be scale very well, but the width of the line always keeps the same.
    Are there some solutions to do it?
    Have you seen http://doc.trolltech.com/4.4/qpen.html#setWidth ?

    Especially: Has your pen a width of 0 (i.e. is it a "cosmetic" pen) or 1?

Similar Threads

  1. Y-Axis Scale Spacing - Newbie Question
    By Rick108 in forum Qwt
    Replies: 3
    Last Post: 13th October 2009, 08:20
  2. Replies: 13
    Last Post: 12th June 2008, 13:23
  3. How to obtain the width of a QTableWidget?
    By Giel Peters in forum Qt Programming
    Replies: 3
    Last Post: 9th January 2006, 22:34

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.