Results 1 to 4 of 4

Thread: QTreeView and item editing

  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTreeView and item editing

    I have a QTreeView with an editable QDirModel. How can I detect when user ends an item editing (rename)? (I need to update some stuff after that)
    And another question - is there someway to catch the Delete key pressing on QTreeView (without a subclassing)?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView and item editing

    I have a QTreeView with an editable QDirModel. How can I detect when user ends an item editing (rename)? (I need to update some stuff after that)
    Am not sure about it,,, but I guess QItemDelegate::setModelData is the function for you
    And another question - is there someway to catch the Delete key pressing on QTreeView (without a subclassing)?
    Yess,,, install a event filter on the QTreeView - Refer QObject::installEventFilter
    Hope this helps

  3. The following user says thank you to aamer4yu for this useful post:

    roxton (25th July 2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView and item editing

    Thank you! And about the QItemDelegate::setModelData - I've used a commitData signal from QItemDelegate.

  5. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView and item editing

    Ya, commitData was the signal, I remembered somewhat abt it but was not able to locate it

Similar Threads

  1. QTreeView, QSortFilterProxyModel and item expansions
    By benacler in forum Qt Programming
    Replies: 3
    Last Post: 21st May 2008, 20:30
  2. Replies: 5
    Last Post: 6th December 2007, 14:43
  3. QTreeView: selection behavior upon selected item removal
    By Pieter from Belgium in forum Qt Programming
    Replies: 6
    Last Post: 11th July 2007, 16:00
  4. Programattically Clicking an Item in QTreeView
    By johnny_sparx in forum Qt Programming
    Replies: 4
    Last Post: 11th May 2006, 16:26
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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.