Akonadi Contacts

dateeditwidget.h
1/*
2 This file is part of Contact Editor.
3
4 SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#pragma once
10
11#include <QDate>
12#include <QLineEdit>
13#include <QWidget>
14
16
18class QToolButton;
19
20class DateView : public QLineEdit
21{
23
24public:
25 explicit DateView(QWidget *parent = nullptr);
26
28 void resetDate();
29
30protected:
31 void contextMenuEvent(QContextMenuEvent *event) override;
32
33private:
34 void emitSignal();
35};
36
37class DateEditWidget : public QWidget
38{
40
41public:
42 enum Type { General, Birthday, Anniversary };
43
44 explicit DateEditWidget(Type type = General, QWidget *parent = nullptr);
45 ~DateEditWidget() override;
46
47 void setDate(const QDate &date);
48 [[nodiscard]] QDate date() const;
49
50 void setReadOnly(bool readOnly);
51
52private:
53 void dateSelected(const QDate &date);
54 void resetDate();
55 void updateView();
56 DateView *mView = nullptr;
57 QToolButton *mSelectButton = nullptr;
58 QToolButton *mClearButton = nullptr;
59 KDatePickerPopup *mMenu = nullptr;
60 QDate mDate;
61 bool mReadOnly = false;
62};
virtual bool event(QEvent *e) override
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:54:05 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.