Results 1 to 3 of 3

Thread: Catch item changed

  1. #1
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Question Catch item changed

    Dears,

    I would like to know if there is a way to detect which item are changed in the QTreeWIdget.
    I have for example in a "MyQWidget" class:

    Qt Code:
    1. QTreeWidget* tree = new QTreeWidget(this);
    2. /* ... all QTreeWidgetItem inserted..... */
    3. connect(tree, SIGNAL( itemChanged ( QTreeWidgetItem * , int ), this, SLOT(...)));
    To copy to clipboard, switch view to plain text mode 
    There is a way to obtain a list of the QTreeWidgetItem that are changed?

    Thank a lot

    Annalisa
    Last edited by jpn; 21st July 2008 at 18:38. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Catch item changed

    Qt Code:
    1. connect(tree, SIGNAL( itemChanged ( QTreeWidgetItem * , int ), this, SLOT(QTreeWidgetItem * , int)));
    To copy to clipboard, switch view to plain text mode 

    This should be enough because a user can anyways change only one item at a time. Every time an item is changed, this signal is emitted and therefore if you want a list of items that are changed, you can create one and maintain it.

  3. #3
    Join Date
    Jul 2008
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Catch item changed

    Thank a lot!

    Now everything works as I want!


Similar Threads

  1. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 07:37
  2. Replies: 3
    Last Post: 4th April 2008, 19:51
  3. Replies: 1
    Last Post: 19th April 2007, 22:23
  4. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 01:34

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.