[Qgis-developer] vector layer updates heads-up
Jürgen E. Fischer
jef at norbit.de
Tue Aug 12 09:18:37 EDT 2008
I'm currently working on the vector layer. Originally I only wanted to
add additional widgets to edit attributes. Additionally to the
traditional line edit I want to have a combobox using the existing
attribute values (using the providers getUniqueValues()), a combobox
that selects from a value map and maybe more (eg. angles with a spin
box, dates, etc).
Doing that I stubbled into some vector layer deficiencies resulting in
commitAttributeChanges() is removed and replaced with addAttribute(),
deleteAttribute() and changeAttributeValue(). Thereby the vector layer
can keep handle all updates transparently until they are commited or
featuresInRectangle() can be thereby be used for both rendering and
labeling (currently labeling is done directly on the data provider with
the old attributes) without carring about the updates.
The vector layer now also emits signals when editing starts or ends,
when attributes are added or deleted or attribute values change (to be
used by the attribute table, legend, QgisApp etc.).
It's now also easily possible to add editing attributes elsewhere (like
the identify dialog).
I also moved some code:
- toggleEditing() logic from the legend to QgisApp
- attribute table logic from the legend to the attribute table itself
- remove toggleEditing() logic from the attribute table and use QgisApp
- tracking and commiting attribute value changes from attribute table to
- Adding and removing attributes from the attribute table to a new tab
in the vector layer properties.
Attribute table and legend now connect to the vector layer signals to do
the (visual) updates.
QgisApp also has a static method instance() now, that allows everyone to
connect to QgisApp signals or slots (like the attribute table).
I also changed the vector data providers supportedNativeTypes() to
report individual QVariant::Types (useful when adding attributes).
As I've noticed #1215, I'm uploading my current work to  to gain some
feed back, although it's not finished yet...
Jürgen E. Fischer norBIT GmbH Tel. +49-4931-918175-0
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-developer