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

Feature Request: Toggle Button Interface for Value Relation Widget #6002

Open
paul-carteron opened this issue Feb 13, 2025 · 0 comments
Open

Comments

@paul-carteron
Copy link

Background

Since QField 3.3, it's possible to define an item threshold for value maps so that if the number of items is below the threshold, a toggle button interface is used (see #2193). This feature works flawlessly for value maps !

Request

It would be great if the same threshold behavior could be applied to the value relation widget, automatically converting it to a toggle button interface when the filtered set of items is small.

Use Case

In my project, I manage multiple tree species. A plugin allows me to select specific species, setting a selected boolean field on the corresponding layer. The value relation widget then applies a filter ("selected" = True), showing only the selected species in the dropdown list. However, even when the number of selected species falls below the threshold, the widget does not switch to the toggle button interface.

Although this scenario might be somewhat niche, I believe that extending the threshold feature to value relation widgets would enhance the QField UI for other users.

Additional Note

I also attempted to modify the ValueMap configuration directly from a plugin, but I encountered a limitation: the setEditorWidgetSetup method is not Q_INVOKABLE.

Thank you for considering this enhancement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants