Skip to content
Permalink
Browse files

Added API to use layer style overrides also in map canvas

... so that map canvas does not always use just the active layer style
  • Loading branch information
wonder-sk committed Jul 7, 2015
1 parent 12a81d9 commit 099faec5970ae056826c8588e13b694042b5ea81
Showing with 38 additions and 0 deletions.
  1. +12 −0 python/gui/qgsmapcanvas.sip
  2. +14 −0 src/gui/qgsmapcanvas.cpp
  3. +12 −0 src/gui/qgsmapcanvas.h
@@ -234,6 +234,14 @@ class QgsMapCanvas : QGraphicsView

QGis::UnitType mapUnits() const;

//! Getter for stored overrides of styles for layers.
//! @note added in 2.12
QMap<QString, QString> layerStyleOverrides() const;

//! Setter for stored overrides of styles for layers.
//! @note added in 2.12
void setLayerStyleOverrides( const QMap<QString, QString>& overrides );

//! Get the current coordinate transform
const QgsMapToPixel* getCoordinateTransform();

@@ -465,6 +473,10 @@ class QgsMapCanvas : QGraphicsView
//! @note added in 2.8
void currentLayerChanged( QgsMapLayer* layer );

//! Emitted when the configuration of overridden layer styles changes
//! @note added in 2.12
void layerStyleOverridesChanged();

protected:
//! Overridden standard event to be gestures aware
bool event( QEvent * e );
@@ -1642,6 +1642,20 @@ QGis::UnitType QgsMapCanvas::mapUnits() const
return mapSettings().mapUnits();
}

QMap<QString, QString> QgsMapCanvas::layerStyleOverrides() const
{
return mSettings.layerStyleOverrides();
}

void QgsMapCanvas::setLayerStyleOverrides( const QMap<QString, QString>& overrides )
{
if ( overrides == mSettings.layerStyleOverrides() )
return;

mSettings.setLayerStyleOverrides( overrides );
emit layerStyleOverridesChanged();
}


void QgsMapCanvas::setRenderFlag( bool theFlag )
{
@@ -304,6 +304,14 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView

QGis::UnitType mapUnits() const;

//! Getter for stored overrides of styles for layers.
//! @note added in 2.12
QMap<QString, QString> layerStyleOverrides() const;

//! Setter for stored overrides of styles for layers.
//! @note added in 2.12
void setLayerStyleOverrides( const QMap<QString, QString>& overrides );

//! Get the current coordinate transform
const QgsMapToPixel* getCoordinateTransform();

@@ -546,6 +554,10 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! @note added in 2.8
void currentLayerChanged( QgsMapLayer* layer );

//! Emitted when the configuration of overridden layer styles changes
//! @note added in 2.12
void layerStyleOverridesChanged();

protected:
#ifdef HAVE_TOUCH
//! Overridden standard event to be gestures aware

0 comments on commit 099faec

Please sign in to comment.
You can’t perform that action at this time.