Results 1 to 13 of 13

Thread: Problem emiting signal in QTreeWidgetItem's subclass

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem emiting signal in QTreeWidgetItem's subclass

    Quote Originally Posted by jpn View Post
    Does MyTreeWidgetItem inherit QObject? What did you try so far?
    Yes, it inherits QObject
    Qt Code:
    1. class MyTreeWidgetItem : public QObject, public QTreeWidgetItem
    2. {
    3. Q_OBJECT
    4.  
    5. public:
    6. MyTreeWidgetItem(QTreeWidget* parent);
    7. MyTreeWidgetItem(MyTreeWidgetItem* parent);
    8. ~MyTreeWidgetItem();
    9.  
    10. Element* pE;
    11. signals:
    12. void itemClicked(MyTreeWidgetItem* item, int column);
    13.  
    14. private slots:
    15. void slot_itemSelected();
    16. };
    17. 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*...
    Last edited by Shawn; 4th September 2007 at 01:29.

Similar Threads

  1. Replies: 3
    Last Post: 15th April 2007, 19:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.