open the Form in editable mode.
Post by Andrew McClureI found this thread very helpful. It seems to be that to the dialog into
edit mode this has to be done programmatically by calling startEditing() -
not by simply having the layer in edit mode. Can anyone else verify that?
Regardless, thanks for the pointers and suggestions in the thread. Much
appreciated.
Hi
Post by Denis Rouzaudiface.openFeatureForm(layer, feature, false, true/false)
http://qgis.org/api/classQgisInterface.html#a11b90f38afd09ac5e9f363933ee4a509
Cheers,
Denis
Actually this how my plugin worked back in QGIS 2.2. But in the latest
versions the iface.openFeatureForm() is always in add mode (like
setIsAddDialog
<http://qgis.org/api/classQgsAttributeDialog.html#a2fbbff1c23be058caa26cc5aaf7040e8>).
That is, after accepting the dialog, it adds a new feature, and does not
update my temporary feature. This leaves no room for any changes before the
feature commit. I described my problem in the following bug report, and
Matthias Kuhn adviced me to create my own Dialog, so that's what I'm trying
to do. I would be glad to use iface.openFeatureForm() only
https://hub.qgis.org/issues/11099
Thanks for your help
Alexandre
Post by Denis RouzaudHello Salvatore,
You were right, I just needed to import the class first, this have
from qgis.gui import QgsAttributeDialog
mc = iface.mapCanvas()
layer = mc.currentLayer()
temp_feature.setAttributes(attributes)
dialog = QgsAttributeDialog(layer, temp_feature, True)
dialog.show()
But now I can't make it editable.
All I can do is cancel the dialog.
Thanks for your help,
Alexandre Neto
Hi,
Post by Alexandre NetoHello,
I'm trying to open an attribute dialog for a temporary feature using
QgsAttributeDialog(). but with no luck. Can anyone point me to working
example?
mc = iface.mapCanvas()
layer = mc.currentLayer()
dialog = QgsAttributeDialog(layer, temp_feature)
dialog.show()
I think you should to import the class before and setting the feature
owner bool parameter.
after this changes the snippet should work fine for you!
Regards,
-SL
--
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
skype: s.larosa
IRC: lrssvt on freenode
_______________________________________________
_______________________________________________
Qgis-developer mailing list
http://lists.osgeo.org/mailman/listinfo/qgis-developer