<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi </span></font>Germán:<o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> Thanks for that pointer. I changed the code to:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> theVersionInt = QGis.QGIS_VERSION_INT<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> if theVersionInt / 100 > 102: # must conform to newer API
standard call<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> QObject.connect(self.emitPoint, SIGNAL("canvasClicked(const
QgsPoint &,\<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> Qt::MouseButton)"),
self.setClipWindow)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> else: # version is 1.2 or earlier - use older API standard call<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> QObject.connect(self.emitPoint,
SIGNAL("canvasClicked(QgsPoint &,\<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> Qt::MouseButton)"),
self.setClipWindow)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>And now it works for all versions of QGIS.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> Bob</span></font><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
qgis-developer-bounces@lists.osgeo.org
[mailto:qgis-developer-bounces@lists.osgeo.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Germán Carrillo<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, September 23,
2009 2:58 PM<br>
<b><span style='font-weight:bold'>To:</span></b> qgis-developer@lists.osgeo.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Fwd: [Qgis-developer]
Finding QGIS Version in Python Plugin?</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hi Bruce, you can use the
QGis class from Core module:<br>
<br>
<a href="http://doc.qgis.org/head/classQGis.html" target="_blank">http://doc.qgis.org/head/classQGis.html</a><br>
<br>
Regards.<br>
<br>
Germán<br>
<br>
<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>2009/9/23 <st1:PersonName w:st="on">Bruce, Bob</st1:PersonName> (CON)
<<a href="mailto:Bob.Bruce@gov.mb.ca" target="_blank">Bob.Bruce@gov.mb.ca</a>><o:p></o:p></span></font></p>
<div>
<div>
<div link=blue vlink="#606420">
<div>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Hi:</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
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:</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>QObject.connect(self.emitPoint,
SIGNAL("canvasClicked(QgsPoint &, Qt::MouseButton)"),
self.setClipWindow)</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>or</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>QObject.connect(self.emitPoint,
SIGNAL("canvasClicked(const QgsPoint &, Qt::MouseButton)"),
self.setClipWindow)</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>based
on the version of QGIS. This would allow me to have one version of my Image
Clipper plugin.</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks,</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>
Bob Bruce</span></font><o:p></o:p></p>
<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> </span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**********************************************************************************************************</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
Bob Bruce,
P.Eng.
Geomatics Support Engineer</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
<a href="mailto:bbruce@gov.mb.ca" target="_blank">bbruce@gov.mb.ca</a>
Manitoba Geomatics/Remote Sensing Branch,</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
work # (204)
945-6636
1007 Century Street,</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
FAX # (204) 945-1365
<st1:place w:st="on"><st1:City w:st="on">Winnipeg</st1:City>, <st1:State w:st="on">Manitoba</st1:State>,
<st1:country-region w:st="on">Canada</st1:country-region></st1:place>, R3H 0W4</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
The <st1:State w:st="on"><st1:place w:st="on">Manitoba</st1:place></st1:State>
Centre for: </span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
Cadastral & Topographical Mapping, and Remote Sensing</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
See us on the Web at: <a href="http://www.gov.mb.ca/conservation/geomatics/"
target="_blank">http://www.gov.mb.ca/conservation/geomatics/</a></span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
and: <a
href="http://www.gov.mb.ca/conservation/geomatics/cada_mapping/index.html"
target="_blank">http://www.gov.mb.ca/conservation/geomatics/cada_mapping/index.html</a></span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
Check out our digital maps at: <a href="http://mlidata.gov.mb.ca/WPMLI"
target="_blank">http://mlidata.gov.mb.ca/WPMLI</a></span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**
and: <a href="https://mli2.gov.mb.ca/" target="_blank">https://mli2.gov.mb.ca/</a>
</span></font><o:p></o:p></p>
<p><font size=1 face=Arial><span style='font-size:8.0pt;font-family:Arial'>**********************************************************************************************************</span></font><o:p></o:p></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'> <o:p></o:p></span></font></p>
</div>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color="#888888"
face="Times New Roman"><span style='font-size:12.0pt;color:#888888'>-- <br>
-----------<br>
|\__ <br>
(:>__)(<br>
|/ <br>
<br>
Soluciones Geoinformáticas Libres
<br>
<a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a></span></font><o:p></o:p></p>
</div>
</div>
</body>
</html>