-
-
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
Merge features: immediately update widgets for attributes with a provider default value #59960
base: master
Are you sure you want to change the base?
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
src/app/qgsmergeattributesdialog.cpp
Outdated
@@ -267,6 +267,15 @@ void QgsMergeAttributesDialog::createTableWidgetContents() | |||
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "manual" ) ) ); | |||
currentComboBox->blockSignals( false ); | |||
} | |||
|
|||
const QString widgetType = QgsGui::editorWidgetRegistry()->findBest( mVectorLayer, mFields.at( idx ).name() ).type(); |
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.
Should this be field.editorWidgetSetup().type()
instead? Iirc findBest is using some heuristics while we can use a configuration here.
src/app/qgsmergeattributesdialog.cpp
Outdated
|
||
const QString widgetType = QgsGui::editorWidgetRegistry()->findBest( mVectorLayer, mFields.at( idx ).name() ).type(); | ||
|
||
const QStringList updateWidgetFor = QStringList() << QStringLiteral( "ValueMap" ) |
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.
What is the reason for this hardcoded list of widget types?
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.
@m-kuhn Apologies for taking so long to respond! My thinking was that these are the widgets where you can have a situation where the default value should be displayed differently, whereas for others such as text edit / range widget it doesn't necessarily matter.
Should I change it so that the widget gets updated regardless of its type?
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
|
69fde6a
to
527d77f
Compare
527d77f
to
88078a2
Compare
@m-kuhn |
@JuhoErvasti thanks, looks good now. If we have hardcoded lists like this, it's good to have a comment that explains the why. Or often it is better to bring this knowledge into the widget registry or widget wrapper, so if someone implements a new widget in a plugin, they can define how it should behave. Just FYI, as this seems to be no longer an issue now. |
@m-kuhn thank you, I'll keep that in mind. If it's okay now, could this change be backported to 3.40 as well? |
Apply for widgets which show a key/description instead of the actual values. Addresses part of #59494 (the additional context part, the main part AFAIK is the intended behavior and is meant to be addressed with a "merge policy" feature)
Backport to 3.40 requested.
before:
after: