Class: QgsTimeEdit¶
- class qgis.gui.QgsTimeEdit¶
Bases:
QgsDateTimeEdit
The
QgsTimeEdit
class is a QTimeEdit widget with the capability of setting/reading null date/times.Warning
You should use the signal timeValueChanged of this subclass rather than QDateTimeEdit.timeChanged. (If you consequently connect parent’s timeChanged signal and call
time()
afterwards there is no guarantee that NULL values will be correctly handled).See also
See also
Added in version 3.14.
QgsTimeEdit(parent: QWidget = None) Constructor for QgsTimeEdit. The current time is used by default. The widget is allowing null by default. If allow null is disabled, you should check allowNull before getting values from the widget.
Methods
write the null value representation to the line edit without changing the value
- param value:
Returns
True
if the widget is currently set to a null valueSets the
time
for the widget and handles null times.Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- customEvent(self, QEvent)¶
- dateTimeFromText(self, str) QDateTime ¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- displayNull(self, updateCalendar: bool = False)¶
write the null value representation to the line edit without changing the value
- Parameters:
updateCalendar – Flag if calendar is open and minimum date needs to be set
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- emitValueChanged(self, value: Any)¶
- Parameters:
value (Any)
- enterEvent(self, QEvent)¶
- fixup(self, str) str ¶
- focusInEvent(self, event: QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, event: QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionSpinBox)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isNull(self) bool ¶
Returns
True
if the widget is currently set to a null value
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- leaveEvent(self, QEvent)¶
- lineEdit(self) QLineEdit ¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, event: QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setLineEdit(self, QLineEdit)¶
- setTime(self, time: QTime | datetime.time)¶
Sets the
time
for the widget and handles null times.Note
Since QDateTimeEdit.setTime() is not virtual, setTime must be called for QgsTimeEdit.
- Parameters:
time (Union[QTime)
- showEvent(self, event: QShowEvent)¶
- stepEnabled(self) QAbstractSpinBox.StepEnabled ¶
- tabletEvent(self, QTabletEvent)¶
- textFromDateTime(self, Union[QDateTime, datetime.datetime]) str ¶
- timeValueChanged¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Parameters:
name (str = ...)
revision (int = ...)
arguments (Sequence = ...)
- Return type:
PYQT_SIGNAL
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- validate(self, str, int) Tuple[QValidator.State, str, int] ¶
- wheelEvent(self, event: QWheelEvent)¶