[Frogface-general] Validation in frogface
Status: Planning
Brought to you by:
declanmcgrath
|
From: Declan M. <dec...@fr...> - 2007-05-06 08:56:15
|
Hi Ganesh, I've worked out how the validation works in Frogface. It's pretty straightfoward. There are two types. One type of validation is an input mask which you create when you design the form graphically in QT4 Designer. The other type is a QValidator that you set in the main form of the application - in our case that is DiveDashboard.cpp. I've been practicing using QValidators to help me do regular expression validation. Anyway, here is what will need to be done for the next phase of the project. * Validate maxlength of Dive Centre in Dive Brief tab ( the file divedashboardwidget.ui will need to be opened in QT Designer and the maxLength property on the Dive Centre field set to something sensible like 30 characters * Validate max depth to be a decimal value (to 1 decimal place) less than 1000. I've just been working on this - it's nearly there - but you can enter numbers greater than 1000.0 which is incorrect. We'll have to make that regular expression work harder :-) It's around around line 360 in DiveDashboard.cpp. That's where the regex is defined. For more info, search for QRegExp in QT Assistant in order to help get more info on QT's regex's. * Validate average depth to a decimal value (to 1 decimal place) less than 1000. So basically, we must make it the validate the same way as max depth. I don't think the Time In, Time Out and Surf Int fields are saving correctly so I'll look at that next. Would you like to look at this validation issue above? As ever there's no rush either way :-) I wonder will we have anything for the QT4 competition :-) :-) :-) All the best, Dec |