aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Nemtsev <enemtsev@luxoft.com>2020-02-27 19:28:14 +0300
committerEgor Nemtsev <enemtsev@luxoft.com>2020-03-03 05:44:53 +0000
commit1272b03ec682f9412cc301cac168d88be491169f (patch)
tree874c18c8f6eff93e5c3a692aa28966413af4d785
parent092c64e408fb02804a6000b0adfc2f485e9a12b5 (diff)
[sysui] reset currentIndex for ToolsColumn on model size change
- if model updates and currentIndex exceeds it's size reset currentIndex to 0 Change-Id: Iddfb955f98aa1a4d37c5cee846dea7de4a1f1531 Reviewed-by: Grigorii Zimin <gzimin@luxoft.com>
-rw-r--r--plugins/controls/ToolsColumn.qml9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/controls/ToolsColumn.qml b/plugins/controls/ToolsColumn.qml
index b06bc15b..e297ab58 100644
--- a/plugins/controls/ToolsColumn.qml
+++ b/plugins/controls/ToolsColumn.qml
@@ -217,4 +217,13 @@ ColumnLayout {
Item {
Layout.fillHeight: true
}
+
+ Connections {
+ target: root.model
+ onCountChanged: {
+ if (currentIndex > 0 && model.count <= currentIndex) {
+ currentIndex = 0;
+ }
+ }
+ }
}