connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(rowsInserted(const QModelIndex &, int, int)));
connect(model, SIGNAL(modelAboutToBeReset()), this, SLOT(modelReset()));
for(int i = 0; i < model->rowCount(); i++) {
connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(rowsInserted(const QModelIndex &, int, int)));
connect(model, SIGNAL(modelAboutToBeReset()), this, SLOT(modelReset()));
for(int i = 0; i < model->rowCount(); i++) {