Results 1 to 3 of 3

Thread: validating input in a QMysqlTableModel

  1. #1
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default validating input in a QMysqlTableModel

    Hello,

    One of the columns in my table is a filename. When that gets edited I want to intercept that, rename the file or revert that cell back to it's original value if the renaming of the file fails.

    Do I have to write my own editor like in the stargate example or is there a simpeler way?

    I know in Bcb there was an event where you could choose to reject the input and leave the cell unchanged.

    Thanks for the help here btw, I'm starting to port more and more from my windows stuff and it's fun.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: validating input in a QMysqlTableModel

    The value will only be changed if the underlying model accepts it.

  3. #3
    Join Date
    Dec 2007
    Location
    Groningen Netherlands
    Posts
    182
    Thanks
    16
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: validating input in a QMysqlTableModel

    Hello,

    What I was looking for is QSqlTableModel::beforeUpdate()

    Thanks.

Similar Threads

  1. QTableView, editing, validating input
    By jml in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2007, 00: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.