16#ifndef QGSDATETIMEEDIT_H
17#define QGSDATETIMEEDIT_H
22#include <QDateTimeEdit>
67 void setDateTime(
const QDateTime &dateTime );
74 QDateTime dateTime()
const;
92 void clear()
override;
106 QString nullRepresentation()
const;
115 void setNullRepresentation(
const QString &null );
123 bool event( QEvent *event )
override;
142#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
143 QgsDateTimeEdit(
const QVariant &var, QMetaType::Type parserType, QWidget *parent );
145 QgsDateTimeEdit(
const QVariant &var, QMetaType::Type parserType, QWidget *parent );
175 void changed(
const QVariant &
dateTime );
181 bool mCurrentPressEvent =
false;
183 QString mOriginalStyleSheet = QString();
184 QAction *mClearAction;
185 QString mNullRepresentation;
188 bool mAllowNull =
true;
191 bool mIsNull =
false;
196 void displayCurrentDate();
199 void resetBeforeChange(
int delta );
211 void setMinimumEditDateTime();
void setDate(const QDate &date)
Sets the date for the widget and handles null dates.
void dateValueChanged(const QDate &date)
Signal emitted whenever the date changes.
QgsDateEdit(QWidget *parent=nullptr)
Constructor for QgsDateEdit.
void emitValueChanged(const QVariant &value) override
Emits the widget's correct value changed signal.
bool allowNull() const
If the widget allows setting null date/time.
void wheelEvent(QWheelEvent *event) override
void setAllowNull(bool allowNull)
Determines if the widget allows setting null date/time.
friend class TestQgsDateTimeEdit
int mBlockChangedSignal
Block change signals if true.
void showEvent(QShowEvent *event) override
QDateTime dateTime() const
Returns the date time which can be a null date/time.
void focusInEvent(QFocusEvent *event) override
bool isNull() const
Returns true if the widget is currently set to a null value.
virtual void emitValueChanged(const QVariant &value)
Emits the widget's correct value changed signal.
void mousePressEvent(QMouseEvent *event) override
QTime time() const
Returns the time which can be a null time.
void focusOutEvent(QFocusEvent *event) override
bool mIsEmpty
true if the widget is empty
void displayNull(bool updateCalendar=false)
write the null value representation to the line edit without changing the value
bool event(QEvent *event) override
Reimplemented to enable/disable the clear action depending on read-only status.
QgsDateTimeEdit(QWidget *parent=nullptr)
Constructor for QgsDateTimeEdit.
QDate date() const
Returns the date which can be a null date.
void valueChanged(const QDateTime &date)
Signal emitted whenever the value changes.
QgsTimeEdit(QWidget *parent=nullptr)
Constructor for QgsTimeEdit.
void emitValueChanged(const QVariant &value) override
Emits the widget's correct value changed signal.
void timeValueChanged(const QTime &time)
Signal emitted whenever the time changes.
void setTime(const QTime &time)
Sets the time for the widget and handles null times.