<div dir="ltr">Hi all,<div><br></div><div>I found this same problem.</div><div><br></div><div>pyuic4 on osgeo4w environment doesn't fix this. Still the compiled py file tries to import <span style="font-size:12.8px">QgsFieldComboBox </span><span style="font-size:12.8px">from qgsfieldcombobox.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Is this an error in osgeo4w environment? Possibly some paths are missing from PYTHONPATH or PATH?</span></div><div>At least qgis package and its gui module couldn't be found by python of osgeo4w.</div><div><br></div><div><span style="font-size:12.8px">I tried to create a qgis.bat to </span>%OSGEO4W_ROOT%\etc\ini with the following commands:</div><div><div> set PYTHONPATH=%OSGEO4W_ROOT%\apps\qgis-dev\python</div><div> PATH %OSGEO4W_ROOT%\apps\qgis-dev\bin;%PATH%</div></div><div>After that qgis.gui is imported fine in python but still pyuic4 can't find <span style="font-size:12.8px">QgsFieldComboBox from correct location.</span></div><div><br></div><div>The actual problem might be that </div><div>C:\OSGeo4W64\apps\qgis-dev\python\PyQt4\uic\widget-plugins\qgis_customwidgets.py file is not found by pyuic4.</div><div>After I copied that file to C:\OSGeo4W64\apps\Python27\Lib\site-packages\PyQt4\uic\widget-plugins everything works ok.</div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div>Is this a osgeo4w bug or could this be fixed by us?</div><div>Should the qgis postinstall bat copy qgis_customwidgets.py file to the right place?</div><div><br></div><div><br></div><div><br></div><div><span style="font-size:12.8px">Thanks,</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Lauri</span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 12:03 PM, Anita Graser <span dir="ltr"><<a href="mailto:anitagraser@gmx.at" target="_blank">anitagraser@gmx.at</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 class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Aug 6, 2015 at 10:54 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 bgcolor="#FFFFFF" text="#000000">
Here is an example of a Makefile compiling ui files<br>
<a href="https://github.com/3nids/quickfinder/blob/master/Makefile#L52" target="_blank">https://github.com/3nids/quickfinder/blob/master/Makefile#L52</a><br>
<br>
it's the line with pyuic4 which does the job!</div></blockquote><div><br></div><div><br></div></span><div><div class="gmail_default" style="font-size:small">Thanks Denis! I'll try that on Win later.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'd still be interested if there is a solution to ensure that dynamic ui loading on Win finds the right libraries for custom widgets.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Best wishes,</div><div class="gmail_default" style="font-size:small">Anita<br></div><br></div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><div><div><br>
<br>
<br>
<br>
<div>On 08/06/2015 10:33 AM, Anita Graser
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div style="font-size:small"><br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Aug 6, 2015 at 10:10 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 bgcolor="#FFFFFF" text="#000000"> Never used, I would
think it would work directly.<br>
</div>
</blockquote>
<div><br>
</div>
<div>
<div style="font-size:small">
According to the plugin author the plugin with
uic.loadUiTypes works on Linux but it certainly does not
work on Windows.</div>
</div>
<div>
<div style="font-size:small"></div>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> But why not adding
a new rule to the makefile to compile the ui?</div>
</blockquote>
<div><br>
</div>
<div>
<div style="font-size:small">If
that's necessary to get custom widgets work on all
platforms, why not. But I don't know where to start to
make that work.</div>
<div style="font-size:small"><br>
</div>
<div style="font-size:small">Best
wishes.</div>
<div style="font-size:small">Anita</div>
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<div><br>
<br>
<br>
<br>
<div>On 08/06/2015 10:06 AM, Anita Graser wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div style="font-size:small"><br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Aug 6, 2015
at 9:44 AM, Denis Rouzaud <span dir="ltr"><<a href="mailto:denis.rouzaud@gmail.com" target="_blank"></a><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 bgcolor="#FFFFFF" text="#000000">
Well, how is compiled the UI file?<br>
</div>
</blockquote>
<div><br>
</div>
<div>
<div style="font-size:small">The plugin
builder creates a template that uses
uic.loadUiType</div>
<br>
FORM_CLASS, _ =
uic.loadUiType(os.path.join(<br>
os.path.dirname(__file__),
'cartogram_dialog_base.ui'))
<div style="font-size:small"></div>
</div>
<div>
<div style="font-size:small">So the UI is
compiled automatically when the plugin
starts in QGIS.</div>
<div style="font-size:small"><br>
</div>
<div style="font-size:small">Best wishes,</div>
<div style="font-size:small">Anita</div>
<br>
</div>
<div><br>
</div>
<div><br>
</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Usually, it is done prior to deployment
using pyuic4<br>
<br>
If pyuic4 was run without the proper
python path, you won't have any error at
compilation but the plugin won't work if
it contains QGIS widgets.<br>
<br>
Was pyuic4 run in an Osgeo shell?
<div>
<div><br>
<br>
<br>
<br>
<div>On 08/06/2015 09:39 AM, Anita
Graser wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div style="font-size:small"><br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On
Thu, Aug 6, 2015 at 9:24 AM,
Denis Rouzaud <span dir="ltr"><<a href="mailto:denis.rouzaud@gmail.com" target="_blank"></a><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 bgcolor="#FFFFFF" text="#000000"> You need
to have qgis lib in your
python path.<br>
On windows, that would
be
C:\OSGeo4W\apps\qgis-dev\python\qgis<br>
To check this, just do
"from qgis.gui import *"
in python. If you don't
have an error, then
pyuic4 will work
properly.<br>
</div>
</blockquote>
<div><br>
</div>
<div>My point is that the
plugin needs to work out
of the box - and it
doesn't. <br>
</div>
<div>
<div style="font-size:small">Usually
all paths are set
correctly on Win in the
OSGeo shell. Only in
this case there is an
issue.</div>
<div style="font-size:small"><br>
</div>
<div style="font-size:small">Best
wishes,</div>
<div style="font-size:small">Anita</div>
<div style="font-size:small"><br>
</div>
</div>
</div>
<br>
</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra"><br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div></div></div><br></div></div>
<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br></blockquote></div><br></div>