EditTrigger
EditTrigger是QAbstractItemView Class的Public Function
This property holds which actions will initiate item editing
此属性保存哪些操作将启动项编辑
This property is a selection of flags defined by EditTrigger, combined using the OR operator. The view will only initiate the editing of an item if the action performed is set in this property.
此属性是由EditTrigger定义的标志的选择,并使用OR运算符组合。只有在此属性中设置了执行的操作,视图才会启动对项目的编辑。
文章来源:https://www.toymoban.com/news/detail-676167.html
Constant | Value | Description |
---|---|---|
QAbstractItemView::NoEditTriggers |
0 |
No editing possible. |
QAbstractItemView::CurrentChanged |
1 |
Editing start whenever current item changes. |
QAbstractItemView::DoubleClicked |
2 |
Editing starts when an item is double clicked. |
QAbstractItemView::SelectedClicked |
4 |
Editing starts when clicking on an already selected item. |
QAbstractItemView::EditKeyPressed |
8 |
Editing starts when the platform edit key has been pressed over an item. |
QAbstractItemView::AnyKeyPressed |
16 |
Editing starts when any key is pressed over an item. |
QAbstractItemView::AllEditTriggers |
31 |
Editing starts for all above actions. |
例子:
如果想要单击开启编辑器而不是双击,则需要设置为CurrentChanged文章来源地址https://www.toymoban.com/news/detail-676167.html
ui->tableView->setEditTriggers(QAbstractItemView::CurrentChanged);
到了这里,关于qt tableview setEditTriggers解析的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!