Mercurial > trustbridge
comparison ui/administrator.cpp @ 876:0051cb07da28
Reduce libraries, document i386 build and statically link fonts.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 07 Aug 2014 19:12:37 +0200 |
parents | 170b13ea05ee |
children | f638eb1f3b0f |
comparison
equal
deleted
inserted
replaced
875:a43ebf716abd | 876:0051cb07da28 |
---|---|
4 * This file is Free Software under the GNU GPL (v>=2) | 4 * This file is Free Software under the GNU GPL (v>=2) |
5 * and comes with ABSOLUTELY NO WARRANTY! | 5 * and comes with ABSOLUTELY NO WARRANTY! |
6 * See LICENSE.txt for details. | 6 * See LICENSE.txt for details. |
7 */ | 7 */ |
8 #include "administratorwindow.h" | 8 #include "administratorwindow.h" |
9 #include "util.h" | |
9 | 10 |
10 #include <QApplication> | 11 #include <QApplication> |
11 #include <QtPlugin> | 12 #include <QtPlugin> |
12 #include <QMessageBox> | 13 #include <QMessageBox> |
13 #include <QSettings> | 14 #include <QSettings> |
14 #include <QTranslator> | 15 #include <QTranslator> |
15 #include <QDebug> | 16 #include <QDebug> |
16 #include <QTextCodec> | 17 #include <QTextCodec> |
18 #include <QFontDatabase> | |
17 | 19 |
18 #ifndef VERSION | 20 #ifndef VERSION |
19 #define VERSION "0.0.1" | 21 #define VERSION "0.0.1" |
20 #endif | 22 #endif |
21 | 23 |
69 | 71 |
70 /* Out of process calls need to be encoded in latin-1 so that they | 72 /* Out of process calls need to be encoded in latin-1 so that they |
71 * look decent on western europe's windows */ | 73 * look decent on western europe's windows */ |
72 QTextCodec::setCodecForLocale(QTextCodec::codecForName ("ISO-8859-1")); | 74 QTextCodec::setCodecForLocale(QTextCodec::codecForName ("ISO-8859-1")); |
73 | 75 |
76 /* Install static fonts */ | |
77 | |
78 /* The putenv here works around a bug in qt. Qt thinks it is a fatal | |
79 * error if the font directory does not exist. */ | |
80 qputenv("QT_QPA_FONTDIR", get_install_dir()); | |
81 int fontId = QFontDatabase::addApplicationFont(":/fonts/DejaVuSans.ttf"); | |
82 if (fontId != -1) | |
83 { | |
84 QFont font("DejaVuSans"); | |
85 font.setPointSize(9); | |
86 app.setFont(font); | |
87 } | |
88 | |
74 AdministratorWindow adminWin; | 89 AdministratorWindow adminWin; |
75 adminWin.show(); | 90 adminWin.show(); |
76 | 91 |
77 return app.exec(); | 92 return app.exec(); |
78 } | 93 } |