Results 1 to 6 of 6

Thread: Incorrect drawing of non cosmetic line

  1. #1
    Join Date
    Jan 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Incorrect drawing of non cosmetic line

    Before I used Qt 4.4.1 and used non cosmetic lines (QGraphicsLineItem) with a width of ~0.1. When zooming in the lines got bigger (scaled) and this is exactly what I want.

    I am testing Qt 4.5.2 now and notice that this functionality is no more. Now a line width of 0.5 and higher is a non cosmetic line, if I set the line width to 0.4 the line doesn't get scaled (and so doesn't get bigger). I suspect some rounding (0.4 -> 0 (and 0 is cosmetic line), 0.5 -> 1 (which is a non cosmetic line))

    Anyone of you have the same experience? Solutions?

  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: Incorrect drawing of non cosmetic line

    Can you provide a minimal compilable example reproducing the problem?
    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. #3
    Join Date
    Jan 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Incorrect drawing of non cosmetic line

    I can, it is attatched to this message (tar.gz).

    This testapplication uses a QGraphicsScene and QGraphicsView with three QGraphicsLineItems (red, green, blue color).

    - The red line has a pen with width 0 and is working ok (the line stays 1 pixel when zooming in with the scrollwheel).
    - The blue line has a pen with width 1 and is working ok (it gets larger when zooming in).
    - The line with width 0.4 is not working ok. In Qt4.4.1 & Qt4.4.3 it is working ok (gets larger when zooming in) (both for QWidget and QGLWidget as viewport in QGraphicsView). In Qt4.5.0 it is still working for QWidget as viewport (line gets larger), but it doesn't work on a QGLWidget as viewport (line stays 1 pixel, the same as the red line).


    Is looks that it is something with a QGLWidget as viewport in QGraphicsView, it think you see the same as I described above?

    Thanks for looking at this
    Attached Files Attached Files

  4. #4
    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: Incorrect drawing of non cosmetic line

    It could indeed be a bug. But I can understand it could also be a feature. The docs say that a pen of width 0 is cosmetic. 0.4 is closer to 0 than to 1, maybe that is intended. But I'd report it anyway.
    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.


  5. #5
    Join Date
    Jan 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Incorrect drawing of non cosmetic line

    Quote Originally Posted by wysota View Post
    It could indeed be a bug. But I can understand it could also be a feature. The docs say that a pen of width 0 is cosmetic. 0.4 is closer to 0 than to 1, maybe that is intended. But I'd report it anyway.
    Could be, but why:
    - did it work in previous versions?
    - can I set a qreal (float) as linewidth if it is rounded? If it was a int I could understand of course, but not with a float.

    I will report it, thanks for you're time.

  6. #6
    Join Date
    Jan 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Incorrect drawing of non cosmetic line

    Yesterday I already contacted Qt and sended the testapplication which I also placed above. I just received a email telling that the bug is fixed, so I will see next qt release and test it.

Similar Threads

  1. Why is my application's CPU usage always > 50%
    By richardander in forum Qt Programming
    Replies: 10
    Last Post: 14th October 2010, 22:22
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.