QCanvas not showing pixmaps

Eric Klumpp klumpp at nerim.fr
Fri Jun 21 11:36:12 BST 2002


Hello !

If you put an item in the canvas, does it appear, for example a 
QCanvasText ?
My first problem with canvas was to see something, and the problem was 
that the default size of the canvas seems to be zero. Using the method 
"resize" of canvas should resolve your problem. You can put items 
outside of the canvas but they won't be shown. Personnaly I use "resize" 
each time I move an item outside of the canvas.

You must also show the QCanvasView, update the canvas each time you 
modify something, and probably other things. But first try to see a 
QCanvasText ! I haven't used a background pixmap but a background color, 
but it shouldn't be a problem !

Eric


Janito Vaqueiro Ferreira Filho wrote:

>Hello!
>	I'm trying to make a MDI app with a canvas. I put the QCanvasView in the 
>View and a QCanvas in the Doc. When I try to setBackgoundPixmap(buffer) it 
>doesn't work. Please help me. Here's the code used:
>
>QString sBuf3 = dir + filename;
>QRect changedRect;
>QPixmap buffer;
>
>if(QFile::exists(sBuf3))
>{
>	buffer.load(sBuf3, "PNG", 0);
>	canvas->setBackgroundPixmap(buffer);
>	changedRect.setSize(canvas->size());
>	canvas->setChanged(changedRect);
>	canvas->update();
>}
>
>Please help me fix this problem. ThanQ,
>
>		JVFF
>
>-
>to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
>unsubscribe »your-email-address«
>
>



-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list