[QGIS-Developer] UI: dockwidgets in tabwidgets and signals

Richard Duivenvoorde rdmailings at duif.net
Wed Feb 13 13:38:30 PST 2019


Hi Devs,

Minor issue, but while looking at the Tile Scale Widget I see that the
orientation of the slider-widget is supposed to change, see

https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgstilescalewidget.cpp#L115

it is connected to the dockLocationChanged-signal, see

https://github.com/qgis/QGIS/blob/master/src/providers/wms/qgstilescalewidget.cpp#L153

This is nice, but I never have seen that working... apparently I always
pull the full (tabbed?) widget (which encloses the tilescale
dockwidget?) to the top or bottom area.
And then this signal is not called, so the orientation of the slider is
not changed to horizontal with me.

BUT: if you ONLY take the TileScaleWidgetPanel (out of the tabbed one,
grabbig it by the bottom tab), THEN the signal is called and you have a
nice horizontal slider.

Others have seen that?

Question: why is our tilescalewidget not receiving the
dockLocationChanged signal when it is part of another dock.

Is the tabbedDock we dock our panels in supposed to bubble up this
signal and not doing it?

Qt docks write:
This signal is emitted when the dock widget is moved to another dock
area, **or is moved to a different location in its current dock area**.
This happens when the dock widget is moved programmatically or is
dragged to a new location by the user.
https://doc.qt.io/qt-5/qdockwidget.html#dockLocationChanged

But I'm not sure if they mean "within it current dock area" or "when it
is in its current dock area"...

Anyway, I do not think other qgis widgets use this signal but I thought
to ask anyway :-)

Regards,

Richard Duivenvoorde


More information about the QGIS-Developer mailing list