[QGIS-Developer] QGIS 3.0 Error: module 'PyQt5.QtWidgets' has no attribute 'QgsDockWidget'

C Hamilton adenaculture at gmail.com
Thu Jul 6 07:21:51 PDT 2017


I am attempting to switch from QDockWidget to QgsDockWidget with my Lat Lon
Tools plugin for QGIS 3.0. I am getting this error:

  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'

Normally what I do when I encounter these types of errors is to change the
custom widget lines of code from something like:

 <customwidgets>
  <customwidget>
   <class>QgsDockWidget</class>
   <extends>QDockWidget</extends>

*  <header>qgsdockwidget.h</header>*   <container>1</container>
  </customwidget>
 </customwidgets>

to

 <customwidgets>
  <customwidget>
   <class>QgsDockWidget</class>
   <extends>QDockWidget</extends>

*  <header>qgis.gui</header>*   <container>1</container>
  </customwidget>

This has always worked in the past, but it is not working for
QgsDockWidget. It still works for the other custom widgets. Is this a bug
or do I need to do something differently in my .ui code?

Thanks,

Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170706/228eb6d7/attachment.html>


More information about the QGIS-Developer mailing list