Results 1 to 2 of 2

Thread: Setting the QGraphicsLineItem tickness.....

  1. #1
    Join Date
    Feb 2008
    Posts
    102
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Setting the QGraphicsLineItem tickness.....

    I try to change the line item tickness but the only option i found was to change the pen's item width.

    when i change the pen width, i see the line length that changes in my scene, but it mantains the same QGraphicsLineItem::length();

    How can i change its tickness without change the pen's width????

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Setting the QGraphicsLineItem tickness.....

    How can i change its tickness without change the pen's width????
    Can you ??

    Well if u mean to keep the original pens width , u can save the painter state and restore after u draw the line with new thickness / pen width.

    like in paint of graphicsitem -

    Qt Code:
    1. painter->save();
    2. painter->setPen(penWithNewThickness);
    3. // draw line
    4. painter->restore();
    To copy to clipboard, switch view to plain text mode 

    Hope this is what u want. Or plz explain little more.

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.