Re: [Qgis-developer] crash with undo command

2014-09-25 Thread Nejia
How to verify if the signal « feature added » is emitted from an add feature
tool?

 

De : qgis-developer-boun...@lists.osgeo.org
[mailto:qgis-developer-boun...@lists.osgeo.org] De la part de Nejia
Envoyé : mercredi 24 septembre 2014 16:09
À : qgis-developer@lists.osgeo.org
Objet : [Qgis-developer] crash with undo command

 

Hi,

 

I have a plugin that allows to change an attribute value of added feature to
the selected value of a combo-box.

I change the attribute when the signal “featureAdded” is emmited (ie. Before
the endEditCommand of “add feature” is called) so in this undo command we
have in the order:

1-  QgsVectorLayerUndoCommandAddFeature

2-  QgsVectorLayerUndoCommandChangeAttribute

 

If we undo “add feature” command it must call undo() on all child commands
in reverse order, but when I debug in QGIS it do it in the order not in
reverse order ie. It call:

1-  QgsVectorLayerUndoCommandAddFeature::undo()

2-  QgsVectorLayerUndoCommandChangeAttribute::undo()

 

That’s why Qgis crash when I undo “add feature” command

An explanation for this?

 

Is there any way to knew if the signal “feature added” is emitted when a new
feature is added not from commitChanges(), redoEditCommand() and
undoEditCommand()?

 

Thank you

Nejia

 

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] crash with undo command

2014-09-24 Thread Nejia
Hi,

 

I have a plugin that allows to change an attribute value of added feature to
the selected value of a combo-box.

I change the attribute when the signal featureAdded is emmited (ie. Before
the endEditCommand of add feature is called) so in this undo command we
have in the order:

1-  QgsVectorLayerUndoCommandAddFeature

2-  QgsVectorLayerUndoCommandChangeAttribute

 

If we undo add feature command it must call undo() on all child commands
in reverse order, but when I debug in QGIS it do it in the order not in
reverse order ie. It call:

1-  QgsVectorLayerUndoCommandAddFeature::undo()

2-  QgsVectorLayerUndoCommandChangeAttribute::undo()

 

That's why Qgis crash when I undo add feature command

An explanation for this?

 

Is there any way to knew if the signal feature added is emitted when a new
feature is added not from commitChanges(), redoEditCommand() and
undoEditCommand()?

 

Thank you

Nejia

 

___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer