KTimeComboBox
#include <KTimeComboBox>
Public Types | |
enum | Option { EditTime = 0x0001 , SelectTime = 0x0002 , ForceTime = 0x0004 , WarnOnInvalid = 0x0008 } |
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 | timeChanged (const QTime &time) |
void | timeEdited (const QTime &time) |
void | timeEntered (const QTime &time) |
Public Slots | |
void | setDisplayFormat (QLocale::FormatType format) |
void | setMaximumTime (const QTime &maxTime, const QString &maxWarnMsg=QString()) |
void | setMinimumTime (const QTime &minTime, const QString &minWarnMsg=QString()) |
void | setOptions (Options options) |
void | setTime (const QTime &time) |
void | setTimeList (QList< QTime > timeList, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString()) |
void | setTimeListInterval (int minutes) |
Detailed Description
A combobox for times.
Definition at line 21 of file ktimecombobox.h.
Member Typedef Documentation
◆ Options
typedef QFlags< Option > KTimeComboBox::Options |
Stores a combination of Option values.
Definition at line 47 of file ktimecombobox.h.
Member Enumeration Documentation
◆ Option
Options provided by the widget.
- See also
- options
- setOptions
- Options
Definition at line 38 of file ktimecombobox.h.
Property Documentation
◆ maximumTime
|
readwrite |
Definition at line 27 of file ktimecombobox.h.
◆ minimumTime
|
readwrite |
Definition at line 26 of file ktimecombobox.h.
◆ options
|
readwrite |
Definition at line 29 of file ktimecombobox.h.
◆ time
|
readwrite |
Definition at line 25 of file ktimecombobox.h.
◆ timeListInterval
|
readwrite |
Definition at line 28 of file ktimecombobox.h.
Constructor & Destructor Documentation
◆ KTimeComboBox()
Create a new KTimeComboBox widget.
Definition at line 275 of file ktimecombobox.cpp.
◆ ~KTimeComboBox()
|
overridedefault |
Destroy the widget.
Member Function Documentation
◆ assignTime()
Assign the time for the widget.
Virtual to allow sub-classes to apply extra validation rules.
- Parameters
-
time the new time
Definition at line 317 of file ktimecombobox.cpp.
◆ displayFormat()
QLocale::FormatType KTimeComboBox::displayFormat | ( | ) | const |
Return the currently set time format.
By default this is the Short Format
- Returns
- the currently set time format
Definition at line 399 of file ktimecombobox.cpp.
◆ eventFilter()
Reimplemented from QObject.
Definition at line 464 of file ktimecombobox.cpp.
◆ focusInEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 521 of file ktimecombobox.cpp.
◆ focusOutEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 494 of file ktimecombobox.cpp.
◆ hidePopup()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 506 of file ktimecombobox.cpp.
◆ isNull()
bool KTimeComboBox::isNull | ( | ) | const |
Return if the current user input is null.
- Returns
- if the current user input is null
- See also
- isValid()
Definition at line 328 of file ktimecombobox.cpp.
◆ isValid()
bool KTimeComboBox::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 322 of file ktimecombobox.cpp.
◆ keyPressEvent()
Reimplemented from QComboBox.
Definition at line 469 of file ktimecombobox.cpp.
◆ maximumTime()
QTime KTimeComboBox::maximumTime | ( | ) | const |
Return the current maximum time.
- Returns
- the current maximum time
Definition at line 362 of file ktimecombobox.cpp.
◆ minimumTime()
QTime KTimeComboBox::minimumTime | ( | ) | const |
Return the current minimum time.
- Returns
- the current minimum time
Definition at line 347 of file ktimecombobox.cpp.
◆ mousePressEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 511 of file ktimecombobox.cpp.
◆ options()
KTimeComboBox::Options KTimeComboBox::options | ( | ) | const |
Return the currently set widget options.
- Returns
- the currently set widget options
Definition at line 333 of file ktimecombobox.cpp.
◆ resetMaximumTime()
void KTimeComboBox::resetMaximumTime | ( | ) |
Reset the maximum time to the default of 23:59:59.999.
Definition at line 372 of file ktimecombobox.cpp.
◆ resetMinimumTime()
void KTimeComboBox::resetMinimumTime | ( | ) |
Reset the minimum time to the default of 00:00:00.000.
Definition at line 357 of file ktimecombobox.cpp.
◆ resetTimeRange()
void KTimeComboBox::resetTimeRange | ( | ) |
Reset the minimum and maximum time to the default values.
Definition at line 394 of file ktimecombobox.cpp.
◆ resizeEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 526 of file ktimecombobox.cpp.
◆ setDisplayFormat
|
slot |
Sets the time format to display.
By default is the Short Format.
- Parameters
-
format the time format to use
Definition at line 404 of file ktimecombobox.cpp.
◆ setMaximumTime
|
slot |
Set the maximum allowed time.
If the time is invalid, or less than current minimum, then the maximum will not be set.
- Parameters
-
maxTime the maximum time maxWarnMsg the maximum warning message
- See also
- minimumTime()
- maximumTime()
- setMaximumTime()
- setTimeRange()
Definition at line 367 of file ktimecombobox.cpp.
◆ setMinimumTime
|
slot |
Set the minimum allowed time.
If the time is invalid, or greater than current maximum, then the minimum will not be set.
- Parameters
-
minTime the minimum time minWarnMsg the minimum warning message
- See also
- minimumTime()
- maximumTime()
- setMaximumTime()
- setTimeRange()
Definition at line 352 of file ktimecombobox.cpp.
◆ setOptions
Set the new widget options.
- Parameters
-
options the new widget options
Definition at line 338 of file ktimecombobox.cpp.
◆ setTime
Set the currently selected time.
You can set an invalid time or a time outside the valid range, validity checking is only done via isValid().
- Parameters
-
time the new time
Definition at line 301 of file ktimecombobox.cpp.
◆ setTimeList
|
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.
- Parameters
-
timeList the list of times able to be selected minWarnMsg the minimum warning message maxWarnMsg the maximum warning message
- See also
- timeList()
Definition at line 449 of file ktimecombobox.cpp.
◆ setTimeListInterval
|
slot |
Set the interval between times able to be selected from the drop-down.
The combo drop-down will be populated with times every 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().
- Parameters
-
minutes the time list interval to display
- See also
- timeListInterval()
Definition at line 418 of file ktimecombobox.cpp.
◆ setTimeRange()
void KTimeComboBox::setTimeRange | ( | const QTime & | minTime, |
const QTime & | maxTime, | ||
const QString & | minWarnMsg = QString(), | ||
const QString & | maxWarnMsg = QString() ) |
Set the minimum and maximum time range.
If either time is invalid, or min > max then the range will not be set.
- Parameters
-
minTime the minimum time maxTime the maximum time minWarnMsg the minimum warning message maxWarnMsg the maximum warning message
Definition at line 377 of file ktimecombobox.cpp.
◆ showPopup()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 501 of file ktimecombobox.cpp.
◆ time()
QTime KTimeComboBox::time | ( | ) | const |
Return the currently selected time.
- Returns
- the currently selected time
Definition at line 295 of file ktimecombobox.cpp.
◆ timeChanged
Signal if the time has been changed either manually by the user or programmatically.
The returned time may be invalid.
- Parameters
-
time the new time
◆ timeEdited
Signal if the time is being manually edited by the user.
The returned time may be invalid.
- Parameters
-
time the new time
◆ timeEntered
Signal if the time has been manually entered or selected by the user.
The returned time may be invalid.
- Parameters
-
time the new time
◆ timeList()
Return the list of times able to be selected in the drop-down.
- Returns
- the select time list
- See also
- setTimeList()
- timeListInterval()
- setTimeListInterval()
Definition at line 437 of file ktimecombobox.cpp.
◆ timeListInterval()
int KTimeComboBox::timeListInterval | ( | ) | const |
Return the interval between select time list entries if set by setTimeListInterval().
Returns -1 if not set.
- Returns
- the select time list interval in minutes
- See also
- setTimeListInterval()
Definition at line 413 of file ktimecombobox.cpp.
◆ wheelEvent()
|
overrideprotectedvirtual |
Reimplemented from QComboBox.
Definition at line 516 of file ktimecombobox.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.