Python PyQt5.QtWidgets.QTimeEdit() Examples

The following are 5 code examples of PyQt5.QtWidgets.QTimeEdit(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source File: mode.py    From Anki-Night-Mode with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #2
Source File: preset_src.py    From linux-show-player with GNU General Public License v3.0 6 votes vote down vote up
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) 
Example #3
Source File: Frames.py    From photobooth with GNU Affero General Public License v3.0 6 votes vote down vote up
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 
Example #4
Source File: broken_example_for_questions.py    From Mastering-GUI-Programming-with-Python with MIT License 5 votes vote down vote up
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) 
Example #5
Source File: calendar_form.py    From Mastering-GUI-Programming-with-Python with MIT License 4 votes vote down vote up
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)