QT

Make QTableView rows not selectable

During a project I had to make rows within a QTableview not selectable based on a columns value. Searching arround the internet showed me how but.... After implementing the most reasonable solution ( check the column value and return via reimplemented flags() function of my model Qt.NoItemFlags ) I stumbled apon the issue, that selecting enabled rows, was extremly slow.

I had a lot of data within my model, so maybe this was the issue. So don't ask the model.data(index, role) if the row is selectable, ask yourself.

RSS - QT abonnieren