diff --git a/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in b/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in index 9e494c09f8f..3b226fc9dfa 100644 --- a/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in +++ b/python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in @@ -457,6 +457,16 @@ Toggles whether or not the rulers should be ``visible`` in the designer. .. versionadded:: 3.4 %End + signals: + + void layoutExported(); +%Docstring +Emitted whenever a layout is exported from the layout designer. + +The results of the export can be retrieved by calling :py:func:`~QgsLayoutDesignerInterface.lastExportResults`. + +.. versionadded:: 3.20 +%End }; diff --git a/src/app/layout/qgslayoutdesignerdialog.cpp b/src/app/layout/qgslayoutdesignerdialog.cpp index 63295a661e3..f507d70d674 100644 --- a/src/app/layout/qgslayoutdesignerdialog.cpp +++ b/src/app/layout/qgslayoutdesignerdialog.cpp @@ -113,7 +113,9 @@ bool QgsLayoutDesignerDialog::sInitializedRegistry = false; QgsAppLayoutDesignerInterface::QgsAppLayoutDesignerInterface( QgsLayoutDesignerDialog *dialog ) : QgsLayoutDesignerInterface( dialog ) , mDesigner( dialog ) -{} +{ + connect( mDesigner, &QgsLayoutDesignerDialog::layoutExported, this, &QgsLayoutDesignerInterface::layoutExported ); +} QWidget *QgsAppLayoutDesignerInterface::window() { @@ -4904,6 +4906,8 @@ void QgsLayoutDesignerDialog::storeExportResults( QgsLayoutExporter::ExportResul qDeleteAll( mLastExportLabelingResults ); mLastExportLabelingResults.clear(); } + + emit layoutExported(); } void QgsLayoutDesignerDialog::selectItems( const QList &items ) diff --git a/src/app/layout/qgslayoutdesignerdialog.h b/src/app/layout/qgslayoutdesignerdialog.h index 6c45b7f8625..b886661ef06 100644 --- a/src/app/layout/qgslayoutdesignerdialog.h +++ b/src/app/layout/qgslayoutdesignerdialog.h @@ -338,6 +338,12 @@ class QgsLayoutDesignerDialog: public QMainWindow, public Ui::QgsLayoutDesignerB */ void aboutToClose(); + /** + * Emitted whenever a layout is exported from the layout designer. + * + */ + void layoutExported(); + protected: void closeEvent( QCloseEvent * ) override; diff --git a/src/gui/layout/qgslayoutdesignerinterface.h b/src/gui/layout/qgslayoutdesignerinterface.h index 8c35b6c7402..f771d6565ad 100644 --- a/src/gui/layout/qgslayoutdesignerinterface.h +++ b/src/gui/layout/qgslayoutdesignerinterface.h @@ -398,6 +398,16 @@ class GUI_EXPORT QgsLayoutDesignerInterface: public QObject */ virtual void showRulers( bool visible ) = 0; + signals: + + /** + * Emitted whenever a layout is exported from the layout designer. + * + * The results of the export can be retrieved by calling lastExportResults(). + * + * \since QGIS 3.20 + */ + void layoutExported(); };