CenGen - Генератор ценников  1.1
tnvalidator.h
00001 #ifndef TNVALIDATOR_H
00002 #define TNVALIDATOR_H
00003 class TNValidator : public QValidator {
00004 public:
00005     TNValidator(QObject* parent)
00006         : QValidator(parent)
00007     {
00008 
00009     }
00010 
00011     virtual State validate(QString& str, int& ) const
00012     {
00013         //pos++;
00014         QRegExp rxp = QRegExp ("\\D");
00015         if (str.contains(rxp)) {
00016             return Invalid;
00017         }
00018         if (str.length()>6) {
00019             return Invalid;
00020         }
00021         return Acceptable;
00022 
00023     }
00024 };
00025 #endif // TNVALIDATOR_H
 Указатель Классы Функции