QGIS API Documentation  2.99.0-Master (19b062c)
Public Member Functions | Protected Member Functions | Properties | List of all members
QgsDateTimeEdit Class Reference

The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times. More...

#include <qgsdatetimeedit.h>

Inheritance diagram for QgsDateTimeEdit:
Inheritance graph
[legend]

Public Member Functions

 QgsDateTimeEdit (QWidget *parent=0)
 
bool allowNull () const
 
virtual void clear () override
 Set the current date as NULL. More...
 
QDateTime dateTime () const
 dateTime returns the date time which can eventually be a null date/time More...
 
void setAllowNull (bool allowNull)
 Determines if the widget allows setting null date/time. More...
 
void setDateTime (const QDateTime &dateTime)
 setDateTime set the date time in the widget and handles null date times. More...
 
void setEmpty ()
 Resets the widget to show no value (ie, an "unknown" state). More...
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 
virtual void resizeEvent (QResizeEvent *event) override
 

Properties

bool allowNull
 

Detailed Description

The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times.

Definition at line 30 of file qgsdatetimeedit.h.

Constructor & Destructor Documentation

◆ QgsDateTimeEdit()

QgsDateTimeEdit::QgsDateTimeEdit ( QWidget *  parent = 0)
explicit

Definition at line 27 of file qgsdatetimeedit.cpp.

Member Function Documentation

◆ allowNull()

bool QgsDateTimeEdit::allowNull ( ) const
inline

Definition at line 40 of file qgsdatetimeedit.h.

◆ clear()

void QgsDateTimeEdit::clear ( )
overridevirtual

Set the current date as NULL.

Note
if the widget is not configured to accept NULL dates, this will have no effect

Definition at line 65 of file qgsdatetimeedit.cpp.

◆ dateTime()

QDateTime QgsDateTimeEdit::dateTime ( ) const

dateTime returns the date time which can eventually be a null date/time

Note
since QDateTimeEdit::dateTime() is not virtual, dateTime must be called for QgsDateTimeEdit.

Definition at line 123 of file qgsdatetimeedit.cpp.

◆ mousePressEvent()

void QgsDateTimeEdit::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Definition at line 78 of file qgsdatetimeedit.cpp.

◆ resizeEvent()

void QgsDateTimeEdit::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

Definition at line 135 of file qgsdatetimeedit.cpp.

◆ setAllowNull()

void QgsDateTimeEdit::setAllowNull ( bool  allowNull)

Determines if the widget allows setting null date/time.

Definition at line 55 of file qgsdatetimeedit.cpp.

◆ setDateTime()

void QgsDateTimeEdit::setDateTime ( const QDateTime &  dateTime)

setDateTime set the date time in the widget and handles null date times.

Note
since QDateTimeEdit::setDateTime() is not virtual, setDateTime must be called for QgsDateTimeEdit.

Definition at line 106 of file qgsdatetimeedit.cpp.

◆ setEmpty()

void QgsDateTimeEdit::setEmpty ( )

Resets the widget to show no value (ie, an "unknown" state).

Since
QGIS 2.16

Definition at line 71 of file qgsdatetimeedit.cpp.

Property Documentation

◆ allowNull

bool QgsDateTimeEdit::allowNull
readwrite

Definition at line 33 of file qgsdatetimeedit.h.


The documentation for this class was generated from the following files: