QTreeWidgetItem 点击可编辑修改
2013-08-19 22:18
330 查看
enum Qt::ItemFlag
flags Qt::ItemFlags
This enum describes the properties of an item:Constant | Value | Description |
---|---|---|
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. |
and QTreeWidgetItem.
The ItemFlags type is a typedef for QFlags<ItemFlag>. It stores an OR combination of ItemFlag values.
注意最后一句,ItemFlags存储的是几个ItemFlag的逻辑或的结果。
所以设置某个Item可编辑时,可以item->setFlags(Qt::ItemIsEditable |Qt::ItemIsEnabled);
相关文章推荐
- QTreeWidgetItem 点击可编辑修改
- Qt中如何在点击控件时获取QTreeWidgetItem绑定控件所在的item
- Qt程序学习(三)------QTreeWidget、右键菜单、动态改变comboBox、QTreeWidgetItem的对应列的文字编辑
- QTreewidget的 item Checked 编辑
- QTreeWidget绑定控件获取点击按钮所对应节点QTreeWidgetItem
- listview的item中有个checkbox,点击后会修改相应数据库数据,如何在listview中实时显示这个更新?
- [Gridview]点击编辑列,修改后点击更新获取不到修改后的值
- 如何设置QtreeWidgetItem勾选框的样式
- 继承QTreeWidgetItem发生error: 'staticMetaObject' is not a member of 'QTreeWidgetItem' 错误
- Qt:解决QListWidget/QTreeWidget选取Item不准确/偏移问题(右键菜单)
- table 点击编辑 修改当前行
- 在Gridview控件中点击编辑链接,把这一行数据传给编辑界面进行修改
- UITabbar 中的 item的字体颜色 item点击后的tint颜色 和图片颜色的修改 UINavigationBar字体设置
- 点击编辑按钮,前端table表格行内指定td可修改。(table是动态生成的)
- 控制DataGrid可编辑行且点击回车执行修改.
- QTreewidgetItem关键字高亮
- iOS开发之--如何修改TabBarItem的title的字体和颜色/BarButtonItem的title的字体大小和颜色/添加背景图片,并添加点击方法
- 仿淘宝图片空间 点击文字 出现可编辑文本框 提交ajax数据到后台修改
- Android--GridView/ListView 点击Item修改Item背景 标识是当前选择项方法:
- jquery表格可编辑修改表格里面的值,点击td变input无刷新更新表格