Skip to content

Commit ddbd25d

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.
1 parent bad1372 commit ddbd25d

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
@@ -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

+1-1
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

+3
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)