KGuiAddons

kdatevalidator.h
1/* -*- C++ -*-
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 1997 Tim D. Gilman <tdgilman@best.org>
4 SPDX-FileCopyrightText: 1998-2001 Mirko Boehm <mirko@kde.org>
5 SPDX-FileCopyrightText: 2007 John Layt <john@layt.net>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#ifndef KDATEVALIDATOR_H
11#define KDATEVALIDATOR_H
12
13#include <kguiaddons_export.h>
14
15#include <QValidator>
16
17#include <memory>
18
19class KDateValidatorPrivate;
20
21/**
22 * @class KDateValidator kdatevalidator.h KDateValidator
23 *
24 * Validates user-entered dates.
25 */
26class KGUIADDONS_EXPORT KDateValidator : public QValidator
27{
28 Q_OBJECT
29public:
30 explicit KDateValidator(QObject *parent = nullptr);
31 ~KDateValidator() override;
32
33public:
34 State validate(QString &text, int &e) const override;
35 void fixup(QString &input) const override;
36 State date(const QString &text, QDate &date) const;
37
38private:
39 std::unique_ptr<KDateValidatorPrivate> const d;
40};
41
42#endif // KDATEVALIDATOR_H
Validates user-entered dates.
virtual void fixup(QString &input) const const
virtual State validate(QString &input, int &pos) const const=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:40 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.