Fix property GUI updates by using ClientConnectionModel callbacks #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix property GUI updates by using ClientConnectionModel callbacks
Problem
The GUI property updates were not working for SetPropertyDataReply messages because
InitiatorWidget::setupPropertyCallbacks()was bypassing the ClientConnectionModel callback system and registering directly with ObservablePropertyList. This meant that while the callback was invoked, it didn't trigger the proper GUI update chain.Solution
Replaced direct ObservablePropertyList callbacks with ClientConnectionModel callbacks in InitiatorWidget to mirror the Kotlin implementation pattern:
Before (bypassing ClientConnectionModel):
After (using ClientConnectionModel callbacks):
Key Insights from Kotlin Implementation
mutableStateListOf<PropertyValue>()for automatic Compose UI updatesconn.propertyClient.properties.valueUpdated.add { entry ->directly modifies the reactive state listClientPropertyListtracksvm.conn.propertiesdirectly for reactive updatesvm.conn.properties.firstOrNull { it.id == propertyId }for reactive bindingThe C++ version now replicates this reactive pattern by ensuring ClientConnectionModel callbacks properly trigger Qt widget updates.
Changes Made
InitiatorWidget::setupPropertyCallbacks()to use ClientConnectionModel callback systemTesting
on_property_value_updated()Verification Steps
cmake -B build && cmake --build build./build/tools/qt5-ci-tool/midicci-guiLink to Devin run: https://app.devin.ai/sessions/69f0e6db929942fd921006ff78d5c946
Requested by: Atsushi Eno (atsushieno@gmail.com)