[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] uic.loadUiType does not consider uic plugin for top level widget
From:       Denis Rouzaud <denis.rouzaud () gmail ! com>
Date:       2017-10-09 8:49:50
Message-ID: CAMtsY+Yib5W2sMVHdZZcN3_q6OsthdWm7U-Dm+YNXFfbHprr5g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Phil, hi list,

I have an issue using uic plugins for custom widgets.

The idea of the plugin (either MODULE or CW_FILTER) is to redirect import
from the c++ header of the custom widget to the proper python module.
This does not seem to be working for top level widgets.

I have a concrete example using QGIS' custom dock widget (QgsDockWidget).
When setting a UI file with this widget and using loadUiType, I get this
error:

File "/usr/lib64/python2.7/site-packages/PyQt4/uic/__init__.py", line 215,
in loadUiType
    return (ui_globals[winfo["uiclass"]], getattr(QtGui,
winfo["baseclass"]))
AttributeError: 'module' object has no attribute 'QgsDockWidget'

Looking down to the code made think that there's something wrong in the
parser in setupObject where probably the top level widget is set without
taking care of the custom widgets.

Phil, does that speak to you?
Would you need me to try to track the issue to a more precise point?
Or to give you step to reproduce using QGIS?

Thanks a lot by advance,
Kind regards,
Denis

[Attachment #5 (text/html)]

<div dir="ltr">Hi Phil, hi list,<div><br></div><div>I have an issue using uic plugins \
for custom widgets.</div><div><br></div><div>The idea of the plugin (either MODULE or \
CW_FILTER) is to redirect import from the c++ header of the custom widget to the \
proper python module.</div><div>This does not seem to be working for top level \
widgets.</div><div><br></div><div>I have a concrete example using QGIS&#39; custom \
dock widget (QgsDockWidget).</div><div>When setting a UI file with this widget and \
using loadUiType, I get this error:</div><div><br></div><div><div>File \
&quot;/usr/lib64/python2.7/site-packages/PyQt4/uic/__init__.py&quot;, line 215, in \
loadUiType</div><div>      return (ui_globals[winfo[&quot;uiclass&quot;]], \
getattr(QtGui, winfo[&quot;baseclass&quot;]))</div><div>AttributeError: \
&#39;module&#39; object has no attribute \
&#39;QgsDockWidget&#39;</div></div><div><br></div><div>Looking down to the code made \
think that there&#39;s something wrong in the parser in setupObject where probably \
the top level widget is set without taking care of the custom \
widgets.</div><div><br></div><div>Phil, does that speak to you?</div><div>Would you \
need me to try to track the issue to a more precise point?</div><div>Or to give you \
step to reproduce using QGIS?</div><div><br></div><div>Thanks a lot by \
advance,</div><div>Kind regards,</div><div>Denis</div><div><br></div></div>


[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic