qlibraryinfo.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/global/qlibraryinfo.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Copyright (C) 2016 Intel Corporation.-
5** Contact: https://www.qt.io/licensing/-
6**-
7** This file is part of the QtCore module of the Qt Toolkit.-
8**-
9** $QT_BEGIN_LICENSE:LGPL$-
10** Commercial License Usage-
11** Licensees holding valid commercial Qt licenses may use this file in-
12** accordance with the commercial license agreement provided with the-
13** Software or, alternatively, in accordance with the terms contained in-
14** a written agreement between you and The Qt Company. For licensing terms-
15** and conditions see https://www.qt.io/terms-conditions. For further-
16** information use the contact form at https://www.qt.io/contact-us.-
17**-
18** GNU Lesser General Public License Usage-
19** Alternatively, this file may be used under the terms of the GNU Lesser-
20** General Public License version 3 as published by the Free Software-
21** Foundation and appearing in the file LICENSE.LGPL3 included in the-
22** packaging of this file. Please review the following information to-
23** ensure the GNU Lesser General Public License version 3 requirements-
24** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
25**-
26** GNU General Public License Usage-
27** Alternatively, this file may be used under the terms of the GNU-
28** General Public License version 2.0 or (at your option) the GNU General-
29** Public license version 3 or any later version approved by the KDE Free-
30** Qt Foundation. The licenses are as published by the Free Software-
31** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
32** included in the packaging of this file. Please review the following-
33** information to ensure the GNU General Public License requirements will-
34** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
35** https://www.gnu.org/licenses/gpl-3.0.html.-
36**-
37** $QT_END_LICENSE$-
38**-
39****************************************************************************/-
40-
41#include "qdir.h"-
42#include "qstringlist.h"-
43#include "qfile.h"-
44#include "qsettings.h"-
45#include "qlibraryinfo.h"-
46#include "qscopedpointer.h"-
47-
48#ifdef QT_BUILD_QMAKE-
49QT_BEGIN_NAMESPACE-
50extern QString qmake_libraryInfoFile();-
51QT_END_NAMESPACE-
52#else-
53# include "qcoreapplication.h"-
54#endif-
55-
56#ifdef Q_OS_DARWIN-
57# include "private/qcore_mac_p.h"-
58#endif-
59-
60#include "qconfig.cpp"-
61#include "archdetect.cpp"-
62-
63QT_BEGIN_NAMESPACE-
64-
65extern void qDumpCPUFeatures(); // in qsimd.cpp-
66-
67#ifndef QT_NO_SETTINGS-
68-
69struct QLibrarySettings-
70{-
71 QLibrarySettings();-
72 void load();-
73-
74 QScopedPointer<QSettings> settings;-
75#ifdef QT_BUILD_QMAKE-
76 bool haveDevicePaths;-
77 bool haveEffectiveSourcePaths;-
78 bool haveEffectivePaths;-
79 bool havePaths;-
80#else-
81 bool reloadOnQAppAvailable;-
82#endif-
83};-
84Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings)
executed 1438 times by 508 tests: end of block
Executed by:
  • tst_collections - unknown status
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractfileengine - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • ...
executed 1438 times by 508 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_collections - unknown status
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractfileengine - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • ...
executed 5338 times by 67 tests: return &holder.value;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
guard.load() =...c::InitializedDescription
TRUEevaluated 1438 times by 508 tests
Evaluated by:
  • tst_collections - unknown status
  • tst_compiler - unknown status
  • tst_gestures - unknown status
  • tst_lancelot - unknown status
  • tst_languagechange - unknown status
  • tst_largefile - unknown status
  • tst_modeltest - unknown status
  • tst_networkselftest - unknown status
  • tst_platformsocketengine - unknown status
  • tst_q_func_info - unknown status
  • tst_qabstractanimation - unknown status
  • tst_qabstractbutton - unknown status
  • tst_qabstractfileengine - unknown status
  • tst_qabstractitemmodel - unknown status
  • tst_qabstractitemview - unknown status
  • tst_qabstractnetworkcache - unknown status
  • tst_qabstractprintdialog - unknown status
  • tst_qabstractproxymodel - unknown status
  • tst_qabstractscrollarea - unknown status
  • tst_qabstractslider - unknown status
  • tst_qabstractsocket - unknown status
  • tst_qabstractspinbox - unknown status
  • tst_qabstracttextdocumentlayout - unknown status
  • tst_qaccessibility - unknown status
  • tst_qaction - unknown status
  • ...
FALSEnever evaluated
0-5338
85-
86class QLibraryInfoPrivate-
87{-
88public:-
89 static QSettings *findConfiguration();-
90#ifdef QT_BUILD_QMAKE-
91 static bool haveGroup(QLibraryInfo::PathGroup group)-
92 {-
93 QLibrarySettings *ls = qt_library_settings();-
94 return ls ? (group == QLibraryInfo::EffectiveSourcePaths-
95 ? ls->haveEffectiveSourcePaths-
96 : group == QLibraryInfo::EffectivePaths-
97 ? ls->haveEffectivePaths-
98 : group == QLibraryInfo::DevicePaths-
99 ? ls->haveDevicePaths-
100 : ls->havePaths) : false;-
101 }-
102#endif-
103 static QSettings *configuration()-
104 {-
105 QLibrarySettings *ls = qt_library_settings();-
106 if (ls) {
lsDescription
TRUEevaluated 5338 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEnever evaluated
0-5338
107#ifndef QT_BUILD_QMAKE-
108 if (ls->reloadOnQAppAvailable && QCoreApplication::instance() != 0)
ls->reloadOnQAppAvailableDescription
TRUEevaluated 713 times by 14 tests
Evaluated by:
  • tst_QApplication
  • tst_QChar
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qdbuscpp2xml
  • tst_selftests - unknown status
FALSEevaluated 4625 times by 65 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • ...
QCoreApplicati...nstance() != 0Description
TRUEevaluated 11 times by 11 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
FALSEevaluated 702 times by 4 tests
Evaluated by:
  • tst_QApplication
  • tst_QChar
  • tst_qdbuscpp2xml
  • tst_selftests - unknown status
11-4625
109 ls->load();
executed 11 times by 11 tests: ls->load();
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
11
110#endif-
111 return ls->settings.data();
executed 5338 times by 67 tests: return ls->settings.data();
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
5338
112 } else {-
113 return 0;
never executed: return 0;
0
114 }-
115 }-
116};-
117-
118static const char platformsSection[] = "Platforms";-
119-
120QLibrarySettings::QLibrarySettings()-
121{-
122 load();-
123}
executed 1015 times by 12 tests: end of block
Executed by:
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1015
124-
125void QLibrarySettings::load()-
126{-
127 // If we get any settings here, those won't change when the application shows up.-
128 settings.reset(QLibraryInfoPrivate::findConfiguration());-
129#ifndef QT_BUILD_QMAKE-
130 reloadOnQAppAvailable = (settings.data() == 0 && QCoreApplication::instance() == 0);
settings.data() == 0Description
TRUEevaluated 881 times by 22 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
FALSEevaluated 145 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_selftests - unknown status
QCoreApplicati...nstance() == 0Description
TRUEevaluated 179 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 702 times by 22 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
145-881
131 bool haveDevicePaths;-
132 bool haveEffectivePaths;-
133 bool havePaths;-
134#endif-
135 if (settings) {
settingsDescription
TRUEevaluated 145 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_selftests - unknown status
FALSEevaluated 881 times by 22 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
145-881
136 // This code needs to be in the regular library, as otherwise a qt.conf that-
137 // works for qmake would break things for dynamically built Qt tools.-
138 QStringList children = settings->childGroups();-
139 haveDevicePaths = children.contains(QLatin1String("DevicePaths"));-
140#ifdef QT_BUILD_QMAKE-
141 haveEffectiveSourcePaths = children.contains(QLatin1String("EffectiveSourcePaths"));-
142#else-
143 // EffectiveSourcePaths is for the Qt build only, so needs no backwards compat trickery.-
144 bool haveEffectiveSourcePaths = false;-
145#endif-
146 haveEffectivePaths = haveEffectiveSourcePaths || children.contains(QLatin1String("EffectivePaths"));
haveEffectiveSourcePathsDescription
TRUEnever evaluated
FALSEevaluated 145 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_selftests - unknown status
children.conta...ectivePaths"))Description
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
0-145
147 // Backwards compat: an existing but empty file is claimed to contain the Paths section.-
148 havePaths = (!haveDevicePaths && !haveEffectivePaths
!haveDevicePathsDescription
TRUEevaluated 145 times by 2 tests
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
!haveEffectivePathsDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
0-145
149 && !children.contains(QLatin1String(platformsSection)))
!children.cont...formsSection))Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
0-25
150 || children.contains(QLatin1String("Paths"));
children.conta...ring("Paths"))Description
TRUEnever evaluated
FALSEevaluated 120 times by 1 test
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
0-120
151#ifndef QT_BUILD_QMAKE-
152 if (!havePaths)
!havePathsDescription
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
25-120
153 settings.reset(0);
executed 120 times by 1 test: settings.reset(0);
Executed by:
  • tst_qdbusxml2cpp - unknown status
120
154#else-
155 } else {-
156 haveDevicePaths = false;-
157 haveEffectiveSourcePaths = false;-
158 haveEffectivePaths = false;-
159 havePaths = false;-
160#endif-
161 }
executed 145 times by 2 tests: end of block
Executed by:
  • tst_qdbusxml2cpp - unknown status
  • tst_selftests - unknown status
145
162}
executed 1026 times by 23 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1026
163-
164QSettings *QLibraryInfoPrivate::findConfiguration()-
165{-
166 QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
executed 1162 times by 23 tests: return qstring_literal_temp;
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1162
167 if (QFile::exists(qtconfig))
QFile::exists(qtconfig)Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 1136 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
25-1136
168 return new QSettings(qtconfig, QSettings::IniFormat);
executed 25 times by 1 test: return new QSettings(qtconfig, QSettings::IniFormat);
Executed by:
  • tst_selftests - unknown status
25
169#ifdef QT_BUILD_QMAKE-
170 qtconfig = qmake_libraryInfoFile();-
171 if (QFile::exists(qtconfig))-
172 return new QSettings(qtconfig, QSettings::IniFormat);-
173#else-
174#ifdef Q_OS_DARWIN-
175 CFBundleRef bundleRef = CFBundleGetMainBundle();-
176 if (bundleRef) {-
177 QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,-
178 QCFString(QLatin1String("qt.conf")),-
179 0,-
180 0);-
181 if (urlRef) {-
182 QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);-
183 qtconfig = QDir::cleanPath(path);-
184 if (QFile::exists(qtconfig))-
185 return new QSettings(qtconfig, QSettings::IniFormat);-
186 }-
187 }-
188#endif-
189 if (QCoreApplication::instance()) {
QCoreApplication::instance()Description
TRUEevaluated 957 times by 23 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qdbusxml2cpp - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
FALSEevaluated 179 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
179-957
190 QDir pwd(QCoreApplication::applicationDirPath());-
191 qtconfig = pwd.filePath(QLatin1String("qt.conf"));-
192 if (QFile::exists(qtconfig))
QFile::exists(qtconfig)Description
TRUEevaluated 120 times by 1 test
Evaluated by:
  • tst_qdbusxml2cpp - unknown status
FALSEevaluated 837 times by 22 tests
Evaluated by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
120-837
193 return new QSettings(qtconfig, QSettings::IniFormat);
executed 120 times by 1 test: return new QSettings(qtconfig, QSettings::IniFormat);
Executed by:
  • tst_qdbusxml2cpp - unknown status
120
194 }
executed 837 times by 22 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
837
195#endif-
196 return 0; //no luck
executed 1016 times by 22 tests: return 0;
Executed by:
  • tst_QApplication
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QGlobal
  • tst_QGuiApplication
  • tst_QNetworkConfigurationManager
  • tst_QSql
  • tst_qapplication - unknown status
  • tst_qdbusabstractadaptor - unknown status
  • tst_qdbusabstractinterface - unknown status
  • tst_qdbusinterface - unknown status
  • tst_qdbusmarshall - unknown status
  • tst_qlogging - unknown status
  • tst_qobject - unknown status
  • tst_qprocess - unknown status
  • tst_qsharedmemory - unknown status
  • tst_qsystemsemaphore - unknown status
  • tst_selftests - unknown status
1016
197}-
198-
199#endif // QT_NO_SETTINGS-
200-
201/*!-
202 \class QLibraryInfo-
203 \inmodule QtCore-
204 \brief The QLibraryInfo class provides information about the Qt library.-
205-
206 Many pieces of information are established when Qt is configured and built.-
207 This class provides an abstraction for accessing that information.-
208 By using the static functions of this class, an application can obtain-
209 information about the instance of the Qt library which the application-
210 is using at run-time.-
211-
212 You can also use a \c qt.conf file to override the hard-coded paths-
213 that are compiled into the Qt library. For more information, see-
214 the \l {Using qt.conf} documentation.-
215-
216 \sa QSysInfo, {Using qt.conf}-
217*/-
218-
219#ifndef QT_BUILD_QMAKE-
220-
221/*!-
222 \internal-
223-
224 You cannot create a QLibraryInfo, instead only the static functions are available to query-
225 information.-
226*/-
227-
228QLibraryInfo::QLibraryInfo()-
229{ }-
230-
231/*!-
232 Returns the person to whom this build of Qt is licensed.-
233-
234 \sa licensedProducts()-
235*/-
236-
237QString-
238QLibraryInfo::licensee()-
239{-
240 const char * volatile str = QT_CONFIGURE_LICENSEE;-
241 return QString::fromLocal8Bit(str);
never executed: return QString::fromLocal8Bit(str);
0
242}-
243-
244/*!-
245 Returns the products that the license for this build of Qt has access to.-
246-
247 \sa licensee()-
248*/-
249-
250QString-
251QLibraryInfo::licensedProducts()-
252{-
253 const char * volatile str = QT_CONFIGURE_LICENSED_PRODUCTS;-
254 return QString::fromLatin1(str);
never executed: return QString::fromLatin1(str);
0
255}-
256-
257/*!-
258 \since 4.6-
259 \deprecated-
260 This function used to return the installation date for this build of Qt, but now returns a constant date.-
261*/-
262#ifndef QT_NO_DATESTRING-
263#if QT_DEPRECATED_SINCE(5, 5)-
264QDate-
265QLibraryInfo::buildDate()-
266{-
267 return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
never executed: return QDate::fromString(QString::fromLatin1(qt_configure_installation + 12), Qt::ISODate);
0
268}-
269#endif-
270#endif //QT_NO_DATESTRING-
271-
272#if defined(Q_CC_INTEL) // must be before GNU, Clang and MSVC because ICC/ICL claim to be them-
273# ifdef __INTEL_CLANG_COMPILER-
274# define ICC_COMPAT "Clang"-
275# elif defined(__INTEL_MS_COMPAT_LEVEL)-
276# define ICC_COMPAT "Microsoft"-
277# elif defined(__GNUC__)-
278# define ICC_COMPAT "GCC"-
279# else-
280# define ICC_COMPAT "no"-
281# endif-
282# if __INTEL_COMPILER == 1300-
283# define ICC_VERSION "13.0"-
284# elif __INTEL_COMPILER == 1310-
285# define ICC_VERSION "13.1"-
286# elif __INTEL_COMPILER == 1400-
287# define ICC_VERSION "14.0"-
288# elif __INTEL_COMPILER == 1500-
289# define ICC_VERSION "15.0"-
290# else-
291# define ICC_VERSION QT_STRINGIFY(__INTEL_COMPILER)-
292# endif-
293# ifdef __INTEL_COMPILER_UPDATE-
294# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION "." QT_STRINGIFY(__INTEL_COMPILER_UPDATE) \-
295 " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \-
296 ICC_COMPAT " compatibility]"-
297# else-
298# define COMPILER_STRING "Intel(R) C++ " ICC_VERSION \-
299 " build " QT_STRINGIFY(__INTEL_COMPILER_BUILD_DATE) " [" \-
300 ICC_COMPAT " compatibility]"-
301# endif-
302#elif defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too-
303# ifdef __apple_build_version__ // Apple clang has other version numbers-
304# define COMPILER_STRING "Clang " __clang_version__ " (Apple)"-
305# else-
306# define COMPILER_STRING "Clang " __clang_version__-
307# endif-
308#elif defined(Q_CC_GHS)-
309# define COMPILER_STRING "GHS " QT_STRINGIFY(__GHS_VERSION_NUMBER)-
310#elif defined(Q_CC_GNU)-
311# define COMPILER_STRING "GCC " __VERSION__-
312#elif defined(Q_CC_MSVC)-
313# if _MSC_VER < 1600-
314# define COMPILER_STRING "MSVC 2008"-
315# elif _MSC_VER < 1700-
316# define COMPILER_STRING "MSVC 2010"-
317# elif _MSC_VER < 1800-
318# define COMPILER_STRING "MSVC 2012"-
319# elif _MSC_VER < 1900-
320# define COMPILER_STRING "MSVC 2013"-
321# elif _MSC_VER < 1910-
322# define COMPILER_STRING "MSVC 2015"-
323# elif _MSC_VER < 2000-
324# define COMPILER_STRING "MSVC 2017"-
325# else-
326# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)-
327# endif-
328#else-
329# define COMPILER_STRING "<unknown compiler>"-
330#endif-
331#ifdef QT_NO_DEBUG-
332# define DEBUG_STRING " release"-
333#else-
334# define DEBUG_STRING " debug"-
335#endif-
336#ifdef QT_SHARED-
337# define SHARED_STRING " shared (dynamic)"-
338#else-
339# define SHARED_STRING " static"-
340#endif-
341#define QT_BUILD_STR "Qt " QT_VERSION_STR " (" ARCH_FULL SHARED_STRING DEBUG_STRING " build; by " COMPILER_STRING ")"-
342-
343/*!-
344 Returns a string describing how this version of Qt was built.-
345-
346 \internal-
347-
348 \since 5.3-
349*/-
350-
351const char *QLibraryInfo::build() Q_DECL_NOTHROW-
352{-
353 return QT_BUILD_STR;
executed 1436 times by 506 tests: return "Qt " "5.7.1" " (" "x86_64" "-" "little_endian" "-" "lp64" "" "" "" " shared (dynamic)" " debug" " build; by " "GCC " "4.9.2" ")";
Executed by:
  • tst_Collections
  • tst_Compiler
  • tst_Gestures
  • tst_Lancelot
  • tst_LargeFile
  • tst_ModelTest
  • tst_NetworkSelfTest
  • tst_PlatformSocketEngine
  • tst_QAbstractAnimation
  • tst_QAbstractButton
  • tst_QAbstractFileEngine
  • tst_QAbstractItemModel
  • tst_QAbstractItemView
  • tst_QAbstractNetworkCache
  • tst_QAbstractPrintDialog
  • tst_QAbstractProxyModel
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSocket
  • tst_QAbstractSpinBox
  • tst_QAbstractTextDocumentLayout
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QAlgorithms
  • ...
1436
354}-
355-
356/*!-
357 \since 5.0-
358 Returns \c true if this build of Qt was built with debugging enabled, or-
359 false if it was built in release mode.-
360*/-
361bool-
362QLibraryInfo::isDebugBuild()-
363{-
364#ifdef QT_DEBUG-
365 return true;
executed 3 times by 2 tests: return true;
Executed by:
  • tst_Lancelot
  • tst_QGraphicsAnchorLayout1
3
366#else-
367 return false;-
368#endif-
369}-
370-
371#endif // QT_BUILD_QMAKE-
372-
373/*-
374 * To add a new entry in QLibrary::LibraryLocation, add it to the enum above the bootstrapped values and:-
375 * - add its relative path in the qtConfEntries[] array below-
376 * (the key is what appears in a qt.conf file)-
377 * - add a property name in qmake/property.cpp propList[] array-
378 * (it's used with qmake -query)-
379 * - add to qt_config.prf, qt_module.prf, qt_module_fwdpri.prf-
380 */-
381-
382static const struct {-
383 char key[19], value[13];-
384} qtConfEntries[] = {-
385 { "Prefix", "." },-
386 { "Documentation", "doc" }, // should be ${Data}/doc-
387 { "Headers", "include" },-
388 { "Libraries", "lib" },-
389#ifdef Q_OS_WIN-
390 { "LibraryExecutables", "bin" },-
391#else-
392 { "LibraryExecutables", "libexec" }, // should be ${ArchData}/libexec-
393#endif-
394 { "Binaries", "bin" },-
395 { "Plugins", "plugins" }, // should be ${ArchData}/plugins-
396 { "Imports", "imports" }, // should be ${ArchData}/imports-
397 { "Qml2Imports", "qml" }, // should be ${ArchData}/qml-
398 { "ArchData", "." },-
399 { "Data", "." },-
400 { "Translations", "translations" }, // should be ${Data}/translations-
401 { "Examples", "examples" },-
402 { "Tests", "tests" },-
403#ifdef QT_BUILD_QMAKE-
404 { "Sysroot", "" },-
405 { "HostBinaries", "bin" },-
406 { "HostLibraries", "lib" },-
407 { "HostData", "." },-
408 { "TargetSpec", "" },-
409 { "HostSpec", "" },-
410 { "HostPrefix", "" },-
411#endif-
412};-
413-
414/*!-
415 Returns the location specified by \a loc.-
416*/-
417QString-
418QLibraryInfo::location(LibraryLocation loc)-
419{-
420#ifdef QT_BUILD_QMAKE // ends inside rawLocation !-
421 QString ret = rawLocation(loc, FinalPaths);-
422-
423 // Automatically prepend the sysroot to target paths-
424 if ((loc < SysrootPath || loc > LastHostPath) && QT_CONFIGURE_SYSROOTIFY_PREFIX) {-
425 QString sysroot = rawLocation(SysrootPath, FinalPaths);-
426 if (!sysroot.isEmpty() && ret.length() > 2 && ret.at(1) == QLatin1Char(':')-
427 && (ret.at(2) == QLatin1Char('/') || ret.at(2) == QLatin1Char('\\')))-
428 ret.replace(0, 2, sysroot); // Strip out the drive on Windows targets-
429 else-
430 ret.prepend(sysroot);-
431 }-
432-
433 return ret;-
434}-
435-
436QString-
437QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)-
438{-
439#endif // QT_BUILD_QMAKE, started inside location !-
440 QString ret;-
441#ifdef QT_BUILD_QMAKE-
442 // Logic for choosing the right data source: if EffectivePaths are requested-
443 // and qt.conf with that section is present, use it, otherwise fall back to-
444 // FinalPaths. For FinalPaths, use qt.conf if present and contains not only-
445 // [EffectivePaths], otherwise fall back to builtins.-
446 // EffectiveSourcePaths falls back to EffectivePaths.-
447 // DevicePaths falls back to FinalPaths.-
448 PathGroup orig_group = group;-
449 if (!QLibraryInfoPrivate::haveGroup(group)-
450 && !(group == EffectiveSourcePaths-
451 && (group = EffectivePaths, QLibraryInfoPrivate::haveGroup(group)))-
452 && !((group == EffectivePaths || group == DevicePaths)-
453 && (group = FinalPaths, QLibraryInfoPrivate::haveGroup(group)))-
454 && (group = orig_group, true))-
455#elif !defined(QT_NO_SETTINGS)-
456 if (!QLibraryInfoPrivate::configuration())
!QLibraryInfoP...onfiguration()Description
TRUEevaluated 4638 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEevaluated 350 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
350-4638
457#endif-
458 {-
459 const char * volatile path = 0;-
460 if (loc == PrefixPath) {
loc == PrefixPathDescription
TRUEevaluated 2319 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEevaluated 2319 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
2319
461 path =-
462#ifdef QT_BUILD_QMAKE-
463 (group != DevicePaths) ?-
464 QT_CONFIGURE_EXT_PREFIX_PATH :-
465#endif-
466 QT_CONFIGURE_PREFIX_PATH;-
467 } else if (unsigned(loc) <= sizeof(qt_configure_str_offsets)/sizeof(qt_configure_str_offsets[0])) {
executed 2319 times by 67 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
unsigned(loc) ...tr_offsets[0])Description
TRUEevaluated 2312 times by 60 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • ...
FALSEevaluated 7 times by 7 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSettings
  • tst_QTextFormat
  • tst_languageChange
7-2319
468 path = qt_configure_strs + qt_configure_str_offsets[loc - 1];-
469#ifndef Q_OS_WIN // On Windows we use the registry-
470 } else if (loc == SettingsPath) {
executed 2312 times by 60 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • tst_QLoggingRegistry
  • tst_QMimeDatabase
  • tst_QNetworkAccessManager
  • tst_QNetworkConfiguration
  • ...
loc == SettingsPathDescription
TRUEevaluated 7 times by 7 tests
Evaluated by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSettings
  • tst_QTextFormat
  • tst_languageChange
FALSEnever evaluated
0-2312
471 path = QT_CONFIGURE_SETTINGS_PATH;-
472#endif-
473#ifdef QT_BUILD_QMAKE-
474 } else if (loc == HostPrefixPath) {-
475 path = QT_CONFIGURE_HOST_PREFIX_PATH;-
476#endif-
477 }
executed 7 times by 7 tests: end of block
Executed by:
  • tst_QColorDialog
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QSettings
  • tst_QTextFormat
  • tst_languageChange
7
478-
479 if (path)
pathDescription
TRUEevaluated 4638 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEnever evaluated
0-4638
480 ret = QString::fromLocal8Bit(path);
executed 4638 times by 67 tests: ret = QString::fromLocal8Bit(path);
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
4638
481#ifndef QT_NO_SETTINGS-
482 } else {
executed 4638 times by 67 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
4638
483 QString key;-
484 QString defaultValue;-
485 if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) {
unsigned(loc) ...onfEntries[0])Description
TRUEevaluated 350 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
0-350
486 key = QLatin1String(qtConfEntries[loc].key);-
487 defaultValue = QLatin1String(qtConfEntries[loc].value);-
488 }
executed 350 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
350
489#ifndef Q_OS_WIN // On Windows we use the registry-
490 else if (loc == SettingsPath) {
loc == SettingsPathDescription
TRUEnever evaluated
FALSEnever evaluated
0
491 key = QLatin1String("Settings");-
492 defaultValue = QLatin1String(".");-
493 }
never executed: end of block
0
494#endif-
495-
496 if(!key.isNull()) {
!key.isNull()Description
TRUEevaluated 350 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
0-350
497 QSettings *config = QLibraryInfoPrivate::configuration();-
498 config->beginGroup(QLatin1String(-
499#ifdef QT_BUILD_QMAKE-
500 group == DevicePaths ? "DevicePaths" :-
501 group == EffectiveSourcePaths ? "EffectiveSourcePaths" :-
502 group == EffectivePaths ? "EffectivePaths" :-
503#endif-
504 "Paths"));-
505-
506 ret = config->value(key, defaultValue).toString();-
507-
508#ifdef QT_BUILD_QMAKE-
509 if (ret.isEmpty()) {-
510 if (loc == HostPrefixPath)-
511 ret = config->value(QLatin1String(qtConfEntries[PrefixPath].key),-
512 QLatin1String(qtConfEntries[PrefixPath].value)).toString();-
513 else if (loc == TargetSpecPath || loc == HostSpecPath)-
514 ret = QString::fromLocal8Bit(qt_configure_strs + qt_configure_str_offsets[loc - 1]);-
515 }-
516#endif-
517-
518 // expand environment variables in the form $(ENVVAR)-
519 int rep;-
520 QRegExp reg_var(QLatin1String("\\$\\(.*\\)"));-
521 reg_var.setMinimal(true);-
522 while((rep = reg_var.indexIn(ret)) != -1) {
(rep = reg_var...In(ret)) != -1Description
TRUEnever evaluated
FALSEevaluated 350 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
0-350
523 ret.replace(rep, reg_var.matchedLength(),-
524 QString::fromLocal8Bit(qgetenv(ret.mid(rep + 2,-
525 reg_var.matchedLength() - 3).toLatin1().constData()).constData()));-
526 }
never executed: end of block
0
527-
528 config->endGroup();-
529-
530 ret = QDir::fromNativeSeparators(ret);-
531 }
executed 350 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
350
532#endif // QT_NO_SETTINGS-
533 }
executed 350 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
350
534-
535#ifdef QT_BUILD_QMAKE-
536 // The specs need to be returned verbatim.-
537 if (loc == TargetSpecPath || loc == HostSpecPath)-
538 return ret;-
539#endif-
540-
541 if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
!ret.isEmpty()Description
TRUEevaluated 4988 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEnever evaluated
QDir::isRelativePath(ret)Description
TRUEevaluated 2669 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
FALSEevaluated 2319 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
0-4988
542 QString baseDir;-
543#ifdef QT_BUILD_QMAKE-
544 if (loc == HostPrefixPath || loc == PrefixPath || loc == SysrootPath) {-
545 // We make the prefix/sysroot path absolute to the executable's directory.-
546 // loc == PrefixPath while a sysroot is set would make no sense here.-
547 // loc == SysrootPath only makes sense if qmake lives inside the sysroot itself.-
548 baseDir = QFileInfo(qmake_libraryInfoFile()).absolutePath();-
549 } else if (loc > SysrootPath && loc <= LastHostPath) {-
550 // We make any other host path absolute to the host prefix directory.-
551 baseDir = rawLocation(HostPrefixPath, group);-
552 } else {-
553 // we make any other path absolute to the prefix directory-
554 baseDir = rawLocation(PrefixPath, group);-
555 }-
556#else-
557 if (loc == PrefixPath) {
loc == PrefixPathDescription
TRUEevaluated 175 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEevaluated 2494 times by 67 tests
Evaluated by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
175-2494
558 if (QCoreApplication::instance()) {
QCoreApplication::instance()Description
TRUEevaluated 175 times by 1 test
Evaluated by:
  • tst_selftests - unknown status
FALSEnever evaluated
0-175
559#ifdef Q_OS_DARWIN-
560 CFBundleRef bundleRef = CFBundleGetMainBundle();-
561 if (bundleRef) {-
562 QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);-
563 if (urlRef) {-
564 QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);-
565#ifdef Q_OS_OSX-
566 QString bundleContentsDir = QString(path) + QLatin1String("/Contents/");-
567 if (QDir(bundleContentsDir).exists())-
568 return QDir::cleanPath(bundleContentsDir + ret);-
569#else-
570 return QDir::cleanPath(QString(path) + QLatin1Char('/') + ret); // iOS-
571#endif // Q_OS_OSX-
572 }-
573 }-
574#endif // Q_OS_DARWIN-
575 // We make the prefix path absolute to the executable's directory.-
576 baseDir = QCoreApplication::applicationDirPath();-
577 } else {
executed 175 times by 1 test: end of block
Executed by:
  • tst_selftests - unknown status
175
578 baseDir = QDir::currentPath();-
579 }
never executed: end of block
0
580 } else {-
581 // we make any other path absolute to the prefix directory-
582 baseDir = location(PrefixPath);-
583 }
executed 2494 times by 67 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
2494
584#endif // QT_BUILD_QMAKE-
585 ret = QDir::cleanPath(baseDir + QLatin1Char('/') + ret);-
586 }
executed 2669 times by 67 tests: end of block
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
2669
587 return ret;
executed 4988 times by 67 tests: return ret;
Executed by:
  • tst_NetworkSelfTest
  • tst_QAbstractNetworkCache
  • tst_QApplication
  • tst_QChar
  • tst_QColorDialog
  • tst_QCommandLineParser
  • tst_QCoreApplication
  • tst_QDBusConnectionNoBus
  • tst_QDBusConnectionNoLibDBus1
  • tst_QDBusConnection_Delayed
  • tst_QDnsLookup_Appless
  • tst_QFactoryLoader
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QFontDialog
  • tst_QFtp
  • tst_QGlobal
  • tst_QGlyphRun
  • tst_QGraphicsProxyWidget
  • tst_QGraphicsScene
  • tst_QGuiApplication
  • tst_QHostInfo
  • tst_QHttpNetworkConnection
  • tst_QImage
  • tst_QLocalSocket
  • ...
4988
588}-
589-
590/*!-
591 Returns additional arguments to the platform plugin matching-
592 \a platformName which can be specified as a string list using-
593 the key \c Arguments in a group called \c Platforms of the-
594 \c qt.conf file.-
595-
596 sa {Using qt.conf}-
597-
598 \internal-
599-
600 \since 5.3-
601*/-
602-
603QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)-
604{-
605#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS)-
606 QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());-
607 if (!settings.isNull()) {
!settings.isNull()Description
TRUEnever evaluated
FALSEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
0-135
608 QString key = QLatin1String(platformsSection);-
609 key += QLatin1Char('/');-
610 key += platformName;-
611 key += QLatin1String("Arguments");-
612 return settings->value(key).toStringList();
never executed: return settings->value(key).toStringList();
0
613 }-
614#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS-
615 return QStringList();
executed 135 times by 5 tests: return QStringList();
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
135
616}-
617-
618/*!-
619 \enum QLibraryInfo::LibraryLocation-
620-
621 \keyword library location-
622-
623 This enum type is used to specify a specific location-
624 specifier:-
625-
626 \value PrefixPath The default prefix for all paths.-
627 \value DocumentationPath The location for documentation upon install.-
628 \value HeadersPath The location for all headers.-
629 \value LibrariesPath The location of installed libraries.-
630 \value LibraryExecutablesPath The location of installed executables required by libraries at runtime.-
631 \value BinariesPath The location of installed Qt binaries (tools and applications).-
632 \value PluginsPath The location of installed Qt plugins.-
633 \value ImportsPath The location of installed QML extensions to import (QML 1.x).-
634 \value Qml2ImportsPath The location of installed QML extensions to import (QML 2.x).-
635 \value ArchDataPath The location of general architecture-dependent Qt data.-
636 \value DataPath The location of general architecture-independent Qt data.-
637 \value TranslationsPath The location of translation information for Qt strings.-
638 \value ExamplesPath The location for examples upon install.-
639 \value TestsPath The location of installed Qt testcases.-
640 \value SettingsPath The location for Qt settings. Not applicable on Windows.-
641-
642 \sa location()-
643*/-
644-
645QT_END_NAMESPACE-
646-
647#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)-
648# include <stdio.h>-
649# include <stdlib.h>-
650-
651#include "private/qcoreapplication_p.h"-
652-
653extern const char qt_core_interpreter[] __attribute__((section(".interp")))-
654 = ELF_INTERPRETER;-
655-
656extern "C" void qt_core_boilerplate();-
657void qt_core_boilerplate()-
658{-
659 printf("This is the QtCore library version " QT_BUILD_STR "\n"-
660 "Copyright (C) 2016 The Qt Company Ltd.\n"-
661 "Contact: http://www.qt.io/licensing/\n"-
662 "\n"-
663 "Installation prefix: %s\n"-
664 "Library path: %s\n"-
665 "Include path: %s\n",-
666 qt_configure_prefix_path_str + 12,-
667 qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1],-
668 qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]);-
669-
670 QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();-
671-
672#ifdef QT_EVAL-
673 extern void qt_core_eval_init(QCoreApplicationPrivate::Type);-
674 qt_core_eval_init(QCoreApplicationPrivate::Tty);-
675#endif-
676-
677 exit(0);
never executed: exit(0);
0
678}-
679-
680#endif-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9