How to use a validator with QTableWidgetItem?
-
Assuming I have a QTableWidgetItem item and I just wanna validate data that users enter. Example, users only enter a number into that item otherwise the program will show a warning dialog.
I also search on "that document page":http://harmattan-dev.nokia.com/docs/library/html/qt4/qtablewidgetitem.html but I didn't find similar function with setValidator() function.
How can I use a validator for that QTableWidgetItem item?
Thanks!
-
If I'm not mistaken, you could fill the table->setCellWidget with a pointer to a QLineEdit and set the validator on that widget. Otherwise get the 'cell changed' (or something like it) and do a manual validation there and report back to the user. The first would be my preference.
Greetz