Results 1 to 6 of 6

Thread: QTableView line edit clears the text on edit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2010
    Posts
    769
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 94 Times in 86 Posts

    Default Re: QTableView line edit clears the text on edit

    Found a solution in this thread; add a clause to your model's data() routine that returns the item's data in editable form when called with a Qt::EditRole.

  2. The following 4 users say thank you to SixDegrees for this useful post:

    fede (15th March 2011), jkrienert (14th March 2015), Meladi (4th June 2014), ZyntaxError (11th July 2013)

  3. #2
    Join Date
    Dec 2014
    Posts
    48
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    Windows
    Thanks
    23
    Thanked 1 Time in 1 Post

    Default Re: QTableView line edit clears the text on edit

    @SixDegrees:
    Understandable that since this thread is old an answer to this request might go unspoken.
    -Yet, do you have any example of the implementation you mentioned regarding the data() function in the model?
    [currently experiencing a similar problem where the cell contents are deleted upon selection rather then inherently editable.

Similar Threads

  1. line edit focus
    By addu in forum Qt Programming
    Replies: 3
    Last Post: 16th July 2009, 15:39
  2. Character encoding in text edit and llne edit
    By greenvirag in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2009, 08:45
  3. Checking max text lenght to fit in line edit?
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 16th June 2008, 00:24
  4. mask line edit
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 3rd July 2007, 10:27
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

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
  •  
Qt is a trademark of The Qt Company.