diff options
Diffstat (limited to 'src/controls/Private')
-rw-r--r-- | src/controls/Private/BasicTableView.qml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/controls/Private/BasicTableView.qml b/src/controls/Private/BasicTableView.qml index 2557dca7..1f846b57 100644 --- a/src/controls/Private/BasicTableView.qml +++ b/src/controls/Private/BasicTableView.qml @@ -260,6 +260,17 @@ ScrollView { if (index >= 0 && index <= columnCount && object.Accessible.role === Accessible.ColumnHeader) { object.__view = root columnModel.insert(index, {columnItem: object}) + if (root.__columns[index] !== object) { + // The new column needs to be put into __columns at the specified index + // so the list needs to be recreated to be correct + var arr = [] + for (var i = 0; i < index; ++i) + arr.push(root.__columns[i]) + arr.push(object) + for (i = index; i < root.__columns.length; ++i) + arr.push(root.__columns[i]) + root.__columns = arr + } return object } |