[Qgis-developer] Get signal on edited feature ?

Junior Delaz delazj at gmail.com
Thu Jul 31 03:20:00 PDT 2014


Hello,
For the first question, I think you have done something like
logFeaturesAdded(Idofmylayer, features) instead of doing
self.logFeaturesAdded(Idofmylayer, features).The function you created has
three args : self, layerId, addfeatures. When using it you should give him
three args. The second expression has three arguments not the first one.
Try that.

for your second question, give a look at self.iface.zoomToActiveLayer(),
after having activated your layer. There may be another way but...

I think one good way to learn how to use all this is to make tests with the
qgis Python Console and you'll quickly find the best functions to call.


2014-07-31 11:08 GMT+02:00 dandrigo <lcelati at latitude-geosystems.com>:

> Hello, thank for your reply.
>
> 1/ For my pyqgis plugin 2.2, i try to
> -----------------------------------------------------------------------
> def logFeatureAdded(self,layerId,addfeatures):
>                 message = str(layerId) + " has features added: "
>                 for feature in addedFeatures:
>                         message += str( feature.id() ) + ", "
>                 QgsMessageLog.logMessage(message)
>                 QApplication.beep()
> ------------------------------------------------------------------------
>
> When i try to add a feature, this following error message appears:
>
> TypeError : logFeaturesAdded() takes exactly 3 arguments (2 given).
>
> 2/ Always for my plugin, i can load a vector layer succesfully. But when i
> try to zoom to the layer extent. But it does not work. How to do in order
> to
> zoom to the layer extent?
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Get-signal-on-edited-feature-tp5154173p5154364.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140731/5734c85d/attachment.html>


More information about the Qgis-developer mailing list