<div dir="ltr">Well, I think using pyuic is the only way at the moment to use QgsDockWidget as top widget.<div>But for any other case, using uic.loadUiType is eaiser since there no Python path to deal with when using pyuic.</div><div><br></div><div>Cheers,</div><div>Denis</div></div><br><div class="gmail_quote"><div dir="ltr">Le jeu. 11 janv. 2018 à 17:28, C Hamilton <<a href="mailto:adenaculture@gmail.com">adenaculture@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Thanks to everyone for confirming that this is not just me and that it is a bug. So the question I now have is whether it is better to use uic.loadUiType or to compile the ui to python code from a best practice point of view?<br><br></div>Best wishes,<br><br></div>Calvin<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 11, 2018 at 8:24 AM, Denis Rouzaud <span dir="ltr"><<a href="mailto:denis.rouzaud@gmail.com" target="_blank">denis.rouzaud@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>Hi all,</div><div><br></div><div>I think this is not currently feasible with PyQt5 at the moment (using QgsDockWidget as a top class for a UI and loading it with uic.loadUiType)<br></div><div><br></div><div>Here is a description of the issue on PyQt mailing list</div><div><a href="https://www.riverbankcomputing.com/pipermail/pyqt/2017-October/039647.html" target="_blank">https://www.riverbankcomputing.com/pipermail/pyqt/2017-October/039647.html</a><br></div><div><br></div><div>Here is a part of the reply from Phil Thomson:</div><div><br></div><div><span style="color:rgb(33,33,33);font-size:13px">> I can confirm it is a bug, however the fix is non-trivial so it won't get fixed quickly. The fundamental problem is that the code has the assumption that all custom widgets will reside in the PyQt5 package hard-coded (but even then it's not quite as simple as that).</span><br></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">I just pinged Phil to get an update on this as he said he would fix it.</span></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">Best wishes,</span></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">Denis</span></div><br><div class="gmail_quote"><div><div class="m_-2918286230104454013h5"><div dir="ltr">Le mer. 10 janv. 2018 à 18:02, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>> a écrit :<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-2918286230104454013h5">On 11 January 2018 at 07:37, C Hamilton <<a href="mailto:adenaculture@gmail.com" target="_blank">adenaculture@gmail.com</a>> wrote:<br>
> I seem to remember seeing something that said that QgsDockWidget should be<br>
> used rather than QDockWidget. I was trying it today, but it generates the<br>
> error below in this line of code.<br>
><br>
> FORM_CLASS, _ = loadUiType(os.path.join(<br>
>     os.path.dirname(__file__), 'ui/zoomToLatLon.ui'))<br>
><br>
> Has anyone had problems with this or should I not use QgsDockWidget and<br>
> stick with QDockWiget? I'm trying this on QGIS 2.99.<br>
><br>
> AttributeError: module 'PyQt5.QtWidgets' has no attribute 'QgsDockWidget'<br>
<br>
It's not a PyQt class - it's in the QGIS gui library:<br>
<br>
from qgis.gui import QgsDockWidget<br>
<br>
Nyall<br></div></div>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div></div>
</blockquote></div><br></div>
</blockquote></div>