本页内容

QTimeEdit Class

QTimeEdit 类提供了一个基于QDateTimeEdit 控件的时间编辑控件。更多内容...

头文件: #include <QTimeEdit>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承自: QDateTimeEdit

公共函数

QTimeEdit(QWidget *parent = nullptr)
QTimeEdit(QTime time, QWidget *parent = nullptr)
virtual ~QTimeEdit()

详细描述

可编辑时间

QTimeEdit 提供的许多属性与函数均在QDateTimeEdit 中实现。以下是该类的相关属性:

  • time 存储控件显示的时间。
  • minimumTime 定义用户可设置的最小(最早)时间。
  • maximumTime 定义用户可设置的最大(最晚)时间。
  • displayFormat 包含一个字符串,用于格式化控件中显示的时间。

另请参阅 QDateEdit 和QDateTimeEdit 。

成员函数文档

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

使用parent 构建一个空的时间编辑器。

[explicit] QTimeEdit::QTimeEdit(QTime time, QWidget *parent = nullptr)

使用parent 创建一个空的时间编辑器。时间设置为time 。

[virtual noexcept] QTimeEdit::~QTimeEdit()

析构函数。

© 2026 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.