MCPcopy Create free account
hub / github.com/chris2511/xca / XcaApplication

Method XcaApplication

widgets/XcaApplication.cpp:37–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37XcaApplication::XcaApplication(int &argc, char *argv[])
38 : QApplication(argc, argv)
39{
40 QLocale lang;
41
42 QFile file(defaultlang());
43
44 if (file.open(QIODevice::ReadOnly)) {
45 lang = QLocale(QString(file.read(128)));
46 }
47
48 langAvail << QLocale::system();
49 langAvail << QLocale("en");
50 QDirIterator qmIt(getI18nDir(), QStringList() << "*.qm", QDir::Files);
51 while (qmIt.hasNext()) {
52 XcaTranslator t;
53 qmIt.next();
54 QString language = qmIt.fileInfo().baseName().mid(4, -1);
55 if (t.load(QLocale(language), "xca", getI18nDir()))
56 langAvail << QLocale(language);
57 }
58 setupLanguage(lang);
59#ifdef Q_OS_MACOS
60 QStringList libp = libraryPaths();
61 libp.prepend(applicationDirPath() + "/../Plugins");
62 setLibraryPaths(libp);
63#endif
64
65 tableFont = QFont("Courier New", QApplication::font().pointSize()
66#if defined (Q_OS_WIN32)
67 +1
68#else
69 +2
70#endif
71 );
72 installEventFilter(this);
73}
74
75#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
76#define QT_MAJOR "qt6"

Callers

nothing calls this directly

Calls 5

defaultlangFunction · 0.85
getI18nDirFunction · 0.85
openMethod · 0.80
QStringClass · 0.50
loadMethod · 0.45

Tested by

no test coverage detected