[QGIS-Developer] QgsDockWidget does not seem to work with loadUiType

Nyall Dawson nyall.dawson at gmail.com
Wed Jan 10 14:02:26 PST 2018


On 11 January 2018 at 07:37, C Hamilton <adenaculture at gmail.com> wrote:
> I seem to remember seeing something that said that QgsDockWidget should be
> used rather than QDockWidget. I was trying it today, but it generates the
> error below in this line of code.
>
> FORM_CLASS, _ = loadUiType(os.path.join(
>     os.path.dirname(__file__), 'ui/zoomToLatLon.ui'))
>
> Has anyone had problems with this or should I not use QgsDockWidget and
> stick with QDockWiget? I'm trying this on QGIS 2.99.
>
> AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QgsDockWidget'

It's not a PyQt class - it's in the QGIS gui library:

from qgis.gui import QgsDockWidget

Nyall


More information about the QGIS-Developer mailing list