Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[forms] Copy and paste widget configuration when designing forms (Request in QGIS) #9540

Open
qgis-bot opened this issue Jan 10, 2025 · 0 comments
Labels
3.42 QGIS 3.42 new features Properties Vector
Milestone

Comments

@qgis-bot
Copy link
Collaborator

Request for documentation

From pull request qgis/QGIS#60091
Author: @gacarrillor
QGIS version: 3.42

[forms] Copy and paste widget configuration when designing forms

PR Description:

When designing forms (e.g., using the Drag and Drop Designer) in layers with multiple fields, chances are we want to set similar or even the same configurations for some of them that are somehow related (e.g., configuring latitude and longitude field widgets). This process is currently manual, which ends up being a bit tedious and error prone.

This PR adds a handy context menu (in the Vector properties dialog, Attributes Form tab, Available Widgets tree, Fields category, :) ), allowing users to copy widget configurations between fields, and thus, saving time and making sure we'll not miss any particular setting by mistake.

image

Implementation details:

  • Copy&paste of widget configuration can be done between fields of the same layer, between fields from different layers in the QGIS project, or between fields from layers in different QGIS instances.
  • Pasted widget configuration overwrites the target one, but is not applied automatically, so that users can see the pasted configuration and possibly tune it and apply it or avoid saving it by cancelling the dialog or just selecting another field.
  • We avoid copying aliases and comments. The target field ones are respected.
  • A widget configuration can be copied and pasted on the very same field, thus adding support for keeping a widget config in the clipboard, making and testing changes and eventually reverting them by pasting the clipboard content in the same field.
  • We only paste "editor widget configs" when the target field supports the source editor widget type. Otherwise, we leave the target editor widget type and config intact, while showing a warning message (in dialog's message bar) explaining why the config could not be pasted.
    image
  • Target provider constraints are kept, we only paste constraints with layer origin.

Fix #58971


Funded by Ville de Pully (Switzerland)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.42 QGIS 3.42 new features Properties Vector
Projects
None yet
Development

No branches or pull requests

2 participants