Results 1 to 1 of 1

Thread: QTreeView - persistentEditor or delegates

  1. #1
    Join Date
    Jul 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QTreeView - persistentEditor or delegates

    Hi all
    I have QTreeView implementation as QMyTreeView
    to this tree i have contextMenu with action "rename"
    when user choose rename the action call to my method
    Qt Code:
    1. StartEditing(QModelIndex& indx)
    2. {
    3. this->openPersistentEditor(indx);
    4. }
    To copy to clipboard, switch view to plain text mode 
    and i reimplemented the slot
    Qt Code:
    1. currentChanged (QModelIndex& current, QModelIndex& previous)
    2. {
    3. if(current!=previous)
    4. {
    5. //here i want to get the new text the user write before commitData
    6. this->closePersistentEditor(previous);
    7. }
    8. }
    To copy to clipboard, switch view to plain text mode 
    what i need to do is to get the new text user enter and check it before commit it.
    How can i do it? how can i get the text?
    should i need to use delegate? how ? example will help?
    thanks alot
    Last edited by moti.lahiani; 23rd July 2009 at 15:35.

Similar Threads

  1. Direct root childs inline QTreeView
    By faraslacks in forum Qt Programming
    Replies: 2
    Last Post: 15th January 2009, 07:45
  2. QDirModel and QTreeView cut and paste
    By Micawber in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2008, 20:16
  3. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:22
  4. QTreeView: Holding a line on screen
    By gri in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 11:42
  5. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 06:25

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.