[Qgis-developer] Finding QGIS Version in Python Plugin?

Bruce, Bob (CON) Bob.Bruce at gov.mb.ca
Wed Sep 23 17:54:20 EDT 2009


Hi Germán:

                        Thanks for that pointer. I changed the code to:

 

        theVersionInt = QGis.QGIS_VERSION_INT

        if theVersionInt / 100 > 102: # must conform to newer API standard call

            QObject.connect(self.emitPoint, SIGNAL("canvasClicked(const QgsPoint &,\

                            Qt::MouseButton)"), self.setClipWindow)

        else: # version is 1.2 or earlier - use older API standard call

            QObject.connect(self.emitPoint, SIGNAL("canvasClicked(QgsPoint &,\

                            Qt::MouseButton)"), self.setClipWindow)

 

And now it works for all versions of QGIS.

 

            Bob

 

________________________________

From: qgis-developer-bounces at lists.osgeo.org [mailto:qgis-developer-bounces at lists.osgeo.org] On Behalf Of Germán Carrillo
Sent: Wednesday, September 23, 2009 2:58 PM
To: qgis-developer at lists.osgeo.org
Subject: Fwd: [Qgis-developer] Finding QGIS Version in Python Plugin?

 

Hi Bruce, you can use the QGis class from Core module:

http://doc.qgis.org/head/classQGis.html

Regards.

Germán



2009/9/23 Bruce, Bob (CON) <Bob.Bruce at gov.mb.ca>

Hi:

            Is there a function to call to 'discover' the version of QGIS that you are running? I would like to be able to decide whether to call:

 

QObject.connect(self.emitPoint, SIGNAL("canvasClicked(QgsPoint &, Qt::MouseButton)"), self.setClipWindow)

 

or

 

QObject.connect(self.emitPoint, SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"), self.setClipWindow)

 

based on the version of QGIS. This would allow me to have one version of my Image Clipper plugin.

 

Thanks,

            Bob Bruce

 

**********************************************************************************************************

**    Bob Bruce, P.Eng.                            Geomatics Support Engineer

**    bbruce at gov.mb.ca                          Manitoba Geomatics/Remote Sensing Branch,

**    work # (204) 945-6636                    1007 Century Street,

**    FAX  # (204) 945-1365                    Winnipeg, Manitoba, Canada, R3H 0W4

**

**    The Manitoba Centre for:  

**             Cadastral & Topographical Mapping, and Remote Sensing

**             See us on the Web at: http://www.gov.mb.ca/conservation/geomatics/

**                 and: http://www.gov.mb.ca/conservation/geomatics/cada_mapping/index.html

**             Check out our digital maps at: http://mlidata.gov.mb.ca/WPMLI

**                 and: https://mli2.gov.mb.ca/ 

**********************************************************************************************************

 

 

_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

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

Soluciones Geoinformáticas Libres                            
http://geotux.tuxfamily.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090923/24267d46/attachment-0001.html


More information about the Qgis-developer mailing list