QTableView自动设置单元格的编辑状态

	QSqlTableModel *model =(QSqlTableModel *) ui.table->model();
	model->insertRow(0);
	QModelIndex index = model->index(0,0);
	ui.table->openPersistentEditor(index);
	ui.table->setFocus();

	QWidget* editWidget = ui.table->indexWidget(index);
	if(editWidget != NULL){
		editWidget->setFocus();
		connect(editWidget,SIGNAL(editingFinished()),editWidget,SLOT(close()));
	}

你可能感兴趣的