Results 1 to 3 of 3

Thread: Edit items in table model

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Edit items in table model

    Hi , I have a question...
    I have a table model...working fine...
    the only thing that makes me a bit angry is that everytime when I try to edit items there is no way I can add new data to the ones that it already contains it...when I try to edit data in an item the old value that is stored in it gets disappeared and I get empty item with blinking cursor...yes If i press Esc the old value gets displayed...
    What I want is standard behaviour of table editor->> when I double click the item I want EDIT the value not INSERT NEW value in edited item...
    Anyone idea ?
    THanks !

    my model implementation is in attachement
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Edit items in table model

    Make your model return the same data for Qt::EditRole as for Qt::DisplayRole and just to be sure, try ModelTest.

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

    gyre (14th January 2008)

  4. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Edit items in table model

    Quote Originally Posted by jacek View Post
    Make your model return the same data for Qt::EditRole as for Qt:isplayRole and just to be sure, try ModelTest.
    Thanks man...returning the same data for Edit and Display roles helpes...
    PLUS, that modeltest thing is cool..
    Thanks

Similar Threads

  1. removing model Items
    By gyre in forum Newbie
    Replies: 2
    Last Post: 25th November 2007, 20:10
  2. Edit items on QTreeView + QDirModel
    By junior0007 in forum Qt Programming
    Replies: 4
    Last Post: 23rd November 2007, 07:16
  3. Table Model / View Problem -- Data Not Displaying
    By jhendersen in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2007, 06:45
  4. QT Table Model
    By aekilic in forum Qt Programming
    Replies: 15
    Last Post: 24th January 2007, 12:57
  5. Table model / view editing issue
    By Caius Aérobus in forum Qt Programming
    Replies: 9
    Last Post: 7th April 2006, 11:03

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.