# class KLanguageButton

###

Module | kdeui
Namespace |
Class | KLanguageButton
Inherits | QWidget

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.

### methods

- KLanguageButton (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

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

  parent - the parent of the button

- KLanguageButton (text, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  parent | QWidget | 0

  Constructs a button with static text.

  text - the text of the button

  parent - the parent of the button

- KLanguageButton (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- KLanguageButton (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QString |
  a1 | QWidget | 0

- activated (languageCode)

  returns Nothing
  SIGNAL ("activated (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  languageCode | QString |

  This signal is emitted when a new item is activated.

  languageCode - code of the activated language

- clear ( )

  returns Nothing

  Removes all combobox items.

- contains (languageCode)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  languageCode | QString |

  Checks whether the specified language is in the popup list.

  languageCode - the language's code Returns true if in the list

- count ( )

  returns int

  Returns the number of items in the combo box.

- current ( )

  returns QString

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

  Returns the current item's language code

- highlighted (languageCode)

  returns Nothing
  SIGNAL ("highlighted (const QString&)")

  Argument | Type | Default
  --- | --- | ---
  languageCode | QString |

  This signal is emitted when a new item is highlighted.

  languageCode - code of the highlighted language

- insertLanguage (languageCode, name, index)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  languageCode | QString |
  name | QString | QString()
  index | int | -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.

  languageCode - the code for the language

  name - language name. If empty, the name is obtained automatically.

  index - the insertion position, or -1 to insert in alphabetical order

- insertSeparator (index)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  index | int | -1

  Inserts a separator item into the combo box. A negative index will append the item.

  index - the insertion position

- loadAllLanguages ( )

  returns Nothing

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

- setCurrentItem (languageCode)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  languageCode | QString |

  Sets a given language to be the current item.

  languageCode - the language's code

- setLocale (locale)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  locale | KLocale |

  Sets the locale to display language names. By default, KGlobal.locale() is used.

  locale - locale to use

- setText (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  Sets a static button text.

  text - button text

- showLanguageCodes (show)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  show | bool |

  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.

  show - true to show codes, false to hide codes