QTimeEdit Class

QTimeEdit 类基于QDateTimeEdit widget 提供了一个用于编辑时间的 widget。更多

Header: #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 持有 widget 显示的时间。
  • minimumTime 定义用户可设置的最小(最早)时间。
  • maximumTime 定义用户可设置的最大(最新)时间。
  • displayFormat 包含一个字符串,用于格式化 widget 中显示的时间。

另请参阅 QDateEditQDateTimeEdit

成员函数文档

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

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

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

构造一个空的时间编辑器,其parent 。时间设置为time

[virtual noexcept] QTimeEdit::~QTimeEdit()

毁灭者

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