Skip to content
Snippets Groups Projects
Commit 1fad473f authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

MasksQModel - move fcts

parent af3dc8ad
No related branches found
No related tags found
1 merge request!2441MasksSet inherits SetWithModel
...@@ -84,38 +84,3 @@ QModelIndex MasksQModel::pushItem(MaskItem* t) ...@@ -84,38 +84,3 @@ QModelIndex MasksQModel::pushItem(MaskItem* t)
return createIndex(row, 0); return createIndex(row, 0);
} }
//! Move mask to a given row
void MasksQModel::moveMask(int from_row, int to_row)
{
emit QAbstractListModel::beginMoveRows(m_masks->rootIndex, from_row, from_row,
m_masks->rootIndex, to_row);
m_masks->swap(from_row, to_row);
emit QAbstractListModel::endMoveRows();
}
void MasksQModel::moveUp()
{
/*
for (const QModelIndex& itemIndex : m_selection_model->selectedIndexes()) {
int row = itemIndex.row();
int new_row = row - 1;
if (new_row >= 0 && new_row < rowCount({}))
moveMask(row, new_row);
}
*/
}
void MasksQModel::moveDown()
{
/*
for (const QModelIndex& itemIndex : m_selection_model->selectedIndexes()) {
int row = itemIndex.row();
int new_row = row + 1;
if (new_row >= 0 && new_row < rowCount({}))
// Here we lower element from 'new_row' instead of rising element from 'row'
// The result should be the same, but rising doesn't work for an unknown reason
moveMask(new_row, row);
}
*/
}
...@@ -38,10 +38,6 @@ public: ...@@ -38,10 +38,6 @@ public:
void deleteItem(); void deleteItem();
QModelIndex pushItem(MaskItem*); QModelIndex pushItem(MaskItem*);
void moveMask(int from_row, int to_row);
void moveUp();
void moveDown();
MasksSet* set() { return m_masks; } MasksSet* set() { return m_masks; }
const MasksSet* set() const { return m_masks; } const MasksSet* set() const { return m_masks; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment