QDateEdit Class

QDateEdit 类在QDateTimeEdit widget 的基础上提供了一个用于编辑日期的 widget。更多

Header: #include <QDateEdit>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QDateTimeEdit

公共函数

QDateEdit(QWidget *parent = nullptr)
QDateEdit(QDate date, QWidget *parent = nullptr)
virtual ~QDateEdit()

详细说明

QDateEdit 提供的许多属性和函数都在QDateTimeEdit 中实现。这些是该类的相关属性:

  • date 持有 widget 显示的日期。
  • minimumDate 定义用户可设置的最小(最早)日期。
  • maximumDate 定义用户可设置的最大(最新)日期。
  • displayFormat 包含一个字符串,用于格式化 widget 中显示的日期。

另请参阅 QTimeEditQDateTimeEdit

成员函数文档

[explicit] QDateEdit::QDateEdit(QWidget *parent = nullptr)

parent 构建一个空的日期编辑器。

[explicit] QDateEdit::QDateEdit(QDate date, QWidget *parent = nullptr)

构造一个空的日期编辑器,其parent 。日期设置为date

[virtual noexcept] QDateEdit::~QDateEdit()

毁灭者

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.