[Qgis-user] Size of QgsDockWidget pyqgis
Ludwig Kniprath
ludwig at kni-online.de
Mon Jan 13 10:05:30 PST 2025
Hello Denis,
I didn't know about QgsDockwidget yet, but looking on
https://api.qgis.org/api/classQgsDockWidget.html it's a derived
QDockwidget.
Image taken from https://doc.qt.io/qt-5/qdockwidget.html:
https://doc.qt.io/qt-5/images/mainwindow-docks.png
A docked QDockwidget uses automatically the available height or width of
the widget where it is added, it can only be resized when it is floating:
dock_wdg = QgsDockWidget()
iface.addDockWidget(QtCore.Qt.RightDockWidgetArea, dock_wdg)
dock_wdg.setFloating(True)
dock_wdg.setGeometry(0,0, 600, 800)
Note:
addDockWidget and setFloating will both affect size/extent of mapCanvas
and trigger two annoying canvas refreshes.
hth
Ludwig
Am 13.01.25 um 17:44 schrieb Denis Bourouffala via QGIS-User:
> Hello,
>
> On Qgis, I want to create a QgsDockwidget but I need to know if it's
> possible to fix the height with a special value or QgsDockWidget take
> up necessarily the entire height of my screen ?
>
> Thanks you for your help.
>
> Best regards
>
> /Denis/
>
>
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250113/97ef7259/attachment.htm>
More information about the QGIS-User
mailing list