Skip to content

Commit

Permalink
Add activeDecorations to iface object
Browse files Browse the repository at this point in the history
Allow plugins and scripts to export animations with decorations
  • Loading branch information
keigoi authored and nyalldawson committed Jul 23, 2021
1 parent 09297ed commit 811a035
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/gui/auto_generated/qgisinterface.sip.in
Expand Up @@ -120,6 +120,11 @@ Returns a pointer to the active layer (layer selected in the legend)
virtual QgsMapCanvas *mapCanvas() = 0;
%Docstring
Returns a pointer to the map canvas
%End

virtual QList<QgsMapDecoration *> activeDecorations() = 0;
%Docstring
Returns a list of the active decorations
%End

virtual QgsLayerTreeMapCanvasBridge *layerTreeCanvasBridge() = 0;
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgisappinterface.cpp
Expand Up @@ -902,3 +902,8 @@ void QgisAppInterface::setGpsPanelConnection( QgsGpsConnection *connection )
{
qgis->setGpsPanelConnection( connection );
}

QList<QgsMapDecoration *> QgisAppInterface::activeDecorations()
{
return qgis->activeDecorations();
}
1 change: 1 addition & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -321,6 +321,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
QgsBrowserGuiModel *browserModel() override;
QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint() override;
void setGpsPanelConnection( QgsGpsConnection *connection ) override;
QList<QgsMapDecoration *> activeDecorations() override;

private slots:

Expand Down
4 changes: 4 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -53,6 +53,7 @@ class QgsMapCanvas;
class QgsMapLayer;
enum class QgsMapLayerType;
class QgsMapLayerConfigWidgetFactory;
class QgsMapDecoration;
class QgsMessageBar;
class QgsPluginManagerInterface;
class QgsRasterLayer;
Expand Down Expand Up @@ -165,6 +166,9 @@ class GUI_EXPORT QgisInterface : public QObject
//! Returns a pointer to the map canvas
virtual QgsMapCanvas *mapCanvas() = 0;

//! Returns a list of the active decorations
virtual QList<QgsMapDecoration *> activeDecorations() = 0;

/**
* Returns a pointer to the layer tree canvas bridge
*
Expand Down

0 comments on commit 811a035

Please sign in to comment.