summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* QImageReader: check allocation limit for minimum 32 bppEirik Aavitsland2021-11-222-2/+13
| | | | | | | | | | | | | | | | | Also, as a driveby, add an environment variable so the limit can be changed at runtime. [ChangeLog][QtGui][QImageReader] When checking allocation limit during image reading, the memory requirements are now calculated for a minimum of 32 bits per pixel, since Qt will typically convert an image to that depth when it is used in GUI. This means that the effective allocation limit is significantly smaller when reading 1 bpp and 8 bpp images. Pick-to: 6.2 6.2.2 Change-Id: If1b204d413973b0975eea531e29c260fdcec931d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support for combining multiple QFuturesSona Kurazyan2021-11-204-0/+508
| | | | | | | | | | | [ChangeLog][QtCore] Added QtFuture::whenAll() and QtFuture::whenAny() functions, returning a QFuture that becomes ready when all or any of the supplied futures complete. Task-number: QTBUG-86714 Change-Id: I2bb7dbb4cdc4f79a7a4fd494142df6a0f93a2b39 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Q{CoffPe,Elf,MachO}Parser: check that the magic string is presentThiago Macieira2021-11-193-8/+31
| | | | | | | | | | Commit 2549a88ba2a48fa2bedce97dd71a2974c6f8840a changed the ELF and Mach-O parsers to return an offset to the actual data header, not the magic string, which we stopped searching for anyway. This commit brings such a validity check back and adds it to the new COFF PE parser. Change-Id: Iccb47e5527544b6fbd75fffd16b8b2252a76f179 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPluginLoader: add COFF PE file parserThiago Macieira2021-11-194-0/+490
| | | | | | | | Fixes: QTBUG-67461 Docs: https://docs.microsoft.com/en-us/windows/win32/debug/pe-format Change-Id: I5e52dc5b093c43a3b678fffd16b77bf9a8f2b17e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: reorganize the QT_FEATURE_library portion of CMakeLists.txtThiago Macieira2021-11-192-11/+9
| | | | | | | | No need to attempt to compile both qelfparser and qmachoparser in all systems. Change-Id: Iccb47e5527544b6fbd75fffd16b7ee5a1555a7a8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QString::fromUtf16: use qustrlenThiago Macieira2021-11-191-5/+2
| | | | | | | | We have it. Pick-to: 6.2 Change-Id: Iccb47e5527544b6fbd75fffd16b901fe4d2920a7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Re-apply "QReadWriteLock: replace (QWaitCondition, QMutex) with ↵Marc Mutz2021-11-202-22/+25
| | | | | | | | | | | | | | std::(condition_variable, mutex)" This reverts commit 1283ee324578e4cf5cc210d8d3c89647d6c56ec3. We now have wrappers around std::mutex and std::condition_variable that fall back to QMutex and QWaitCondition on the broken Integrity toolchain. Use them. Change-Id: I881aa931167b845b489713048b57ccc5f79d4237 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Short live q20::ssize()!Marc Mutz2021-11-202-0/+81
| | | | | | | | | Extract the definition of q20::ssize() from tst_qanystringview.cpp, where it had to be placed for its backport to 6.2. Change-Id: I3f758c98a4b1efd453f4fc044b8d3f1a89de62d1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QAndroidActivityResultReceiver: avoid double(triple)-lookupMarc Mutz2021-11-201-6/+9
| | | | | | | | | | | | | | | | The code used the if (!contains()) { insert() } anti-pattern, necessitated by Qt's deviation from the STL of allowing insert() to overwrite an existing entry, causing two lookups of the same key. Fix by recording the size prior to the execution of the indexing operator and taking a size increase as the cue to populate the (new) entry. This way, we look up the key only once. Also fix two instances of double lookup caused by the if (contains()) { value() } anti-pattern. Change-Id: I961fe45ec571aa94aff5dd578f2276e7b74d800d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use Authz API to query permissions info in Windows filesystem backendIevgenii Meshcheriakov2021-11-192-117/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | Microsoft documentation for GetEffectiveRightsFromAclW function that was used previously has this at the top of the page: > GetEffectiveRightsFromAcl is available for use in the operating > systems specified in the Requirements section. It may be altered > or unavailable in subsequent versions. Instead, use the method > demonstrated in the example below. This says to me that the function is deprecated. In addition to that, it is not able to handle ACLs that are not in "canonical" order, returning ERROR_INVALID_ACL. Such ACLs are useful to represent POSIX permissions in Windows, and are produced by Cygwin for example. This patch uses Authz API referenced by the message quoted above. The used API is available starting from Windows XP/Windows Server 2003. This API also allowe to perform access checks given access token, and so allows to use similar code all permission checks. Task-number: QTBUG-79750 Change-Id: I8b11ff3cc83cd9ed5bfb2ce9432a375a122cdbbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* xcb: Return standalone image from QXcbBackingStore::toImage()Tor Arne Vestbø2021-11-191-1/+7
| | | | | | | | | Otherwise the original backingstore image will detach from the m_xcb_image data on the next backingstore paint or scroll. Pick-to: 6.2 Change-Id: I73f68d9c2e7c106951541831a5df8b97695f2001 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Skip disabled proxy widgets when (back)tabbingAlexander Volkov2021-11-191-1/+4
| | | | | | | Fixes: QTBUG-98137 Pick-to: 6.2 5.15 Change-Id: If52053dce361b130ef7dcfaf747710d8ceb9bbcd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Move the 'qmake' feature to src/tools/configure.cmakeJoerg Bornemann2021-11-191-0/+7
| | | | | | | | This allows us to present 'qmake' in the tool-related section of the configure summary. Change-Id: I897dec23cb0608706ec01d9b91283dbce92b293f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add configure feature 'androiddeployqt'Joerg Bornemann2021-11-192-2/+15
| | | | | | | | | | | This makes it possible to turn off the build of the Android deployment tool. A new src/tools/configure.cmake is added that will be the place for all tool-related features in qtbase. Change-Id: Ic9264c93ee96de06c97d21d2f27f73256f48ffda Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add more verification when parsing http headers and add testsØystein Heskestad2021-11-191-23/+61
| | | | | | | | Adding tests from QtWebSockets that will reuse QHttpHeaderParser Task-number: QTBUG-80700 Change-Id: I76294a9156173314a3cf09160d0ca4e0d7c6ef3a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Compile: Work around false positive on gcc >= 900Morten Johan Sørvig2021-11-191-1/+1
| | | | | Change-Id: Id9d2c968322963af6a2e31f0d9e4195120d0b5ea Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: remove unused variableMorten Johan Sørvig2021-11-191-4/+0
| | | | | | Change-Id: I442e3dc4534193709c3510c43a484e5d3c2eb4af Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Link printer plugins into user projects when using a static QtJoerg Bornemann2021-11-193-4/+6
| | | | | | | | | | | | When building a user project against a static Qt on Windows or macOS the static printer support plugins were not linked. Move the Q_IMPORT_PLUGIN statements to qplatformprintplugin.cpp, which is a translation unit that is guaranteed to be linked into the user project. Pick-to: 6.2 Fixes: QTBUG-97490 Change-Id: Ic35c6483a664a06461304c7e8a2b7b06ce651ed6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix generating of Android deployment config in Multi-Config buildAlexey Edelev2021-11-191-1/+2
| | | | | | | | | | Add the config-specific suffix to the generated Android deployment config file. Amends d20f4ae706559fb7de8db9dd4845f7ce3936061a Change-Id: If1755baf5548adb4d95733477d8b5af85e1fd2dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change qt.conf key Qml2Imports to QmlImportsJoerg Bornemann2021-11-192-19/+32
| | | | | | | | | | | | | [ChangeLog][qt.conf] The key Paths/Qml2Imports has been renamed to Paths/QmlImports. For backwards-compatibility, Paths/Qml2Imports is still accepted and acts as default value for when Paths/QmlImports is not present. Fixes: QTBUG-98335 Change-Id: If7ffedd281eb8a87e8ab1a2b69a823e615c33541 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QLoggingRegistry: avoid double-lookupMarc Mutz2021-11-191-2/+5
| | | | | | | | | | | | | The code used the if (!contains()) { insert() } anti-pattern, necessitated by Qt's deviation from the STL of allowing insert() to overwrite an existing entry, causing two lookups of the same key. Fix by recording the size prior to the execution of the indexing operator and taking a size increase as the cue to populate the (new) entry. This way, we look up the key only once. Change-Id: Ica039035fe9ea4b88c20184784c324c9fac33d49 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QHash: optimize value(key) and key(value) callersMarc Mutz2021-11-192-25/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | ... by not injecting potentially-expensive temporary objects into the caller's stack frame. Default arguments are a convenient way to avoid overloads, but if the defaulted argument isn't a Trivial Type, and the common use case is not to pass the extra argument explicitly, the construction of the temporary can dominate the call's runtime. Since QHash is generic code, we don't know whether T or Key are expensive or cheap to construct, so use overloading instead of default arguments to avoid injecting needless code into call sites. [ChangeLog][QtCore][Potentially Source-Incompatible Changes][QHash/QMultiHash] The value(key) and key(value) functions are now overloaded on presence of the defaultValue (was: defaulted argument) to avoid injecting temporary objects into the caller's stack frame. Task-number: QTBUG-98117 Change-Id: I80fdd5436f3de3e4bbe20242fe45916aef62ff0c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prefer QBAV over raw char * form of qt_configure_strsEdward Welbourne2021-11-191-2/+2
| | | | | | | | | | | Passing the QByteArrayView to QString::fromLocal8Bit() ensures we tell it the size and saves a strlen(). Quite apart from avoiding some misguided grumbles from compilers, this save searching for a '\0' when we already know where it is. Change-Id: I2e3f2edfb4d3bdf488374570567d1dd30641ebc3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Docs: Move manifest and androiddeployqt docs to where code livesNicholas Bennett2021-11-193-1/+539
| | | | | | | | | | | Removed content describing androiddeployqt from deployment-android.html to androiddeployqt.html,the qdoc source now living in qtbase. Docs src locations added to the qtcore.qdocconf. Task-number: QTBUG-97842 Pick-to: 6.2 Change-Id: I94783520280098ce1ab35f335a644bea70b8131a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Remove unneeded int conversions in qmetatype.hKai Köhne2021-11-191-9/+9
| | | | | | | | | | | | | | | They were added in Qt 5, where QByteArray::reserve() was an int argument, and qstrlen() was returning an int. In Qt 6, both accept and return qsizetype/size_t. As a side effect, this fixes various informational messages when loading a Qt project into Visual Studio 2022: lnt-arithmetic-overflow: A sub-expression may overflow before being assigned to a wider type. Pick-to: 6.2 Change-Id: Ifc9a1f7046a78bcfb97fe241d697c1bf91c6ba4f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up line clipping code in rasterizerEirik Aavitsland2021-11-191-36/+59
| | | | | | | | | | | | | | Replace old code with the line clipper from qcosmeticstroker. Also avoids tripping some issue with the current clang 13 that would cause paint errors on macOS. Fixes: QTBUG-98403 Fixes: QTBUG-98388 Pick-to: 6.2 6.2.2 Change-Id: I257eeec6f71153ec51b4176df3be8c443938484c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QOperatingSystemVersion: Add Windows11Mårten Nordheim2021-11-192-0/+7
| | | | | | Change-Id: Ieb7674bbbbc78689f1e2a1e5a06dfd4d0ce25ac1 Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAnyStringView: fix broken implicit conversion from QStringBuilderMarc Mutz2021-11-192-2/+3
| | | | | | | | | | | | | | Need to use QConcatenable<>::ConvertTo for SFINAE, the forwarded type alias in QStringBuilder itself doesn't work. [ChangeLog][QtCore][QAnyStringView/QStringBuilder] Implicit conversion from QStringBuilder to QAnyStringView now works as advertised. Pick-to: 6.2 Fixes: QTBUG-98138 Change-Id: I1c300675cf43b13017bc56398ae5d8c1c51e64fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Windows QPA: Fix multi-touch support in some devicesAndré de la Rocha2021-11-182-9/+37
| | | | | | | | | | | | | | | | Some multi-touch devices send touch information for each finger using different WM_POINTER messages/frames, instead of a single one with a list of touches, like most devices. This would result in the generation of multiple touch events, which can cause unexpected behavior in applications (the QTouchEvent documentation specifies that it should contain all simultaneous touches). This patch adds a workaround to ensure all simultaneous touches are included in the events, to comply with the expected behavior. Pick-to: 6.2 5.15 Change-Id: I12a2f84b35a6bdd49ee53d25de580c0941a9aea6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Clarify validity of image returned from QPlatformBackingStore::toImage()Tor Arne Vestbø2021-11-181-0/+5
| | | | | | | | | | | | The backingstore may reconfigure the internal data, so clients should not assume that the image is valid beyond any new operations on the backingstore. Pick-to: 6.2 Change-Id: I137ad4f2adb45ec8bb78a989fbb5bac1e72965ce Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Don't mark scrolled area as flushed when doing client side scrollTor Arne Vestbø2021-11-181-8/+9
| | | | | | | | | | | | | | The m_pendingFlush variable is used to track what is missing in the server side backingstore. If we're doing a client side scroll the pending area is still the same. If we were to always discard the scrolled area from m_pendingFlush we would get in trouble on the next non-client side scroll, as we think the content exists server-side. Pick-to: 6.2 Change-Id: Ie50a99a8e5d8a83d1299c53534a1c83c6bfb47bd Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Ensure we have pixmap GC before trying to flush to it during scrollTor Arne Vestbø2021-11-181-2/+2
| | | | | | Pick-to: 6.2 Change-Id: Icc85b1eb830d8d9b1b2bfb8b9998470388522832 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* xcb: Prepare correct area when doing client side backingstore scrollTor Arne Vestbø2021-11-181-2/+4
| | | | | | | | The area we're going to fill is the one after applying the scroll delta. Pick-to: 6.2 Change-Id: I254830a15e5f4c93ba28ed8f0a9b35c40f1d1af2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix assert in QFontComboBox when setting empty fontEskil Abrahamsen Blomfeldt2021-11-181-1/+2
| | | | | | | | | | Don't crash if the font does not have any families set. Pick-to: 6.2 Task-number: QTBUG-97995 Change-Id: I8dc2f2fc00309b6fff6d4a661ec6d659f30808af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix deserializing Qt 5.x fonts through QDataStreamEskil Abrahamsen Blomfeldt2021-11-181-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, fonts had both singular family and plural families properties, and both were stored separately when streaming through QDataStream. The families list was treated as an extension of family in this case, and the primary font family was always the singular family property. In Qt 6, it has been merged into one and family() is now just a convenience for families().at(0). But when reading files generated with Qt 5, we would ignore the fact that these were previously separated. We would first read the family entry into the families list, and then we would later overwrite this with an empty families list. Instead, we detect streams created with Qt 5.15 or lower and make sure we append the families list instead of overwriting it in this case. In addition, we need to make sure we split up the list again when outputting to Qt 5.x. This adds a file generated with QDataStream in Qt 5.15 to the test to verify. [ChangeLog][Fonts] Fixed a problem deserializing the family of fonts that had been serialized using QDataStream in Qt 5. Pick-to: 6.2 Fixes: QTBUG-97995 Change-Id: Id3c6e13fc2375685643caee5f8e3009c00918ccb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* macOS: Fix QSlider's knob positioning on MontereyVolker Hilsheimer2021-11-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMacStyle has a single NSSlider that is used to render any QSlider. For each QStyle API operating on a slider, the style sets the slider up with respecive properties. On macOS 12, the NSSlider maintains some states that make QSlider instances influence each other's knob position when rendering, resulting in uncontrollable jumping of the slider. This can be fixed by not using startTrackingAt/stopTracking APIs, which are however the only way we have to make the slider knob get rendered pressed - there is no property in NSSlider(Cell), and none of the NSCell attributes have any effect. So we need to use startTrackingAt, and work around the side effect by reinitializing the NSSlider by calling initWithFrame. This fixes the positioning error, but also causes flickering of the knob when dragging. To fix the flickering, we have to always call startTrackingAt for a slider that is pressed, even for calls to setupSlider that are made in QStyle APIs that are not drawing anything. Also tried with no complete success (either positiong bug or flicker): * call prepareForReuse on the NSView * always call stopTracking on the NSSlider Fixes: QTBUG-98093 Pick-to: 6.2 6.2.2 Change-Id: I3423b9f7cb125a59831c6722509ab3b74742b6ae Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add operating system version for macOS 12 "Monterey"Volker Hilsheimer2021-11-182-0/+10
| | | | | | | | | With pre-11 SDKs, macOS reports version 10.16, which already matches BigSur, so we only match Monterey if version 12 is reported. Change-Id: I37fee43756310370444981212750cdfe7fad64b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Introduce Q_APPLICATION_STATICMike Achtelik2021-11-186-51/+229
| | | | | | | | | | | | | | QObjects must be deleted if the QCoreApplication is being destroyed. This was previously done by implementing custom code in qtbase and other modules. So unify it and introduce a Q_APPLICATION_STATIC, based on the Q_GLOBAL_STATIC, which centralises the logic. Since we still have a few remaining living QObjects, this comes in handy to fix those as well. Task-number: QTBUG-84234 Change-Id: I3040a2280ff56291f2b1c39948c06a23597865c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Increment reference count when restoring referenceAllan Sandfeld Jensen2021-11-181-0/+1
| | | | | | | | | | Otherwise the count will be wrong after an out of memory failure in reinterpretAsFormat. Pick-to: 6.2 5.15 Fixes: QTBUG-98377 Change-Id: Ice51d47a6db9277126a5c7337e14aaf5ddee3a10 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add missing QT_TRID_N_NOOP definitionLucie Gérard2021-11-183-0/+35
| | | | | | | | | | | | | Amends c74bd2b93, properly following up on qttools/bc47b5190. [ChangeLog][QtCore] Added missing QT_TRID_N_NOOP() macro. Lupdate actually recognizes it since Qt 5.12. Fixes: QTBUG-98277 Fixes: QTBUG-3945 Change-Id: I0ea15ceb49b2ead5c8bb40d2a55a0ae8577e8850 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use a QVarLengthArray for FatalSignalHandler's alternate stackEdward Welbourne2021-11-181-3/+4
| | | | | | | | | | | The stack needs to be at least SIGSTKSZ, which isn't constexpr, so we can't allocate it at compile time. However, we can resize(SIGSTKSZ) a QVarLengthArray that's probably big enough anyway. At the same time, increase the compile-time size to 32k, to match what our Catch2 harness for the self-test uses. Change-Id: I3a34ece73901dd402672cd6fe4da66923f1932c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rework FatalSignalHandler to use ranged-for loops over signalsEdward Welbourne2021-11-181-7/+7
| | | | | | | | Shrinks the const array by one zero-terminator and makes the code accessing it read more gracefully. Change-Id: I4034116a83ff3cd05ea0feb0ce8a4340c54a9faa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Test the return from sigaction()Edward Welbourne2021-11-181-11/+19
| | | | | | | | | | | | | | If we fail to install our own action, the contents of oldact are noise anyway, so we can't use them to decide anything; and, in any case, we didn't replace the prior action, so have no duty to restore it. In the process, restructure and comment the code to make it easier to follow what's going on and why. Package a conditional in a lambda to make the #if-ery less problematic. This should also make it easier to hack any other complications into the condition, should they arise. Change-Id: I712335ee27f68a8594dc2fe6441a91f686967da2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix macOS system locale's formatting of negative yearsEdward Welbourne2021-11-181-17/+112
| | | | | | | It leaves off the minus sign. Change-Id: Iad72349368d8849330524144033453cbd79e9e7c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix formatting of dates before 1601 in MS system localeEdward Welbourne2021-11-181-1/+65
| | | | | | | | | | | | | | | | The relevant MS system calls (say they) don't support date formatting for years < 1601 (but apparently do in fact) and the year field of the data structure is unsigned, so can't support years < 0. As a result, the windows back-end for QSystemLocale failed for negative years. So replace year < 1601 with a place-holder and substitute after formatting. Added new tests (based loosely on one in qtdeclarative that failed) to verify that this actually works. These reveal that macOS also fails to handle negative years; marked as expected failure there pending a fix. Change-Id: I9b63cefd5f0b77a39cf1238549412de3e26ca1bd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove some spurious prefixes in declarationsEdward Welbourne2021-11-182-4/+4
| | | | | | | | | | The parameter-list of a method is already in its class's context, so doesn't need it made explicit on the other class members involved. Change-Id: I253b098ad1f2d2db80d49d8f484b7f95d14acec1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add a note on the sign of daylight-saving offsetsEdward Welbourne2021-11-181-1/+4
| | | | | | | | | | | Given that at least one zone has a negative offset (so that it's in standard time for most of the year, including summer, and daylight-saving time relatively briefly during winter), QTimeZone's docs should explain what that means. Change-Id: I6649b4cdefbd685dc97bf85d957960da44d07aed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Eliminate a constant from qtimezoneprivate_win.cppEdward Welbourne2021-11-181-6/+7
| | | | | | | | | Its MIN_YEAR was duplicating what's now provided by QDateTime::YearRange::First, so use that instead. In the process, tidy up an over-long line. Change-Id: I109f5435f63cb5cc97d54529a172b640f919dec0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Remove some unused constants from qtimezoneprivate_win.cppEdward Welbourne2021-11-181-6/+3
| | | | | | | | | Recent commit 6845c444d082cfac561b3c8f28f53480ae066746 elicits warnings about two unused constants. Remove an unused macro at the same time, and add missing LL suffix to remaining qint64 constants. Change-Id: I4c84e10b512030e0e4f860d434382e62e6c936f5 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QIODeviceBase: make dtor protectedMarc Mutz2021-11-181-0/+2
| | | | | | | | | | | | | Base class dtors should be virtual and public or else protected and non-virtual. This one was neither of these. [ChangeLog][Potentially Source-Incompatible Changes][QtCore] The QIODeviceBase destructor is now protected to avoid deleting objects of classes derived from it through a QIODeviceBase pointer, which would be undefined behavior. Change-Id: Id390ace75d5b64f746d9b1865b8800c9f0590977 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>