Results 1 to 20 of 23

Thread: Canvas problems

Threaded 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 Canvas problems

    Hi,

    I'm having problems with an application that uses the QCanvasView. My canvas items get distorted if another window covers them and then SLOWLY uncovers the items. This is especially pronounced when the view is zoomed. I created a minimal application that exhibits the problem (I'm using PyQt but you should be able to reproduce it with C++). I have also attached a screen shot of what I get when I move another window across my application. I have a feeling this is related to rounding errors of the world matrix transformation. Although I occasionally see these kind of problem when there is no transformation matrix involved.
    Maybe this has been fixed in a later version. I'm using Qt 3.3.1 on a Windows XP box.
    Please let me know if you can't reproduce this effect with a newer version.

    Thanks,
    Thomas

    Qt Code:
    1. import sys
    2. import qt
    3. import qtcanvas
    4.  
    5. class TMainWindow(qtcanvas.QCanvasView):
    6. def __init__(self, *args):
    7. qtcanvas.QCanvasView.__init__(self, *args)
    8.  
    9. oMatrix = qt.QWMatrix()
    10. oMatrix.scale(2, 2)
    11. self.setWorldMatrix(oMatrix)
    12. oRect = qtcanvas.QCanvasRectangle(20, 50, 100, 100, self.canvas())
    13. oRect.setBrush(qt.QBrush(qt.QColor('red')))
    14. oRect.show()
    15.  
    16. def closeEvent(self, e):
    17. oApp.quit()
    18.  
    19. oApp = qt.QApplication(sys.argv)
    20. canvas = qtcanvas.QCanvas(2000, 2000)
    21. oMainWindow = TMainWindow(canvas, None, 'Main Window')
    22. oMainWindow.show()
    23. oApp.exec_loop()
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.