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 );
67 void setDateTime(
const QDateTime &dateTime );
74 QDateTime dateTime()
const;
92 void clear()
override;
107 QString nullRepresentation()
const;
116 void setNullRepresentation(
const QString &
null );
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 QgsDateTimeEdit(
const QVariant &var, QVariant::Type parserType, QWidget *parent );
140 bool mIsEmpty =
false;
143 int mBlockChangedSignal = 0;
149 void displayNull(
bool updateCalendar =
false );
154 virtual void emitValueChanged(
const QVariant &value );
163 void changed(
const QVariant &dateTime );
170 bool mCurrentPressEvent =
false;
172 QString mOriginalStyleSheet = QString();
173 QAction *mClearAction;
174 QString mNullRepresentation;
177 bool mAllowNull =
true;
180 bool mIsNull =
false;
185 void displayCurrentDate();
188 void resetBeforeChange(
int delta );
203 void setMinimumEditDateTime()
205 setDateTimeRange( QDateTime( QDate( 1, 1, 1 ), QTime( 0, 0, 0 ) ), maximumDateTime() );
208 friend class TestQgsDateTimeEdit;
244 void setTime(
const QTime &time );
290 void setDate(
const QDate &date );
304 #endif // QGSDATETIMEEDIT_H