KTimezoneWidget Class Reference

`#include <ktimezonewidget.h>`

Inheritance diagram for KTimezoneWidget:

## Public Member Functions

| KTimezoneWidget (QWidget *parent=0, const char *name=0, KTimezones *db=0)
virtual | ~KTimezoneWidget ()
QStringList | selection () const
void | setSelected (const QString &zone, bool selected)
Public Member Functions inherited from KListView
| KListView (QWidget *parent=0, const char *name=0)
virtual | ~KListView ()
virtual void | setAcceptDrops (bool)
virtual bool | isExecuteArea (const QPoint &point)
bool | isExecuteArea (int x)
QPtrList< QListViewItem > | selectedItems () const
QPtrList< QListViewItem > | selectedItems (bool includeHiddenItems) const
void | moveItem (QListViewItem *item, QListViewItem *parent, QListViewItem *after)
QListViewItem * | lastItem () const
QListViewItem * | lastChild () const
KLineEdit * | renameLineEdit () const
bool | itemsMovable () const
bool | itemsRenameable () const
bool | dragEnabled () const
bool | autoOpen () const
bool | isRenameable (int column) const
bool | dropVisualizer () const
int | tooltipColumn () const
bool | createChildren () const KDE_DEPRECATED
bool | dropHighlighter () const
int | dropVisualizerWidth () const
SelectionModeExt | selectionModeExt () const
int | itemIndex (const QListViewItem *item) const
QListViewItem * | itemAtIndex (int index)
void | setFullWidth () KDE_DEPRECATED
void | setFullWidth (bool fullWidth)
bool | fullWidth () const
virtual int | addColumn (const QString &label, int width=-1)
virtual int | addColumn (const QIconSet &iconset, const QString &label, int width=-1)
virtual void | removeColumn (int index)
void | setAlternateBackground (const QColor &c)
const QColor & | alternateBackground () const
void | saveLayout (KConfig *config, const QString &group) const
void | restoreLayout (KConfig *config, const QString &group)
virtual void | setSorting (int column, bool ascending=true)
int | columnSorted (void) const
bool | ascendingSort (void) const
virtual void | takeItem (QListViewItem *i)
void | setShadeSortColumn (bool shadeSortColumn)
bool | shadeSortColumn (void) const

## Static Public Member Functions

static QString | displayName (const KTimezone *zone)

## Additional Inherited Members

Public Types inherited from KListView
enum | SelectionModeExt { Single = QListView::Single, Multi = QListView::Multi, Extended = QListView::Extended, NoSelection = QListView::NoSelection, FileManager }
Public Slots inherited from KListView
virtual void | rename (QListViewItem *item, int c)
void | setRenameable (int column, bool yesno=true)
virtual void | setItemsMovable (bool b)
virtual void | setItemsRenameable (bool b)
virtual void | setDragEnabled (bool b)
virtual void | setAutoOpen (bool b)
virtual void | setDropVisualizer (bool b)
void | setDropVisualizerWidth (int w)
virtual void | setTooltipColumn (int column)
virtual void | setDropHighlighter (bool b)
virtual void | setCreateChildren (bool b) KDE_DEPRECATED
void | setSelectionModeExt (SelectionModeExt mode)
void | setTabOrderedRenaming (bool b)
bool | tabOrderedRenaming () const
Signals inherited from KListView
void | executed (QListViewItem *item)
void | executed (QListViewItem *item, const QPoint &pos, int c)
void | dropped (QDropEvent *e, QListViewItem *after)
void | dropped (KListView *list, QDropEvent *e, QListViewItem *after)
void | dropped (KListView *list, QDropEvent *e, QListViewItem *parent, QListViewItem *after)
void | dropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after)
void | moved ()
void | aboutToMove ()
void | moved (QListViewItem *item, QListViewItem *afterFirst, QListViewItem *afterNow)
void | moved (QPtrList< QListViewItem > &items, QPtrList< QListViewItem > &afterFirst, QPtrList< QListViewItem > &afterNow)
void | itemRenamed (QListViewItem *item, const QString &str, int col)
void | itemRenamed (QListViewItem *item)
void | menuShortCutPressed (KListView *list, QListViewItem *item)
void | contextMenu (KListView *l, QListViewItem *i, const QPoint &p)
void | itemAdded (QListViewItem *item)
void | itemRemoved (QListViewItem *item)
Protected Slots inherited from KListView
void | slotSettingsChanged (int)
void | slotMouseButtonClicked (int btn, QListViewItem *item, const QPoint &pos, int c)
void | doneEditing (QListViewItem *item, int row)
void | cleanDropVisualizer ()
void | cleanItemHighlighter ()
void | emitContextMenu (QListViewItem *, const QPoint &, int)
void | emitContextMenu (KListView *, QListViewItem *)
void | slotOnItem (QListViewItem *item)
void | slotOnViewport ()
void | slotAutoSelect ()
void | slotDragExpand ()
void | slotHeaderChanged ()
Protected Member Functions inherited from KListView
bool | below (const QRect &rect, const QPoint &p)
bool | below (QListViewItem *i, const QPoint &p)
virtual bool | event (QEvent *)
void | emitExecute (QListViewItem *item, const QPoint &pos, int c)
virtual void | focusInEvent (QFocusEvent *fe)
virtual void | focusOutEvent (QFocusEvent *fe)
virtual void | leaveEvent (QEvent *e)
virtual QString | tooltip (QListViewItem *item, int column) const
virtual bool | showTooltip (QListViewItem *item, const QPoint &pos, int column) const
virtual void | contentsDragMoveEvent (QDragMoveEvent *event)
virtual void | contentsMousePressEvent (QMouseEvent *e)
virtual void | contentsMouseMoveEvent (QMouseEvent *e)
virtual void | contentsMouseDoubleClickEvent (QMouseEvent *e)
virtual void | contentsDragLeaveEvent (QDragLeaveEvent *event)
virtual void | contentsMouseReleaseEvent (QMouseEvent *)
virtual void | contentsDropEvent (QDropEvent *)
virtual void | contentsDragEnterEvent (QDragEnterEvent *)
virtual QDragObject * | dragObject ()
virtual bool | acceptDrag (QDropEvent *event) const
virtual QRect | drawDropVisualizer (QPainter *p, QListViewItem *parent, QListViewItem *after)
virtual QRect | drawItemHighlighter (QPainter *painter, QListViewItem *item)
virtual void | startDrag ()
virtual void | keyPressEvent (QKeyEvent *)
virtual void | viewportPaintEvent (QPaintEvent *)
void | activateAutomaticSelection ()
void | deactivateAutomaticSelection ()
bool | automaticSelection () const
virtual void | viewportResizeEvent (QResizeEvent *e)
void | disableAutoSelection ()
void | resetAutoSelection ()
void | doubleClicked (QListViewItem *item, const QPoint &pos, int c)
virtual void | movableDropEvent (QListViewItem *parent, QListViewItem *afterme)
virtual void | findDrop (const QPoint &pos, QListViewItem *&parent, QListViewItem *&after)
void | fileManagerKeyPressEvent (QKeyEvent *)
int | depthToPixels (int depth)
virtual void | virtual_hook (int id, void *data)
Properties inherited from KListView
bool | fullWidth
bool | itemsMovable
bool | itemsRenameable
bool | dragEnabled
bool | autoOpen
bool | dropVisualizer
int | tooltipColumn
int | dropVisualizerWidth
QColor | alternateBackground
bool | shadeSortColumn

## 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);
...

Author
  S.R.Haque srhaq.nosp@m.ue@i.nosp@m.ee.or.nosp@m.g

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

Destroys the timezone selection widget.

Definition at line 80 of file ktimezonewidget.cpp.

## 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:

- ktimezonewidget.h
- ktimezonewidget.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys