-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[settings] support direct connection from widget value change to upda… #58611
Conversation
9f347f6
to
5da0d65
Compare
6b3ce8c
to
e939c09
Compare
@nyalldawson now, you can give a dialog, so it saves on accept. |
* | ||
* \since QGIS 3.40 | ||
*/ | ||
void configureAutomaticUpdate( QDialog *dialog = nullptr ); |
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.
Sorry, I think this would be a bit better in my humble opinion :)
(also, you'll need a sip update, so good reason to do a final name tweak ;) )
void configureAutomaticUpdate( QDialog *dialog = nullptr ); | |
void configureUpdateBehavior( QDialog *dialog = nullptr ); |
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.
I prefer configureAutomaticUpdate because it actually enables the auto update (not direct if dialog, direct if no dialog)
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.
@3nids , I guess yeah automatic update in that it'll automatically take care of updates (live update vs dialog close update). OK.
Co-authored-by: Mathieu Pellerin <nirvn.asia@gmail.com>
qgis#58611) * [settings] support direct connection from widget value change to update setting value * support automatic setting update on dialog accept * add settings entry * better name + fix typo * Update src/gui/settings/qgssettingseditorwidgetwrapper.h Co-authored-by: Mathieu Pellerin <nirvn.asia@gmail.com> * sipify --------- Co-authored-by: Mathieu Pellerin <nirvn.asia@gmail.com>
…te setting value
This is useful to remember last used values for instance.
There is an API break in
QgsSettingsEditorWidgetWrapper
. I would prefer to make the method pure virtual from the beginning. Considering the recently solved ticket of settings unregistration from plugin (#58595), it is pretty sure no one ever implemented a customQgsSettingsEditorWidgetWrapper
in python.For instance, this code will set a combobox to display options from an enum with translations and auto save the last used option: