summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update windows version detectionMårten Nordheim2021-10-241-1/+11
| | | | | | | | Since the API still doesn't return 11. Pick-to: 6.2 5.15 Change-Id: Ifd4f7f845915702fcbb0f857487358ae8e806273 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-2/+2
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add private qAbort helper functionTor Arne Vestbø2021-09-221-0/+29
| | | | | | | Used from qt_message_fatal(), but is useful in other situations too. Change-Id: I3c0e438536d40271061c76d954c7878abfe37b8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve version-related docs in qglobal.cppEdward Welbourne2021-09-211-21/+23
| | | | | | | | | | Give a more pragmatic illustration for QT_DEPRECATED_BEFORE. Make various minor tweaks to wording, use slightly less antique versions in examples. Make usage of "runtime" standard in qglobal.cpp, at least, since "run-time" seems to be less used generally. Change-Id: I1db4950d0d0e97903b1586d98ecba75576493b1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix assorted misindented end-comment markers in qglobal.cppEdward Welbourne2021-09-201-14/+14
| | | | | | Change-Id: I240e7d32c4aa004f2bd7dd8cafd39b7c7d64e014 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Encourage use of QT_VERSION_CHECK()Edward Welbourne2021-09-201-11/+21
| | | | | | | | | | | | Document that QT_VERSION should normally be compared against it, rather than raw hex, and mildly update the example versions used in docs. (Left the snippets testing old version, since the code in which the #if-ery is used might actually make sense for those versions.) Improve related documentation in the process. Change-Id: Id3e97f41bfb0f81a117cf7b3a3ccd5f244e2a99a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-3/+3
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Use QByteArrayView::toInt() instead of duplicating its implementationEdward Welbourne2021-08-311-31/+2
| | | | | | | | | | The code in qEnvironmentVariableIntValue() to parse the text as an int can now delegate it to QByteArrayView, so that keeping in sync with QByteArray::toInt(), as a comment requested, is now automatic. Change-Id: I09a6b7245ecd02f39a850a4ce187f86709282e8c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert various callers of strtou?ll() to call strntou?ll()Edward Welbourne2021-08-301-2/+4
| | | | | | | | Where size is known or can readily be determined. Change-Id: I442e7ebb3757fdbf7d021a15e19aeba533b590a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix documentation issues for Qt CoreTopi Reinio2021-08-241-1/+1
| | | | | | | | | | | | | | * Tag deprecated Q(Multi)Map operators in the header to correctly match them with documentation \fn commands. * Add documentation for QByteArrayView comparison operators. * Add a dummy typedef 'jfieldID' for generating docs correctly on non-Android platforms * Fix other minor issues Pick-to: 6.2 Task-number: QTBUG-95860 Change-Id: I141d2f75d6aa10557aa374201f09ad74b4cd6e81 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QSysInfo: Delete pre-windows 10 codeMårten Nordheim2021-07-281-28/+4
| | | | | | | It's not supported. Change-Id: Id8c6ca7e7ad152620c76b5479ca495e9f64cc354 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: QtCore: Fix more documentation warningsTopi Reinio2021-06-071-1/+1
| | | | | | | | | | | | | | * Omit 'Bluetooth' enum value in QPermission::PermisionType (sic) as that seems to be unimplemented. * Comment out \sa links to internal/undocumented functions. * Fix incomplete template parameters in \fn commands for QProperty methods. Task-number: QTBUG-93995 Change-Id: Ic8e63fca22c9c72325c76f90f537b221f56ebace Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-261-3/+3
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Farewell Q_DISABLE_MOVEGiuseppe D'Angelo2021-05-261-14/+3
| | | | | | | | | | | | | | | | | | | | In hindsight, this macro is an API mistake, as it should NEVER be used alone, but always in combination with Q_DISABLE_COPY. But in that case, there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either bad, or completely redundant. A GitHub search reveals that luckily there's a handful of usages in the wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and removing it entirely. [ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE macro has been removed. Code that was using it can be ported to Q_DISABLE_COPY_MOVE instead. Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live qToUnderlyingGiuseppe D'Angelo2021-05-181-0/+9
| | | | | | | | | | | "Cherry-pick" of C++2b's std::to_underlying. [ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been added, to convert an value of enumeration type to its underlying value. Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.cpp: build under QT_NO_EXCEPTIONSGiuseppe D'Angelo2021-05-181-3/+9
| | | | | | | | | | | | | | | | | The boostrap library is built with exceptions disabled, and its sources include qglobal.cpp. Therefore, the file must work when built w/o exceptions. Amend/partially revert 282b724808ea4524ed09b9f0183055fdffc3c38a with the necessary fixes. Driveby, cleanup an unnecessary QT_THROW (just throw, if we do have exceptions). Change-Id: I370c295c21edd3d81a9fa670e60909b29d1c68aa Pick-to: 6.1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Make qTerminate available when QT_NO_EXCEPTIONS flag is setAlexey Edelev2021-05-161-10/+2
| | | | | | | | | | | | It seems that QtCore could only be compiled with exceptions enabled. Therefore it doesn't make sense to keep conditonal code under QT_NO_EXCEPTIONS in qglobal.cpp. qTerminate may be called whether exceptions are enabled or not. Pick-to: 6.1 Fixes: QTBUG-93739 Change-Id: Ie49c10f27cfa75360f018e8638603e6a1791450e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add test(Any)Flag(s)Giuseppe D'Angelo2021-05-151-0/+38
| | | | | | | | | | | | | | | QFlags was lacking a named function for testing whether a QFlags object contains _any_ of the bits set by a given enumerator/other QFlags. Drive-by, add testFlags taking a QFlags, not just an object of the enumeration; and simplify the implementation of testFlags to more closely follow what its documentation says it does. [ChangeLog][QtCore][QFlags] The testFlags, testAnyFlag and testAnyFlags functions have been added. Change-Id: Ie8688c8b0dd393d34d32bc7786cdcee3eba24d1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rejig native interface plumbingTor Arne Vestbø2021-05-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial approach for providing public access to native interfaces via T::nativeInteface<I>() was based on the template not being defined, and then having explicit instantiations of the supported types in a source file, so that the accessors were exported and available to the user. This worked fine for "simple" types such as QOpenGLContext and QOffscreenSurface, but presented a problem in the context of classes with subclasses, such as Q{Core,Gui}Application. To ensure that a native interface for QCoreApplication was accessible both from QCoreApplication and its subclasses, while at the same time preventing a native interface for QGuiApplication to be accessible for QCoreApplication, the nativeInterface() template function had to be declared in each subclass. Which in turn meant specializing each native interface once for each subclass it was available in. This quickly became tedious to manage, and the requirements for exposing a new native interface wasn't very clear with all these template specializations and explicit instantiations spread around. To improve on this situation, while also squashing a few other birds at the same time, we change the approach to use type erasure. The definition of T::nativeInteface<I>() is now inline, passing on the requested interface to a per type (T, not I) helper function, with the interface type flattened to a std::type_info. The type_info requested by the user is then compared to the available types in a single per-type (T) "switch statement", which is a lot easier to follow for someone trying to trace the logic of how a native interface is resolved. We can safely rely on type_info being stable between the user application and the Qt library as a result of exporting the type info for each native interface, by explicitly ensuring they have a key function. This is the same mechanism that ensures we can safely dynamic_cast these interfaces, even across library boundaries. The use of a free standing templated helper function instead of a member function in the type T, is to avoid shadowing issues, and to not pollute the class namespace of T with the helper function. Since we are already changing the plumbing for how a user resolves a native interface for a type T, we take the opportunity to add a few extra safeguards to the machinery. First, we add a static assert in the T::nativeInteface<I>() definition, that ensures that only compatible interfaces, as declared by the interface themselves, are allowed. This ensures a compile time error when an incompatible interface is requested, which improves on the link time errors we had prior to this patch, and also offsets the one downside of type erasure, namely that errors are only caught at runtime. Secondly, each interface meant for public consumption through T::nativeInteface<I>() is declared with a revision, which is checked when requesting the interface. This allows us to bump the revision when we make breaking changes to the interface that would have otherwise been binary incompatible. Since the user will never see this interface due to the revision check, they will not end up calling methods that have been removed or renamed. One advantage of moving to a type-erased approach for the plumbing is that we're not longer exposing the native interface types as part of the T::nativeInteface symbols. This means that if we ever want to rename a native interface, the only exported symbol that the user code relies on is the type info. Renaming is then possible by just exporting the type info for the old interface, but leaving it empty. Since no class in Qt implements the old native interface, the user will just get a nullptr back, similarly to bumping the revision of an interface. Change-Id: Ie50d8fb536aafe2836370caacb22afbcfaf1712a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QFlags::testFlag: clarify the behavior in the docsGiuseppe D'Angelo2021-05-111-0/+8
| | | | | | | | | | | | | The name made me fall in a trap: I thought that testFlag returned true if *any* of the bits in the argument were set in the QFlags object. In reality, it returns true if *all* the bits are set, and an argument equivalent to 0 is treated specially. Clarify this in the documentation. Change-Id: I9e8088c48038b4e6ba5830fdb7e473c6d7884b29 Pick-to: 5.15 6.0 6.1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add operator== and !=Giuseppe D'Angelo2021-05-111-0/+24
| | | | | | | | | | | | | It's a value type, and we don't need detours through implicit conversions (which are a real disgrace, as they make nonsense like `flags != 3.14` well-formed). [ChangeLog][QtCore][QFlags] Added overloads of operator== and operator!= between QFlags objects, and between a QFlags object and an object of the flag's enumeration. Change-Id: I36701dea8fcd4cc64941e78af58fa7d38a15a8c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add operator& / &= overloads taking a QFlags objectGiuseppe D'Angelo2021-05-111-0/+14
| | | | | | | | | | | | | It makes no sense to offer the "type-unsafe" operators taking a plain int, and not offer the ones taking a QFlags object. Using these operators has actually always worked by going through a conversion to int, but we're going to limit that possibility in the future. [ChangeLog][QtCore][QFlags] The operator& and operator&= now accept a QFlags object. Change-Id: Iee0845640014d35b646787e8bdb77854f180a9ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add qHash overloadGiuseppe D'Angelo2021-05-111-0/+9
| | | | | | | | | Stop going through the implicit int conversion. [ChangeLog][QtCore][QFlags] QFlags now has a qHash() overload. Change-Id: Id380ed252695f24af2e8c239b650dcb6f44e2893 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFlags: add (named) explicit conversion from/to intGiuseppe D'Angelo2021-05-111-0/+18
| | | | | | | | | | | | | There are some use cases where one may want to convert a QFlags object from/to an integer deliberately; for instance, to store it in a bitfield, saving some space. So far this worked by means of a implicit conversions; instead, also add named conversions for this. [ChangeLog][QtCore][QFlags] Added the fromInt() and toInt() functions for explicit conversions from/to a plain integer. Change-Id: I705559bf75b28c30b4446bb6d0753aedfc808eed Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* PRIx macros: add missing \relates to the docsGiuseppe D'Angelo2021-05-101-0/+4
| | | | | | | Otherwise they won't appear. Change-Id: I19d93aef9acb9d7afced8acbc76813a30b572953 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* PRI* datatypes: fix typos in documentationGiuseppe D'Angelo2021-04-251-2/+2
| | | | | | | A c&p mistake manage to slip through in 5fabad9a61, amend it. Change-Id: I706a6643d0745f336afca7bda0d8b0359354a0d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Long live PRI*QdatatypesGiuseppe D'Angelo2021-04-251-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt defines some integral datatypes (qsizetype, qintptr, quintptr, qptrdiff) not in terms of the corresponding language datatypes (resp. make_signed_t<size_t>, intptr_t, uintptr_t, ptrdiff_t) but as "integer types with the same bit size of the corresponding language type" (and of course the corret correct signedness for the target type). This makes the Qt datatypes not printable via printf-like formatted output, incl. qDebug, qWarning, QString::asprintf and so on; that's because there isn't a format modifier that would universally work with the Qt definitions. For instance, on a 32 bit platform, ptrdiff_t may be a typedef for long, while qptrdiff is a typedef for _int_ instead. Both long and int would indeed be 32 bits, but they still are different types, and this means that the ptrdiff_t-specific 't' length modifier would be wrong for qptrdiff: qptrdiff p; printf("%td", p); // WARNING: -Wformat: wanted long, got int Similarly, not using 't' breaks on 64 bits, and so on and so forth. There isn't a way out, short of inserting casts on every print statement. So, let's adopt the same solution C/C++ use for their own integer typedefs: the PRIx macros. This allows one to always use the correct formatting specifier without the need of a cast. I'm not adding the macros for the qintXX datatypes, as they already exist in the Standard Library. [ChangeLog][QtCore][QtGlobal] A series of PRIxQTDATATYPE macros have been added. They make it possible to print some Qt type aliases (qsizetype, qintptr, etc.) via a formatted output facility such as printf() or qDebug() without raising formatting warnings and without the need of a type cast. Change-Id: I473226a661868aed9514d793c8e6e4d391ab5055 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fixed type integers: streamline the definitionsGiuseppe D'Angelo2021-04-241-5/+4
| | | | | | | | | | | | | | | | | | | | | | On all the platforms we support, we require these sizes in bits: * char: 8 * short: 16 * int: 32 * long long: 64 We can get rid of the MSVC-specific type aliases (MSVC guarantees __intXX to be aliases anyhow, not extended integer types) and just use the builtin types. Also, we require C++11 and C99, so "LL" and "ULL" are the correct standard suffixes for (unsigned) long long. Remove the non-standard suffixes from the Q_(U)INT64_C macros. Change-Id: If007cd88d74064a163b5e910ca1983acd1dd1d10 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGlobal: check the Qt fixed size integersGiuseppe D'Angelo2021-04-231-0/+6
| | | | | | | | | | "Just in case", together with all the others platform checks we have in qglobal.cpp, check that we're not accidentally breaking our type aliases for fixed size integers. Change-Id: Iaa9438741b3a7e89f3c458763c7d222ef2abe961 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use Core library for qmake instead of the Bootstrap libraryAlexey Edelev2021-02-251-12/+1
| | | | | | | | | | | | | | | | | | | Move the qmake-specific logic of the QLibraryInfo class to qmake internals. 'qconfig.cpp.in' now stores information about the library info entries to keep them consistent between qmake and the Core library. qmake requires specific features enabled in the Core library, so building qmake will be skipped if the features are not enabled. All flags directly related to the qmake have been removed from Core lib. Remove all bootstrap related sections from qmake CMakeLists.txt Task-number: QTBUG-89369 Change-Id: I26de157d3bfd4a5526699296e9d46e1c180b89ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Mark qBadAlloc as [[noreturn]]Giuseppe D'Angelo2021-01-191-0/+4
| | | | | | | | | | | | So that static analyzers don't get confused by its semantics. In builds with exceptions disabled, it's not actually called by client code (e.g. Q_CHECK_PTR will just terminate in that case), but we still need to make it not return -- add another path that callss std::terminate(), otherwise we'd have a noreturn function returning. Change-Id: Ia8c4ce3e9d971f1757e9c273051cb3dedf23c61f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Assert that wchar_t's size matches one of the unicode character typesEdward Welbourne2021-01-081-0/+2
| | | | | | | This is assumed in various places, so best checked explicitly. Change-Id: I475dcf5cbb60c0272dec560acd2893cff73872ce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add test for qRoundDavid Skoland2020-12-021-0/+8
| | | | | | | | | Add test for qRound that covers some edge cases for rounding. Note that as of right now, this test fails and the docs have been updated to warn that it should not be depended on for strict correctness. Change-Id: I1a61bca47abd77855fe7c13ded44e913cc7e8722 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Extend container overview documentation, mention Q_DECLARE_TYPEINFOAndreas Buhr2020-11-301-3/+10
| | | | | | | | | | | | The container overview documentation did not mention Q_DECLARE_TYPEINFO and the related optimizations. This patch adds a short paragraph about it. Task-number: QTBUG-86584 Pick-to: 6.0 Change-Id: I5b0b8ce92a47da5f0398cc413fbf3e07b0921e59 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Re-fix the definition of primitive typesGiuseppe D'Angelo2020-11-241-1/+1
| | | | | | | | | | | The conditions are AND, not OR. Technically we don't rely on not having constructors any more, but we may reserve the right in the future to have uninitialized resizes. Change-Id: Icfae61079a544f7ac8e90a32ad605c12cfa8b4aa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit bcd38a96149f5397375b57e948c05c7a8f172194) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Centralize the wchar_t == char16_t check on WindowsGiuseppe D'Angelo2020-11-181-0/+3
| | | | | | | | Don't push it onto every TU that includes QChar (... approx. everything that uses Qt). Change-Id: I4a07ce9e38a347b45315db93b0c5b90c20bacdbc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Don't initialize POD types with memset(0)Lars Knoll2020-11-171-4/+2
| | | | | | | | | This is dangerous as at least pointers to member objects/data are not always zero initialized. Change-Id: I1250e101ab73cd816694315fc9130f4d486b9feb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Q_PRIMITIVE_TYPE: improve the documentationGiuseppe D'Angelo2020-11-091-2/+3
| | | | | | | | | | | | | A key piece of information missing from Q_PRIMITIVE_TYPE documentation is that for them value initialization must equal memset()ting with zeroes. A type like QPoint is primitive because `QPoint p;` is initialized to (0, 0), but a type like QSize is movable (and NOT primitive) because `QSize s;` is actually initialized to (-1, -1). Amend the docs. Change-Id: I121684810da46be5d0579c7d3de945149390a32a Pick-to: 5.15 5.12 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove documentation for removed QFlags constructorVolker Hilsheimer2020-10-261-10/+0
| | | | | Change-Id: I407392d8d92da2ebcfc2cb8050155ab44ba1f0ff Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Whitespace cleanup in corelib/globalAllan Sandfeld Jensen2020-10-211-11/+11
| | | | | Change-Id: I087d7d949cfd43e48e8a008621a4eeaa9d104ceb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use Q_RELOCATABLE* instead of Q_MOVABLE* wording in docsAndrei Golubev2020-09-291-8/+8
| | | | | | | | Movable in Qt is confusing since C++11. Our code also relies on wording with "relocatable" and "movable" is mostly a backwards-compatibility thing Change-Id: I28f5a61b4482aa1dd26c7b760d78be031d11ef10 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Normalize roundingAllan Sandfeld Jensen2020-09-161-4/+4
| | | | | | | | Change the rounding of negative half values to match standard C++ round, this will also allow future optimizations. Change-Id: I8f8c71bed1f05891e82ea787c6bc284297de9c5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Purge Q_{STDLIB,COMPILER}_UNICODE_STRINGSEdward Welbourne2020-09-141-4/+0
| | | | | | | | | These were now always defined, hence redundant. Leave the #define in place so that we can verify we actually do always define it, in a #else of an existing #if check on it. Change-Id: Iea4c3dbc8f9982268bcf81da5ef17fe2ebf5c462 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.h: remove deprecated global functionsEdward Welbourne2020-08-141-9/+0
| | | | | | | | Since 5.0 - qMalloc(), qFree(), qRealloc(), qMemCopy(), qMemSet() Since 5.15 - qsrand(), qrand() Change-Id: I74fa3d17b05521271c3dc563fc85a5b133289ce3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove non-Qt6 compile time switches from QtCoreAllan Sandfeld Jensen2020-07-241-5/+0
| | | | | | | | We already manage to compile without this code, and none of it are full classes or separate functions suitable for qt5compat. Change-Id: I47facac7ec621cfc4b0b26214b7de37897443519 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QSysInfo: remove deprecated windowsVersion() and macVersion()Edward Welbourne2020-07-221-223/+0
| | | | | | | | | Remove their associated enums, too. All deprecated since 5.9. Change-Id: Ieefba1a08c221ea7b62500f219baea8a3ccfb7db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-2/+1
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-14/+14
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove winrtOliver Wolff2020-06-061-27/+10
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>