Commit 22ebc746 authored by Don Gagne's avatar Don Gagne

QImage creations fails causing QPainter to fail

Need to check for QImage failure otherwise it will through a qWarning.
parent 5221c66e
......@@ -133,13 +133,15 @@ namespace mapcontrol
temp=QImage(size,
QImage::Format_ARGB32_Premultiplied);
temp.fill(0);
QPainter imagePainter(&temp);
imagePainter.translate(-boundingRect().topLeft());
imagePainter.scale(2*zoomdiff,2*zoomdiff);
paintImage(&imagePainter);
imagePainter.end();
lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff);
lastimage=temp;
if (!temp.isNull()) {
QPainter imagePainter(&temp);
imagePainter.translate(-boundingRect().topLeft());
imagePainter.scale(2*zoomdiff,2*zoomdiff);
paintImage(&imagePainter);
imagePainter.end();
lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff);
lastimage=temp;
}
}
void MapGraphicItem::paintImage(QPainter *painter)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment