2010-10-22 702 views

回答

2

該信號包含QPointQWidget::customContextMenuRequested(const QPoint & pos),你可以傳遞給QTreeWidget::itemAt(const QPoint & p)返回一個QTreeWidgetItem一些驗證。

+0

一個問題仍然存在,當我右鍵單擊不在樹節點上,我仍然觸發customContextMenuRequested SLOT函數,我如何檢查它的QTreeWidgetItem對象? – user63898 2010-10-23 13:12:19

+1

該文件不明確。我期望在這種情況下,itemAt()將返回null或根項目。 – 2010-10-23 16:18:25