trikRuntime
languageSelectionWidget.h
Go to the documentation of this file.
1 /* Copyright 2015 CyberTech Labs Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/qglobal.h>
18 
19 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
20  #include <QtGui/QLabel>
21  #include <QtGui/QVBoxLayout>
22  #include <QtGui/QListWidget>
23 #else
24  #include <QtWidgets/QLabel>
25  #include <QtWidgets/QVBoxLayout>
26  #include <QtWidgets/QListWidget>
27 #endif
28 
29 #include <QtCore/QString>
30 #include <QtCore/QMap>
31 
32 #include "trikGuiDialog.h"
33 
34 namespace trikGui {
35 
39 {
40  Q_OBJECT
41 
42 public:
45  LanguageSelectionWidget(QWidget *parent = 0);
46 
48  static QString menuEntry();
49 
50  void renewFocus() override;
51 
52 protected:
53  void keyPressEvent(QKeyEvent *event) override;
54 
55 private:
57  void loadLocales();
58 
59  QVBoxLayout mLayout;
60  QLabel mTitle;
61  QListWidget mLanguages;
62  QMap<QString, QString> mAvailableLocales;
63 };
64 
65 }
LanguageSelectionWidget(QWidget *parent=0)
Constructor.
Definition: languageSelectionWidget.cpp:30
Widget that allows selection of TrikGUI interface language.
Definition: languageSelectionWidget.h:38
Base class for all trikGui dialog widgets.
Definition: trikGuiDialog.h:24
Definition: abstractIndicator.h:21
void renewFocus() override
Set focus properly on this widget or one of its children.
Definition: languageSelectionWidget.cpp:72
void keyPressEvent(QKeyEvent *event) override
Definition: languageSelectionWidget.cpp:77
static QString menuEntry()
Returns menu entry for this widget.
Definition: languageSelectionWidget.cpp:67