summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qsysinfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QSysInfo: don't pass QStringLiteral to QWinRegistryKey::stringValue()Marc Mutz2025-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | The stringValue() function took QStringView from the initial commit of the class, so passing QStringLiteral (which creates and destroys a full QString instance, and, until recently, even injected an additional isNull() branch when converted to QStringView) was never necessary; a UTF-16 string literal would have always sufficed, and be faster. Since the API will will soon be changed to take const wchar_t*, use a wchar_t literal instead of char16_t one. For QStringView, it doesn't matter (on Windows, at least), but it keeps the call compatible with the future QWinRegistryKey API. Amends 80996d2e5d6d04b08452cf507f6ced7d8a09068c. Pick-to: 6.10 6.8 6.5 Change-Id: If88fb074c72bf3a41adf5cfb4b68f185c24481fd Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Darwin: Add missing micro version to QSysInfoLars Schmertmann2025-07-291-3/+16
| | | | | | | | | | | | | | | productVersion() and prettyProductName() are currently missing the micro version Apple uses for bug fixes or patch releases. For productVersion we always include the micro version, but for prettyProductName we only include it if it's non-0, just like the "about macOS" dialog. Fixes: QTBUG-131513 Pick-to: 6.10 6.9 6.8 Change-Id: Ic8beabe5cd783d49612a1a6ea2a563aec76c3fe2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QOperatingSystemVersion/QSysInfo support for macOS 26 (Tahoe)Tor Arne Vestbø2025-06-101-0/+1
| | | | | | Pick-to: 6.10 6.9 6.8 6.5 Change-Id: If6e7ee92e7c491c91a17e2730112319a132ca623 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Corelib, fix runtime platform detection on CYGWINCarlo Bramini2025-03-071-3/+3
| | | | | | | | | | | | | | | | | | | On CYGWIN, the build process fails at this point: In file included from qtbase/src/corelib/global/qsysinfo.cpp:40: qtbase/src/corelib/global/qoperatingsystemversion_win_p.h:19:10: fatal error: qt_windows.h: No such file or directory 19 | #include <qt_windows.h> | ^~~~~~~~~~~~~~ compilation terminated. Besides the fact that qt_windows.h doesn't exist into the build directory when compiling a POSIX-like platform, when compiling under CYGWIN, the operating system is CYGWIN, not Windows. So, it is better to collect those information by using Q_OS_UNIX tools instead. Change-Id: I496eedb58c4a3d1ce2da9fb3526a6ec5ed67f638 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* doc: Fix broken links, including auto-linksDavid Boddie2025-02-101-1/+1
| | | | | | Pick-to: 6.8 6.9 Change-Id: I967304c24e1a593b1b555998a718d0a015e12900 Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
* Recognize Windows Server 2025 build numberDavid Warner2024-11-201-0/+2
| | | | | | | Pick-to: 6.8 Fixes: QTBUG-131395 Change-Id: If3c4d6371b21720be4cbecc1508f83c9b3526751 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* WinSock: Initialize with version 2.2Mårten Nordheim2024-11-181-5/+3
| | | | | | | | | It hasn't seemingly made a difference in the time since then but we were using 2.0, apparently an internal draft version. Fixes: QTBUG-130590 Change-Id: I78e25eba76dc9a3150932981f6c703eb0b7f3874 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSysInfo: use QString::data() instead of const_castAhmad Samir2024-11-041-3/+3
| | | | | Change-Id: Ib95cdc4c428c429c8965e32b2fd0be31944b4d2d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* macOS: Add missing product names for QSysInfo::prettyProductName()Tor Arne Vestbø2024-07-051-23/+21
| | | | | | | | | And restructure the logic a bit for easier maintenance in the future. Pick-to: 6.8 6.7 6.5 Change-Id: I6ff7396378bf02e177a4fb06978683474a79ad2f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Handle VxWorks in QSysInfoŁukasz Matysiak2024-06-191-3/+24
| | | | | | | | | | | | | Right now VxWorks is not recognized as a known platform in QSysInfo. This leads to issues with classes that depend on it to properly handle the OS specific functionality (like QFileSelector). Solve the issue by adding vxworks-specific implementation of kernelVersion, productType and productVersion. Task-number: QTBUG-115777 Pick-to: 6.7 6.8 Change-Id: Ib544d19f604f3f2d1f088f6160dd210cd6743717 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add preliminary support for Qt for visionOSTor Arne Vestbø2024-04-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | Qt already runs on Vision Pro as "Designed for iPad", using Qt for iOS. This change enables building Qt for visionOS directly, which opens the door to visionOS specific APIs and use-cases such as volumes and immersive spaces. The platform removes some APIs we depend on, notably UIScreen, so some code paths have been disabled or mocked to get something up and running. As our current window management approach on UIKit platforms depends on UIWindow and UIScreen there is currently no way to bring up QWindows. This will improve once we refactor our window management to use window scenes. To configure for visionOS, pass -platform macx-visionos-clang, and optionally add -sdk xrsimulator to build for the simulator. Change-Id: I4eda55fc3fd06e12d30a188928487cf68940ee07 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Apple: Fix a few deprecation warnings after bumping deployment targetsTor Arne Vestbø2024-02-191-2/+1
| | | | | | | | | | | | - kIOMasterPortDefault -> kIOMainPortDefault - Use UTType instead of Carbon Core functions/constants - NSWorkspace iconForFileType -> iconForContentType - Removed obsoleted kUTTypeInkText pasteboard type There are still a few more, but these will be fixed in follow ups. Change-Id: Ibbca226d578b4ba64bd9c8c5d0addc1870114a20 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSysInfo: sanitize /etc file parsing [1/N]: properly check endsWith('"') in ↵Marc Mutz2023-12-071-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | unquote() When 3535f46374ccf8ad966e4b266c0dbd919646fded dropped the Q_ASSERT(end[-1] == '"') by reviewer request from the original 767beb7fff6f08f5574a193967f8f814970ac289 change, it didn't replace it with some other check, leaving the possibility open that we'd be passing an invalid range (end < begin) to QString::fromUtf8(), with unknown consequences. While technically a security problem, this has very low impact, since the files being parsed should contain "trusted content", being supposed to be owned by root, and not writable by mere mortals. I hasten to add, though, that the code doesn't check permissions of the files it reads. The bug existed with the original Q_ASSERT, too. Namely in release mode. And in debug mode, it would be a DOS. Port to QByteArrayView to get the more expressive API and as a prerequestite for follow-up (non-security) patches. Pick-to: 6.6 6.5 Change-Id: Ib79cdad8680861d1f11b6be9234695273d0a97c2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Misc: Fix qsizetype-related narrowing coversionsAhmad Samir2023-03-111-4/+3
| | | | | | Task-number: QTBUG-102461 Change-Id: I96757abc50fc45756bc1271a970f819a48021663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSysInfo: Work around erroneous warning output from WindowsMårten Nordheim2023-02-091-1/+14
| | | | | | | | | | | | | | | | | | | gethostname is in no way labeled deprecated, but it _tries_ to query some deprecated functionality, thus some warning like this is printed: "" LogHr(1) tid(6e14) 8007277C No such service is known. The service cannot be found in the specified name space. "" By using GetComputerNameEx we work around that. Bonus side effect is that it gives us UTF-16 right away so we save a conversion. Fixes: QTBUG-110468 Pick-to: 6.5 Change-Id: I3a370354d9cce50e3d89d125ce61fc9b619294cc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Provide the proper QSysInfo::productType on WASMMikolaj Boc2023-01-111-0/+2
| | | | | | | Task-number: QTBUG-110057 Change-Id: I73b78e56faa3af858f60b884d0ea36acbd7f78cf Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSysInfo::prettyProductName(): Add macOS Ventura product nameAlexander Rezepkin2022-12-081-0/+2
| | | | | | | Pick-to: 6.2 6.3 6.4 5.15 Change-Id: I5f54866e30f08465943922e3dee5150f37054225 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Port from container.count()/length() to size()Marc Mutz2022-10-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Android: Update version names on QSysInfo and QOperatingSystemVersionAssam Boudjelthia2022-09-261-57/+58
| | | | | | | | Add latest versions that were missing in QOperatingSystemVersion and the version names used with QSysInfo::prettyProductName(). Change-Id: I933158898f9ec39f1c224e15fd6456b7e0546a67 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QSysInfo: remove unneeded assertSona Kurazyan2022-09-221-3/+1
| | | | | Change-Id: I850aeb2acf569c42fd15df860d9724d8e7e236ee Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the implementation and docs of QSysInfo to qsysinfo.cppSona Kurazyan2022-09-221-0/+1055
Task-number: QTBUG-106154 Change-Id: Ib2d812104b3514fb255d79ab6e4097ec6a851e21 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>