Ejemplo n.º 1
0
void CFX2DCsvImportDialog::removeFile()
{
    QModelIndex index = ui->listView->currentIndex ();
    if(!index.isValid ())
        return;
    QStringListModel* model = getStringListModel ();
    model->removeRow (index.row ());
}
Ejemplo n.º 2
0
void QQBoardsSettings::deleteBouchot()
{
	QModelIndexList indexes = ui->bouchotListView->selectionModel()->selectedIndexes();
	QStringListModel *model = (QStringListModel *) ui->bouchotListView->model();
	QModelIndex first;

	while(!indexes.isEmpty())
	{
		first = indexes.takeFirst();

		QString bouchotName = first.data().toString();
		if(! m_oldBouchots.contains(bouchotName))
			m_oldBouchots.append(bouchotName);
		m_newBouchots.remove(bouchotName);
		m_bouchots.remove(bouchotName);
		m_listNames.removeOne(bouchotName);

		model->removeRow(first.row());
	}
}