CodePudding user response:
Void itemClicked (QTreeWidgetItem * item, int column), the signal of the second argument, is the number of columns of this item. What is his columns. Distinguish between just the way they are.CodePudding user response:
Thank you for your reply but my QTreeWidget upstairs is used to display the tree menu, the number of columns column only one want to ask how to distinguish between different lines with QTreeWidgetItemCodePudding user response:
QTreeWidgetitem * clickedItem=qobject_case & lt; QTreeWidgetItem * & gt; (sender ()); This should be able to get click on the itemCodePudding user response:
Problem has been solved, such as the upstairs said, through the QTreeWidgetitem * can differentiate different QTreeWidgetitem thanks for your replyCodePudding user response:
QTreeWidgetitem not a qobject should use qobject_castCodePudding user response:
QTreeWidgetItem * clickedItem=qobject_case & lt; QTreeWidgetItem * & gt; (sender ()); 1 & gt; ./Control/TreeList. CPP (105) : error C2065: 'qobject_case: undeclared identifier1 & gt; ./Control/TreeList. CPP (105) : error C2059: syntax error: '& gt; 'CodePudding user response: