digiKam Developer Documentation: Digikam::DDatePicker Class Reference

| digiKam Developer Documentation Professional Photo Management with the Power of Open Source

Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | Friends | List of all members
Digikam::DDatePicker Class Reference

Provides a widget for calendar date input.

Inheritance diagram for Digikam::DDatePicker:

## Signals
void | dateChanged (const QDate &date)
| This signal is emitted each time the selected date is changed.
void | dateEntered (const QDate &date)
| This signal is emitted when enter is pressed and a VALID date has been entered before into the line edit.
void | dateSelected (const QDate &date)
| This signal is emitted each time a day has been selected by clicking on the table (hitting a day in the current month).
void | tableClicked ()
| This signal is emitted when the day has been selected by clicking on it in the table.

## Public Member Functions
| DDatePicker (const QDate &dt, QWidget *const parent=nullptr)
| The constructor.
| DDatePicker (QWidget *const parent=nullptr)
| The constructor.
| ~DDatePicker () override
| The destructor.
const QDate & | date () const
DDateTable * | dateTable () const
int | fontSize () const
bool | hasCloseButton () const
void | setCloseButton (bool enable)
| By calling this method with `enable` = true, DDatePicker will show a little close-button in the upper button-row.
bool | setDate (const QDate &date)
| Sets the date.
void | setFontSize (int)
| Sets the font size of the widgets elements.
QSize | sizeHint () const override
| The size hint for date pickers.

## Protected Slots
void | dateChangedSlot (const QDate &date)
void | lineEnterPressed ()
void | monthBackwardClicked ()
void | monthForwardClicked ()
void | selectMonthClicked ()
void | selectYearClicked ()
void | tableClickedSlot ()
void | todayButtonClicked ()
void | uncheckYearSelector ()
void | weekSelected (int)
void | yearBackwardClicked ()
void | yearForwardClicked ()

## Protected Member Functions
void | changeEvent (QEvent *) override
bool | eventFilter (QObject *, QEvent *) override
| to catch move keyEvents when QLineEdit has keyFocus
void | resizeEvent (QResizeEvent *) override
| the resize event

## Properties
bool | closeButton
QDate | date
int | fontSize

## Friends
class | Private

## Constructor & Destructor Documentation

## ◆ DDatePicker() [1/2]

Digikam::DDatePicker::DDatePicker | ( | QWidget *const | parent = `nullptr` | ) |
| explicit

The current date will be displayed initially.

## ◆ DDatePicker() [2/2]

Digikam::DDatePicker::DDatePicker | ( | const QDate & | dt,
|  | QWidget *const | parent = `nullptr`
| ) |  |
| explicit

The given date will be displayed initially.

## Member Function Documentation

## ◆ date()

const QDate & Digikam::DDatePicker::date | ( |  | ) | const

Returns
  The selected date.

## ◆ dateChanged

void Digikam::DDatePicker::dateChanged | ( | const QDate & | date | ) |
| signal

Usually, this does not mean that the date has been entered, since the date also changes, for example, when another month is selected.

See also
  dateSelected

## ◆ dateEntered

void Digikam::DDatePicker::dateEntered | ( | const QDate & | date | ) |
| signal

Connect to both dateEntered() and dateSelected() to receive all events where the user really enters a date.

## ◆ dateSelected

void Digikam::DDatePicker::dateSelected | ( | const QDate & | date | ) |
| signal

It has the same meaning as dateSelected() in older versions of DDatePicker.

## ◆ dateTable()

DDateTable * Digikam::DDatePicker::dateTable | ( |  | ) | const

Returns
  The DDateTable widget child of this DDatePicker widget.

## ◆ fontSize()

int Digikam::DDatePicker::fontSize | ( |  | ) | const

Returns
  The font size of the widget elements.

## ◆ hasCloseButton()

bool Digikam::DDatePicker::hasCloseButton | ( |  | ) | const

Returns
  True if a DDatePicker shows a close-button.

See also
  setCloseButton

## ◆ setCloseButton()

void Digikam::DDatePicker::setCloseButton | ( | bool | enable | ) |

Clicking the close-button will cause the DDatePicker's topLevelWidget()'s close() method being called. This is mostly useful for toplevel datepickers without a window manager decoration.

See also
  hasCloseButton

## ◆ setDate()

bool Digikam::DDatePicker::setDate | ( | const QDate & | date | ) |

Returns
  False and does not change anything if the date given is invalid.

## ◆ sizeHint()

QSize Digikam::DDatePicker::sizeHint | ( |  | ) | const
| override

The size hint recommends the minimum size of the widget so that all elements may be placed without clipping. This sometimes looks ugly, so when using the size hint, try adding 28 to each of the reported numbers of pixels.