Skip to content

Commit

Permalink
Add QgsMapLayer::flagsChanged() signal
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Sep 11, 2018
1 parent 9d22389 commit 602b3e9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/core/auto_generated/qgsmaplayer.sip.in
Expand Up @@ -1378,6 +1378,17 @@ Emitted when the layer's metadata is changed.
.. seealso:: :py:func:`metadata`

.. versionadded:: 3.0
%End

void flagsChanged();
%Docstring
Emitted when layer's flags have been modified.

.. seealso:: :py:func:`setFlags`

.. seealso:: :py:func:`flags`

.. versionadded:: 3.4
%End

protected:
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsmaplayer.cpp
Expand Up @@ -151,7 +151,11 @@ QgsMapLayer::LayerFlags QgsMapLayer::flags() const

void QgsMapLayer::setFlags( QgsMapLayer::LayerFlags flags )
{
if ( flags == mFlags )
return;

mFlags = flags;
emit flagsChanged();
}

QString QgsMapLayer::id() const
Expand Down
8 changes: 8 additions & 0 deletions src/core/qgsmaplayer.h
Expand Up @@ -1200,6 +1200,14 @@ class CORE_EXPORT QgsMapLayer : public QObject
*/
void metadataChanged();

/**
* Emitted when layer's flags have been modified.
* \see setFlags()
* \see flags()
* \since QGIS 3.4
*/
void flagsChanged();

private slots:

void onNotifiedTriggerRepaint( const QString &message );
Expand Down

0 comments on commit 602b3e9

Please sign in to comment.