16 #ifndef QGSDATETIMEEDIT_H
17 #define QGSDATETIMEEDIT_H
19 #include <QDateTimeEdit>
39 Q_PROPERTY(
bool allowNull READ allowNull WRITE setAllowNull )
55 void setAllowNull(
bool allowNull );
61 bool allowNull()
const {
return mAllowNull;}
67 void setDateTime(
const QDateTime &dateTime );
74 QDateTime dateTime()
const;
92 void clear()
override;
107 QString nullRepresentation()
const;
116 void setNullRepresentation(
const QString &
null );
124 void valueChanged(
const QDateTime &date );
127 void mousePressEvent( QMouseEvent *event )
override;
128 void focusOutEvent( QFocusEvent *event )
override;
129 void focusInEvent( QFocusEvent *event )
override;
130 void wheelEvent( QWheelEvent *event )
override;
131 void showEvent( QShowEvent *event )
override;
134 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
136 QgsDateTimeEdit(
const QVariant &var, QVariant::Type parserType, QWidget *parent );
138 QgsDateTimeEdit(
const QVariant &var, QMetaType::Type parserType, QWidget *parent );
144 bool mIsEmpty =
false;
147 int mBlockChangedSignal = 0;
153 void displayNull(
bool updateCalendar =
false );
158 virtual void emitValueChanged(
const QVariant &value );
167 void changed(
const QVariant &dateTime );
174 bool mCurrentPressEvent =
false;
176 QString mOriginalStyleSheet = QString();
177 QAction *mClearAction;
178 QString mNullRepresentation;
181 bool mAllowNull =
true;
184 bool mIsNull =
false;
189 void displayCurrentDate();
192 void resetBeforeChange(
int delta );
207 void setMinimumEditDateTime()
209 setDateTimeRange( QDateTime( QDate( 1, 1, 1 ), QTime( 0, 0, 0 ) ), maximumDateTime() );
212 friend class TestQgsDateTimeEdit;
248 void setTime(
const QTime &time );
255 void timeValueChanged(
const QTime &time );
294 void setDate(
const QDate &date );
301 void dateValueChanged(
const QDate &date );
308 #endif // QGSDATETIMEEDIT_H