Skip to content
Permalink
Browse files

Fix main panel ownership in QgsPanelWidgetStack bindings

(cherry picked from commit ef250c4)
  • Loading branch information
nyalldawson committed Jan 15, 2019
1 parent 59485f3 commit d35228de55cfe62246716295bdb3ebbf2fb69bcd
Showing with 15 additions and 10 deletions.
  1. +6 −5 python/gui/auto_generated/qgspanelwidgetstack.sip.in
  2. +9 −5 src/gui/qgspanelwidgetstack.h
@@ -31,13 +31,14 @@ for added panels.
:param parent:
%End

void setMainPanel( QgsPanelWidget *panel );
void setMainPanel( QgsPanelWidget *panel /Transfer/ );
%Docstring
Adds the main panel widget to the stack and selects it for the user
The main widget can not be closed and only the showPanel signal is attached
Sets the main ``panel`` widget for the stack and selects it for the user.

The main widget cannot be closed and only the showPanel signal is attached
to handle children widget opening panels.

:param panel: The panel to set as the first widget in the stack.
Ownership of ``panel`` is transferred to the stack.

.. note::

@@ -59,7 +60,7 @@ and doesn't display a back button.
.. seealso:: :py:func:`setMainPanel`
%End

QgsPanelWidget *takeMainPanel();
QgsPanelWidget *takeMainPanel() /TransferBack/;
%Docstring
Removes the main panel widget from the stack and transfers ownsership to the
caller.
@@ -45,16 +45,20 @@ class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWi
QgsPanelWidgetStack( QWidget *parent = nullptr );

/**
* Adds the main panel widget to the stack and selects it for the user
* The main widget can not be closed and only the showPanel signal is attached
* Sets the main \a panel widget for the stack and selects it for the user.
*
* The main widget cannot be closed and only the showPanel signal is attached
* to handle children widget opening panels.
* \param panel The panel to set as the first widget in the stack.
*
* Ownership of \a panel is transferred to the stack.
*
* \note a stack can have only one main panel. Any existing main panel
* should be removed by first calling takeMainPanel().
*
* \see mainPanel()
* \see takeMainPanel()
*/
void setMainPanel( QgsPanelWidget *panel );
void setMainPanel( QgsPanelWidget *panel SIP_TRANSFER );

/**
* The main panel widget that is set in the stack. The main widget can not be closed
@@ -73,7 +77,7 @@ class GUI_EXPORT QgsPanelWidgetStack : public QWidget, private Ui::QgsRendererWi
* \see mainPanel()
* \see setMainPanel()
*/
QgsPanelWidget *takeMainPanel();
QgsPanelWidget *takeMainPanel() SIP_TRANSFERBACK;

/**
* Clear the stack of all widgets. Unless the panels autoDelete is set to false

0 comments on commit d35228d

Please sign in to comment.
You can’t perform that action at this time.