Qtableview
-
@Amogh hi,friend,welcome.
you can use the
editorfactoryforsame value typecell item. and delegate for column.particular value type
Qt Itemviews color editor factpry
editable just for column
Two ways:
- when you new cell item, set the item is editable.
- set delegate just for this column, and you should to finished new editor widget in delegate.model-view-delegate
-
By default it is editable only. It shows you the lineEdit by default. Any other specific stuff r u trying to do ?
-
It's not just up to the View.
- You can make sure the view has some edit triggers set: http://doc.qt.io/qt-5/qabstractitemview.html#editTriggers-prop
- The delegate has to handle the editing (this only applies if you set a custom delegate)
- The model
flags()method must return a value withQt::ItemIsEditableset and itssetValuemethod must actually do something rather than just returningfalse
For example, if you are trying to edit a
QSqlQueryModelvia aQTableViewyou won't be successful as the 3rd point is failing