Qtableview add rows based on other Qtableview
Solved
General and Desktop
-
@VRonin said in Qtableview add rows based on other Qtableview:
QAbstractItemModel::rowsRemoved
you mean using removeRow()and insertRow ?
bool QAbstractItemModel::removeRow(int row, const QModelIndex &parent = QModelIndex())
bool QAbstractItemModel::insertRow(int row, const QModelIndex &parent = QModelIndex()) -
@VRonin said in Qtableview add rows based on other Qtableview:
like this ??
connect(ui.tableView_1->model(), &QAbstractItemModel::rowsInserted, ui.tableView_1->model(), [ui.tableView_1- >model()](const QModelIndex& parent, int first, int last) QAbstractItemModel* table1 = ui.tableView_1->model(); QAbstractItemModel* table2 = ui.tableView_2->model(); connect(table1, &QAbstractItemModel::rowsRemoved, table2, [table2](const QModelIndex& parent, int first, int last)