1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKVALIDATOR_P_H
5#define QQUICKVALIDATOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qtquickglobal_p.h>
19
20#include <QtQml/qqml.h>
21
22#include <QtGui/qvalidator.h>
23
24QT_BEGIN_NAMESPACE
25
26#if QT_CONFIG(validator)
27class Q_QUICK_PRIVATE_EXPORT QQuickIntValidator : public QIntValidator
28{
29 Q_OBJECT
30 Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged FINAL)
31 QML_NAMED_ELEMENT(IntValidator)
32 QML_ADDED_IN_VERSION(2, 0)
33public:
34 QQuickIntValidator(QObject *parent = nullptr);
35
36 QString localeName() const;
37 void setLocaleName(const QString &name);
38 void resetLocaleName();
39
40Q_SIGNALS:
41 void localeNameChanged();
42};
43
44class Q_QUICK_PRIVATE_EXPORT QQuickDoubleValidator : public QDoubleValidator
45{
46 Q_OBJECT
47 Q_PROPERTY(QString locale READ localeName WRITE setLocaleName RESET resetLocaleName NOTIFY localeNameChanged FINAL)
48 QML_NAMED_ELEMENT(DoubleValidator)
49 QML_ADDED_IN_VERSION(2, 0)
50public:
51 QQuickDoubleValidator(QObject *parent = nullptr);
52
53 QString localeName() const;
54 void setLocaleName(const QString &name);
55 void resetLocaleName();
56
57Q_SIGNALS:
58 void localeNameChanged();
59};
60#endif
61
62QT_END_NAMESPACE
63
64#if QT_CONFIG(validator)
65QML_DECLARE_TYPE(QValidator)
66QML_DECLARE_TYPE(QQuickIntValidator)
67QML_DECLARE_TYPE(QQuickDoubleValidator)
68#if QT_CONFIG(regularexpression)
69QML_DECLARE_TYPE(QRegularExpressionValidator)
70#endif
71#endif
72
73#endif // QQUICKVALIDATOR_P_H
74

source code of qtdeclarative/src/quick/util/qquickvalidator_p.h