[Qgis-user] How to get a new 'the_geom' into the 'Init function' of an 'Edit UI'?

Jürgen E. Fischer jef at norbit.de
Fri Dec 3 14:17:49 PST 2010


Hi Knut,

On Fri, 03. Dec 2010 at 20:45:15 +0100, Knut Sübert wrote:
> using a PostGIS-layer, I thought about adding informations to the
> table. 'Edit UI' and 'Init function' are working well for updating
> existent geometries. Minimal example:

Editing happens in a layer transaction.  The layer temporarily stores all
additions and updates after editing is toggled and only stores them to the
database (or other data source), when you toggle editing again later and decide
to commit the changes.

The attribute dialog is called in that context, so you probably shouldn't
update the database directly, but update the vector layer instead (ie.
QgsVectorLayer.changeAttributeValue).

The init function is used to initialize the dialog (not the feature), so that
you can add new widgets, connect signals and the like.  You can also overwrite
the QGIS' widget initialization.

On accept QGIS will read out the widgets and update the vector layer
attributes.  The user can still undo/redo his actions and even decide to
discard all updates.   The database is normally only updated when the changes
are committed.


hth
Jürgen

-- 
Jürgen E. Fischer         norBIT GmbH               Tel. +49-4931-918175-20
Dipl.-Inf. (FH)           Rheinstraße 13            Fax. +49-4931-918175-50
Software Engineer         D-26506 Norden               http://www.norbit.de

-- 
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Emden, HRB 5502




More information about the Qgis-user mailing list