digiKam
Digikam::DDateEdit Class Reference
+ Inheritance diagram for Digikam::DDateEdit:

Public Slots

void setDate (const QDate &date)
 

Signals

void dateChanged (const QDate &date)
 

Public Member Functions

QDate date () const
 
 DDateEdit (QWidget *const parent=nullptr, const QString &name=QString())
 
bool isReadOnly () const
 
void setReadOnly (bool readOnly)
 
void showPopup () override
 
 ~DDateEdit () override
 

Protected Slots

void dateEntered (const QDate &)
 
void dateSelected (const QDate &)
 
void lineEnterPressed ()
 
void slotTextChanged (const QString &)
 

Protected Member Functions

virtual bool assignDate (const QDate &date)
 
bool eventFilter (QObject *, QEvent *) override
 
void mousePressEvent (QMouseEvent *) override
 
void setupKeywords ()
 

Detailed Description

A date editing widget that consists of an editable combo box. The combo box contains the date in text form, and clicking the combo box arrow will display a 'popup' style date picker.

This widget also supports advanced features like allowing the user to type in the day name to get the date. The following keywords are supported (in the native language): tomorrow, yesterday, today, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.

Constructor & Destructor Documentation

◆ DDateEdit()

Digikam::DDateEdit::DDateEdit ( QWidget *const  parent = nullptr,
const QString &  name = QString() 
)
explicit

◆ ~DDateEdit()

Digikam::DDateEdit::~DDateEdit ( )
override

Member Function Documentation

◆ assignDate()

bool Digikam::DDateEdit::assignDate ( const QDate &  date)
protectedvirtual

Sets the date, without altering the display. This method is used internally to set the widget's date value. As a virtual method, it allows derived classes to perform additional validation on the date value before it is set. Derived classes should return true if QDate::isValid(date) returns false.

Parameters
dateThe new date to set.
Returns
True if the date was set, false if it was considered invalid and remains unchanged.

References date().

Referenced by dateEntered(), dateSelected(), eventFilter(), lineEnterPressed(), setDate(), showPopup(), and slotTextChanged().

◆ date()

QDate Digikam::DDateEdit::date ( ) const
Returns
The date entered. This date could be invalid, you have to check validity yourself.

Referenced by assignDate(), dateEntered(), dateSelected(), eventFilter(), lineEnterPressed(), setDate(), showPopup(), slotTextChanged(), Digikam::SearchFieldRangeDate::valueChanged(), and Digikam::SearchFieldRangeDate::write().

◆ dateChanged

void Digikam::DDateEdit::dateChanged ( const QDate &  date)
signal

This signal is emitted whenever the user modifies the date. The passed date can be invalid.

Referenced by dateEntered(), dateSelected(), DDateEdit(), Digikam::DDateTimeEdit::DDateTimeEdit(), eventFilter(), lineEnterPressed(), and slotTextChanged().

◆ dateEntered

void Digikam::DDateEdit::dateEntered ( const QDate &  date)
protectedslot

References assignDate(), date(), and dateChanged().

◆ dateSelected

void Digikam::DDateEdit::dateSelected ( const QDate &  date)
protectedslot

References assignDate(), date(), and dateChanged().

Referenced by DDateEdit().

◆ eventFilter()

bool Digikam::DDateEdit::eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprotected

◆ isReadOnly()

bool Digikam::DDateEdit::isReadOnly ( ) const
Returns
True if the widget is read-only, false if read-write.

◆ lineEnterPressed

void Digikam::DDateEdit::lineEnterPressed ( )
protectedslot

References assignDate(), date(), and dateChanged().

Referenced by DDateEdit(), and eventFilter().

◆ mousePressEvent()

void Digikam::DDateEdit::mousePressEvent ( QMouseEvent *  e)
overrideprotected

◆ setDate

void Digikam::DDateEdit::setDate ( const QDate &  date)
slot

Sets the date.

Parameters
dateThe new date to display. This date must be valid or it will not be set

References assignDate(), and date().

Referenced by Digikam::SearchFieldRangeDate::read(), and Digikam::SearchFieldRangeDate::reset().

◆ setReadOnly()

void Digikam::DDateEdit::setReadOnly ( bool  readOnly)

Sets whether the widget is read-only for the user. If read-only, the date picker pop-up is inactive, and the displayed date cannot be edited.

Parameters
readOnlyTrue to set the widget read-only, false to set it read-write.

◆ setupKeywords()

void Digikam::DDateEdit::setupKeywords ( )
protected

Fills the keyword map. Re-implement it if you want additional keywords.

Referenced by DDateEdit().

◆ showPopup()

void Digikam::DDateEdit::showPopup ( )
override

References assignDate(), and date().

◆ slotTextChanged

void Digikam::DDateEdit::slotTextChanged ( const QString &  )
protectedslot

References assignDate(), date(), and dateChanged().

Referenced by DDateEdit().


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