[Qgis-developer] What to do with attribute actions

Gavin Macaulay gavin at macaulay.co.nz
Wed Apr 26 02:12:18 EDT 2006


Martin,

I can think of a few instances where the attribute actions could by used
by a 3rd party non-gui application (e.g., run an external program based on
the attribute features in the current map bounding box). When qgis gets a
scripting language I can see the actions becoming a part of the scripting
ability, and I'd definitely want to see scripts in the non-GUI part of the
qgis.

An action is associated with the attributes of a geometry feature, and as
such doesn't need to involve GUI classes.

I think that a more general solution would be to abstract out the
attribute actions and provide a specialisation that displays the output in
the QgsMessageBox as present, with the non-specialised version using files
or stdout, etc.

Your suggestion about abstracting the QgsVectorLayer class would yield
other benefits to those mentioned below, and may be a good idea in any
case.

Gavin



Hi,

the last thing regarding handling vector layers to resolve in library
refactoring is to resolve attribute actions. The problem is that
vector layer owns a set of these actions, however these are GUI
dependent (they use QgsRunProcess to run the action which uses
QgsMessageViewer to show the output).

It would be possible to make attribute actions GUI independent,
however I don't think that this feature could be used in 3rd party
apps which will use core library, therefore I suggest creating a
vector layer for core library e.g. QgsCoreVectorLayer, then QGIS
application will have derived vector layer's class called
QgsVectorLayer as before which will be more specialized. This would
enable also more QGIS specific stuff to layer's definition without
having to change basic layer's definition.

Please share your opinions...

Bye,
Martin




More information about the Qgis-developer mailing list