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

C Hamilton adenaculture at gmail.com
Wed Jan 10 13:37:59 PST 2018


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'

Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 336,
in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\latlontools\__init__.py",
line 2, in classFactory
    from .latLonTools import LatLonTools
  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\latlontools\latLonTools.py",
line 7, in
    from .zoomToLatLon import ZoomToLatLon
  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\latlontools\zoomToLatLon.py",
line 17, in
    os.path.dirname(__file__), 'ui/zoomToLatLon.ui'))
  File "C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\__init__.py",
line 203, in loadUiType
    return (ui_globals[winfo["uiclass"]], getattr(QtWidgets,
winfo["baseclass"]))
AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QgsDockWidget'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180110/9e78956f/attachment.html>


More information about the QGIS-Developer mailing list