Demonstration 2a: Feature Editing

This demonstration extends the plugin component in qfield_vegetation_monitoring/demo2_selection. We have added a new geopackage layer to the project called entries. It has no geometry, and holds a completely generic list of attributes, along with a time stamp attribute, a primary key, and a foreign key to the plots layer which is the plotId sent by the pointHandler in the main module. The plugin component now contains a very simple entry selection menu, a new entry button, a simple form, and a save button. We will use this simple form to demonstrate basic feature edit operations.

This form, and the entries layer, are not part of the final plugin. This is a detour for demonstration purposes. It will help you to understand the more complicated code in the rest of the demonstrations. This is also the last demonstration that will be covered in the workshop. The remaining demo projects are left for your later perusal.

What We Will Learn

What Does It Do?

Plugin screen

Setup

  1. Create a new project directory: ${ROOT}/qfield_project_demo_2a
  2. Copy the entire demo directory ${ROOT}/qfield_vegetation_monitoring/demo2a_crud to ${ROOT}/qfield_project_demo_2a
  3. Open the project in QGIS if you want to see the structure of the entries layer. This is included in the project as a non-geometry layer.
  4. Run QField from the command line to open the project directly as a local project.
"C:\Program Files\QField\usr\bin\qfield.exe" ${ROOT}\qfield_vegetation_monitoring\demo2a_crud\demo2a_crud.qgs