Outdated documentation
The latest documentation was moved to docs.qfield.org
Most of the settings which QGIS offers are directly supported by QField without any extra effort.
All style settings from QGIS are directly supported by QField. This includes all renderer types like graduated, categorized, rule based, 2.5D as well as data defined symbology.
In QField, objects are identified with a name. The expression to generate this name can be defined by opening the attribute table in QGIS and switching to the form view. Choose the appropriate field or an expression in the list there. Starting from QGIS 3, this can be done directly from the
page.The display expression is also used to search in layers.
Some layers in a project are just there for pure visual purpose. Such layers should not show up when a user taps somewhere to identify objects.
Some other layers serve as source of information and shouldn’t be modified by the user. It is possible to protect layers from editing attributes or adding and deleting features.
It is also possible to configure which layers are searchable.
To configure identify, readonly and searchable behavior, go to the
page and activate the checkboxes to match your desired behavior.QField creates forms similar to, but not equal to QGIS.
The setting suppress feature form is directly applied to the QField form.
The field widgets from QGIS are supported on a best effort basis.
Field type | Support | Notes |
---|---|---|
Text Edit | ✔ |
|
Check Box | ✔ | |
Value Map | ✔ | |
Hidden | ✔ | |
External Resource | ~ | This field is combined with camera integration. Only images can be viewed so far. Make it grow, make it yours |
Date Time | ✔ | |
Relation Reference | ✔ | |
Relation Widget | ✔ | |
Others | ✘ | Make it grow, make it yours |
For more information refer to the relations chapter of the official QGIS Documentation.
The relation widget shows all the referencing child features in a list. It’s possible to add, delete and open them.
The visual identification of the list entries are done a Display Expression on the child layer.
Key handling
Since the parents primary keys are used as foreign keys on the referencing child features, these primary keys must be save to use even after the synchronization back to the original data. Therefore we recommend to use stable values such as UUIDs for primary keys.
Child features can be added before the parent is finaly saved - means while adding a parent. But it’s blocked if there is no valid primary key on the parent or the constraints are violated. In case the adding of the parent feature is canceled after there have been some childs added already, the childs are deleted by cascade.
Many-To-Many relations
On many-to-many relationships, according to the cardinality setting in the QGIS Vector Layer Properties, on adding, deleting or opening an entry in the list effects directly the child layer (on direct cardinality) or the linking table (on many-to-one cardinality).
The second case is usually used when there are additional relation information (e.g. percentage) in the linking table.
In case of the many-to-one cardinality on many-to-many relations the Display Expression needs to be set on the linking table.
The widget type “Attachement” is used to store the path to collected photos.
The path should be set to relative. Means the pictures are stored then in a sub-directory of the project, where the link stored in the textfield is pointing to.
In QField the picture is displayed. By clicking the camera symbol the camera is started to update the picture with a new photo.
On synchronization the sub-directory with the pictures has to be copied as well.
Groups and Tabs from Drag and Drop designer forms are supported.
Groups can be hidden based on an expression. This is useful when certain attributes are only required under certain conditions. As an example imagine mapping trees. Some of them might have a disease and you have a list of possible deseases. To not clutter the form with many fields, make a group and configure a visibility expression for a group “diseases”. Add a field “desease” with a checkbox. Only when the checkbox is checked, the list of diseases will be available to the user.
Attribute fields can have constraints attached. Constraints are expressions that needs to
evaluate to True
(or 1
) in order to be able to save the form. Constraints
are configured on a per-field basis and a description can be added that will be shown to the
user if a constraint is not satisfied.
You cannot enter an elevation value higher than the highest mountain in this country.
"elevation" < 5000
It is required to fill in an identifier.
"identifier" IS NOT NULL
Fields can have default values configured. Default values are inserted into the attribute form when digitizing a new feature. They are visible to the user and can be modified as long as the field is editable. They can be based on the geometry or expression variables.
In QField, there are some additional variables available regarding the current positioning information.
Insert positioning information as variable:
@position_horizontal_accuracy
Insert the current date and time:
now()
Insert the length of the digitized line:
length($geometry)
Configure global variables on the device and insert them.
@operator_name
If you want to assign a region code based on the location where a new feature is inserted, you can do so by using an aggregate expression:
aggregate( layer:='regions', aggregate:='max', expression:="code", filter:=intersects( $geometry, geometry( @parent ) ) )
The editable flag of fields is respected.
QField offers a much more fine-grained control over the last used values and ignores the QGIS setting.
While digitizing new features, new points can be snapped to existing geometries.
All configuration can be done in
( in QGIS 2.x).It is possible to snap new points
It is also possible to only snap to one or a few layers.
The snapping tolerance can be specified in map units or pixels.
In almost any case, the units should be set to pixels. We made good experiences with a tolerance value of 20.
GPS devices are capable of measuring the altitude next to the current 2D position on the earth surface. This information can be saved