starting PyQGIS
We can't use `None` as a keyword exposed to python, it's reserved.
Also move the enum to Qgis before making it part of public stable
API.
This adds the API framework for storing additional, semi-structured
properties inside QgsField objects. The intention is that strong
field-type specific properties can be stored.
Eg for a geometry field type coming from the postgres provider
the metadata can be used to store the associated CRS and WKB types
so that clients can be aware of the correct format required for
geometries stored in that field. Instead of cluttering the QgsField
API with specific getters/setters for properties like crs(), wkbType(),
etc which only apply for a certain field type, the metadata map
approach helps us keep the API nice and slim.
The API has been designed to follow the approach used by various
Qt objects (such as QTextFormat) where a preset set of keys
are exposed as an enum, but additional ones can be used for
custom property storage. This allows for a more structured
use of properties with conventions which apply across different
providers (as opposed to a free-form string key approach).
Refs #49380
fails
And fix Python exception handling in QgsField::convertCompatible to
avoid Python "returned an object with the error set" error message
and instead just use the proper ValueError exception with a descriptive
exception message
- added new `QString QgsField::displayType( const bool showConstraints = false )` to unify the display of field types whenever length or precision are present
- added new argument `expression` to `QgsFieldModel::fieldToolTip( const QgsField &field, const QString &expression = QStringLiteral() )`. Now the tooltip shows "<alias> (<field>)\n<type>\n<comment>\n<expression>" with appropriate formatting
- added meaningful field tooltips in the "Identify Results" dialog
- field tooltips show the same content in "Feature Attributes" form, "Attribute Table" and "Identify Tool"
Fixes#15144
This adds another method to display field names with alias, this is to be used when
working close to the data structure (sql builder, expressions etc.) when the information
in the alias is sometimes fundamental to indentify what the field contains.
displayNameWithAlias is now used (insted of field name) in:
expressions dialog
query builder
The format is:
alias (field_name)
and, in case there is no alias:
field_name