1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
9 | contributed Qt objects |
11 \----------------------------------------------------------------------/
13 File: QY2CharValidator.h
15 Author: Stefan Hundhammer <sh@suse.de>
17 This is a pure Qt object - it can be used independently of YaST2.
22 #ifndef QY2CharValidator_h
23 #define QY2CharValidator_h
25 #include <qvalidator.h>
28 class QY2CharValidator : public QValidator
37 * Create a validator object that checks for input characters being any one
38 * of 'validChars'. If this is empty, any input is accepted.
40 QY2CharValidator( const QString & initialValidChars,
42 const char * name = 0 );
52 * Reimplemented from @ref QValidator.
54 virtual State validate( QString & input, int & pos ) const;
57 * Set the valid input characters.
58 * If 'newValidChars' is empty, any input is accepted.
60 void setValidChars( const QString & newValidChars )
61 { _validChars = newValidChars; }
64 * Retrieve the valid input characters.
66 QString validChars() const { return _validChars; }
73 #endif // QY2CharValidator_h