Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qlibraryinfo.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// Copyright (C) 2021 Intel Corporation.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#include "qdir.h"
6#include "qstringlist.h"
7#include "qfile.h"
8#if QT_CONFIG(settings)
9#include "qsettings.h"
10#endif
11#include "qlibraryinfo.h"
12#include "qlibraryinfo_p.h"
13#include "qscopedpointer.h"
14
15#include "qcoreapplication.h"
16
17#include "private/qglobal_p.h"
18#include "archdetect.cpp"
19#include "qconfig.cpp"
20
21#ifdef Q_OS_DARWIN
22# include "private/qcore_mac_p.h"
23#endif // Q_OS_DARWIN
24
25#if QT_CONFIG(relocatable) && QT_CONFIG(dlopen) && !QT_CONFIG(framework)
26# include <dlfcn.h>
27#endif
28
29#if QT_CONFIG(relocatable) && defined(Q_OS_WIN)
30# include <qt_windows.h>
31#endif
32
34
35using namespace Qt::StringLiterals;
36
37extern void qDumpCPUFeatures(); // in qsimd.cpp
38
39#if QT_CONFIG(settings)
40
41static QSettings *findConfiguration();
42
43struct QLibrarySettings
44{
45 QLibrarySettings();
46 void load();
47 bool havePaths();
48 QSettings *configuration();
49
50 QScopedPointer<QSettings> settings;
51 bool paths;
52 bool reloadOnQAppAvailable;
53};
54Q_GLOBAL_STATIC(QLibrarySettings, qt_library_settings)
55
56QLibrarySettings::QLibrarySettings() : paths(false), reloadOnQAppAvailable(false)
57{
58 load();
59}
60
61QSettings *QLibrarySettings::configuration()
62{
63 if (reloadOnQAppAvailable && QCoreApplication::instance() != nullptr)
64 load();
65 return settings.data();
66}
67
68bool QLibrarySettings::havePaths()
69{
70 if (reloadOnQAppAvailable && QCoreApplication::instance() != nullptr)
71 load();
72 return paths;
73}
74
75void QLibrarySettings::load()
76{
77 // If we get any settings here, those won't change when the application shows up.
78 settings.reset(findConfiguration());
79 reloadOnQAppAvailable = (settings.data() == nullptr && QCoreApplication::instance() == nullptr);
80
81 if (settings) {
82 // This code needs to be in the regular library, as otherwise a qt.conf that
83 // works for qmake would break things for dynamically built Qt tools.
84 QStringList children = settings->childGroups();
85 paths = !children.contains("Platforms"_L1)
86 || children.contains("Paths"_L1);
87 }
88}
89
90namespace {
91const QString *qtconfManualPath = nullptr;
92}
93
94void QLibraryInfoPrivate::setQtconfManualPath(const QString *path)
95{
96 qtconfManualPath = path;
97}
98
99static QSettings *findConfiguration()
100{
101 if (qtconfManualPath)
102 return new QSettings(*qtconfManualPath, QSettings::IniFormat);
103
104 QString qtconfig = QStringLiteral(":/qt/etc/qt.conf");
105 if (QFile::exists(qtconfig))
106 return new QSettings(qtconfig, QSettings::IniFormat);
107#ifdef Q_OS_DARWIN
108 CFBundleRef bundleRef = CFBundleGetMainBundle();
109 if (bundleRef) {
110 QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(bundleRef,
111 QCFString("qt.conf"_L1),
112 0,
113 0);
114 if (urlRef) {
115 QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
116 qtconfig = QDir::cleanPath(path);
117 if (QFile::exists(qtconfig))
118 return new QSettings(qtconfig, QSettings::IniFormat);
119 }
120 }
121#endif
124 qtconfig = pwd.filePath(u"qt" QT_STRINGIFY(QT_VERSION_MAJOR) ".conf"_s);
125 if (QFile::exists(qtconfig))
126 return new QSettings(qtconfig, QSettings::IniFormat);
127 qtconfig = pwd.filePath("qt.conf"_L1);
128 if (QFile::exists(qtconfig))
129 return new QSettings(qtconfig, QSettings::IniFormat);
130 }
131 return nullptr; //no luck
132}
133
134QSettings *QLibraryInfoPrivate::configuration()
135{
136 QLibrarySettings *ls = qt_library_settings();
137 return ls ? ls->configuration() : nullptr;
138}
139
140void QLibraryInfoPrivate::reload()
141{
142 if (qt_library_settings.exists())
143 qt_library_settings->load();
144}
145
146static bool havePaths() {
147 QLibrarySettings *ls = qt_library_settings();
148 return ls && ls->havePaths();
149}
150
151#endif // settings
152
178QLibraryInfo::QLibraryInfo()
179{ }
180
181#if defined(Q_CC_CLANG) // must be before GNU, because clang claims to be GNU too
182# define COMPILER_STRING __VERSION__ /* already includes the compiler's name */
183#elif defined(Q_CC_GHS)
184# define COMPILER_STRING "GHS " QT_STRINGIFY(__GHS_VERSION_NUMBER)
185#elif defined(Q_CC_GNU)
186# define COMPILER_STRING "GCC " __VERSION__
187#elif defined(Q_CC_MSVC)
188# if _MSC_VER < 1910
189# define COMPILER_STRING "MSVC 2015"
190# elif _MSC_VER < 1917
191# define COMPILER_STRING "MSVC 2017"
192# elif _MSC_VER < 1930
193# define COMPILER_STRING "MSVC 2019"
194# elif _MSC_VER < 2000
195# define COMPILER_STRING "MSVC 2022"
196# else
197# define COMPILER_STRING "MSVC _MSC_VER " QT_STRINGIFY(_MSC_VER)
198# endif
199#else
200# define COMPILER_STRING "<unknown compiler>"
201#endif
202#ifdef QT_NO_DEBUG
203# define DEBUG_STRING " release"
204#else
205# define DEBUG_STRING " debug"
206#endif
207#ifdef QT_SHARED
208# define SHARED_STRING " shared (dynamic)"
209#else
210# define SHARED_STRING " static"
211#endif
212static const char *qt_build_string() noexcept
213{
214 return "Qt " QT_VERSION_STR " (" ARCH_FULL SHARED_STRING DEBUG_STRING " build; by " COMPILER_STRING ")";
215}
216
225const char *QLibraryInfo::build() noexcept
226{
227 return qt_build_string();
228}
229
235bool
237{
238#ifdef QT_DEBUG
239 return true;
240#else
241 return false;
242#endif
243}
244
250{
251#ifdef QT_SHARED
252 return true;
253#else
254 return false;
255#endif
256}
257
265{
266 return QVersionNumber(QT_VERSION_MAJOR, QT_VERSION_MINOR, QT_VERSION_PATCH);
267}
268
270{
271 QString appDir;
272
274#ifdef Q_OS_DARWIN
275 CFBundleRef bundleRef = CFBundleGetMainBundle();
276 if (bundleRef) {
277 QCFType<CFURLRef> urlRef = CFBundleCopyBundleURL(bundleRef);
278 if (urlRef) {
279 QCFString path = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
280#ifdef Q_OS_MACOS
281 QString bundleContentsDir = QString(path) + "/Contents/"_L1;
282 if (QDir(bundleContentsDir).exists())
283 return QDir::cleanPath(bundleContentsDir);
284#else
285 return QDir::cleanPath(QString(path)); // iOS
286#endif // Q_OS_MACOS
287 }
288 }
289#endif // Q_OS_DARWIN
290 // We make the prefix path absolute to the executable's directory.
292 } else {
293 appDir = QDir::currentPath();
294 }
295
296 return appDir;
297}
298
299#if QT_CONFIG(relocatable)
300#if !defined(QT_STATIC) && !(defined(Q_OS_DARWIN) && QT_CONFIG(framework)) \
301 && (QT_CONFIG(dlopen) || defined(Q_OS_WIN))
302static QString prefixFromQtCoreLibraryHelper(const QString &qtCoreLibraryPath)
303{
304 const QString qtCoreLibrary = QDir::fromNativeSeparators(qtCoreLibraryPath);
305 const QString libDir = QFileInfo(qtCoreLibrary).absolutePath();
306 const QString prefixDir = libDir + "/" QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH;
307 return QDir::cleanPath(prefixDir);
308}
309#endif
310
311#if defined(Q_OS_WIN)
312static HMODULE getWindowsModuleHandle()
313{
314 HMODULE hModule = NULL;
315 GetModuleHandleEx(
316 GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
317 (LPCTSTR)&QLibraryInfo::isDebugBuild, &hModule);
318 return hModule;
319}
320#endif // Q_OS_WIN
321
322static QString getRelocatablePrefix(QLibraryInfoPrivate::UsageMode usageMode)
323{
324 QString prefixPath;
325
326 // For static builds, the prefix will be the app directory.
327 // For regular builds, the prefix will be relative to the location of the QtCore shared library.
328#if defined(QT_STATIC)
329 prefixPath = prefixFromAppDirHelper();
330 if (usageMode == QLibraryInfoPrivate::UsedFromQtBinDir) {
331 // For Qt tools in a static build, we must chop off the bin directory.
332 constexpr QByteArrayView binDir = qt_configure_strs.viewAt(QLibraryInfo::BinariesPath - 1);
333 constexpr size_t binDirLength = binDir.size() + 1;
334 prefixPath.chop(binDirLength);
335 }
336#elif defined(Q_OS_DARWIN) && QT_CONFIG(framework)
337 Q_UNUSED(usageMode);
338#ifndef QT_LIBINFIX
339 #define QT_LIBINFIX ""
340#endif
341 auto qtCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtCore" QT_LIBINFIX));
342 if (!qtCoreBundle) {
343 // When running Qt apps over Samba shares, CoreFoundation will fail to find
344 // the Resources directory inside the bundle, This directory is a symlink,
345 // and CF relies on readdir() and dtent.dt_type to detect symlinks, which
346 // does not work reliably for Samba shares. We work around it by manually
347 // looking for the QtCore bundle.
348 auto allBundles = CFBundleGetAllBundles();
349 auto bundleCount = CFArrayGetCount(allBundles);
350 for (int i = 0; i < bundleCount; ++i) {
351 auto bundle = CFBundleRef(CFArrayGetValueAtIndex(allBundles, i));
352 auto url = QCFType<CFURLRef>(CFBundleCopyBundleURL(bundle));
353 auto path = QCFType<CFStringRef>(CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle));
354 if (CFStringHasSuffix(path, CFSTR("/QtCore" QT_LIBINFIX ".framework"))) {
355 qtCoreBundle = bundle;
356 break;
357 }
358 }
359 }
360 Q_ASSERT(qtCoreBundle);
361
362 QCFType<CFURLRef> qtCorePath = CFBundleCopyBundleURL(qtCoreBundle);
363 Q_ASSERT(qtCorePath);
364
365 QCFType<CFURLRef> qtCorePathAbsolute = CFURLCopyAbsoluteURL(qtCorePath);
366 Q_ASSERT(qtCorePathAbsolute);
367
368 QCFType<CFURLRef> libDirCFPath = CFURLCreateCopyDeletingLastPathComponent(NULL, qtCorePathAbsolute);
369
370 const QCFString libDirCFString = CFURLCopyFileSystemPath(libDirCFPath, kCFURLPOSIXPathStyle);
371
372 const QString prefixDir = QString(libDirCFString) + "/" QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH;
373
374 prefixPath = QDir::cleanPath(prefixDir);
375#elif defined(Q_OS_WASM)
376 // Emscripten expects to find shared libraries at the root of the in-memory
377 // file system when resolving dependencies for for dlopen() calls. So that's
378 // where libqt6core.so would be.
379 prefixPath = QStringLiteral("/");
380#elif QT_CONFIG(dlopen)
381 Q_UNUSED(usageMode);
382 Dl_info info;
383 int result = dladdr(reinterpret_cast<void *>(&QLibraryInfo::isDebugBuild), &info);
384 if (result > 0 && info.dli_fname)
385 prefixPath = prefixFromQtCoreLibraryHelper(QString::fromLocal8Bit(info.dli_fname));
386#elif defined(Q_OS_WIN)
387 Q_UNUSED(usageMode);
388 HMODULE hModule = getWindowsModuleHandle();
389 const int kBufferSize = 4096;
390 wchar_t buffer[kBufferSize];
391 DWORD pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
392 const QString qtCoreFilePath = QString::fromWCharArray(buffer, int(pathSize));
393 const QString qtCoreDirPath = QFileInfo(qtCoreFilePath).absolutePath();
394 pathSize = GetModuleFileName(NULL, buffer, kBufferSize);
395 const QString exeDirPath = QFileInfo(QString::fromWCharArray(buffer, int(pathSize))).absolutePath();
396 if (QFileInfo(exeDirPath) == QFileInfo(qtCoreDirPath)) {
397 // QtCore DLL is next to the executable. This is either a windeployqt'ed executable or an
398 // executable within the QT_HOST_BIN directory. We're detecting the latter case by checking
399 // whether there's an import library corresponding to our QtCore DLL in PREFIX/lib.
400 const QString libdir = QString::fromLocal8Bit(
401 qt_configure_strs.viewAt(QLibraryInfo::LibrariesPath - 1));
402 const QLatin1Char slash('/');
403#if defined(Q_CC_MINGW)
404 const QString implibPrefix = QStringLiteral("lib");
405 const QString implibSuffix = QStringLiteral(".a");
406#else
407 const QString implibPrefix;
408 const QString implibSuffix = QStringLiteral(".lib");
409#endif
410 const QString qtCoreImpLibFileName = implibPrefix
411 + QFileInfo(qtCoreFilePath).completeBaseName() + implibSuffix;
412 const QString qtCoreImpLibPath = qtCoreDirPath
413 + slash + QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH
414 + slash + libdir
415 + slash + qtCoreImpLibFileName;
416 if (!QFileInfo::exists(qtCoreImpLibPath)) {
417 // We did not find a corresponding import library and conclude that this is a
418 // windeployqt'ed executable.
419 return exeDirPath;
420 }
421 }
422 if (!qtCoreFilePath.isEmpty())
423 prefixPath = prefixFromQtCoreLibraryHelper(qtCoreFilePath);
424#else
425#error "The chosen platform / config does not support querying for a dynamic prefix."
426#endif
427
428#if defined(Q_OS_LINUX) && !defined(QT_STATIC) && defined(__GLIBC__)
429 // QTBUG-78948: libQt5Core.so may be located in subdirectories below libdir.
430 // See "Hardware capabilities" in the ld.so documentation and the Qt 5.3.0
431 // changelog regarding SSE2 support.
432 const QString libdir = QString::fromLocal8Bit(
433 qt_configure_strs.viewAt(QLibraryInfo::LibrariesPath - 1));
434 QDir prefixDir(prefixPath);
435 while (!prefixDir.exists(libdir)) {
436 prefixDir.cdUp();
437 prefixPath = prefixDir.absolutePath();
438 if (prefixDir.isRoot()) {
439 prefixPath.clear();
440 break;
441 }
442 }
443#endif
444
445 Q_ASSERT_X(!prefixPath.isEmpty(), "getRelocatablePrefix",
446 "Failed to find the Qt prefix path.");
447 return prefixPath;
448}
449#endif
450
452{
453#if QT_CONFIG(relocatable)
454 return getRelocatablePrefix(usageMode);
455#else
456 Q_UNUSED(usageMode);
457 return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH);
458#endif
459}
460
462{
463 /*
464 * To add a new entry in QLibraryInfo::LibraryPath, add it to the enum
465 * in qtbase/src/corelib/global/qlibraryinfo.h and:
466 * - add its relative path in the qtConfEntries[] array below
467 * (the key is what appears in a qt.conf file)
468 */
469 static constexpr auto qtConfEntries = qOffsetStringArray(
470 "Prefix", ".",
471 "Documentation", "doc", // should be ${Data}/doc
472 "Headers", "include",
473 "Libraries", "lib",
474#ifdef Q_OS_WIN
475 "LibraryExecutables", "bin",
476#else
477 "LibraryExecutables", "libexec", // should be ${ArchData}/libexec
478#endif
479 "Binaries", "bin",
480 "Plugins", "plugins", // should be ${ArchData}/plugins
481
482 "QmlImports", "qml", // should be ${ArchData}/qml
483
484 "ArchData", ".",
485 "Data", ".",
486 "Translations", "translations", // should be ${Data}/translations
487 "Examples", "examples",
488 "Tests", "tests"
489 );
490 [[maybe_unused]]
491 constexpr QByteArrayView dot{"."};
492
494
495 if (int(loc) < qtConfEntries.count()) {
496 result.key = QLatin1StringView(qtConfEntries.viewAt(loc * 2));
497 result.defaultValue = QLatin1StringView(qtConfEntries.viewAt(loc * 2 + 1));
498 if (result.key == u"QmlImports")
499 result.fallbackKey = u"Qml2Imports"_s;
500#ifndef Q_OS_WIN // On Windows we use the registry
501 } else if (loc == QLibraryInfo::SettingsPath) {
502 result.key = "Settings"_L1;
503 result.defaultValue = QLatin1StringView(dot);
504#endif
505 }
506
507 return result;
508}
509
524
525
526/*
527 Returns the path specified by \a p.
528
529 The usage mode can be set to UsedFromQtBinDir to enable special handling for executables that
530 live in <install-prefix>/bin.
531 */
533{
534 const QLibraryInfo::LibraryPath loc = p;
535 QString ret;
536 bool fromConf = false;
537#if QT_CONFIG(settings)
538 if (havePaths()) {
539 fromConf = true;
540
542 if (!li.key.isNull()) {
543 QSettings *config = QLibraryInfoPrivate::configuration();
544 Q_ASSERT(config != nullptr);
545 config->beginGroup("Paths"_L1);
546
547 if (li.fallbackKey.isNull()) {
548 ret = config->value(li.key, li.defaultValue).toString();
549 } else {
550 QVariant v = config->value(li.key);
551 if (!v.isValid())
552 v = config->value(li.fallbackKey, li.defaultValue);
553 ret = v.toString();
554 }
555
556 qsizetype startIndex = 0;
557 /* We support placeholders of the form $(<ENV_VAR>) in qt.conf.
558 The loop below tries to find all such placeholders, and replaces
559 them with the actual value of the ENV_VAR environment variable
560 */
561 while (true) {
562 startIndex = ret.indexOf(u'$', startIndex);
563 if (startIndex < 0)
564 break;
565 if (ret.size() < startIndex + 3)
566 break;
567 if (ret.at(startIndex + 1) != u'(') {
568 startIndex++;
569 continue;
570 }
571 qsizetype endIndex = ret.indexOf(u')', startIndex + 2);
572 if (endIndex < 0)
573 break;
574 auto envVarName = QStringView{ret}.mid(startIndex + 2, endIndex - startIndex - 2);
575 QString value = QString::fromLocal8Bit(qgetenv(envVarName.toLocal8Bit().constData()));
576 ret.replace(startIndex, endIndex - startIndex + 1, value);
577 startIndex += value.size();
578 }
579
580 config->endGroup();
581
583 }
584 }
585#endif // settings
586
587 if (!fromConf) {
588 if (loc == QLibraryInfo::PrefixPath) {
589 ret = getPrefix(usageMode);
590 } else if (int(loc) <= qt_configure_strs.count()) {
591 ret = QString::fromLocal8Bit(qt_configure_strs.viewAt(loc - 1));
592#ifndef Q_OS_WIN // On Windows we use the registry
593 } else if (loc == QLibraryInfo::SettingsPath) {
594 // Use of volatile is a hack to discourage compilers from calling
595 // strlen(), in the inlined fromLocal8Bit(const char *)'s body, at
596 // compile-time, as Qt installers binary-patch the path, replacing
597 // the dummy path seen at compile-time, typically changing length.
598 const char *volatile path = QT_CONFIGURE_SETTINGS_PATH;
600#endif
601 }
602 }
603
604 if (!ret.isEmpty() && QDir::isRelativePath(ret)) {
605 QString baseDir;
606 if (loc == QLibraryInfo::PrefixPath) {
607 baseDir = prefixFromAppDirHelper();
608 } else {
609 // we make any other path absolute to the prefix directory
610 baseDir = path(QLibraryInfo::PrefixPath, usageMode);
611 }
612 ret = QDir::cleanPath(baseDir + u'/' + ret);
613 }
614 return ret;
615}
616
631{
632#if QT_CONFIG(settings)
633 QScopedPointer<const QSettings> settings(findConfiguration());
634 if (!settings.isNull()) {
635 const QString key = "Platforms/"_L1
636 + platformName
637 + "Arguments"_L1;
638 return settings->value(key).toStringList();
639 }
640#else
641 Q_UNUSED(platformName);
642#endif // settings
643 return QStringList();
644}
645
699const char *qVersion() noexcept
700{
701 return QT_VERSION_STR;
702}
703
704#if QT_DEPRECATED_SINCE(6, 9)
705
706bool qSharedBuild() noexcept
707{
709}
710
711#endif // QT_DEPRECATED_SINCE(6, 9)
712
714
715#if defined(Q_CC_GNU) && defined(ELF_INTERPRETER)
716# include <elf.h>
717# include <stdio.h>
718# include <stdlib.h>
719
720#include "private/qcoreapplication_p.h"
721
722QT_WARNING_DISABLE_GCC("-Wformat-overflow")
723QT_WARNING_DISABLE_GCC("-Wattributes")
724QT_WARNING_DISABLE_CLANG("-Wattributes")
726
727# if defined(Q_OS_LINUX)
728# include "minimum-linux_p.h"
729# endif
730# ifdef QT_ELF_NOTE_OS_TYPE
731struct ElfNoteAbiTag
732{
733 static_assert(sizeof(Elf32_Nhdr) == sizeof(Elf64_Nhdr),
734 "The size of an ELF note is wrong (should be 12 bytes)");
735 struct Payload {
736 Elf32_Word ostype = QT_ELF_NOTE_OS_TYPE;
737 Elf32_Word major = QT_ELF_NOTE_OS_MAJOR;
738 Elf32_Word minor = QT_ELF_NOTE_OS_MINOR;
739# ifdef QT_ELF_NOTE_OS_PATCH
740 Elf32_Word patch = QT_ELF_NOTE_OS_PATCH;
741# endif
742 };
743
744 Elf32_Nhdr header = {
745 .n_namesz = sizeof(name),
746 .n_descsz = sizeof(Payload),
747 .n_type = NT_GNU_ABI_TAG
748 };
749 char name[sizeof ELF_NOTE_GNU] = ELF_NOTE_GNU; // yes, include the null terminator
750 Payload payload = {};
751};
752__attribute__((section(".note.ABI-tag"), aligned(4), used))
753extern constexpr ElfNoteAbiTag QT_MANGLE_NAMESPACE(qt_abi_tag) = {};
754# endif
755
756extern const char qt_core_interpreter[] __attribute__((section(".interp")))
757 = ELF_INTERPRETER;
758
759extern "C" void qt_core_boilerplate() __attribute__((force_align_arg_pointer));
760void qt_core_boilerplate()
761{
762 printf("This is the QtCore library version %s\n"
763 "%s\n"
764 "Contact: https://www.qt.io/licensing/\n"
765 "\n"
766 "Installation prefix: %s\n"
767 "Library path: %s\n"
768 "Plugin path: %s\n",
769 QT_PREPEND_NAMESPACE(qt_build_string)(),
770 QT_COPYRIGHT,
771 QT_CONFIGURE_PREFIX_PATH,
772 qt_configure_strs[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1],
773 qt_configure_strs[QT_PREPEND_NAMESPACE(QLibraryInfo)::PluginsPath - 1]);
774
775 QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
776
777 exit(0);
778}
779
780#endif
#define ARCH_FULL
struct capHdr __attribute__
constexpr qsizetype size() const noexcept
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static QString applicationDirPath()
Returns the directory that contains the application executable.
\inmodule QtCore
Definition qdir.h:20
static bool isRelativePath(const QString &path)
Returns true if path is relative; returns false if it is absolute.
Definition qdir.cpp:2412
static QString fromNativeSeparators(const QString &pathName)
Definition qdir.cpp:962
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
Definition qdir.cpp:2398
static QString currentPath()
Returns the absolute path of the application's current directory.
Definition qdir.cpp:2054
QString completeBaseName() const
Returns the complete base name of the file without the path.
QString absolutePath() const
Returns the absolute path of the file system entry this QFileInfo refers to, excluding the entry's na...
bool exists() const
Returns true if the file system entry this QFileInfo refers to exists; otherwise returns false.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qfile.cpp:351
static QString path(QLibraryInfo::LibraryPath p, UsageMode usageMode=RegularUsage)
static LocationInfo locationInfo(QLibraryInfo::LibraryPath loc)
\inmodule QtCore
static bool isSharedBuild() noexcept Q_DECL_CONST_FUNCTION
static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION
static QStringList platformPluginArguments(const QString &platformName)
Returns additional arguments to the platform plugin matching platformName which can be specified as a...
static QString path(LibraryPath p)
LibraryPath
\keyword library location
static QVersionNumber version() noexcept Q_DECL_CONST_FUNCTION
static const char * build() noexcept
Returns a string describing how this version of Qt was built.
\inmodule QtCore
Definition qsettings.h:30
QVariant value(QAnyStringView key, const QVariant &defaultValue) const
Returns the value for setting key.
QStringList childGroups() const
Returns a list of all key top-level groups that contain keys that can be read using the QSettings obj...
\inmodule QtCore
\inmodule QtCore
Definition qstringview.h:78
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5949
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
Definition qstring.h:1309
\inmodule QtCore
Definition qvariant.h:65
T value() const &
Definition qvariant.h:516
QStringList toStringList() const
Returns the variant as a QStringList if the variant has userType() \l QMetaType::QStringList,...
\inmodule QtCore
p1 load("image.bmp")
#define QT_ELF_NOTE_OS_PATCH
#define QT_ELF_NOTE_OS_TYPE
#define QT_ELF_NOTE_OS_MINOR
#define QT_ELF_NOTE_OS_MAJOR
Combined button and popup list for selecting options.
#define QT_WARNING_DISABLE_INTEL(number)
#define QT_WARNING_DISABLE_GCC(text)
#define QT_WARNING_DISABLE_CLANG(text)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
static QString header(const QString &name)
EGLConfig config
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static const int kBufferSize
static const char * qt_build_string() noexcept
static QString getPrefix(QLibraryInfoPrivate::UsageMode usageMode)
static QString prefixFromAppDirHelper()
#define SHARED_STRING
void qDumpCPUFeatures()
Definition qsimd.cpp:613
#define COMPILER_STRING
#define DEBUG_STRING
return ret
constexpr auto qOffsetStringArray(const char(&...strings)[Nx]) noexcept
GLsizei const GLfloat * v
[13]
GLuint64 key
GLenum GLuint buffer
GLsizei const GLuint * paths
GLuint name
GLsizei const GLchar *const * path
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
static qreal dot(const QPointF &a, const QPointF &b)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define Q_ASSERT_X(cond, x, msg)
Definition qrandom.cpp:48
Int aligned(Int v, Int byteAlign)
#define QStringLiteral(str)
#define QT_MANGLE_NAMESPACE(name)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define QT_STRINGIFY(x)
#define Q_UNUSED(x)
QT_BEGIN_NAMESPACE Q_CORE_EXPORT Q_DECL_CONST_FUNCTION const char * qVersion(void) Q_DECL_NOEXCEPT
ptrdiff_t qsizetype
Definition qtypes.h:165
HINSTANCE HMODULE
QSettings settings("MySoft", "Star Runner")
[0]
QUrl url("example.com")
[constructor-url-reference]
manager patch(request, myData, this, [this](QRestReply &reply) { if(reply.isSuccess()) })
[9]
QHostInfo info
[0]
\inmodule QtCore \reentrant
Definition qchar.h:18