mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +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()))
|
if (!(QStandardItemModel::canDropMimeData(data, action, row, column, parent) && parent.isValid()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QStandardItem *qsi = itemFromIndex(parent.child(row, column));
|
QStandardItem *qsi = itemFromIndex(parent.QModelIndex::model()->index(row, column));
|
||||||
if (!qsi)
|
if (!qsi)
|
||||||
qsi = itemFromIndex(parent);
|
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)
|
bool ElementsCollectionModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(action)
|
Q_UNUSED(action)
|
||||||
|
QStandardItem *qsi = itemFromIndex(parent.QModelIndex::model()->index(row, column));
|
||||||
QStandardItem *qsi = itemFromIndex(parent.child(row, column));
|
|
||||||
if (!qsi)
|
if (!qsi)
|
||||||
qsi = itemFromIndex(parent);
|
qsi = itemFromIndex(parent);
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ui->m_tree_view->expand(index);
|
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_tree_view->setCurrentIndex(index);
|
||||||
ui->m_remove_selection->setEnabled(true);
|
ui->m_remove_selection->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -870,7 +870,7 @@ bool DynamicElementTextModel::indexIsText(const QModelIndex &index) const
|
|||||||
if(index.column() == 1)
|
if(index.column() == 1)
|
||||||
{
|
{
|
||||||
if(index.parent().isValid())
|
if(index.parent().isValid())
|
||||||
item = itemFromIndex(index.parent().child(index.row(),0));
|
item = itemFromIndex(index.parent().QModelIndex::model()->index(index.row(),0));
|
||||||
else
|
else
|
||||||
item = itemFromIndex(this->index(index.row(),0));
|
item = itemFromIndex(this->index(index.row(),0));
|
||||||
}
|
}
|
||||||
@@ -897,7 +897,7 @@ bool DynamicElementTextModel::indexIsGroup(const QModelIndex &index) const
|
|||||||
if(index.column() == 1)
|
if(index.column() == 1)
|
||||||
{
|
{
|
||||||
if(index.parent().isValid())
|
if(index.parent().isValid())
|
||||||
item = itemFromIndex(index.parent().child(index.row(),0));
|
item = itemFromIndex(index.parent().QModelIndex::model()->index(index.row(),0));
|
||||||
else
|
else
|
||||||
item = itemFromIndex(this->index(index.row(),0));
|
item = itemFromIndex(this->index(index.row(),0));
|
||||||
}
|
}
|
||||||
@@ -918,7 +918,7 @@ bool DynamicElementTextModel::canDropMimeData(const QMimeData *data, Qt::DropAct
|
|||||||
{
|
{
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
if(parent.isValid() && row != -1 && column !=1) //Insert in child of parent
|
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
|
else if (parent.isValid() && row == -1 && column == -1) //Drop in parent
|
||||||
index = parent;
|
index = parent;
|
||||||
|
|
||||||
@@ -977,7 +977,7 @@ bool DynamicElementTextModel::dropMimeData(const QMimeData *data, Qt::DropAction
|
|||||||
|
|
||||||
QModelIndex index;
|
QModelIndex index;
|
||||||
if(parent.isValid() && row != -1 && column !=1) //Insert in child of parent
|
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
|
else if (parent.isValid() && row == -1 && column == -1) //Drop in parent
|
||||||
index = parent;
|
index = parent;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user