PDA

View Full Version : validating input in a QMysqlTableModel



JeanC
28th January 2008, 16:56
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. :)

wysota
28th January 2008, 16:58
The value will only be changed if the underlying model accepts it.

JeanC
28th January 2008, 17:06
Hello,

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

Thanks.