Results 1 to 2 of 2

Thread: Scale size of QGraphicsItem without scaling pen width

  1. #1
    Join Date
    May 2009
    Posts
    21
    Thanks
    4
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Scale size of QGraphicsItem without scaling pen width

    Hi,

    I've some QGraphicsItem in my QGraphicsScene which should scale by size when calling QGraphicsView::scale() but the pen width should stay the same. Normally when calling QGraphicsView::scale() the pen width gets scaled too.

    For example I've got a circle and I want the diameter to be scaled but not the line width of the pen. Is there a more or less simple way doing so but keeping the normal scaling functionality for the other QGraphicsItem? I'm using Qt 4.5.1.

    Reimplementing QGraphicsItem::scale(...) doesn't work and QGraphicsItem::ItemIgnoresTransformations keeps the diameter and the line width fixed.


    Thank you in advance

    Markus

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Scale size of QGraphicsItem without scaling pen width

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following 3 users say thank you to wysota for this useful post:

    jepessen (3rd February 2023), Jolly (2nd March 2011), Lodorot (4th July 2009)

Similar Threads

  1. Replies: 9
    Last Post: 13th June 2012, 15:42
  2. Replies: 4
    Last Post: 11th July 2010, 09:47
  3. How can we scale the pen's width
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2008, 11:20
  4. Scaling of pen width in QGraphicsView
    By spuds in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2008, 01:47
  5. How to get size (length, width ....) of string or char
    By Krishnacins in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2006, 09:55

Tags for this Thread

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.