Skip to content

Commit d073ca2

Browse files
committedOct 6, 2016
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)
1 parent d000833 commit d073ca2

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed
 

‎python/gui/qgspanelwidget.sip

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ class QgsPanelWidget : public QWidget
8989
* @param panel The panel widget that was accepted.
9090
* @note This argument is normally raised with emit panelAccepted(this)
9191
* so that callers can retrive the widget easier in calling code.
92+
* @note this is emitted only when this panel is accepted, and is not emitted for
93+
* child panels. Eg, if this panel opens a second stacked panel, then this panel
94+
* will not emit panelAccepted when the second panel is accepted.
9295
*/
9396
void panelAccepted( QgsPanelWidget* panel );
9497

‎src/gui/qgspanelwidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void QgsPanelWidget::openPanel( QgsPanelWidget* panel )
8484
dlg->layout()->addWidget( buttonBox );
8585
dlg->exec();
8686
settings.setValue( key, dlg->saveGeometry() );
87-
emit panelAccepted( panel );
87+
panel->acceptPanel();
8888
}
8989
}
9090

‎src/gui/qgspanelwidget.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
108108
* @param panel The panel widget that was accepted.
109109
* @note This argument is normally raised with emit panelAccepted(this)
110110
* so that callers can retrive the widget easier in calling code.
111+
* @note this is emitted only when this panel is accepted, and is not emitted for
112+
* child panels. Eg, if this panel opens a second stacked panel, then this panel
113+
* will not emit panelAccepted when the second panel is accepted.
111114
*/
112115
void panelAccepted( QgsPanelWidget* panel );
113116

0 commit comments

Comments
 (0)
Please sign in to comment.