[layouts] Add api to retrieve window from designer dialog interface

This commit is contained in:
Nyall Dawson 2018-10-23 09:29:56 +10:00
parent 4212cca56e
commit a093dd7293
4 changed files with 20 additions and 0 deletions

View File

@ -61,6 +61,13 @@ Returns the current layout displayed in the designer.
Returns the master layout displayed in the designer.
.. seealso:: :py:func:`layout`
%End
virtual QWidget *window() = 0;
%Docstring
Returns a pointer to the designer window.
.. versionadded:: 3.4
%End
virtual QgsLayoutView *view() = 0;

View File

@ -102,6 +102,11 @@ QgsAppLayoutDesignerInterface::QgsAppLayoutDesignerInterface( QgsLayoutDesignerD
, mDesigner( dialog )
{}
QWidget *QgsAppLayoutDesignerInterface::window()
{
return mDesigner;
}
QgsLayout *QgsAppLayoutDesignerInterface::layout()
{
return mDesigner->currentLayout();

View File

@ -55,6 +55,7 @@ class QgsAppLayoutDesignerInterface : public QgsLayoutDesignerInterface
public:
QgsAppLayoutDesignerInterface( QgsLayoutDesignerDialog *dialog );
QWidget *window() override;
QgsLayout *layout() override;
QgsMasterLayoutInterface *masterLayout() override;
QgsLayoutView *view() override;

View File

@ -85,6 +85,13 @@ class GUI_EXPORT QgsLayoutDesignerInterface: public QObject
*/
virtual QgsMasterLayoutInterface *masterLayout() = 0;
/**
* Returns a pointer to the designer window.
*
* \since QGIS 3.4
*/
virtual QWidget *window() = 0;
/**
* Returns the layout view utilized by the designer.
* \see layout()