Skip to content

Commit 93b1170

Browse files
committed
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 767b88d commit 93b1170

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

python/gui/qgspanelwidget.sip

+3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class QgsPanelWidget : public QWidget
8181
* @param panel The panel widget that was accepted.
8282
* @note This argument is normally raised with emit panelAccepted(this)
8383
* so that callers can retrive the widget easier in calling code.
84+
* @note this is emitted only when this panel is accepted, and is not emitted for
85+
* child panels. Eg, if this panel opens a second stacked panel, then this panel
86+
* will not emit panelAccepted when the second panel is accepted.
8487
*/
8588
void panelAccepted( QgsPanelWidget* panel );
8689

src/gui/qgspanelwidget.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void QgsPanelWidget::openPanel( QgsPanelWidget* panel )
6868
dlg->layout()->addWidget( buttonBox );
6969
dlg->exec();
7070
settings.setValue( key, dlg->saveGeometry() );
71-
emit panelAccepted( panel );
71+
panel->acceptPanel();
7272
}
7373
}
7474

src/gui/qgspanelwidget.h

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class GUI_EXPORT QgsPanelWidget : public QWidget
100100
* @param panel The panel widget that was accepted.
101101
* @note This argument is normally raised with emit panelAccepted(this)
102102
* so that callers can retrive the widget easier in calling code.
103+
* @note this is emitted only when this panel is accepted, and is not emitted for
104+
* child panels. Eg, if this panel opens a second stacked panel, then this panel
105+
* will not emit panelAccepted when the second panel is accepted.
103106
*/
104107
void panelAccepted( QgsPanelWidget* panel );
105108

0 commit comments

Comments
 (0)