KConfigWidgets
klanguagebutton.cpp
126void KLanguageButton::insertLanguage(const QString &languageCode, const QString &name, int index)
132 QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("locale/") + languageCode + QLatin1String("/kf6_entry.desktop"));
179 const QStringList localeDirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("locale"), QStandardPaths::LocateDirectory);
183 const QString entryFile = localeDir + QLatin1Char('/') + d + QStringLiteral("/kf6_entry.desktop");
SimpleConfig
KLanguageButton is a pushbutton which allows a language to be selected from a popup list.
Definition klanguagebutton.h:36
QString current() const
Returns the language code of the combobox's current item.
Definition klanguagebutton.cpp:239
void insertSeparator(int index=-1)
Inserts a separator item into the combo box.
Definition klanguagebutton.cpp:168
void highlighted(const QString &languageCode)
This signal is emitted when a new item is highlighted.
KLanguageButton(QWidget *parent=nullptr)
Constructs a button whose text is determined by the current language in the popup list.
Definition klanguagebutton.cpp:68
void activated(const QString &languageCode)
This signal is emitted when a new item is activated.
void insertLanguage(const QString &languageCode, const QString &name=QString(), int index=-1)
Inserts a language into the combo box.
Definition klanguagebutton.cpp:126
void setCurrentItem(const QString &languageCode)
Sets a given language to be the current item.
Definition klanguagebutton.cpp:255
void showLanguageCodes(bool show)
Specifies whether language codes should be shown alongside language names in the popup.
Definition klanguagebutton.cpp:114
void loadAllLanguages()
Load all known languages into the popup list.
Definition klanguagebutton.cpp:177
bool contains(const QString &languageCode) const
Checks whether the specified language is in the popup list.
Definition klanguagebutton.cpp:234
void setLocale(const QString &locale)
Sets the locale to display language names.
Definition klanguagebutton.cpp:109
void setText(const QString &text)
QVariant data() const const
void setData(const QVariant &data)
text
Dirs
Name
QStringList entryList(Filters filters, SortFlags sort) const const
bool exists() const const
void addWidget(QWidget *w)
void setContentsMargins(const QMargins &margins)
void clear()
qsizetype count() const const
QLocale c()
QString languageToString(Language language)
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
LocateDirectory
GenericDataLocation
QString locate(StandardLocation type, const QString &fileName, LocateOptions options)
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
bool isEmpty() const const
int localeAwareCompare(QStringView s1, QStringView s2)
bool isValid() const const
QString toString() const const
QList< QAction * > actions() const const
QLayout * layout() const const
locale
void show()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:46 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.