[api] Add QgsLayoutDesignerInterface.layoutExported signal

Emitted whenever the layout is exported from the designer
This commit is contained in:
Nyall Dawson 2021-06-08 11:18:51 +10:00
parent e62714484f
commit 6bd24e5d17
4 changed files with 31 additions and 1 deletions

View File

@ -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
};

View File

@ -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<QgsLayoutItem *> &items )

View File

@ -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;

View File

@ -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();
};