-
-
Notifications
You must be signed in to change notification settings - Fork 274
Remember/reuse last value improvements #6648
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
base: master
Are you sure you want to change the base?
Conversation
🎉 Ta-daaa, freshly created APKs are available for 31adbe9: arm64-android |
width: 49 | ||
height: 48 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why 49 - 48
?
void AttributeFormModelBase::activateAllRememberValues() | ||
{ | ||
QMap<QStandardItem *, int>::ConstIterator fieldIterator( mFields.constBegin() ); | ||
for ( ; fieldIterator != mFields.constEnd(); ++fieldIterator ) | ||
{ | ||
setData( fieldIterator.key()->index(), true, AttributeFormModel::RememberValue ); | ||
} | ||
} | ||
|
||
void AttributeFormModelBase::deactivateAllRememberValues() | ||
{ | ||
QMap<QStandardItem *, int>::ConstIterator fieldIterator( mFields.constBegin() ); | ||
for ( ; fieldIterator != mFields.constEnd(); ++fieldIterator ) | ||
{ | ||
setData( fieldIterator.key()->index(), false, AttributeFormModel::RememberValue ); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of activateAllRememberValues and deactivateAllRememberValues is clear and consistent with the codebase;
However, currently, these functions apply to all fields, regardless of whether CanRememberValue is true.
for added robustness, you might check CanRememberValue before setting RememberValue, otherwise everything looks good.
This PR adds a menu in the feature addition form that allows for users to quickly activate / deactivate the pin tool button that dictates whether a given attribute value will be remembered and reused during the next feature addition.
Screenshot:
In addition, logic can be added into QField now, in preparation for QGIS 4.0, where the reusing of value functionality has been improved, with distinct options to activate/deactivate the possibility to reuse values and whether they should be remembered by default. The only thing left to do after this will be a vcpkg rebase when we get closer to QGIS 4.0 release date (or a manual patch if needed).
A bit more on this: it will answer the repeated asks by the community to get a way to get rid of the "remember last value" button in the feature addition form. That's quite exciting to me :)