C++ (Qt)void DataBaseFilterModel::insertData(){ int lastRow = rowCount(QModelIndex()); qDebug()<<lastRow; qDebug()<<insertRows(lastRow,1);//?????????????????????????????}
bool QSortFilterProxyModel::insertRows(int row, int count, const QModelIndex &parent){ Q_D(QSortFilterProxyModel); if (row < 0 || count <= 0) return false; QModelIndex source_parent = mapToSource(parent); if (parent.isValid() && !source_parent.isValid()) return false; QSortFilterProxyModelPrivate::Mapping *m = d->create_mapping(source_parent).value(); if (row > m->source_rows.count()) return false; int source_row = (row >= m->source_rows.count() ? m->source_rows.count() : m->source_rows.at(row)); return d->model->insertRows(source_row, count, source_parent);}