diff options
Diffstat (limited to 'src/GraphemeCountValidator.h')
| -rw-r--r-- | src/GraphemeCountValidator.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/GraphemeCountValidator.h b/src/GraphemeCountValidator.h new file mode 100644 index 0000000..e2a5dc7 --- /dev/null +++ b/src/GraphemeCountValidator.h @@ -0,0 +1,26 @@ +#ifndef GRAPHEMECOUNTVALIDATOR_H +#define GRAPHEMECOUNTVALIDATOR_H + +#include <QValidator> + +class Q_GUI_EXPORT GraphemeCountValidator : public QValidator +{ + Q_OBJECT + Q_PROPERTY(uint minGraphemeCount READ minGraphemeCount WRITE setMinGraphemeCount NOTIFY minGraphemeCountChanged) +public: + explicit GraphemeCountValidator(QObject *parent = nullptr); + explicit GraphemeCountValidator(uint min_count, QObject *parent = nullptr); + virtual QValidator::State validate(QString &, int &) const override; + + uint minGraphemeCount() const; + void setMinGraphemeCount(uint c); + + +Q_SIGNALS: + void minGraphemeCountChanged(uint minGraphemeCount); + +private: + uint minCount; +}; + +#endif // GRAPHEMECOUNTVALIDATOR_H |
