disconnect(ui->ListObj,SIGNAL(doubleClicked(QModelIndex)));
modelObj = new QSqlTableModel(); modelObj->setTable("list_obj"); modelObj->setEditStrategy(QSqlTableModel::OnFieldChange); modelObj->select(); modelObj->setHeaderData(0, Qt::Horizontal, QString::fromUtf8("Название объекта")); modelObj->setHeaderData(1, Qt::Horizontal, QString::fromUtf8("Индикация")); modelObj->setHeaderData(2, Qt::Horizontal, QString::fromUtf8("Картиночка")); ui->ListObj->setModel(modelObj);
QAbstractItemModel::flags ( const QModelIndex & index ) const
void QAbstractItemView::mouseDoubleClickEvent
C++ (Qt)void QAbstractItemView::setEditTriggers( QAbstractItemView::EditTriggers triggers )
Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const{ if(index.row()==0) return ItemIsEnabled; else return Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;}
Qt::ItemFlags QAbstractItemModel::flags(const QModelIndex &index) const{ return Qt::NoItemFlags;}
setWindowFlags(Qt::WindowMinimizeButtonHint);
ui->ListObj->setEditTriggers(QAbstractItemView::NoEditTriggers);