Qt5: 'QModelIndex QModelIndex::child(int, int) const' is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user