[Qgis-developer] Developing a custom PyQGIS desktop application

Bob English bobengl at gmail.com
Sat Jun 18 09:19:13 EDT 2011


Hi All,

First, I'd like to thank all those who have contributed to the QGIS
application.  It is a wonderful piece of work, and besides my personal use,
we have recently used it in a course to help high school teachers teach
their students GIS.

I have been investigating whether it is feasible for me to create a PyQGIS
desktop application to serve as a "scenario builder" for an environmental
computer modeling program.  There is grant money available to create this
application, and I would really like to do it and make the code available to
others when it is finished.  

I managed to use the available documentation to create a main window and
load some layers.  I also was able to integrate the GeoTux layer list widget
into the application.  I thought these were very impressive results for such
a relatively short investment of my time.  Next, I tried to create a
"select" tool using QgsMapToolEmitPoint.  I created a "select" button and
successfully activated the tool, but the connect function doesn't seem to
emit the point or call the slot.  Here is some sample code:

def printHello(p):
    z = PyQt4.QtGui.QMessageBox()
    z.setText('hello')
    z.show()

emitPoint = qgis.gui.QgsMapToolEmitPoint(w.canvas)
w.canvas.setMapTool(emitPoint)
w.connect(emitPoint, PyQt4.QtCore.SIGNAL("canvasClicked(QgsPoint)"),
printHello)

I've done a Google search and searched this list's archives and tried many
variations of the above with no success.  Any help on this particular
problem would be appreciated.  It is making me wonder if creating this
application in a reasonable time (i.e. 6 months) is feasible.

Also:

(1) would anyone be interested in collaborating on developing this
application?
(2) I have looked for existing PyQGIS custom applications without success. 
Do any exist?
(3) Does anyone have suggestions for how best to proceed (i.e. is there a
good book on the QGIS and QT APIs?)

Thanks all!
Bob



--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Developing-a-custom-PyQGIS-desktop-application-tp6490724p6490724.html
Sent from the qgis-developer mailing list archive at Nabble.com.


More information about the Qgis-developer mailing list