[Qgis-user] python appliction example

Germán Carrillo carrillo.german at gmail.com
Sun Mar 29 17:17:04 PDT 2009


Hi Jachym, you have to do next things in demo_app.py:

1. Line 11: Use qgis_prefix = "/usr" instead of "qgis_prefix =
os.getenv("QGISHOME")". I don't know why last mode doesn't work for me.
2. Line 14: You have __init_ instead of __init__. (Important! Your GUI
doesn't initialize)
3. Line 28: useQImageToRender doesn't exists, use useImageToRender.
4. Line 56: Use mActionPan.png instead of mActionZoomPan.png
5. Line 61: Use mActionZoomFullExtent.png instead of mActionZoomFull.png
6. Line 76 and 77: You have QgsMapToolPan but you want create Zoom Tool, so
replace it with QgsMapToolZoom.
7. Line 89: Replace zoomFullExtent with zoomToFullExtent.
8. Line 106: You have a sintaxis error there: Use addMapLayer, not
adMapLayer.
9. Be carefull, every single word in your code is important.
10. Read again 9.

Yes, I'm on vacations... :)

Germán.

2009/3/29 Jachym Cepicky <jachym.cepicky at gmail.com>

> Hi,
> I followed the guide in QGIS Book [1] (pages 161-167), "Creating PyQGIS
> Applications" and I somehow did not get the desired result.
>
> I get only one "empty" window, but no qgis-based application. Could
> anyone point me to the bug, I probably did? Files attached.
>
> I'm running it as follows:
>
> Qgis (1.1.0), installed from debian package (custom compilation) in the
> system the standard way.
>
> export QGISHOME=/usr/
> export PYTHONPATH=/usr/share/qgis/python/
> python demo_app.py
>
> Thanks
>
> Jachym
>
> [1]
> http://download.osgeo.org/qgis/doc/manual/qgis-1.0.0_user_guide_en.pdf
> --
> Jachym Cepicky
> e-mail: jachym.cepicky gmail com
> URL: http://les-ejk.cz
> GPG: http://www.les-ejk.cz/pgp/JachymCepicky.pgp
> Key fingerprint: 0C6D 0EAE 76BD 506C F299  ED8A C8AB 74B8 08D4 E08F
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAknPe20ACgkQyKt0uAjU4I/hQwCbBZY2PkC/dvJcJXQ/pnsoat9F
> t50AoMFm2mKRQ9bWafXzjwqK8DX76ji2
> =ASH8
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
>


-- 
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20090329/2c56475a/attachment.html>


More information about the Qgis-user mailing list