1
我閱讀了關於dynamically re-arrange-able view。 Qt-Creator也提供了相同的例子。索引在動態視圖排列示例中未更新
我想在我的數據庫中存儲更新後的重新排列順序。我添加一個額外的行的列定義用於檢查索引值:
Column {
id: column
anchors { fill: parent; margins: 2 }
Text { text: 'Name: ' + name }
Text { text: 'Type: ' + type }
Text { text: 'Age: ' + age }
Text { text: 'Size: ' + size }
Text { text: 'Rank: ' + index } // Added to test the index values
}
然而,我認識到重新排列的元素後,索引值被示出在用戶界面相同。索引不變嗎?或者文本的綁定無法正常工作,更新後的索引值在重新排列之後沒有顯示出來?
前:
移動最上面的元素(波利)一點點下來之後:
我的理解是,排名應該始終從0露面到最高價值,因爲我們從上到下移動,無論重新排列,因爲索引值將按照這個順序排列。