KDateComboBox
#include <KDateComboBox>
Public Types | |
enum | Option { EditDate = 0x0001 , SelectDate = 0x0002 , DatePicker = 0x0004 , DateKeywords = 0x0008 , WarnOnInvalid = 0x0010 } |
typedef QFlags< Option > | Options |
Public Types inherited from QComboBox | |
enum | InsertPolicy |
enum | SizeAdjustPolicy |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Signals | |
void | dateChanged (const QDate &date) |
void | dateEdited (const QDate &date) |
void | dateEntered (const QDate &date) |
Public Slots | |
void | resetDateRange () |
void | resetMaximumDate () |
void | resetMinimumDate () |
void | setDate (const QDate &date) |
void | setDateMap (QMap< QDate, QString > dateMap) |
void | setDateRange (const QDate &minDate, const QDate &maxDate, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString()) |
void | setDisplayFormat (QLocale::FormatType format) |
void | setMaximumDate (const QDate &maxDate, const QString &maxWarnMsg=QString()) |
void | setMinimumDate (const QDate &minDate, const QString &minWarnMsg=QString()) |
void | setOptions (Options options) |
Detailed Description
A combobox for dates.
Definition at line 21 of file kdatecombobox.h.
Member Typedef Documentation
◆ Options
typedef QFlags< Option > KDateComboBox::Options |
Stores a combination of Option values.
Definition at line 47 of file kdatecombobox.h.
Member Enumeration Documentation
◆ Option
Options provided by the widget.
- See also
- options()
- setOptions()
- Options
Definition at line 37 of file kdatecombobox.h.
Property Documentation
◆ date
|
readwrite |
Definition at line 25 of file kdatecombobox.h.
◆ maximumDate
|
readwrite |
Definition at line 27 of file kdatecombobox.h.
◆ minimumDate
|
readwrite |
Definition at line 26 of file kdatecombobox.h.
◆ options
|
readwrite |
Definition at line 28 of file kdatecombobox.h.
Constructor & Destructor Documentation
◆ KDateComboBox()
Create a new KDateComboBox widget.
By default the EditDate, SelectDate, DatePicker and DateKeywords options are enabled, the ShortDate format is used and the date is set to the current date.
Definition at line 208 of file kdatecombobox.cpp.
◆ ~KDateComboBox()
|
overridedefault |
Destroy the widget.
Member Function Documentation
◆ assignDate()
Assign the date for the widget.
Virtual to allow sub-classes to apply extra validation rules.
- Parameters
-
date the new date
Definition at line 256 of file kdatecombobox.cpp.
◆ date()
QDate KDateComboBox::date | ( | ) | const |
Return the currently selected date.
- Returns
- the currently selected date
Definition at line 238 of file kdatecombobox.cpp.
◆ dateChanged
Signal if the date has been changed either manually by the user or programmatically.
The emitted date may be invalid.
- Parameters
-
date the new date
◆ dateEdited
Signal if the date is being manually edited by the user.
The emitted date may be invalid, or may not yet be what the user intends as the final date.
- Parameters
-
date the new date
◆ dateEntered
Signal if the date has been manually entered (by typing a date and losing focus, or pressing Enter) or selected by the user (using the popup selector, or up, down, page up, page down keys, or the mouse wheel).
The emitted date may be invalid.
- Parameters
-
date the new date
◆ dateMap()
Return the map of dates listed in the drop-down and their displayed string forms.
- Returns
- the select date map
- See also
- setDateMap()
Definition at line 346 of file kdatecombobox.cpp.
◆ displayFormat()
QLocale::FormatType KDateComboBox::displayFormat | ( | ) | const |
Return the currently set date display format.
By default this is the Short Format
- Returns
- the currently set date format
Definition at line 332 of file kdatecombobox.cpp.
◆ eventFilter()
Reimplemented from QObject.
Definition at line 356 of file kdatecombobox.cpp.
◆ focusInEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 456 of file kdatecombobox.cpp.
◆ focusOutEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 386 of file kdatecombobox.cpp.
◆ hidePopup()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 433 of file kdatecombobox.cpp.
◆ isNull()
bool KDateComboBox::isNull | ( | ) | const |
Return if the current user input is null.
- Returns
- if the current user input is null
- See also
- isValid()
Definition at line 267 of file kdatecombobox.cpp.
◆ isValid()
bool KDateComboBox::isValid | ( | ) | const |
Return if the current user input is valid.
If the user input is null then it is not valid
- Returns
- if the current user input is valid
- See also
- isNull()
Definition at line 261 of file kdatecombobox.cpp.
◆ keyPressEvent()
Reimplemented from QComboBox.
Definition at line 361 of file kdatecombobox.cpp.
◆ maximumDate()
QDate KDateComboBox::maximumDate | ( | ) | const |
Return the current maximum date.
- Returns
- the current maximum date
Definition at line 303 of file kdatecombobox.cpp.
◆ minimumDate()
QDate KDateComboBox::minimumDate | ( | ) | const |
Return the current minimum date.
- Returns
- the current minimum date
Definition at line 286 of file kdatecombobox.cpp.
◆ mousePressEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 438 of file kdatecombobox.cpp.
◆ options()
KDateComboBox::Options KDateComboBox::options | ( | ) | const |
Return the currently set widget options.
- Returns
- the currently set widget options
Definition at line 272 of file kdatecombobox.cpp.
◆ resetDateRange
|
slot |
Reset the minimum and maximum date to the default values.
- See also
- setDateRange()
Definition at line 327 of file kdatecombobox.cpp.
◆ resetMaximumDate
|
slot |
Reset the maximum date to the default.
The default is to have no maximum date.
Definition at line 315 of file kdatecombobox.cpp.
◆ resetMinimumDate
|
slot |
Reset the minimum date to the default.
The default is to have no minimum date.
Definition at line 298 of file kdatecombobox.cpp.
◆ resizeEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 461 of file kdatecombobox.cpp.
◆ setDate
Set the currently selected date.
You can set an invalid date or a date outside the valid range, validity checking is only done via isValid().
- Parameters
-
date the new date
Definition at line 244 of file kdatecombobox.cpp.
◆ setDateMap
Set the list of dates able to be selected from the drop-down and the string form to display for those dates, e.g.
"2010-01-01" and "Yesterday".
Any invalid or duplicate dates will be used, the list will NOT be sorted, and the minimum and maximum date will not be affected.
The dateMap
is keyed by the date to be listed and the value is the string to be displayed. If you want the date to be displayed in the default date format then the string should be null. If you want a separator to be displayed then set the string to "separator".
- Parameters
-
dateMap the map of dates able to be selected
- See also
- dateMap()
Definition at line 351 of file kdatecombobox.cpp.
◆ setDateRange
|
slot |
Set the valid date range to be applied by isValid().
Both dates must be valid and the minimum date must be less than or equal to the maximum date, otherwise the date range will not be set.
- Parameters
-
minDate the minimum date maxDate the maximum date minWarnMsg the minimum warning message maxWarnMsg the maximum warning message
Definition at line 320 of file kdatecombobox.cpp.
◆ setDisplayFormat
|
slot |
Sets the date format to display.
By default is the Short Format.
- Parameters
-
format the date format to use
Definition at line 337 of file kdatecombobox.cpp.
◆ setMaximumDate
|
slot |
Set the maximum allowed date.
If the date is invalid, or less than current minimum, then the maximum will not be set.
- Parameters
-
maxDate the maximum date maxWarnMsg the maximum warning message
- See also
- minimumDate()
- maximumDate()
- setMaximumDate()
- setDateRange()
Definition at line 308 of file kdatecombobox.cpp.
◆ setMinimumDate
|
slot |
Set the minimum allowed date.
If the date is invalid, or greater than current maximum, then the minimum will not be set.
- Parameters
-
minDate the minimum date minWarnMsg the minimum warning message
- See also
- minimumDate()
- maximumDate()
- setMaximumDate()
- setDateRange()
Definition at line 291 of file kdatecombobox.cpp.
◆ setOptions
Set the new widget options.
- Parameters
-
options the new widget options
Definition at line 277 of file kdatecombobox.cpp.
◆ showPopup()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 397 of file kdatecombobox.cpp.
◆ wheelEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 443 of file kdatecombobox.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:43 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.