Results 1 to 2 of 2

Thread: how can i keep the original data when i edit the element in the table view?

  1. #1
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default how can i keep the original data when i edit the element in the table view?

    I have just make a tool with Qt4. I have just made a subclass of QAbstractTableModel, and show the items with QTableView. When i double-clicked the item and start to edit the item, i found the original data was cleared while i wanted to keep it except i input some new data. Does some one have some advices?
    P.S. sorry for my poor english.

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: how can i keep the original data when i edit the element in the table view?

    In your ::data method, return the data to be shown in the edtor when asked for the Qt::EditRole.
    It's nice to be important but it's more important to be nice.

Similar Threads

  1. How to get the index of original SQL table?
    By Kode.Cooper in forum Qt Programming
    Replies: 0
    Last Post: 27th January 2010, 08:43
  2. Fetching data from table view
    By utkuaydin in forum Newbie
    Replies: 6
    Last Post: 19th January 2010, 07:27
  3. Table view->model->set data
    By tulsi in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 08:36
  4. Table Model / View Problem -- Data Not Displaying
    By jhendersen in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2007, 06:45
  5. View/edit database in a table and in a form
    By igorko in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2006, 09:09

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.