Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, March 2002
QCanvas/QCanvasView


Message 1 in thread

Hi.

(1)
I'm having trouble adding QCanvasView to a layout. I can add buttons
etc. but QCanvasView doesnt display. When I call the QCanvasView's show()
method it displays itself in a seperate frame and works 100% ... why does
this happen ? The same happens when I set it as center widget in a mainwindow.

I made my own class, using QCanvasView.

Does it have something to do with QCanvasView being a child of a QFrame ?
Do I need to tell a widget that inherits from a QFrame to stay in the 
layout ? QTextEdit inherits from QFrame but stays in the layout ... ?

The examples work. I'm sure it's something stupid :P 
What am I doing wrong here ?

(2)
One can set the zooming with QCanvasView. My problem is this gets very, 
very slow, especialy when scrolling. I'm sure I could get my project to work 
faster if I can plot to screen coordinates. How would I draw a pixmap in the 
top left corner, always at the same size. Kinda lika a overlay, that looks 
the same, independent of the world matrix (scale/etc.)

(3)

Do you have any tips on making QCanvasView faster ... more specificaly,
a QCanvasSprite object that I use as a background map (GeoGraphical).
When I zoom in by a factor of 5 (or whatever) the scrolling gets really 
slow ... Does QCanvasView (QCanvasSprite) scale on the fly or does it create
a temp bitmap it blits from .... mmmmmm .... The only reason why i'm using 
QCanvas is because I need the nice coordinate system with 'clickable' items 
etc ...

am I making sense ? I really need it a bit faster ... any idees ?
HELP ! ;-)

Thanks.
Reyn Vlietstra.