[Qgis-developer] Compiling ui files with custom widgets creates wrong imports

Lauri Kajan lauri.kajan at gmail.com
Sat Sep 19 06:16:32 PDT 2015


Hi Jürgen!

I think that this can't be fixed by just setting the PYTHONPATH.

If I have understood right the problem is that PyQt and its uic module
can't find qgis_customwidgets.py or better said
'qgis-dev\python\PyQt4\uic\widget-plugins' directory because it is not told
to do so. It is not that some module can't be imported because it is not in
pythonpath. Please correct me if I'm wrong.

Directories that are searched for widget plugins by PyQt4 are defined in
uic.widgetPluginPath. I have not found any environment variable where this
list can be altered.
After I appended
"C:\OSGeo4W64\apps\qgis-dev\python\PyQt4\uic\widget-plugins" to the
widgetPluginPath list I'm able to use uic.loadUiType function inside
python. Still that doesn't solve the problem with pyuic4 because
widgetPluginPath can't be set externally.


-Lauri



On Sat, Sep 19, 2015 at 12:47 PM, Jürgen E. <jef at norbit.de> wrote:

> Hi Lauri,
>
> On Sat, 19. Sep 2015 at 12:11:11 +0300, Lauri Kajan wrote:
> > The actual problem might be that
> >
> C:\OSGeo4W64\apps\qgis-dev\python\PyQt4\uic\widget-plugins\qgis_customwidgets.py
> > file is not found by pyuic4.
> > After I copied that file
> > to C:\OSGeo4W64\apps\Python27\Lib\site-packages\PyQt4\uic\widget-plugins
> > everything works ok.
> >
> > Is this a osgeo4w bug or could this be fixed by us?
>
> > Should the qgis postinstall bat copy qgis_customwidgets.py file to the
> > right place?
>
> No, qgis-dev might not be the only installed version - so you have to
> setup the
> PYTHONPATH to use the version you target.
>
>
> Jürgen
>
> --
> Jürgen E. Fischer           norBIT GmbH             Tel.
> +49-4931-918175-31
> Dipl.-Inf. (FH)             Rheinstraße 13          Fax.
> +49-4931-918175-50
> Software Engineer           D-26506 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150919/28875aea/attachment-0001.html>


More information about the Qgis-developer mailing list