QDateEdit Class

The QDateEdit class provides a widget for editing dates based on the QDateTimeEdit widget. More...

Header: #include <QDateEdit>
qmake: QT += widgets
Inherits: QDateTimeEdit

Public Functions

QDateEdit(QWidget *parent = Q_NULLPTR)
QDateEdit(const QDate &date, QWidget *parent = Q_NULLPTR)
~QDateEdit()

Additional Inherited Members

Detailed Description

The QDateEdit class provides a widget for editing dates based on the QDateTimeEdit widget.

Many of the properties and functions provided by QDateEdit are implemented in QDateTimeEdit. These are the relevant properties of this class:

  • date holds the date displayed by the widget.
  • minimumDate defines the minimum (earliest) date that can be set by the user.
  • maximumDate defines the maximum (latest) date that can be set by the user.
  • displayFormat contains a string that is used to format the date displayed in the widget.
Screenshot of a Windows Vista style date editing widget A date editing widget shown in the Windows Vista widget style.
Screenshot of a Macintosh style date editing widget A date editing widget shown in the Macintosh widget style.
Screenshot of a Fusion style date editing widget A date editing widget shown in the Fusion widget style.

See also QTimeEdit and QDateTimeEdit.

Member Function Documentation

QDateEdit::QDateEdit(QWidget *parent = Q_NULLPTR)

Constructs an empty date editor with a parent.

QDateEdit::QDateEdit(const QDate &date, QWidget *parent = Q_NULLPTR)

Constructs an empty date editor with a parent. The date is set to date.

QDateEdit::~QDateEdit()

Destructor.

© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/archives/qt-5.6/qdateedit.html