如题。我在qtreewidget中新建两列,想把第一列设置为不可编辑,第二列设置成可编辑,请问如何设置?
PS:设置itemiseditable是设置整行都不可编辑,不能区分列。
求大神们指点……
------解决方案--------------------
你可以遍历整个里面的item.然后设置属性
item->setFlags(Qt::ItemIsEditable
------解决方案--------------------
item->flags()) ;
Qt::NoItemFlags 0 It does not have any properties set.
Qt::ItemIsSelectable 1 It can be selected.
Qt::ItemIsEditable 2 It can be edited.
Qt::ItemIsDragEnabled 4 It can be dragged.
Qt::ItemIsDropEnabled 8 It can be used as a drop target.
Qt::ItemIsUserCheckable 16 It can be checked or unchecked by the user.
Qt::ItemIsEnabled 32 The user can interact with the item.
Qt::ItemIsTristate 64 The item is checkable with three separate states