KDEUI
#include <ktimezonewidget.h>
Public Member Functions | |
KTimeZoneWidget (QWidget *parent=0, KTimeZones *timeZones=0) | |
virtual | ~KTimeZoneWidget () |
void | clearSelection () |
bool | itemsCheckable () const |
QStringList | selection () const |
QAbstractItemView::SelectionMode | selectionMode () const |
void | setItemsCheckable (bool enable) |
void | setSelected (const QString &zone, bool selected) |
void | setSelectionMode (QAbstractItemView::SelectionMode mode) |
Static Public Member Functions | |
static QString | displayName (const KTimeZone &zone) |
Properties | |
bool | itemsCheckable |
QAbstractItemView::SelectionMode | selectionMode |
Detailed Description
A time zone selection widget.
Detail:
This class provides for selection of one or more time zones.
Example:
To use the class to implement a system timezone selection feature:
To use the class to implement a multiple-choice custom time zone selector:
Definition at line 59 of file ktimezonewidget.h.
Constructor & Destructor Documentation
|
explicit |
Constructs a time zone selection widget.
- Parameters
-
parent The parent widget. timeZones The time zone database to use. If 0, the system time zone database is used.
Definition at line 60 of file ktimezonewidget.cpp.
|
virtual |
Destroys the time zone selection widget.
Definition at line 130 of file ktimezonewidget.cpp.
Member Function Documentation
void KTimeZoneWidget::clearSelection | ( | ) |
Unselect all timezones.
This is the same as QTreeWidget::clearSelection, except in checkable items mode, where items are all unchecked. The overload is
- Since
- 4.4.
Definition at line 218 of file ktimezonewidget.cpp.
Format a time zone name in a standardised manner.
The returned value is transformed via an i18n lookup, so the caller should previously have set the time zone catalog:
- Returns
- formatted time zone name.
Definition at line 151 of file ktimezonewidget.cpp.
bool KTimeZoneWidget::itemsCheckable | ( | ) | const |
- Returns
- true if setItemsCheckable(true) was called.
- Since
- 4.4
QStringList KTimeZoneWidget::selection | ( | ) | const |
Returns the currently selected time zones.
See QTreeView::selectionChanged().
- Returns
- a list of time zone names, in the format used by the database supplied to the KTimeZoneWidget() constructor.
Definition at line 156 of file ktimezonewidget.cpp.
QAbstractItemView::SelectionMode KTimeZoneWidget::selectionMode | ( | ) | const |
- Returns
- the selection mode set by setSelectionMode().
- Since
- 4.4
void KTimeZoneWidget::setItemsCheckable | ( | bool | enable | ) |
Makes all items show a checkbox, so that the user can select multiple timezones by means of checking checkboxes, rather than via multi-selection.
In "items checkable" mode, the selection(), setSelected() and clearSelection() methods work on the check states rather than on selecting/unselecting.
- Since
- 4.4
Definition at line 135 of file ktimezonewidget.cpp.
Select/deselect the named time zone.
- Parameters
-
zone The time zone name to be selected. Ignored if not recognized! selected The new selection state.
Definition at line 172 of file ktimezonewidget.cpp.
void KTimeZoneWidget::setSelectionMode | ( | QAbstractItemView::SelectionMode | mode | ) |
Allows to select multiple timezones.
This is the same as setSelectionMode(KTimeZoneWidget::MultiSelection) normally, but in "items checkable" mode, this is rather about allowing to check multiple items. In that case, the actual QTreeWidget selection mode remains unchanged.
- Since
- 4.4
Definition at line 233 of file ktimezonewidget.cpp.
Property Documentation
|
readwrite |
Definition at line 62 of file ktimezonewidget.h.
|
readwrite |
Definition at line 63 of file ktimezonewidget.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:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.