KDEUI
#include <kdatetimeedit.h>
Public Types | |
enum | Option { ShowCalendar = 0x00001, ShowDate = 0x00002, ShowTime = 0x00004, ShowTimeSpec = 0x00008, EditDate = 0x00020, EditTime = 0x00040, SelectCalendar = 0x00100, SelectDate = 0x00200, SelectTime = 0x00400, SelectTimeSpec = 0x00800, DatePicker = 0x01000, DateKeywords = 0x02000, ForceTime = 0x04000, WarnOnInvalid = 0x08000 } |
Signals | |
void | calendarChanged (KLocale::CalendarSystem calendarSystem) |
void | calendarEntered (KLocale::CalendarSystem calendarSystem) |
void | dateChanged (const QDate &date) |
void | dateEdited (const QDate &date) |
void | dateEntered (const QDate &date) |
void | dateTimeChanged (const KDateTime &dateTime) |
void | dateTimeEdited (const KDateTime &dateTime) |
void | dateTimeEntered (const KDateTime &dateTime) |
void | timeChanged (const QTime &time) |
void | timeEdited (const QTime &time) |
void | timeEntered (const QTime &time) |
void | timeSpecChanged (const KDateTime::Spec &spec) |
void | timeSpecEntered (const KDateTime::Spec &spec) |
Public Member Functions | |
KDateTimeEdit (QWidget *parent=0) | |
virtual | ~KDateTimeEdit () |
const KCalendarSystem * | calendar () const |
KLocale::CalendarSystem | calendarSystem () const |
QList< KLocale::CalendarSystem > | calendarSystemsList () const |
QDate | date () const |
KLocale::DateFormat | dateDisplayFormat () const |
QMap< QDate, QString > | dateMap () const |
KDateTime | dateTime () const |
bool | isNull () const |
bool | isNullDate () const |
bool | isNullTime () const |
bool | isValid () const |
bool | isValidDate () const |
bool | isValidTime () const |
KDateTime | maximumDateTime () const |
KDateTime | minimumDateTime () const |
Options | options () const |
QTime | time () const |
KLocale::TimeFormatOptions | timeDisplayFormat () const |
QList< QTime > | timeList () const |
int | timeListInterval () const |
KDateTime::Spec | timeSpec () const |
KTimeZones::ZoneMap | timeZones () const |
Protected Member Functions | |
void | assignCalendarSystem (KLocale::CalendarSystem calendarSystem) |
virtual void | assignDate (const QDate &date) |
virtual void | assignDateTime (const KDateTime &dateTime) |
virtual void | assignTime (const QTime &time) |
void | assignTimeSpec (const KDateTime::Spec &spec) |
virtual bool | eventFilter (QObject *object, QEvent *event) |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
virtual void | resizeEvent (QResizeEvent *event) |
Properties | |
QDate | date |
Options | options |
QTime | time |
int | timeListInterval |
Detailed Description
Definition at line 33 of file kdatetimeedit.h.
Member Enumeration Documentation
Options provided by the widget.
- See also
- options
- setOptions
Definition at line 50 of file kdatetimeedit.h.
Constructor & Destructor Documentation
|
explicit |
Create a new KDateTimeEdit widget.
Definition at line 264 of file kdatetimeedit.cpp.
|
virtual |
Destroy the widget.
Definition at line 286 of file kdatetimeedit.cpp.
Member Function Documentation
|
protected |
Assign the calendar system for the widget.
Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.
- Parameters
-
calendarSystem the new calendar system
Definition at line 404 of file kdatetimeedit.cpp.
|
protectedvirtual |
Assign the date for the widget.
Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.
- Parameters
-
date the new date
Definition at line 387 of file kdatetimeedit.cpp.
|
protectedvirtual |
Assign the date, time and time spec for the widget.
Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.
- Parameters
-
datetime the new date and time
Definition at line 371 of file kdatetimeedit.cpp.
|
protectedvirtual |
Assign the time for the widget.
Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.
- Parameters
-
time the new time
Definition at line 425 of file kdatetimeedit.cpp.
|
protected |
Assign the time spec for the widget.
Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.
- Parameters
-
spec the new time spec
Definition at line 442 of file kdatetimeedit.cpp.
const KCalendarSystem* KDateTimeEdit::calendar | ( | ) | const |
Returns a pointer to the Calendar System object used by this widget.
Usually this will be the Global Calendar System using the Global Locale, but this may have been changed to a custom Calendar System possibly using a custom Locale.
Normally you will not need to access this object.
- See also
- KCalendarSystem
- setCalendar
- Returns
- the current calendar system instance
|
signal |
Signal if the Calendar System has been changed either manually by the user or programatically.
- Parameters
-
calendarSystem the new calendar system
|
signal |
Signal if the Calendar System has been manually entered by the user.
- Parameters
-
calendarSystem the new calendar system
KLocale::CalendarSystem KDateTimeEdit::calendarSystem | ( | ) | const |
Returns the Calendar System type used by the widget.
- Returns
- the Calendar System currently used
Definition at line 296 of file kdatetimeedit.cpp.
QList< KLocale::CalendarSystem > KDateTimeEdit::calendarSystemsList | ( | ) | const |
Returns the list of Calendar Systems displayed.
- Parameters
-
calendars the list of calendar systems to display
Definition at line 510 of file kdatetimeedit.cpp.
QDate KDateTimeEdit::date | ( | ) | const |
Return the currently selected date.
- Returns
- the currently selected date
|
signal |
Signal if the date has been changed either manually by the user or programatically.
The returned date may be invalid.
- Parameters
-
date the new date
KLocale::DateFormat KDateTimeEdit::dateDisplayFormat | ( | ) | const |
Return the currently set date display format.
By default this is the Short Date
- Returns
- the currently set date format
Definition at line 520 of file kdatetimeedit.cpp.
|
signal |
Signal if the date is being manually edited by the user.
The returned date may be invalid.
- Parameters
-
date the new date
|
signal |
Signal if the date has been manually entered by the user.
The returned date may be invalid.
- Parameters
-
date the new date
Return the map of dates listed in the drop-down and their displayed string forms.
- See also
- setDateMap()
- Returns
- the select date map
Definition at line 530 of file kdatetimeedit.cpp.
KDateTime KDateTimeEdit::dateTime | ( | ) | const |
Return the currently selected date, time and time spec.
- Returns
- the currently selected date, time and time spec
Definition at line 291 of file kdatetimeedit.cpp.
|
signal |
Signal if the date or time has been changed either manually by the user or programatically.
The returned date and time may be invalid.
- Parameters
-
dateTime the new date, time and time spec
|
signal |
Signal if the date or time is being manually edited by the user.
The returned date and time may be invalid.
- Parameters
-
dateTime the new date, time and time spec
|
signal |
Signal if the date or time has been manually entered by the user.
The returned date and time may be invalid.
- Parameters
-
dateTime the new date, time and time spec
Definition at line 580 of file kdatetimeedit.cpp.
|
protectedvirtual |
Definition at line 585 of file kdatetimeedit.cpp.
|
protectedvirtual |
Definition at line 590 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isNull | ( | ) | const |
Return if the current user input is null.
- See also
- isValid()
- Returns
- if the current user input is null
Definition at line 323 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isNullDate | ( | ) | const |
Return if the current user input date is null.
- See also
- isValidDate()
- Returns
- if the current user input date is null
Definition at line 333 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isNullTime | ( | ) | const |
Return if the current user input time is null.
- See also
- isValidTime()
- Returns
- if the current user input time is null
Definition at line 343 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isValid | ( | ) | const |
Return if the current user input is valid.
If the user input is null then it is not valid
- See also
- isNull()
- Returns
- if the current user input is valid
Definition at line 316 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isValidDate | ( | ) | const |
Return if the current user input date is valid.
If the user input date is null then it is not valid
- See also
- isNullDate()
- Returns
- if the current user input date is valid
Definition at line 328 of file kdatetimeedit.cpp.
bool KDateTimeEdit::isValidTime | ( | ) | const |
Return if the current user input time is valid.
If the user input time is null then it is not valid
- See also
- isNullTime()
- Returns
- if the current user input time is valid
Definition at line 338 of file kdatetimeedit.cpp.
KDateTime KDateTimeEdit::maximumDateTime | ( | ) | const |
Return the current maximum date and time.
- Returns
- the current maximum date and time
Definition at line 468 of file kdatetimeedit.cpp.
KDateTime KDateTimeEdit::minimumDateTime | ( | ) | const |
Return the current minimum date and time.
- Returns
- the current minimum date and time
Definition at line 453 of file kdatetimeedit.cpp.
Options KDateTimeEdit::options | ( | ) | const |
Return the currently set widget options.
- Returns
- the currently set widget options
|
slot |
Reset the minimum and maximum date and time to the default.
Definition at line 497 of file kdatetimeedit.cpp.
|
slot |
Reset the minimum date and time to the default.
Definition at line 473 of file kdatetimeedit.cpp.
|
slot |
Reset the minimum date and time to the default.
Definition at line 458 of file kdatetimeedit.cpp.
|
protectedvirtual |
Definition at line 596 of file kdatetimeedit.cpp.
|
slot |
Changes the calendar system to use.
Can use its own local locale if set.
You retain ownership of the calendar object, it will not be destroyed with the widget.
- Parameters
-
calendar the calendar system object to use, defaults to global
Definition at line 410 of file kdatetimeedit.cpp.
|
slot |
Set the Calendar System used for this widget.
Uses the global locale.
- Parameters
-
calendarSystem the Calendar System to use
Definition at line 393 of file kdatetimeedit.cpp.
|
slot |
Set the list of Calendar Systems to display.
- Parameters
-
calendars the list of calendar systems to display
Definition at line 502 of file kdatetimeedit.cpp.
|
slot |
Set the currently selected date.
- Parameters
-
date the new date
Definition at line 378 of file kdatetimeedit.cpp.
|
slot |
Sets the date format to display.
By default is the Short Date format.
- Parameters
-
format the date format to use
Definition at line 515 of file kdatetimeedit.cpp.
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 "seperator".
- See also
- dateMap()
- Parameters
-
dateMap the map of dates able to be selected
Definition at line 525 of file kdatetimeedit.cpp.
|
slot |
Set the currently selected date, time and time spec.
- Parameters
-
dateTime the new date, time and time spec
Definition at line 361 of file kdatetimeedit.cpp.
|
slot |
Set the minimum and maximum date and time range.
To enable range checking provide two valid dates. To disable range checking provide two invalid dates, or call clearDateRange;
- Parameters
-
minDateTime the minimum date and time maxDateTime the maximum date and time minWarnMsg the minimum warning message maxWarnMsg the maximum warning message
Definition at line 478 of file kdatetimeedit.cpp.
|
slot |
Set the maximum allowed date.
If the date is invalid, or less than current minimum, then the maximum will not be set.
- See also
- setMinimumDateTime()
- setDateRange()
- Parameters
-
maxDate the maximum date maxWarnMsg the maximum warning message
Definition at line 463 of file kdatetimeedit.cpp.
|
slot |
Set the minimum allowed date.
If the date is invalid, or more than current maximum, then the minimum will not be set.
- See also
- setMaximumDateTime()
- setDateRange()
- Parameters
-
maxDate the minimum date maxWarnMsg the minimum warning message
Definition at line 448 of file kdatetimeedit.cpp.
|
slot |
Set the new widget options.
- Parameters
-
options the new widget options
Definition at line 348 of file kdatetimeedit.cpp.
|
slot |
Set the currently selected time.
- Parameters
-
time the new time
Definition at line 416 of file kdatetimeedit.cpp.
|
slot |
Sets the time format to display.
By default is the Short Time format.
- Parameters
-
format the time format to use
Definition at line 535 of file kdatetimeedit.cpp.
|
slot |
Set the list of times able to be selected from the drop-down.
Setting the time list will override any time interval previously set via setTimeListInterval().
Any invalid or duplicate times will be ignored, and the list will be sorted.
The minimum and maximum time will automatically be set to the earliest and latest value in the list.
- See also
- timeList()
- Parameters
-
timeList the list of times able to be selected minWarnMsg the minimum warning message maxWarnMsg the maximum warning message
Definition at line 555 of file kdatetimeedit.cpp.
|
slot |
Set the interval between times able to be selected from the drop-down.
The combo drop-down will be populated with times every
- Parameters
-
minutes apart, starting from the minimumTime() and ending at maximumTime().
If the ForceInterval option is set then any time manually typed into the combo line edit will be forced to the nearest interval.
This interval must be an exact divisor of the valid time range hours. For example with the default 24 hour range interval
must divide 1440 minutes exactly, meaning 1, 6 and 90 are valid but 7, 31 and 91 are not.
Setting the time list interval will override any time list previously set via setTimeList().
- See also
- timeListInterval()
- Parameters
-
minutes the time list interval to display
Definition at line 545 of file kdatetimeedit.cpp.
|
slot |
Set the current time spec.
- Parameters
-
spec the new spec
Definition at line 431 of file kdatetimeedit.cpp.
|
slot |
Set the time zones able to be selected.
- Parameters
-
zones the time zones to display
Definition at line 567 of file kdatetimeedit.cpp.
QTime KDateTimeEdit::time | ( | ) | const |
Return the currently selected time.
- Returns
- the currently selected time
|
signal |
Signal if the time has been changed either manually by the user or programatically.
The returned time may be invalid.
- Parameters
-
time the new time
KLocale::TimeFormatOptions KDateTimeEdit::timeDisplayFormat | ( | ) | const |
Return the currently set time format.
By default this is the Short Time
- Returns
- the currently set time format
Definition at line 540 of file kdatetimeedit.cpp.
|
signal |
Signal if the time is being manually edited by the user.
The returned time may be invalid.
- Parameters
-
time the new time
|
signal |
Signal if the time has been manually entered by the user.
The returned time may be invalid.
- Parameters
-
time the new time
QList< QTime > KDateTimeEdit::timeList | ( | ) | const |
Return the list of times able to be selected in the drop-down.
- Returns
- the select time list
Definition at line 562 of file kdatetimeedit.cpp.
int KDateTimeEdit::timeListInterval | ( | ) | const |
Return the time list interval able to be selected.
- Returns
- the select time intervals in minutes
KDateTime::Spec KDateTimeEdit::timeSpec | ( | ) | const |
Return the currently selected time spec.
- Returns
- the currently selected time spec
Definition at line 311 of file kdatetimeedit.cpp.
|
signal |
Signal if the time spec has been changed either manually by the user or programatically.
- Parameters
-
timeSpec the new time spec
|
signal |
Signal if the time spec has been changed manually by the user.
- Parameters
-
timeSpec the new time spec
KTimeZones::ZoneMap KDateTimeEdit::timeZones | ( | ) | const |
Return the list of time zones able to be selected.
- Parameters
-
zones the time zones to display
Definition at line 575 of file kdatetimeedit.cpp.
Property Documentation
|
readwrite |
Definition at line 37 of file kdatetimeedit.h.
|
readwrite |
Definition at line 40 of file kdatetimeedit.h.
|
readwrite |
Definition at line 38 of file kdatetimeedit.h.
|
readwrite |
Definition at line 39 of file kdatetimeedit.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.