File indexing completed on 2024-04-28 05:50:09

0001 /*
0002  * SPDX-License-Identifier: GPL-3.0-or-later
0003  * SPDX-FileCopyrightText: 2019 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
0004  */
0005 
0006 #ifndef NAME_VALIDATOR_H
0007 #define NAME_VALIDATOR_H
0008 
0009 #include <QRegularExpressionValidator>
0010 #include <QValidator>
0011 
0012 namespace validators
0013 {
0014     class NameValidator: public QValidator
0015     {
0016         Q_OBJECT
0017     public:
0018         explicit NameValidator(QObject *parent = nullptr);
0019         QValidator::State validate(QString &input, int &pos) const override;
0020         void fixup(QString &input) const override;
0021     private:
0022         const QRegularExpressionValidator m_pattern;
0023     };
0024 }
0025 
0026 #endif