Skip to content

Improve UX on AddFeature method in the attributetable#65131

Draft
signedav wants to merge 2 commits intoqgis:masterfrom
signedav:addfeaturebutton
Draft

Improve UX on AddFeature method in the attributetable#65131
signedav wants to merge 2 commits intoqgis:masterfrom
signedav:addfeaturebutton

Conversation

@signedav
Copy link
Collaborator

@signedav signedav commented Feb 27, 2026

Two inconveniences regarding the method for adding features to the attribute table (opening a feature form vs adding a row in the table) are resolved here.

  1. The button was difficult to handle. It required a long press to change the method, which was very cumbersome for inexperienced users.
    image
    And in dark mode, it was almost impossible to see that a long press option existed because the tiny black triangle was (almost) invisible:
    image
    This is resolved by using a QToolButton with actions instead. It is much more practical to use and fits better into the QGIS UX.
    image
    and
    image

  2. The method used to be stored in the settings (the last one used). However, the form method is especially used when using transaction mode on PostgreSQL, making the choice of method relevant to the specific project and layer. That's why the method is now stored in the attribute table configuration per layer. This allows you to distribute your project with the correct method selected by default. The former "last used method" setting in QGIS.ini is still used as a default when creating new layers or when opening old projects that do not have this setting stored.

…viaTable) action to have the two modes more visible.
@github-actions github-actions bot added the GUI/UX Related to QGIS application GUI or User Experience label Feb 27, 2026
@github-actions github-actions bot added this to the 4.0.0 milestone Feb 27, 2026
@signedav signedav added the Frozen Feature freeze - Do not merge! label Feb 27, 2026
@signedav signedav modified the milestones: 4.0.0, 4.2.0 Feb 27, 2026

configElement.setAttribute( u"sortOrder"_s, mSortOrder );

configElement.setAttribute( u"addFeatureMethod"_s, mAddFeatureMethod == AddFeatureMethod::Form ? "form" : "table" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that table is the default? Worth mentioning it in the function docs that this is used when the method is None.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... good point. Thanks. I think I'll change that. When a user opens a project and closes it again without touching anything in this area, it should not store anything.

But when the user opens the attribute table and adds a feature there, the last used method is stored.

And there, the default is the last used one from the settings. But if it's a freshly installed QGIS (or profile), the question is which method should be offered as the default selection?
At the moment, it's the table method because this is the one that has been there from the beginning. However, I would love to change it to the form method because it's stable in any case. Do you have an opinion on that @elpaso ?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit a341393)

@uclaros
Copy link
Contributor

uclaros commented Feb 27, 2026

  1. And in dark mode, it was almost impossible to see that a long press option existed because the tiny black triangle was (almost) invisible

I only found this out now, and I'm using the light theme!

…be able to have the default per layer (you still can change it anytime while working)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frozen Feature freeze - Do not merge! GUI/UX Related to QGIS application GUI or User Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants