mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
fix deprecated warning QModelIndex::child
Use QModelIndex::index instead. This function was DEPRECATED_SINCE(5, 8)
This commit is contained in:
committed by
Laurent Trinques
parent
803414f716
commit
24528b0fdb
@@ -112,7 +112,7 @@ bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, Qt::DropAct
|
||||
if (!(QStandardItemModel::canDropMimeData(data, action, row, column, parent) && parent.isValid()))
|
||||
return false;
|
||||
|
||||
QStandardItem *qsi = itemFromIndex(parent.child(row, column));
|
||||
QStandardItem *qsi = itemFromIndex(parent.QModelIndex::model()->index(row, column));
|
||||
if (!qsi)
|
||||
qsi = itemFromIndex(parent);
|
||||
|
||||
@@ -150,8 +150,7 @@ bool ElementsCollectionModel::canDropMimeData(const QMimeData *data, Qt::DropAct
|
||||
bool ElementsCollectionModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
||||
{
|
||||
Q_UNUSED(action)
|
||||
|
||||
QStandardItem *qsi = itemFromIndex(parent.child(row, column));
|
||||
QStandardItem *qsi = itemFromIndex(parent.QModelIndex::model()->index(row, column));
|
||||
if (!qsi)
|
||||
qsi = itemFromIndex(parent);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text)
|
||||
return;
|
||||
|
||||
ui->m_tree_view->expand(index);
|
||||
ui->m_tree_view->expand(index.child(0,0));
|
||||
ui->m_tree_view->expand(index.QModelIndex::model()->index(0,0));
|
||||
ui->m_tree_view->setCurrentIndex(index);
|
||||
ui->m_remove_selection->setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ bool DynamicElementTextModel::indexIsText(const QModelIndex &index) const
|
||||
if(index.column() == 1)
|
||||
{
|
||||
if(index.parent().isValid())
|
||||
item = itemFromIndex(index.parent().child(index.row(),0));
|
||||
item = itemFromIndex(index.parent().QModelIndex::model()->index(index.row(),0));
|
||||
else
|
||||
item = itemFromIndex(this->index(index.row(),0));
|
||||
}
|
||||
@@ -897,7 +897,7 @@ bool DynamicElementTextModel::indexIsGroup(const QModelIndex &index) const
|
||||
if(index.column() == 1)
|
||||
{
|
||||
if(index.parent().isValid())
|
||||
item = itemFromIndex(index.parent().child(index.row(),0));
|
||||
item = itemFromIndex(index.parent().QModelIndex::model()->index(index.row(),0));
|
||||
else
|
||||
item = itemFromIndex(this->index(index.row(),0));
|
||||
}
|
||||
@@ -918,7 +918,7 @@ bool DynamicElementTextModel::canDropMimeData(const QMimeData *data, Qt::DropAct
|
||||
{
|
||||
QModelIndex index;
|
||||
if(parent.isValid() && row != -1 && column !=1) //Insert in child of parent
|
||||
index = parent.child(row, column);
|
||||
index = parent.QModelIndex::model()->index(row, column);
|
||||
else if (parent.isValid() && row == -1 && column == -1) //Drop in parent
|
||||
index = parent;
|
||||
|
||||
@@ -977,7 +977,7 @@ bool DynamicElementTextModel::dropMimeData(const QMimeData *data, Qt::DropAction
|
||||
|
||||
QModelIndex index;
|
||||
if(parent.isValid() && row != -1 && column !=1) //Insert in child of parent
|
||||
index = parent.child(row, column);
|
||||
index = parent.QModelIndex::model()->index(row, column);
|
||||
else if (parent.isValid() && row == -1 && column == -1) //Drop in parent
|
||||
index = parent;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user