• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Public Member Functions | Static Public Member Functions | Properties
KTimeZoneWidget Class Reference

#include <ktimezonewidget.h>

Inheritance diagram for KTimeZoneWidget:
QTreeWidget

List of all members.

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:

// 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 );
...
ktimezonewidget.png
KDE Time Zone Widget
Author:
S.R.Haque srhaq.nosp@m.ue@i.nosp@m.ee.or.nosp@m.g

Definition at line 59 of file ktimezonewidget.h.


Constructor & Destructor Documentation

KTimeZoneWidget::KTimeZoneWidget ( QWidget *  parent = 0,
KTimeZones *  timeZones = 0 
)
explicit

Constructs a time zone selection widget.

Parameters:
parentThe parent widget.
timeZonesThe time zone database to use. If 0, the system time zone database is used.

Definition at line 60 of file ktimezonewidget.cpp.

KTimeZoneWidget::~KTimeZoneWidget ( )
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.

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 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().

  @return a list of time zone names, in the format used by the database
          supplied to the {@link 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.

void KTimeZoneWidget::setSelected ( const QString &  zone,
bool  selected 
)

Select/deselect the named time zone.

Parameters:
zoneThe time zone name to be selected. Ignored if not recognized!
selectedThe 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

bool KTimeZoneWidget::itemsCheckable
readwrite

Definition at line 62 of file ktimezonewidget.h.

QAbstractItemView::SelectionMode KTimeZoneWidget::selectionMode
readwrite

Definition at line 63 of file ktimezonewidget.h.


The documentation for this class was generated from the following files:
  • ktimezonewidget.h
  • ktimezonewidget.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 20:34:24 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal