Skip to content

Commit 8f4169f

Browse files
author
timlinux
committed
Added accessor for canvas bg colour
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7876 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b0b6689 commit 8f4169f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/gui/qgsmapcanvas.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,10 @@ void QgsMapCanvas::setCanvasColor(const QColor & theColor)
941941
mScene->setBackgroundBrush(bgBrush);
942942
} // setbgColor
943943

944+
QColor QgsMapCanvas::canvasColor() const
945+
{
946+
return mScene->backgroundBrush().color();
947+
}
944948

945949
int QgsMapCanvas::layerCount() const
946950
{

src/gui/qgsmapcanvas.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
160160

161161
/** Write property of QColor bgColor. */
162162
virtual void setCanvasColor(const QColor & _newVal);
163+
/** Read property of QColor bgColor. */
164+
virtual QColor canvasColor() const;
163165

164166
/** Emits signal scalChanged to update scale in main window */
165167
void updateScale();

0 commit comments

Comments
 (0)