Skip to content

Commit

Permalink
[layouts] Add api to retrieve window from designer dialog interface
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 23, 2018
1 parent 4212cca commit a093dd7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -102,6 +102,11 @@ QgsAppLayoutDesignerInterface::QgsAppLayoutDesignerInterface( QgsLayoutDesignerD
, mDesigner( dialog )
{}

QWidget *QgsAppLayoutDesignerInterface::window()
{
return mDesigner;
}

QgsLayout *QgsAppLayoutDesignerInterface::layout()
{
return mDesigner->currentLayout();
Expand Down
1 change: 1 addition & 0 deletions src/app/layout/qgslayoutdesignerdialog.h
Expand Up @@ -55,6 +55,7 @@ class QgsAppLayoutDesignerInterface : public QgsLayoutDesignerInterface

public:
QgsAppLayoutDesignerInterface( QgsLayoutDesignerDialog *dialog );
QWidget *window() override;
QgsLayout *layout() override;
QgsMasterLayoutInterface *masterLayout() override;
QgsLayoutView *view() override;
Expand Down
7 changes: 7 additions & 0 deletions src/gui/layout/qgslayoutdesignerinterface.h
Expand Up @@ -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()
Expand Down

0 comments on commit a093dd7

Please sign in to comment.