Skip to content

Commit 7c346d9

Browse files
author
mhugent
committedJan 17, 2008
Fix for bug #904: 'no decorations'
git-svn-id: http://svn.osgeo.org/qgis/trunk@7991 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ea3288f commit 7c346d9

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
 

‎src/gui/qgsmapcanvas.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void QgsMapCanvas::refresh()
368368

369369
// notify any listeners that rendering is complete
370370
QPainter p;
371-
p.begin(&mMap->pixmap());
371+
p.begin(&mMap->paintDevice());
372372
emit renderComplete(&p);
373373
p.end();
374374

‎src/gui/qgsmapcanvasmap.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,15 @@ void QgsMapCanvasMap::render()
100100
}
101101
update();
102102
}
103+
104+
QPaintDevice& QgsMapCanvasMap::paintDevice()
105+
{
106+
if (mUseQImageToRender)
107+
{
108+
return mImage;
109+
}
110+
else
111+
{
112+
return mPixmap;
113+
}
114+
}

‎src/gui/qgsmapcanvasmap.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem
4545

4646
void setPanningOffset(const QPoint& point);
4747

48+
//deprecated. Please use paintDevice() function
49+
//which is also save in case QImage is used
4850
QPixmap& pixmap() { return mPixmap; }
51+
52+
QPaintDevice& paintDevice();
4953

5054
void paint(QPainter* p, const QStyleOptionGraphicsItem*, QWidget*);
5155

0 commit comments

Comments
 (0)
Please sign in to comment.