[QGIS-Developer] How to restore dock widget plugin size after relaunch of QGIS?

Jean-Baptiste Peter jbpeter at outlook.com
Wed Nov 16 08:22:37 PST 2022


Hi,

I am working on a QGIS plugin which is based on QGIS plugin Builder dock widget template. The default behavior of this template is that the dock widget is not restored after closing and reopening QGIS. Here is the repo of my plugin:
https://github.com/jbp35/layout_panel

I managed to reopen the dock widget automatically when QGIS starts by calling the run() function from initGui() function. However, the dimensions of the widget is not saved and I am not able to figure out how to restore the width and height of the widget. I tried to use QDockWidget::restoreGeometry without success. Could someone please point me how to achieve this? Thanks!

Best,

--
Jean-Baptiste PETER

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20221116/61317607/attachment.htm>


More information about the QGIS-Developer mailing list