开发者

Qt: How to detect the right clicked item when using customContextMenuRequested signal

开发者 https://www.devze.com 2023-01-22 03:33 出处:网络
hello all quick question im using in Treewidget the customConte开发者_如何学JAVAxtMenuRequested signal and using using popup with qmenu

hello all quick question im using in Treewidget the customConte开发者_如何学JAVAxtMenuRequested signal and using using popup with qmenu How can I get the item pointer / object / reference that just bean right clicked before the popup executed

I need to make some validation on the item


That signal contains a QPoint, QWidget::customContextMenuRequested(const QPoint & pos), which you can pass to QTreeWidget::itemAt(const QPoint & p) which returns a QTreeWidgetItem.

0

精彩评论

暂无评论...
验证码 换一张
取 消