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

KDEUI

Signals | Public Member Functions | List of all members
KLanguageButton Class Reference

#include <klanguagebutton.h>

Inheritance diagram for KLanguageButton:
Inheritance graph
[legend]

Signals

void activated (const QString &languageCode)
 
void highlighted (const QString &languageCode)
 

Public Member Functions

 KLanguageButton (QWidget *parent=0)
 
 KLanguageButton (const QString &text, QWidget *parent=0)
 
virtual ~KLanguageButton ()
 
void clear ()
 
bool contains (const QString &languageCode) const
 
int count () const
 
QString current () const
 
void insertLanguage (const QString &languageCode, const QString &name=QString(), int index=-1)
 
void insertSeparator (int index=-1)
 
void loadAllLanguages ()
 
void setCurrentItem (const QString &languageCode)
 
void setLocale (const KLocale *locale)
 
void setText (const QString &text)
 
void showLanguageCodes (bool show)
 

Detailed Description

KLanguageButton is a pushbutton which allows a language to be selected from a popup list.

Languages are identified by their ISO 639-1 codes, e.g. en, pt_BR.

klanguagebutton.png
KDE Language Selection Widget
Author
Hans Petter Bieker bieke.nosp@m.r@kd.nosp@m.e.org, Martijn Klingens kling.nosp@m.ens@.nosp@m.kde.o.nosp@m.rg, David Jarvie softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 46 of file klanguagebutton.h.

Constructor & Destructor Documentation

KLanguageButton::KLanguageButton ( QWidget *  parent = 0)
explicit

Constructs a button whose text is determined by the current language in the popup list.

Parameters
parentthe parent of the button

Definition at line 76 of file klanguagebutton.cpp.

KLanguageButton::KLanguageButton ( const QString &  text,
QWidget *  parent = 0 
)
explicit

Constructs a button with static text.

Parameters
textthe text of the button
parentthe parent of the button

Definition at line 82 of file klanguagebutton.cpp.

KLanguageButton::~KLanguageButton ( )
virtual

Deconstructor.

Definition at line 109 of file klanguagebutton.cpp.

Member Function Documentation

void KLanguageButton::activated ( const QString &  languageCode)
signal

This signal is emitted when a new item is activated.

Parameters
languageCodecode of the activated language
void KLanguageButton::clear ( )

Removes all combobox items.

Definition at line 209 of file klanguagebutton.cpp.

bool KLanguageButton::contains ( const QString &  languageCode) const

Checks whether the specified language is in the popup list.

Parameters
languageCodethe language's code
Returns
true if in the list

Definition at line 224 of file klanguagebutton.cpp.

int KLanguageButton::count ( ) const

Returns the number of items in the combo box.

Definition at line 204 of file klanguagebutton.cpp.

QString KLanguageButton::current ( ) const

Returns the language code of the combobox's current item.

Returns
the current item's language code

Definition at line 229 of file klanguagebutton.cpp.

void KLanguageButton::highlighted ( const QString &  languageCode)
signal

This signal is emitted when a new item is highlighted.

Parameters
languageCodecode of the highlighted language
void KLanguageButton::insertLanguage ( const QString &  languageCode,
const QString &  name = QString(),
int  index = -1 
)

Inserts a language into the combo box.

Normally the display name of the language is obtained automatically, but if either the language code does not exist, or there are special display requirements, the name of the language can be specified in name.

Parameters
languageCodethe code for the language
namelanguage name. If empty, the name is obtained automatically.
indexthe insertion position, or -1 to insert in alphabetical order

Definition at line 130 of file klanguagebutton.cpp.

void KLanguageButton::insertSeparator ( int  index = -1)

Inserts a separator item into the combo box.

A negative index will append the item.

Parameters
indexthe insertion position

Definition at line 158 of file klanguagebutton.cpp.

void KLanguageButton::loadAllLanguages ( )

Load all known languages into the popup list.

The current language in the list is set to the default language for the current locale (as modified by setLocale()).

Definition at line 166 of file klanguagebutton.cpp.

void KLanguageButton::setCurrentItem ( const QString &  languageCode)

Sets a given language to be the current item.

Parameters
languageCodethe language's code

Definition at line 243 of file klanguagebutton.cpp.

void KLanguageButton::setLocale ( const KLocale *  locale)

Sets the locale to display language names.

By default, KGlobal::locale() is used.

Parameters
localelocale to use

Definition at line 120 of file klanguagebutton.cpp.

void KLanguageButton::setText ( const QString &  text)

Sets a static button text.

Parameters
textbutton text

Definition at line 114 of file klanguagebutton.cpp.

void KLanguageButton::showLanguageCodes ( bool  show)

Specifies whether language codes should be shown alongside language names in the popup.

Calling this method does not affect any previously inserted language texts, so it should normally be called before populating the list.

Parameters
showtrue to show codes, false to hide codes

Definition at line 125 of file klanguagebutton.cpp.


The documentation for this class was generated from the following files:
  • klanguagebutton.h
  • klanguagebutton.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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