MCPcopy Create free account
hub / github.com/KDAB/KDChart / moveRow

Method moveRow

python/examples/reorder/main.py:68–79  ·  view source on GitHub ↗
(self, fromIndex, toIndex)

Source from the content-addressed store, hash-verified

66 return None
67
68 def moveRow(self, fromIndex, toIndex):
69 if fromIndex == toIndex:
70 return
71
72 if fromIndex >= len(self.tasks) or toIndex >= len(self.tasks)+1:
73 return
74
75 if self.beginMoveRows(QModelIndex(), fromIndex, fromIndex, QModelIndex(), toIndex):
76 self.tasks.insert(toIndex, self.tasks.pop(fromIndex))
77 self.endMoveRows()
78 else:
79 return
80
81
82if __name__ == '__main__':

Callers 1

main.pyFile · 0.45

Calls 1

QModelIndexClass · 0.50

Tested by

no test coverage detected