Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When editing a ListTextField, we would write the new value to the data point, then emit 'root.accepted(text)'. This causes problems for ListTextFields where the secondary text is different to the raw value of the DataPoint, such as the generator service interval, where the DataPoint stores the value in seconds, and the secondary text is presented in hours, as follows (elided for brevity): ListTextField { id: serviceInterval text: qsTrId("page_settings_generator_service_interval") secondaryText: Math.round(dataValue / 60 / 60) dataSource: settingsBindPrefix + "/ServiceInterval" onAccepted: function(hours) { setDataValue(hours * 60 * 60) } } The user might change the service interval to 1000 hours. The data point gets set to '1000'. The 'serviceInterval' object detects that the 'dataValue' has changed, and updates the secondary text to 1000 / 60 / 60, i.e. 0.2, which gets displayed as 0. ListTextField continues its 'onAccepted' routine, and emits 'root.accepted(text)', which is now equal to 0. The 'serviceInterval' object runs 'onAccepted', and calls 'setDataValue(hours * 60 * 60)', which in this case, is equal to 0.
- Loading branch information