1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the Qt Designer of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU
19** General Public License version 3 as published by the Free Software
20** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21** included in the packaging of this file. Please review the following
22** information to ensure the GNU General Public License requirements will
23** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24**
25** $QT_END_LICENSE$
26**
27****************************************************************************/
28
29#ifndef QLONGLONGVALIDATOR_H
30#define QLONGLONGVALIDATOR_H
31
32#include <QtGui/qvalidator.h>
33
34QT_BEGIN_NAMESPACE
35
36namespace qdesigner_internal {
37
38class QLongLongValidator : public QValidator
39{
40 Q_OBJECT
41 Q_PROPERTY(qlonglong bottom READ bottom WRITE setBottom)
42 Q_PROPERTY(qlonglong top READ top WRITE setTop)
43
44public:
45 explicit QLongLongValidator(QObject * parent);
46 QLongLongValidator(qlonglong bottom, qlonglong top, QObject * parent);
47 ~QLongLongValidator();
48
49 QValidator::State validate(QString &, int &) const;
50
51 void setBottom(qlonglong);
52 void setTop(qlonglong);
53 void setRange(qlonglong bottom, qlonglong top);
54
55 qlonglong bottom() const { return b; }
56 qlonglong top() const { return t; }
57
58private:
59 Q_DISABLE_COPY_MOVE(QLongLongValidator)
60
61 qlonglong b;
62 qlonglong t;
63};
64
65// ----------------------------------------------------------------------------
66class QULongLongValidator : public QValidator
67{
68 Q_OBJECT
69 Q_PROPERTY(qulonglong bottom READ bottom WRITE setBottom)
70 Q_PROPERTY(qulonglong top READ top WRITE setTop)
71
72public:
73 explicit QULongLongValidator(QObject * parent);
74 QULongLongValidator(qulonglong bottom, qulonglong top, QObject * parent);
75 ~QULongLongValidator();
76
77 QValidator::State validate(QString &, int &) const;
78
79 void setBottom(qulonglong);
80 void setTop(qulonglong);
81 void setRange(qulonglong bottom, qulonglong top);
82
83 qulonglong bottom() const { return b; }
84 qulonglong top() const { return t; }
85
86private:
87 Q_DISABLE_COPY_MOVE(QULongLongValidator)
88
89 qulonglong b;
90 qulonglong t;
91};
92
93} // namespace qdesigner_internal
94
95QT_END_NAMESPACE
96
97#endif // QLONGLONGVALIDATOR_H
98

source code of qttools/src/designer/src/components/propertyeditor/qlonglongvalidator.h