Krita Source Code Documentation
Loading...
Searching...
No Matches
klanguagebutton.h
Go to the documentation of this file.
1/*
2 * klangbutton.h - Button with language selection drop down menu.
3 * Derived from the KLangCombo class by Hans Petter Bieker.
4 *
5 * SPDX-FileCopyrightText: 1999-2003 Hans Petter Bieker <bieker@kde.org>
6 * SPDX-FileCopyrightText: 2001 Martijn Klingens <klingens@kde.org>
7 * SPDX-FileCopyrightText: 2007 David Jarvie <software@astrojar.org.uk>
8 *
9 * SPDX-License-Identifier: LGPL-2.0-or-later
10 */
11
12#ifndef KLANGUAGEBUTTON_H
13#define KLANGUAGEBUTTON_H
14
15#include "kritawidgetutils_export.h"
16#include <QWidget>
17
18class QAction;
20
32class KRITAWIDGETUTILS_EXPORT KLanguageButton : public QWidget
33{
34 Q_OBJECT
35
36public:
43 explicit KLanguageButton(QWidget *parent = 0);
44
51 explicit KLanguageButton(const QString &text, QWidget *parent = 0);
52
56 ~KLanguageButton() override;
57
63 void setLocale(const QString &locale);
64
70 void setText(const QString &text);
71
80 void showLanguageCodes(bool show);
81
87 void loadAllLanguages();
88
99 void insertLanguage(const QString &languageCode, const QString &name = QString(), int index = -1);
100
106 void insertSeparator(int index = -1);
107
111 int count() const;
112
116 void clear();
117
123 QString current() const;
124
131 bool contains(const QString &languageCode) const;
132
138 void setCurrentItem(const QString &languageCode);
139
140Q_SIGNALS:
146 void activated(const QString &languageCode);
152 void highlighted(const QString &languageCode);
153
154private Q_SLOTS:
155 void slotTriggered(QAction *);
156 void slotHovered(QAction *);
157
158private:
160};
161
162#endif
void highlighted(const QString &languageCode)
void activated(const QString &languageCode)
KLanguageButtonPrivate *const d