Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qquickvalidator.cpp
Go to the documentation of this file.
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#include "qquickvalidator_p.h"
5
7
8#if QT_CONFIG(validator)
9
28QQuickIntValidator::QQuickIntValidator(QObject *parent)
30{
31}
32
41QString QQuickIntValidator::localeName() const
42{
43 return locale().name();
44}
45
46void QQuickIntValidator::setLocaleName(const QString &name)
47{
48 if (locale().name() != name) {
49 setLocale(QLocale(name));
50 emit localeNameChanged();
51 }
52}
53
54void QQuickIntValidator::resetLocaleName()
55{
56 QLocale defaultLocale;
57 if (locale() != defaultLocale) {
58 setLocale(defaultLocale);
59 emit localeNameChanged();
60 }
61}
62
106QQuickDoubleValidator::QQuickDoubleValidator(QObject *parent)
108{
109}
110
119QString QQuickDoubleValidator::localeName() const
120{
121 return locale().name();
122}
123
124void QQuickDoubleValidator::setLocaleName(const QString &name)
125{
126 if (locale().name() != name) {
127 setLocale(QLocale(name));
128 emit localeNameChanged();
129 }
130}
131
132void QQuickDoubleValidator::resetLocaleName()
133{
134 QLocale defaultLocale;
135 if (locale() != defaultLocale) {
136 setLocale(defaultLocale);
137 emit localeNameChanged();
138 }
139}
140
215#endif // validator
216
218
219#include "moc_qquickvalidator_p.cpp"
The QDoubleValidator class provides range checking of floating-point numbers.
Definition qvalidator.h:89
The QIntValidator class provides a validator that ensures a string contains a valid integer within a ...
Definition qvalidator.h:56
\inmodule QtCore
Definition qobject.h:90
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Q_QML_PRIVATE_EXPORT QV4::ReturnedValue locale(QV4::ExecutionEngine *engine, const QString &localeName)
Provides locale specific properties and formatted data.
Combined button and popup list for selecting options.
GLuint name
#define emit
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent