parent
e313e84010
commit
06ef175b46
@ -234,13 +234,15 @@ class PlaylistTab(QTableView):
|
|||||||
super().dropEvent(event)
|
super().dropEvent(event)
|
||||||
|
|
||||||
from_rows = self.selected_model_row_numbers()
|
from_rows = self.selected_model_row_numbers()
|
||||||
to_row = self.indexAt(event.position().toPoint()).row()
|
to_index = self.indexAt(event.position().toPoint())
|
||||||
|
to_model_row = self.proxy_model.mapToSource(to_index).row()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
0 <= min(from_rows) <= self.model().rowCount()
|
0 <= min(from_rows) <= self.data_model.rowCount()
|
||||||
and 0 <= max(from_rows) <= self.model().rowCount()
|
and 0 <= max(from_rows) <= self.data_model.rowCount()
|
||||||
and 0 <= to_row <= self.model().rowCount()
|
and 0 <= to_model_row <= self.data_model.rowCount()
|
||||||
):
|
):
|
||||||
self.model().move_rows(from_rows, to_row)
|
self.data_model.move_rows(from_rows, to_model_row)
|
||||||
|
|
||||||
# Reset drag mode to allow row selection by dragging
|
# Reset drag mode to allow row selection by dragging
|
||||||
self.setDragEnabled(False)
|
self.setDragEnabled(False)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user