ext Pierce Krouse skrev:
>
> My implementation of paintEvent is meant to put a background image on 
> my frame:
>
> *protected* *void* paintEvent(QPaintEvent pe){
>
>       QPainter myPainter = *new* QPainter(*this*);
>
>       // QRect rect = pe.rect(); // do not use -- stretches image
>
>       // paint in the logo as a background image
>
>       myPainter.drawPixmap(0, 0, *new* QPixmap("classpath:icons/MC 
> Logo 3 Short.png"));
>
>       myPainter = *null*;
>
>       *this*.paintEvent(pe);
>
>     }
>

You are calling the paintEvent() method recursively here. You probably want:

    super.paintEvent(pe);

Also, remember to call end() on your painter when you are done with it. 
"myPainter = null" only removes the reference to the painter, it does 
not delete it, so the painter won't be closed automatically until later 
on, when the garbage collector kicks in.

-- Eskil
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to