kdeui
KTimezoneWidget Class Reference
A timezone selection widget. More...
#include <ktimezonewidget.h>
Public Member Functions | |
KTimezoneWidget (QWidget *parent=0, const char *name=0, KTimezones *db=0) | |
QStringList | selection () const |
void | setSelected (const QString &zone, bool selected) |
virtual | ~KTimezoneWidget () |
Static Public Member Functions | |
static QString | displayName (const KTimezone *zone) |
Detailed Description
A timezone selection widget.Detail:
This class provides for selection of one or more timezones.
Example:
To use the class to implement a system timezone selection feature:
// This adds a timezone widget to a dialog. m_timezones = new KTimezoneWidget(this, "Timezones"); ...
To use the class to implement a multiple-choice custom timezone selector:
m_timezones = new KTimezoneWidget(this, "Timezones", vcalendarTimezones); m_timezones->setSelectionModeExt(KListView::Multi); ...
- Since:
- 3.5
Definition at line 59 of file ktimezonewidget.h.
Constructor & Destructor Documentation
KTimezoneWidget::KTimezoneWidget | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 , |
|||
KTimezones * | db = 0 | |||
) |
Constructs a timezone selection widget.
- Parameters:
-
parent The parent widget. name The name of this widget. db The timezone database to use. If 0, the system timezone database is used.
Definition at line 36 of file ktimezonewidget.cpp.
KTimezoneWidget::~KTimezoneWidget | ( | ) | [virtual] |
Member Function Documentation
QString KTimezoneWidget::displayName | ( | const KTimezone * | zone | ) | [static] |
Format a timezone name in a standardised manner.
The returned value is transformed via an i18n lookup, so the caller should previously have set the timezone catalogue:
KGlobal::locale()->insertCatalogue("timezones");
- Returns:
- formatted timezone name.
Definition at line 86 of file ktimezonewidget.cpp.
QStringList KTimezoneWidget::selection | ( | ) | const |
Returns the currently selected timezones.
See QListView::selectionChanged().
- Returns:
- a list of timezone names, in the format used by the database supplied to the KTimezoneWidget() constructor.
Definition at line 91 of file ktimezonewidget.cpp.
void KTimezoneWidget::setSelected | ( | const QString & | zone, | |
bool | selected | |||
) |
Select/deselect the named timezone.
- Parameters:
-
zone The timezone name to be selected. Ignored if not recognised! selected The new selection state.
Definition at line 108 of file ktimezonewidget.cpp.
The documentation for this class was generated from the following files: