Results 1 to 3 of 3

Thread: Editing problem in QTreeView

  1. #1
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Editing problem in QTreeView

    I have a QTreeView in my application. When user double clicks on an item to edit it's value, the value disappears and user finds himself/herself in a line-edit like something with no text at all. I want the user to be able to edit the text inside the item, without destroying it (i mean i want the user to see the text he is editing at the time of editing.) How can I do that?

  2. #2
    Join Date
    Nov 2009
    Posts
    129
    Thanks
    4
    Thanked 29 Times in 29 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Editing problem in QTreeView

    I think you need to be sure the override of QAbstractItemModel::data in your model returns the text to be edited when asked for the Qt::EditRole

  3. #3
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Editing problem in QTreeView

    are you using custom delegate?
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. Problem with editing QTableView
    By TimoSan in forum Qt Programming
    Replies: 0
    Last Post: 23rd November 2009, 10:46
  2. enable user editing of QTreeView headers?
    By iraytrace in forum Newbie
    Replies: 0
    Last Post: 9th October 2009, 22:25
  3. QTableWidgetItem editing problem
    By fmariusd in forum Qt Programming
    Replies: 8
    Last Post: 4th September 2009, 08:10
  4. QTreeView and item editing
    By roxton in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2008, 18:56
  5. Problem editing TreeWidget items
    By Moezzie in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2007, 21:22

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.