You have to import the class: <br><div style="margin-left: 40px;"><i>from map_tool_seleccionar import SeleccionarMapTool</i><br></div><br>Then instanciate an object:<br><div style="margin-left: 40px;"><i>self.toolSeleccionar = SeleccionarMapTool( self.canvas )</i><br>
</div><br>And when you want, activate the tool:<br><div style="margin-left: 40px;"><i>self.canvas.setMapTool( self.toolSeleccionar )</i><br></div><br>That's all.<br><br>Germán<br><br><br><div class="gmail_quote">El 19 de enero de 2010 12:50, Arpita Singh <span dir="ltr"><<a href="mailto:singarpita@gmail.com">singarpita@gmail.com</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi,</div>
<div> </div>
<div>Thanks for ur reply...</div>
<div>error is as :</div>
<div>
<p><font color="#ff0000">Microsoft Windows XP [Version 5.1.2600]<br>(C) Copyright 1985-2001 Microsoft Corp.</font></p>
<p><font color="#ff0000">C:\Documents and Settings\asd>e:</font></p>
<p><font color="#ff0000">E:\>cd project</font></p>
<p><font color="#ff0000">E:\project>viewer30_12.py<br></font><font color="#ff0000">No valid projection. Unable to set map units.<br>No valid projection. Unable to set map units.<br>No valid projection. Unable to set map units.<br>
No valid projection. Unable to set map units.<br>QPixmap::scaled: Pixmap is a null pixmap<br>No valid projection. Unable to set map units.<br>No valid projection. Unable to set map units.<br>No valid projection. Unable to set map units.<br>
No valid projection. Unable to set map units.<br>No valid projection. Unable to set map units.<br>No valid projection. Unable to</font> <font color="#ff0000">set map units.<br>No valid projection. Unable to set map units.<br>
No valid projection. Unable to set map units.</font><br><font color="#ff0000">Traceback (most recent call last):<br> File "E:\project\viewer30_12.py", line 674, in <module><br> main(app)<br> File "E:\project\viewer30_12.py", line 658, in main<br>
wnd = MainWindow()<br> File "E:\project\viewer30_12.py", line 156, in __init__<div class="im"><br> self.toolSelect = MapToolSelect(self.canvas)<br></div>NameError: global name 'MapToolSelect' is not defined</font></p>
<p> </p>here is my code attached.<br><br> </div><div><div></div><div class="h5">
<div><span class="gmail_quote">On 1/19/10, <b class="gmail_sendername">Germán Carrillo</b> <<a href="mailto:carrillo.german@gmail.com" target="_blank">carrillo.german@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">Arpita, I attach a Python class ported from the c++ code. <br><br>What is the complete error message?, maybe I can help you a bit.<br>
<br>Germán<br><br>
<div class="gmail_quote">El 19 de enero de 2010 00:20, Arpita Singh <span dir="ltr"><<a href="mailto:singarpita@gmail.com" target="_blank">singarpita@gmail.com</a>></span> escribió:<span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi ,</div>
<div> </div>
<div>Thanks for the reply but i don't understand why some of the qgsmaptool donot work . it give "Attribute Error". as u told about Qgsmaptool select, similarly i wanted to use QgsMapToolIdentify, as i require to get the attribute information of the feature by just clicking on it. but it also didnt work. Please help if u get some idea in python.<br>
<br> </div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><br><br clear="all"><br>-- <br>Arpita<br> </div></div></blockquote></div></blockquote></div></blockquote></span></div>
<div><span>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br>
</span></div><br clear="all"></blockquote></div><br><br clear="all"><br></div></div>-- <br><font color="#888888">Arpita
</font></blockquote></div>-- <br>-----------<br> |\__ <br>(:>__)(<br> |/ <br><br>Soluciones Geoinformáticas Libres <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>