ilya
ilya

Reputation: 1133

How to prevent QTableView from user editing but to change its cells from another thread?

I have a windows with QTableView which shows SQLite table contents. The user must not change cells, they are read-only for him. But another QThread-linked worker will change its cells (it uses another database connection). Which classes can I use for this purpose? QSqlQueryModel for GUI thread and QSqlQuery for the worker thread?

Upvotes: 0

Views: 80

Answers (1)

ratchet freak
ratchet freak

Reputation: 48226

you set the editTriggers of the view to QAbstractItemView::NoEditTriggers

Upvotes: 1

Related Questions