Qt5: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]

This commit is contained in:
wmayer
2020-06-10 23:30:03 +02:00
committed by wwmayer
parent 2c113442a7
commit deb39c4321

View File

@@ -1269,14 +1269,14 @@ void TreeWidget::keyPressEvent(QKeyEvent *event)
}else if(event->key() == Qt::Key_Left) {
auto index = currentIndex();
if(index.column()==1) {
setCurrentIndex(index.parent().child(index.row(),0));
setCurrentIndex(model()->index(index.row(), 0, index.parent()));
event->accept();
return;
}
}else if(event->key() == Qt::Key_Right) {
auto index = currentIndex();
if(index.column()==0) {
setCurrentIndex(index.parent().child(index.row(),1));
setCurrentIndex(model()->index(index.row(), 1, index.parent()));
event->accept();
return;
}