Browse Source

QImage creations fails causing QPainter to fail

Need to check for QImage failure otherwise it will through a qWarning.
QGC4.4
Don Gagne 11 years ago
parent
commit
22ebc746f0
  1. 16
      libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp

16
libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp

@ -133,13 +133,15 @@ namespace mapcontrol
temp=QImage(size, temp=QImage(size,
QImage::Format_ARGB32_Premultiplied); QImage::Format_ARGB32_Premultiplied);
temp.fill(0); temp.fill(0);
QPainter imagePainter(&temp); if (!temp.isNull()) {
imagePainter.translate(-boundingRect().topLeft()); QPainter imagePainter(&temp);
imagePainter.scale(2*zoomdiff,2*zoomdiff); imagePainter.translate(-boundingRect().topLeft());
paintImage(&imagePainter); imagePainter.scale(2*zoomdiff,2*zoomdiff);
imagePainter.end(); paintImage(&imagePainter);
lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff); imagePainter.end();
lastimage=temp; lastimagepoint=Point(core->GetrenderOffset().X()*2*zoomdiff,core->GetrenderOffset().Y()*2*zoomdiff);
lastimage=temp;
}
} }
void MapGraphicItem::paintImage(QPainter *painter) void MapGraphicItem::paintImage(QPainter *painter)
{ {

Loading…
Cancel
Save