ListModel的move(int from, int to, int n)
可以將列表項進行移動
根據鼠標的拖動位置, 可以判斷出需要移動項的序號
var lastIndex = listview.indexAt(mousearea.mouseX + listItem.x,
mousearea.mouseY + listItem.y);
if ((lastIndex < 0) || (lastIndex > listModel.rowCount()))
return;
if (index !== lastIndex){
listModel.move(index, lastIndex, 1);
}
listItem.toIndex = lastIndex;
需要完整代碼請訪問QtQuickExamples
聯繫方式:
作者 | 鄭天佐 |
---|---|
278969898 | |
主頁 | http://www.camelstudio.cn/ |
郵箱 | [email protected] |
博客 | http://blog.csdn.net/zhengtianzuo06/ |
github | https://github.com/zhengtianzuo |
QQ羣 | 199672080 |
捐贈