diff options
author | Ville Voutilainen <ville.voutilainen@qt.io> | 2017-07-04 18:23:29 +0300 |
---|---|---|
committer | Ville Voutilainen <ville.voutilainen@qt.io> | 2017-07-04 17:24:36 +0000 |
commit | dd8e7905fa4daf7fb87f99f8c1d7ccd47c2d040d (patch) | |
tree | 334030ec1c1c368ec8e4a1949c2c25fd0668d324 | |
parent | ec4cdbc7c0a1efb44299437be4e0c41f08a6adb5 (diff) |
Set the method indexes for the comboboxes at a more suitable time
Setting the indexes in Component.onCompleted seems to happen too early.
The service doesn't seem to be ready at that point. Hooking to the
onServiceChanged signal and setting the indexes there works better.
Task-number: QTBUG-60979
Change-Id: Idda882222662415367cd92122e7ed983e1bd9c4b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/settingsui/network/EditWiredSettings.qml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/settingsui/network/EditWiredSettings.qml b/src/settingsui/network/EditWiredSettings.qml index 97f04dd..857c8e9 100644 --- a/src/settingsui/network/EditWiredSettings.qml +++ b/src/settingsui/network/EditWiredSettings.qml @@ -74,6 +74,7 @@ Item { anchors.fill: parent ComboBoxEntry { + id: ipv4Method title: qsTr("Connection method:") titleWidth: content.titleWidth model: ListModel { @@ -92,7 +93,6 @@ Item { method: NetworkSettingsIPv4.Off } } - Component.onCompleted: currentIndex = service.ipv4.method onCurrentIndexChanged: { ipv4Changed = true; service.ipv4.method = model.get(currentIndex).method; @@ -156,6 +156,7 @@ Item { anchors.fill: parent ComboBoxEntry { + id: ipv6Method title: qsTr("Connection method:") titleWidth: content.titleWidth model: ListModel { @@ -175,8 +176,6 @@ Item { } } - Component.onCompleted: currentIndex = service.ipv6.method - onCurrentIndexChanged: { ipv6Changed = true; service.ipv6.method = model.get(currentIndex).method; @@ -360,4 +359,8 @@ Item { stackView.pop(); } } + onServiceChanged: { + ipv4Method.currentIndex = service.ipv4.method + ipv6Method.currentIndex = service.ipv6.method + } } |