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

Detailed Description
MultiValidator behaves like normal KexiUtils::Validator, but it allows to add define more than one different validator. Given validation is successfull if every subvalidator accepted given value.
- acceptsEmptyValue() is used globally here (no matter what is defined in subvalidators).
- result of calling check() depends on value of check() returned by subvalidators:
- Error is returned if at least one subvalidator returned Error;
- Warning is returned if at least one subvalidator returned Warning and no validator returned error;
- Ok is returned only if exactly all subvalidators returned Ok.
- If there is no subvalidators defined, Error is always returned.
- result of calling validate() (a method implemented for QValidator) depends on value of validate() returned by subvalidators:
- Invalid is returned if at least one subvalidator returned Invalid
- Intermediate is returned if at least one subvalidator returned Intermediate
- Acceptable is returned if exactly all subvalidators returned Acceptable.
- If there is no subvalidators defined, Invalid is always returned.
Definition at line 113 of file validator.h.
Public Member Functions | |
MultiValidator (QObject *parent=0, const char *name=0) | |
MultiValidator (Validator *validator, QObject *parent=0, const char *name=0) | |
void | addSubvalidator (Validator *validator, bool owned=true) |
virtual QValidator::State | validate (QString &input, int &pos) const |
virtual void | fixup (QString &input) const |
Protected Attributes | |
QPtrList< Validator > | m_ownedSubValidators |
QValueList< Validator * > | m_subValidators |
Constructor & Destructor Documentation
|
Constructs multivalidator with no subvalidators defined. You can add more validators with addSubvalidator(). Definition at line 60 of file validator.cpp. |
|
Constructs multivalidator with one validator. It will be owned if has no parent defined. You can add more validators with addSubvalidator(). Definition at line 66 of file validator.cpp. |
Member Function Documentation
|
Adds validator validator as another subvalidator. Subvalidator will be owned by this multivalidator if owned is true and its parent is NULL. Definition at line 74 of file validator.cpp. |
|
Calls QValidator::fixup() on every subvalidator. This may be senseless to use this methog in certain cases (can return weir results), so think twice before.. Definition at line 97 of file validator.cpp. |
|
Reimplemented to call validate() on subvalidators. Reimplemented from KexiUtils::Validator. Definition at line 83 of file validator.cpp. |
The documentation for this class was generated from the following files: