KDEUI
KTimeZoneWidget Class Reference
A time zone selection widget. More...
#include <ktimezonewidget.h>

Public Member Functions | |
KTimeZoneWidget (QWidget *parent=0, KTimeZones *timeZones=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 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:
// This adds a time zone widget to a dialog. m_timezones = new KTimeZoneWidget(this); ...
To use the class to implement a multiple-choice custom time zone selector:
m_timezones = new KTimeZoneWidget( this, "Time zones", vcalendarTimezones ); m_timezones->setSelectionMode( QTreeView::MultiSelection ); ...
Definition at line 57 of file ktimezonewidget.h.
Constructor & Destructor Documentation
KTimeZoneWidget::KTimeZoneWidget | ( | QWidget * | parent = 0 , |
|
KTimeZones * | timeZones = 0 | |||
) | [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 54 of file ktimezonewidget.cpp.
KTimeZoneWidget::~KTimeZoneWidget | ( | ) | [virtual] |
Member Function Documentation
QString KTimeZoneWidget::displayName | ( | const KTimeZone & | zone | ) | [static] |
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:
KGlobal::locale()->insertCatalog( "timezones4" );
- Returns:
- formatted time zone name.
Definition at line 122 of file ktimezonewidget.cpp.
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 127 of file ktimezonewidget.cpp.
void KTimeZoneWidget::setSelected | ( | const QString & | zone, | |
bool | selected | |||
) |
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 138 of file ktimezonewidget.cpp.
The documentation for this class was generated from the following files: