KexiUtils::Validator Class Reference
#include <validator.h>
Inheritance diagram for KexiUtils::Validator:

Detailed Description
A validator extending QValidator with offline-checking for value's validity.The offline-checking for value's validity is provided by Validator::check() method. The validator groups two purposes into one container:
- string validator for line editors (online checking, "on typing");
- offline-checking for QVariant values, reimplementing validate().
It also offers error and warning messages for check() method. You may need to reimplement:
- QValidator::State IdentifierValidator::validate( QString& input, int& pos ) const;
- Result check(const QString &valueName, QVariant v, QString &message, QString &details);
Definition at line 45 of file validator.h.
Public Types | |
| enum | Result { Error = 0, Ok = 1, Warning = 2 } |
Public Member Functions | |
| Validator (QObject *parent=0, const char *name=0) | |
| virtual | ~Validator () |
| void | setAcceptsEmptyValue (bool set) |
| bool | acceptsEmptyValue () const |
| Result | check (const QString &valueName, const QVariant &v, QString &message, QString &details) |
| virtual QValidator::State | validate (QString &input, int &pos) const |
| void | addChildValidator (Validator *v) |
| Adds a child validator v. | |
Static Public Member Functions | |
| static const QString | msgColumnNotEmpty () |
| A generic error/warning message. | |
Protected Member Functions | |
| virtual Result | internalCheck (const QString &valueName, const QVariant &v, QString &message, QString &details) |
Protected Attributes | |
| bool | m_acceptsEmptyValue: 1 |
Friends | |
| class | MultiValidator |
Member Enumeration Documentation
|
|
Definition at line 48 of file validator.h. |
Constructor & Destructor Documentation
|
||||||||||||
|
Definition at line 24 of file validator.cpp. |
|
|
Definition at line 30 of file validator.cpp. |
Member Function Documentation
|
|
Definition at line 59 of file validator.h. Referenced by KexiNameWidget::isNameRequired(). |
|
|
Adds a child validator v.
|
|
||||||||||||||||||||
|
Checks if value v is ok and returns one of Result value:
Definition at line 34 of file validator.cpp. References Error, internalCheck(), m_acceptsEmptyValue, msgColumnNotEmpty(), and Ok. Referenced by KexiNameWidget::checkValidity(). |
|
||||||||||||||||||||
|
Reimplemented in KexiDB::ObjectNameValidator, and KexiUtils::IdentifierValidator. Definition at line 47 of file validator.cpp. References Error. Referenced by check(). |
|
|
A generic error/warning message.
Definition at line 77 of file validator.h. Referenced by check(). |
|
|
Sets accepting empty values on (true) or off (false). By default the validator does not accepts empty values. Definition at line 55 of file validator.h. Referenced by KexiNameWidget::setNameRequired(). |
|
||||||||||||
|
This implementation always returns value QValidator::Acceptable. Reimplemented in KexiUtils::IdentifierValidator, and KexiUtils::MultiValidator. Definition at line 53 of file validator.cpp. |
Friends And Related Function Documentation
|
|
Definition at line 91 of file validator.h. |
Member Data Documentation
|
|
Definition at line 89 of file validator.h. Referenced by check(). |
The documentation for this class was generated from the following files:
