Improve UX on AddFeature method in the attributetable#65131
Improve UX on AddFeature method in the attributetable#65131signedav wants to merge 2 commits intoqgis:masterfrom
Conversation
…viaTable) action to have the two modes more visible.
src/core/qgsattributetableconfig.cpp
Outdated
|
|
||
| configElement.setAttribute( u"sortOrder"_s, mSortOrder ); | ||
|
|
||
| configElement.setAttribute( u"addFeatureMethod"_s, mAddFeatureMethod == AddFeatureMethod::Form ? "form" : "table" ); |
There was a problem hiding this comment.
Does this mean that table is the default? Worth mentioning it in the function docs that this is used when the method is None.
There was a problem hiding this comment.
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 ?
🍎 MacOS Qt6 buildsDownload MacOS Qt6 builds of this PR for testing. |
I only found this out now, and I'm using the light theme! |
c789c62 to
fd83fc0
Compare
…be able to have the default per layer (you still can change it anytime while working)
fd83fc0 to
a341393
Compare
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.
The button was difficult to handle. It required a long press to change the method, which was very cumbersome for inexperienced users.




And in dark mode, it was almost impossible to see that a long press option existed because the tiny black triangle was (almost) invisible:
This is resolved by using a
QToolButtonwith actions instead. It is much more practical to use and fits better into the QGIS UX.and
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.