Skip to content
Permalink
Browse files

Correctly emit panelAccepted when panel is not in dock mode

Fixes #15373 - refine current rule not working when symbol widgets
are not used in the style dock

This fixes a behavioural difference when new panels are opened
in a QgsPanelWidget when in docked/undocked mode. When in
docked mode, the newly opened panel will emit panelAccepted
when it is accepted. But for undocked mode, the parent
panel was emitting the panelAccepted signal and so the
connection to update the renderer was never
triggered. Now both docked/undocked panels will always
emit panelAccepted ONLY from the newly opened panel itself.

This also fixes memory leaks as the clean up code was never
run in undocked mode.

I've updated the docs to clarify this behaviour.

(cherry-picked from ddbd25d)
  • Loading branch information
nyalldawson committed Oct 6, 2016
1 parent d000833 commit d073ca29a7c9f9af385d6696ae812aee0608213f
Showing with 7 additions and 1 deletion.
  1. +3 −0 python/gui/qgspanelwidget.sip
  2. +1 −1 src/gui/qgspanelwidget.cpp
  3. +3 −0 src/gui/qgspanelwidget.h
@@ -89,6 +89,9 @@ class QgsPanelWidget : public QWidget
* @param panel The panel widget that was accepted.
* @note This argument is normally raised with emit panelAccepted(this)
* so that callers can retrive the widget easier in calling code.
* @note this is emitted only when this panel is accepted, and is not emitted for
* child panels. Eg, if this panel opens a second stacked panel, then this panel
* will not emit panelAccepted when the second panel is accepted.
*/
void panelAccepted( QgsPanelWidget* panel );

@@ -84,7 +84,7 @@ void QgsPanelWidget::openPanel( QgsPanelWidget* panel )
dlg->layout()->addWidget( buttonBox );
dlg->exec();
settings.setValue( key, dlg->saveGeometry() );
emit panelAccepted( panel );
panel->acceptPanel();
}
}

@@ -108,6 +108,9 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
* @param panel The panel widget that was accepted.
* @note This argument is normally raised with emit panelAccepted(this)
* so that callers can retrive the widget easier in calling code.
* @note this is emitted only when this panel is accepted, and is not emitted for
* child panels. Eg, if this panel opens a second stacked panel, then this panel
* will not emit panelAccepted when the second panel is accepted.
*/
void panelAccepted( QgsPanelWidget* panel );

0 comments on commit d073ca2

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