[QTableView] Some cells and column headers not accessible (editable)
Hello,
I have a problem with QTableView and QSqlRelationalTableModel. The problem is that few cells and column headers are not editable. It's even not clickable.
The following are the conditions:
Code:
- QSqlRelationalTableMode
Thanks in advice! I hope I didn't forget anything, but if anything is missing, just ask!
Edit: Maybe I should post some more information:
Code:
model->setTable("Protokoll");
proxy = new proxymodel(tableView);
// ------
model
->setRelation
(12,
QSqlRelation("Status",
"ID",
"Status"));
tableView
->setSelectionMode
(QTableView::SingleSelection);
tableView
->setSelectionBehavior
(QTableView::SelectRows);
proxy->setSourceModel(model);
tableView->setModel(proxy);
tableView->hideColumn(0);
tableView->setSortingEnabled(true);
model->select();
Re: [QTableView] Some cells and column headers not accessible (editable)
you didn't mention which cells and columns aren't editable.
what is the db you are trying to connect to?
Have you looked at: http://doc.qt.nokia.com/latest/sql-r...ablemodel.html
Re: [QTableView] Some cells and column headers not accessible (editable)
My database is SQLITE. I have 12 columns and 4 of them are not editable.
Starting from left to right - the fourth, the fifth, the sixth and the seventh.
Re: [QTableView] Some cells and column headers not accessible (editable)
so, could there be something common between those 4 columns? Can you list how all fields are defined in the database?