Debian Codegraph @

kysdk-qtwidgets/test/testWidget/main.cpp

raw
1 /*
2 *
3 *
4 * Copyright (C) 2023, KylinSoft Co., Ltd.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this library. If not, see <https://www.gnu.org/licenses/>.
18 *
19 * Authors: Zhen Sun <[email protected]>
20 *
21 */
22
23 #include "kdialog.h"
24 #include "kprogressdialog.h"
25 #include "kwidget.h"
26 #include "kwidgetutils.h"
27 #include "testwidget.h"
28 #include <QApplication>
29 #include <QProgressDialog>
30 #include <QStyleFactory>
31 #include <QTranslator>
32
33 using namespace kdk;
34 int main(int argc, char *argv[])
35 {
36 kdk::KWidgetUtils::highDpiScaling();
37 QApplication a(argc, argv);
38 QTranslator trans;
39 QString locale = QLocale::system().name();
40 if (locale == "zh_CN") {
41 if (trans.load(":/translations/gui_zh_CN.qm")) {
42 a.installTranslator(&trans);
43 }
44 }
45 if (locale == "bo_CN") {
46 if (trans.load(":/translations/gui_bo_CN.qm")) {
47 a.installTranslator(&trans);
48 }
49 }
50 TestWidget widget;
51 widget.setWidgetName("TestWidget");
52 widget.setIcon("kylin-music");
53 widget.show();
54 return a.exec();
55 }