本文整理汇总了Python中PyQt5.QtWidgets.QTimeEdit方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QTimeEdit方法的具体用法?Python QtWidgets.QTimeEdit怎么用?Python QtWidgets.QTimeEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets
的用法示例。
在下文中一共展示了QtWidgets.QTimeEdit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QTimeEdit [as 别名]
def __init__(self, parent, initial_time, label, on_update=lambda x: x):
"""
Args:
parent: ColorMapWindow instance
"""
QWidget.__init__(self, parent)
self.parent = parent
self.on_update = on_update
self.label = QLabel(label)
self.qt_time = QTime.fromString(initial_time)
self.time_edit = QTimeEdit(self.qt_time)
self.time_edit.timeChanged.connect(self.update)
self.grid = QGridLayout()
self.fill_layout()
self.setLayout(self.grid)
示例2: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QTimeEdit [as 别名]
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.setLayout(QVBoxLayout())
self.layout().setAlignment(Qt.AlignTop)
self.functionGroup = QGroupBox(self)
self.functionGroup.setTitle(translate('PresetSrcSettings', 'Presets'))
self.functionGroup.setLayout(QVBoxLayout())
self.layout().addWidget(self.functionGroup)
self.functionCombo = QComboBox(self.functionGroup)
self.functionGroup.layout().addWidget(self.functionCombo)
for function in sorted(PresetSrc.PRESETS.keys()):
self.functionCombo.addItem(function)
self.functionDuration = QTimeEdit(self.functionGroup)
self.functionDuration.setDisplayFormat('HH.mm.ss.zzz')
self.functionGroup.layout().addWidget(self.functionDuration)
示例3: createForm
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QTimeEdit [as 别名]
def createForm(self):
self._date_widget = QtWidgets.QDateEdit(QtCore.QDate.currentDate())
self._date_widget.setCalendarPopup(True)
self._time_widget = QtWidgets.QTimeEdit(QtCore.QTime.currentTime())
layout = QtWidgets.QFormLayout()
layout.addRow(_('Date:'), self._date_widget)
layout.addRow(_('Time:'), self._time_widget)
widget = QtWidgets.QGroupBox()
widget.setTitle(_('Set system date and time:'))
widget.setLayout(layout)
return widget
示例4: __init__
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QTimeEdit [as 别名]
def __init__(self):
super().__init__()
self.setLayout(qtw.QHBoxLayout())
self.time_inp = qtw.QTimeEdit(self)
#self.time_inp = qtw.QTimeEdit(self, objectName='time_inp')
self.layout().addWidget(self.time_inp)
#qtc.QMetaObject.connectSlotsByName(self)
开发者ID:PacktPublishing,项目名称:Mastering-GUI-Programming-with-Python,代码行数:9,代码来源:broken_example_for_questions.py
示例5: setupUi
# 需要导入模块: from PyQt5 import QtWidgets [as 别名]
# 或者: from PyQt5.QtWidgets import QTimeEdit [as 别名]
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(799, 600)
self.horizontalLayout = QtWidgets.QHBoxLayout(MainWindow)
self.horizontalLayout.setObjectName("horizontalLayout")
self.calendar = QtWidgets.QCalendarWidget(MainWindow)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.calendar.sizePolicy().hasHeightForWidth())
self.calendar.setSizePolicy(sizePolicy)
self.calendar.setObjectName("calendar")
self.horizontalLayout.addWidget(self.calendar)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.label = QtWidgets.QLabel(MainWindow)
self.label.setObjectName("label")
self.verticalLayout.addWidget(self.label)
self.event_list = QtWidgets.QListWidget(MainWindow)
self.event_list.setObjectName("event_list")
self.verticalLayout.addWidget(self.event_list)
self.groupBox = QtWidgets.QGroupBox(MainWindow)
self.groupBox.setObjectName("groupBox")
self.gridLayout = QtWidgets.QGridLayout(self.groupBox)
self.gridLayout.setObjectName("gridLayout")
self.event_category = QtWidgets.QComboBox(self.groupBox)
self.event_category.setObjectName("event_category")
self.event_category.addItem("")
self.event_category.addItem("")
self.event_category.addItem("")
self.event_category.addItem("")
self.event_category.addItem("")
self.event_category.addItem("")
self.gridLayout.addWidget(self.event_category, 1, 0, 1, 1)
self.event_time = QtWidgets.QTimeEdit(self.groupBox)
self.event_time.setObjectName("event_time")
self.gridLayout.addWidget(self.event_time, 1, 1, 1, 1)
self.event_detail = QtWidgets.QTextEdit(self.groupBox)
self.event_detail.setObjectName("event_detail")
self.gridLayout.addWidget(self.event_detail, 2, 0, 1, 3)
self.event_title = QtWidgets.QLineEdit(self.groupBox)
self.event_title.setObjectName("event_title")
self.gridLayout.addWidget(self.event_title, 0, 0, 1, 3)
self.allday_check = QtWidgets.QCheckBox(self.groupBox)
self.allday_check.setObjectName("allday_check")
self.gridLayout.addWidget(self.allday_check, 1, 2, 1, 1)
self.add_button = QtWidgets.QPushButton(self.groupBox)
self.add_button.setObjectName("add_button")
self.gridLayout.addWidget(self.add_button, 3, 1, 1, 1)
self.del_button = QtWidgets.QPushButton(self.groupBox)
self.del_button.setObjectName("del_button")
self.gridLayout.addWidget(self.del_button, 3, 2, 1, 1)
self.verticalLayout.addWidget(self.groupBox)
self.horizontalLayout.addLayout(self.verticalLayout)
self.retranslateUi(MainWindow)
self.allday_check.toggled['bool'].connect(self.event_time.setDisabled)
QtCore.QMetaObject.connectSlotsByName(MainWindow)