void MainWindowMenuPlan::cleanListViewING() //Se borra el listview con los ingredientes mostrados en el apartado Ingredientes { QStringListModel *model = new QStringListModel(); model->removeRows(0, model->rowCount()); ui->listView_Ingredientes->setModel(model); delete model; }
void QQBoardsSettings::setBouchots(const QMap<QString, QQBouchot::QQBouchotSettings> currentListBouchot) { m_bouchots = currentListBouchot; QStringListModel *model = (QStringListModel *) ui->bouchotListView->model(); model->removeRows(0, model->rowCount()); model->insertRows(0, m_bouchots.size()); m_listNames = currentListBouchot.keys(); QMapIterator<QString, QQBouchot::QQBouchotSettings> i(m_bouchots); int index = 0; while(i.hasNext()) { i.next(); QQBouchot::QQBouchotSettings settings = i.value(); if(! m_listGroups.contains(settings.group())) m_listGroups.append(settings.group()); model->setData(model->index(index++), QVariant(i.key())); } }