Results 1 to 20 of 23

Thread: Canvas problems

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Canvas problems

    Thanks for the quick answers.

    The problem is not the zooming, it just exacerbates the problem, so I put it in the little sample program.

    The problem is not the bounding rectangle either, I stripped it down to the code listed in my initial post which uses a QCanvasRectangle with no subclassing whatsoever. The effects I see are not typical for an improperly set bounding rect either. It seems to be related to some kind of rounding or update error in the canvas view. It might be fixed in the current 3.3.6 version. If you can run the sample program and your application does not show these distortions most likely this has been fixed. I'm wondering if I should upgrade (which I probably won't if the bug still persists in 3.3.6).

    Cheers,
    Tommy

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

    Default Re: Canvas problems

    But are those red lines the distorsions of the square? The square has black outline and the distorsions are red...
    Last edited by wysota; 8th May 2006 at 17:09.

  3. #3
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Canvas problems

    Probably, I played around with different versions so I get the biggest impact, one of them was with a red pen so the outline of the rect was red as well. I must have used that screenshot. In general it doesn't matter what shape or color you use this happens with all canvas items I have seen so far. There is a sample canvas app which has the same effect. Now maybe if it doesn't happen on your system and you run a newer version of Qt than 3.3.1 it might have been fixed in the mean time (I hope so).

    Tommy

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

    Default Re: Canvas problems

    I translated your app to C++ (see attachment). It doesn't show the artifacts you describe. If you resize the window, it shows some garbage, but not connected with the rectangle (see other attachment).
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Join Date
    Jan 2006
    Location
    Bend, Oregon
    Posts
    27
    Qt products
    Qt3
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Canvas problems

    Your C++ implementation looks like what I would have done. If you take another top level window and draw it "slowly" over the rectangle you don't see any distortions? Which version of Qt are you running? Maybe it is time for an upgrade. Thanks for your testing, that is really very helpful.

    Cheers,
    Thomas

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

    Default Re: Canvas problems

    Quote Originally Posted by Tommytrojan
    If you take another top level window and draw it "slowly" over the rectangle you don't see any distortions?
    I do, but not connected with the rectangle (see attachment).

    Which version of Qt are you running?
    3.3.5
    Attached Images Attached Images

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Canvas problems

    Either I'm too fast or everything is OK on my system (PLD Linux, Qt 3.3.6, PyQt 3.15.1).

Similar Threads

  1. problems creating toolbar...(do see the attachment)!
    By sumit in forum Qt Programming
    Replies: 15
    Last Post: 10th September 2008, 11:23
  2. flicker and wierd resize problems ...
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 18:00
  3. When is the best time to delete a QCanvasItem
    By irudkin in forum Qt Programming
    Replies: 12
    Last Post: 8th March 2007, 21:28
  4. showMaximized doesnt show the canvas
    By Kapil in forum Qt Programming
    Replies: 5
    Last Post: 23rd May 2006, 12:22
  5. Setting focus on Canvas
    By Kapil in forum Qt Programming
    Replies: 10
    Last Post: 17th May 2006, 12:55

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.