[Qt-interest] Redrawing to-from QPixmap

Natan Abolafya natanabolafya at gmail.com
Tue Sep 8 10:17:19 CEST 2009


Hi there,

I'm creating a widget that draws maps from files.So there are lots of
colorful polygons,lines,texts and images on the widget.
Now,what I do is drawing these objects on a QPixmap which is a big loop of
actions.Then update the widget,from the paintEvent I draw this pixmap.

The first time I do this,it works perfectly - although needs some tweaking
-,but whenever I want to redraw the(or another) map onto this widget(let's
say via a key event),thus pixmap first then widget, it doesn't work.

Before drawing a new map I delete the old pixmap( :
//pixMap is a member variable(pointer) of the QWidget
if(pixMap!=NULL)

{

delete pixMap;

pixMap = NULL;

}

pixMap = new QPixmap(size());

pixMap->fill();


then I call the drawing functions, and finally update, which is what I do
for the first time as well. The program does delete the map,and leaves me
with a blank screen.

I'm looking for a stupid mistake for a while yet I have no luck. What might
it be I'm missing?


Thanks.


Qt 4.5.2 on Windows XP platform.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090908/462cee5f/attachment.html 


More information about the Qt-interest-old mailing list