[Qgis-developer] help regarding qgis coding

Germán Carrillo carrillo.german at gmail.com
Tue Jan 19 20:19:30 EST 2010


You have to import the class:
*from map_tool_seleccionar import SeleccionarMapTool*

Then instanciate an object:
*self.toolSeleccionar = SeleccionarMapTool( self.canvas )*

And when you want, activate the tool:
*self.canvas.setMapTool( self.toolSeleccionar )*

That's all.

Germán


El 19 de enero de 2010 12:50, Arpita Singh <singarpita at gmail.com> escribió:

> Hi,
>
> Thanks for ur reply...
> error is as :
>
> Microsoft Windows XP [Version 5.1.2600]
> (C) Copyright 1985-2001 Microsoft Corp.
>
> C:\Documents and Settings\asd>e:
>
> E:\>cd project
>
> E:\project>viewer30_12.py
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> QPixmap::scaled: Pixmap is a null pixmap
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> No valid projection. Unable to set map units.
> Traceback (most recent call last):
>   File "E:\project\viewer30_12.py", line 674, in <module>
>     main(app)
>   File "E:\project\viewer30_12.py", line 658, in main
>     wnd = MainWindow()
>   File "E:\project\viewer30_12.py", line 156, in __init__
>
>     self.toolSelect  = MapToolSelect(self.canvas)
> NameError: global name 'MapToolSelect' is not defined
>
>
> here is my code attached.
>
>
> On 1/19/10, Germán Carrillo <carrillo.german at gmail.com> wrote:
>>
>> Arpita, I attach a Python class ported from the c++ code.
>>
>> What is the complete error message?, maybe I can help you a bit.
>>
>> Germán
>>
>> El 19 de enero de 2010 00:20, Arpita Singh <singarpita at gmail.com>escribió:
>>
>>> Hi ,
>>>
>>> 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.
>>>
>>>
>>>
>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Arpita
>>>>>
>>>>>
>>>> --
>> -----------
>>   |\__
>> (:>__)(
>>   |/
>>
>> Soluciones Geoinformáticas Libres
>> http://geotux.tuxfamily.org/
>>
>>
>
>
> --
> Arpita

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

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100119/d379e36f/attachment.html


More information about the Qgis-developer mailing list