Skip to content

[attribute form] Add the ability to preview the attributes form within the vector layer properties dialog (Request in QGIS) #10668

@qgis-bot

Description

@qgis-bot

Request for documentation

From pull request qgis/QGIS#64514
Author: @nirvn
QGIS version: 4.0

[attribute form] Add the ability to preview the attributes form within the vector layer properties dialog

PR Description:

Description

This PR adds the ability to preview an attributes form while configuring it within the vector layer properties dialog. Here's we're the preview button is located:

image

This will fit in quite nicely with the series of improvements we're going to ship with QGIS 4.0 on the attributes form configuration front. Massive UX wins :)

Since attribute form configuration is all over the place in our API at the moment (i.e., some of it is attached to QgsField, some of it attached to the QgsVectorLayer, etc.), the only way to properly preview the form is to apply all changes in the vector layer properties dialog. The code does so by saving the XML state of the vector layer, applying the changes, showing the preview form, and immediately restoring the saved XML state so users can still cancel the vector layer properties dialog. (An alternative solution that doesn't involve doing that was pushed)

Also, due to the necessity to apply all vector layer properties changes, I'm passing on the QgsVectorLayerProperties widget down to the QgsAttributesFormProperties panel so it can trigger the properties dialog's apply() function. We could also go down a signal connection there but I thought a direct call was better. Open to discuss that :)

Commits tagged with [need-docs] or [FEATURE]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions