Yes, it inherits QObject
Qt Code:
{ Q_OBJECT public: MyTreeWidgetItem(MyTreeWidgetItem* parent); ~MyTreeWidgetItem(); Element* pE; signals: void itemClicked(MyTreeWidgetItem* item, int column); private slots: void slot_itemSelected(); }; int Q_REGISTER_METATYPE(MyTreeWidgetItem*);To copy to clipboard, switch view to plain text mode
In QGraphicsItem, the enum QGraphicsItem::GraphicsItemChangeare sent as the state changes, and I can catch this and emit a signal, which "carrys" the Element* .
But in QTreeWidgetItem I can not find anything like GraphicsItemChange.
I tried to used the signal void itemClicked(QTreeWidgetItem* item, int column) in QTreeWidget, but it can only "return" QTreeWidgetItem*...
Bookmarks