Skip to content

Commit a093dd7

Browse files
committed
[layouts] Add api to retrieve window from designer dialog interface
1 parent 4212cca commit a093dd7

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

python/gui/auto_generated/layout/qgslayoutdesignerinterface.sip.in

+7
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ Returns the current layout displayed in the designer.
6161
Returns the master layout displayed in the designer.
6262

6363
.. seealso:: :py:func:`layout`
64+
%End
65+
66+
virtual QWidget *window() = 0;
67+
%Docstring
68+
Returns a pointer to the designer window.
69+
70+
.. versionadded:: 3.4
6471
%End
6572

6673
virtual QgsLayoutView *view() = 0;

src/app/layout/qgslayoutdesignerdialog.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ QgsAppLayoutDesignerInterface::QgsAppLayoutDesignerInterface( QgsLayoutDesignerD
102102
, mDesigner( dialog )
103103
{}
104104

105+
QWidget *QgsAppLayoutDesignerInterface::window()
106+
{
107+
return mDesigner;
108+
}
109+
105110
QgsLayout *QgsAppLayoutDesignerInterface::layout()
106111
{
107112
return mDesigner->currentLayout();

src/app/layout/qgslayoutdesignerdialog.h

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ class QgsAppLayoutDesignerInterface : public QgsLayoutDesignerInterface
5555

5656
public:
5757
QgsAppLayoutDesignerInterface( QgsLayoutDesignerDialog *dialog );
58+
QWidget *window() override;
5859
QgsLayout *layout() override;
5960
QgsMasterLayoutInterface *masterLayout() override;
6061
QgsLayoutView *view() override;

src/gui/layout/qgslayoutdesignerinterface.h

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ class GUI_EXPORT QgsLayoutDesignerInterface: public QObject
8585
*/
8686
virtual QgsMasterLayoutInterface *masterLayout() = 0;
8787

88+
/**
89+
* Returns a pointer to the designer window.
90+
*
91+
* \since QGIS 3.4
92+
*/
93+
virtual QWidget *window() = 0;
94+
8895
/**
8996
* Returns the layout view utilized by the designer.
9097
* \see layout()

0 commit comments

Comments
 (0)