Skip to content

Disable comboboxes with no and one item #61864

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MoritzMoreira
Copy link
Contributor

@MoritzMoreira MoritzMoreira commented May 16, 2025

Disable the combobox of all the widget types that can have one, when they contain no or only one item. They appear in the attribute form upon generating new features and in the attribute table. The comboboxes tooltip is set accordingly to inform the user about why there is no option.
As of now, clicking on a combobox with only one item will open it's item list with that one item, changing the whole format in an awkward way and changing the background color to blue. Clicking on an empty combobox does nothing, but hovering over it canges the background color.
The proposed change is mainly for a better graphical user experience, giving immediate information for why there are no other options.

undesired behaviour in case of one item:
image
Note: The constraint result label (green checkmark) does not behave correctly in many cases, but that is a separate issue)

desired behaviour for hovering over a checkbox with no item:
image

and one item:
image

@github-actions github-actions bot added this to the 3.44.0 milestone May 16, 2025
Copy link
Contributor

github-actions bot commented May 16, 2025

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit b433e43)

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit b7de30a)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This installer is not signed, control+click > open the app to avoid the warning
(Built from commit b7de30a)

@nyalldawson
Copy link
Collaborator

@MoritzMoreira i get the rationale here, but I don't like how the widget greys out the field value text when it's disabled.

Are you able to overwrite the widget's palette too so that the text still appears in the normal font color?

@MoritzMoreira MoritzMoreira force-pushed the disable-field-value-comboboxes branch 2 times, most recently from 2eaa227 to 224da1e Compare June 10, 2025 17:33
@MoritzMoreira
Copy link
Contributor Author

@nyalldawson I agree, it's better with black test, just added that. Now I will continue to include all widget types with drop boxes, like enumeration in the test, or would it be sufficient to only test value map and value relation?

Copy link
Contributor

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jun 25, 2025
@MoritzMoreira MoritzMoreira force-pushed the disable-field-value-comboboxes branch from 224da1e to 7818508 Compare June 28, 2025 20:25
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jun 28, 2025
@MoritzMoreira MoritzMoreira force-pushed the disable-field-value-comboboxes branch from 7818508 to b433e43 Compare July 5, 2025 13:34
disable the comboboxes of the attribute form editor widgets when they contain no or only one item. Set the tooltip to inform the user.
testing if the combobox of the value map widget is correctly disabled and enabled and the corresponding tooltip set
@MoritzMoreira MoritzMoreira force-pushed the disable-field-value-comboboxes branch from b433e43 to b7de30a Compare July 14, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants