PDA

View Full Version : QTableView & spin



fpujol
18th January 2007, 22:05
Hello,

When I define table with a double field in mysql and I create a QTableView with his QSqlTableModel and I want to edit this field automatically shows me an
spin box and limit me to put values between 0 - 99.99. How I can disable this spin for a free edition or how I can increase the range.

Thank you.

wysota
18th January 2007, 23:51
Set a custom item editor factory for the delegate (QItemDelegate::setItemEditorFactory()) or register a custom editor for the double variant using the default item editor factory.

There are other ways to do what you want too, but they require subclassing the delegate.