diff --git a/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in b/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in index 9712fdaf7dc..4280e10733e 100644 --- a/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in +++ b/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in @@ -62,6 +62,35 @@ Returns the designer's message bar. Selects the specified ``items``. %End + virtual void setAtlasPreviewEnabled( bool enabled ) = 0; +%Docstring +Toggles whether the atlas preview mode should be ``enabled`` in the designer. + +.. seealso:: :py:func:`atlasPreviewModeEnabled` + +.. versionadded:: 3.4 +%End + + virtual bool atlasPreviewEnabled() const = 0; +%Docstring +Returns whether the atlas preview mode is enabled in the designer. + +.. seealso:: :py:func:`setAtlasPreviewEnabled` + +.. versionadded:: 3.4 +%End + + virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0; +%Docstring +Shows the configuration widget for the specified layout ``item``. + +If ``bringPanelToFront`` is true, then the item properties panel will be automatically +shown and raised to the top of the interface. + +.. versionadded:: 3.4 +%End + + public slots: virtual void close() = 0; diff --git a/src/app/layout/qgslayoutdesignerdialog.cpp b/src/app/layout/qgslayoutdesignerdialog.cpp index ccdd89f51fb..350291264fb 100644 --- a/src/app/layout/qgslayoutdesignerdialog.cpp +++ b/src/app/layout/qgslayoutdesignerdialog.cpp @@ -127,6 +127,21 @@ void QgsAppLayoutDesignerInterface::selectItems( const QList &i mDesigner->selectItems( items ); } +void QgsAppLayoutDesignerInterface::setAtlasPreviewEnabled( bool enabled ) +{ + mDesigner->setAtlasPreviewEnabled( enabled ); +} + +bool QgsAppLayoutDesignerInterface::atlasPreviewEnabled() const +{ + return mDesigner->atlasPreviewEnabled(); +} + +void QgsAppLayoutDesignerInterface::showItemOptions( QgsLayoutItem *item, bool bringPanelToFront ) +{ + mDesigner->showItemOptions( item, bringPanelToFront ); +} + void QgsAppLayoutDesignerInterface::close() { mDesigner->close(); @@ -4315,6 +4330,17 @@ QgsMessageBar *QgsLayoutDesignerDialog::messageBar() return mMessageBar; } +void QgsLayoutDesignerDialog::setAtlasPreviewEnabled( bool enabled ) +{ + whileBlocking( mActionAtlasPreview )->setChecked( enabled ); + atlasPreviewTriggered( enabled ); +} + +bool QgsLayoutDesignerDialog::atlasPreviewEnabled() const +{ + return mActionAtlasPreview->isChecked(); +} + void QgsLayoutDesignerDialog::setAtlasFeature( QgsMapLayer *layer, const QgsFeature &feat ) { QgsLayoutAtlas *layoutAtlas = atlas(); diff --git a/src/app/layout/qgslayoutdesignerdialog.h b/src/app/layout/qgslayoutdesignerdialog.h index 787912a9f97..34fb94c73ae 100644 --- a/src/app/layout/qgslayoutdesignerdialog.h +++ b/src/app/layout/qgslayoutdesignerdialog.h @@ -60,7 +60,9 @@ class QgsAppLayoutDesignerInterface : public QgsLayoutDesignerInterface QgsLayoutView *view() override; QgsMessageBar *messageBar() override; void selectItems( const QList< QgsLayoutItem * > &items ) override; - + void setAtlasPreviewEnabled( bool enabled ) override; + bool atlasPreviewEnabled() const override; + void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) override; public slots: void close() override; @@ -139,6 +141,21 @@ class QgsLayoutDesignerDialog: public QMainWindow, private Ui::QgsLayoutDesigner */ QgsMessageBar *messageBar(); + + /** + * Toggles whether the atlas preview mode should be \a enabled in the designer. + * + * \see atlasPreviewModeEnabled() + */ + void setAtlasPreviewEnabled( bool enabled ); + + /** + * Returns whether the atlas preview mode is enabled in the designer. + * + * \see setAtlasPreviewEnabled() + */ + bool atlasPreviewEnabled() const; + /** * Sets the specified feature as the current atlas feature */ diff --git a/src/gui/layout/qgslayoutdesignerinterface.h b/src/gui/layout/qgslayoutdesignerinterface.h index 93817b7eb48..1cb9280adb4 100644 --- a/src/gui/layout/qgslayoutdesignerinterface.h +++ b/src/gui/layout/qgslayoutdesignerinterface.h @@ -78,6 +78,33 @@ class GUI_EXPORT QgsLayoutDesignerInterface: public QObject */ virtual void selectItems( const QList< QgsLayoutItem * > &items ) = 0; + /** + * Toggles whether the atlas preview mode should be \a enabled in the designer. + * + * \see atlasPreviewModeEnabled() + * \since QGIS 3.4 + */ + virtual void setAtlasPreviewEnabled( bool enabled ) = 0; + + /** + * Returns whether the atlas preview mode is enabled in the designer. + * + * \see setAtlasPreviewEnabled() + * \since QGIS 3.4 + */ + virtual bool atlasPreviewEnabled() const = 0; + + /** + * Shows the configuration widget for the specified layout \a item. + * + * If \a bringPanelToFront is true, then the item properties panel will be automatically + * shown and raised to the top of the interface. + * + * \since QGIS 3.4 + */ + virtual void showItemOptions( QgsLayoutItem *item, bool bringPanelToFront = true ) = 0; + + public slots: /**