Results 1 to 1 of 1

Thread: Save problem with custom delegate

  1. #1
    Join Date
    Jan 2008
    Posts
    39
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Save problem with custom delegate

    Hello
    I have written a custom delegate to display dates in a particular format and then save them when entered this way. The problem is that it appears to work randomly. Either it saves the date correctly to a sqlite3 database or I get a messagebox pop up with a Microsoft 'python.exe has encountered a problem' message. I also get 'Process terminated with an exit code of -1073741819' in the IDE OS Commands tab (Wing).

    This is the setModelData function from the delegate.

    Qt Code:
    1. def setModelData(self, editor, model, index):
    2. if index.isValid():
    3. if DATATYPE[self.parent.dataType] == 'SURVEY' and index.column() in [7, 8]:
    4. model.setData(index, QVariant(QDate.fromString(str(editor.text()), 'd/M/yyyy')))
    5. else:
    6. QSqlRelationalDelegate.setModelData(self, editor, model, index)
    To copy to clipboard, switch view to plain text mode 

    Thanks in advance.
    Last edited by jpn; 22nd July 2008 at 07:35. Reason: missing [code] tags

Similar Threads

  1. Capture events in a custom delegate
    By vfernandez in forum Qt Programming
    Replies: 9
    Last Post: 19th March 2008, 05:33
  2. Delegate editor sizing problem
    By smacchia in forum Qt Programming
    Replies: 19
    Last Post: 7th December 2007, 16:27
  3. updating database with custom delegate
    By Shaitan in forum Qt Programming
    Replies: 4
    Last Post: 17th July 2007, 10:34
  4. Problem applying setWindowOpacity to a custom Widget
    By yellowmat in forum Qt Programming
    Replies: 8
    Last Post: 1st November 2006, 10:05
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.