summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Long live Q_UNREACHABLE_RETURN()!Marc Mutz2022-10-1552-213/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a combination of Q_UNREACHABLE() with a return statement. ATM, the return statement is unconditionally included. If we notice that some compilers warn about return after __builtin_unreachable(), then we can map Q_UNREACHABLE_RETURN(...) to Q_UNREACHABLE() without having to touch all the code that uses explicit Q_UNREACHABLE() + return. The fact that Boost has BOOST_UNREACHABLE_RETURN() indicates that there are compilers that complain about a lack of return after Q_UNREACHABLE (we know that MSVC, ICC, and GHS are among them), as well as compilers that complained about a return being present (Coverity). Take this opportunity to properly adapt to Coverity, by leaving out the return statement on this compiler. Apply the macro around the code base, using a clang-tidy transformer rule: const std::string unr = "unr", val = "val", ret = "ret"; auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(", ifBound(val, cat(node(val)), cat("")), ")"); auto ignoringSwitchCases = [](auto stmt) { return anyOf(stmt, switchCase(subStmt(stmt))); }; makeRule( stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)), nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))), {changeTo(node(unr), cat(makeUnreachableReturn, ";")), // TODO: why is the ; lost w/o this? changeTo(node(ret), cat(""))}, cat("use ", makeUnreachableReturn)) ); where nextStmt() is copied from some upstream clang-tidy check's private implementation and subStmt() is a private matcher that gives access to SwitchCase's SubStmt. A.k.a. qt-use-unreachable-return. There were some false positives, suppressed them with NOLINTNEXTLINE. They're not really false positiives, it's just that Clang sees the world in one way and if conditonal compilation (#if) differs for other compilers, Clang doesn't know better. This is an artifact of matching two consecutive statements. I haven't figured out how to remove the empty line left by the deletion of the return statement, if it, indeed, was on a separate line, so post-processed the patch to remove all the lines matching ^\+ *$ from the diff: git commit -am meep git reset --hard HEAD^ git diff HEAD..HEAD@{1} | sed '/^\+ *$/d' | recountdiff - | patch -p1 [ChangeLog][QtCore][QtAssert] Added Q_UNREACHABLE_RETURN() macro. Change-Id: I9782939f16091c964f25b7826e1c0dbd13a71305 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qcompilerdetection.h: detect CoverityMarc Mutz2022-10-151-0/+5
| | | | | | | | | | Just to persist the knowledge of how to detect it for the next guy. Pick-to: 6.4 6.2 5.15 Change-Id: I16847d02ce60fab0ae14ffb2688f2ee92fa6a9f2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* wasm: change logic for copying batchedtestrunner files to build dirDavid Skoland2022-10-151-22/+21
| | | | | | | | | | | | | The previous config did not work for prefix builds (files were not copied over). To fix this, we simply copy over the files in case of a prefix build. Additionally removed batch_test_feature from the condition, as this is now the de facto wasm test runner, which supports batched and unbatched tests. Change-Id: Ib232c7898de0a0d750e4ca5ebf1da8cbcc7da3e0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QOperatingSystemVersion: fix newly introduced Android versionsYuhang Zhao2022-10-152-12/+4
| | | | | | | | | | | | | When introducing new entries for QOperatingSystemVersion, We should follow the new pattern [1], not the old legacy one. Amends commit 14278bb2506c079c4e10724107bd36b7af49b09b [1] qtbase/3446313c7a5cd6005089866a7b20c9f28e132a0a Change-Id: Id3444a1fba1384f9b4a410b3878ad25639b69f3d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAnyStringView: fix MSVC warningYuhang Zhao2022-10-151-5/+9
| | | | | | | | | | | When use /W4, MSVC warns about the code is not reachable. It's not reachable indeed, so it's no need to include it in the final binary, just use the same #ifdef guard to comment it out. Pick-to: 6.4 Change-Id: I22a321e2c748bd1c5608475d61ba9a83734c5364 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Add filter options to qt_generate_deploy_app_scriptJoerg Bornemann2022-10-152-1/+31
| | | | | | | | | | | | Add the options PRE_INCLUDE_REGEXES, PRE_EXCLUDE_REGEXES, POST_INCLUDE_REGEXES, POST_EXCLUDE_REGEXES, POST_INCLUDE_FILES, and POST_EXCLUDE_FILES. These are forwarded to qt_deploy_runtime_dependencies. Change-Id: I003814bec7f797a0035e52b17fd0231f9ad7ff0d Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* CMake: Deploy runtime dependencies outside of the Qt prefix tooJoerg Bornemann2022-10-154-31/+128
| | | | | | | | | | | | | | | | | | | | | | | | We restricted the runtime dependencies we deployed on Linux to libraries within the Qt installation prefix. This restriction was supposed to prevent the deployment of all kinds of system libraries, which is most likely not wanted. However, the user might link against non-system libraries, and those should be deployed. The same holds for QML backend libraries that exist outside the Qt installation prefix in the build directory of the project. Now, we restrict deployment to libraries that are not in default system library directories. This can be overridden with the new qt_deploy_runtime_dependencies option POST_EXCLUDE_REGEXES. We add the following options to qt_deploy_runtime_dependencies, which are then forwarded to file(GET_RUNTIME_DEPENDENCIES): PRE_INCLUDE_REGEXES, PRE_EXCLUDE_REGEXES, POST_INCLUDE_REGEXES, POST_EXCLUDE_REGEXES, and POST_INCLUDE_FILES. Change-Id: I99a98fd91218abedda270609d0bafbb7f3e0feeb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Set RPATH of deployed plugins on LinuxJoerg Bornemann2022-10-152-0/+87
| | | | | | | | | | | | | | | | | | | | When deploying into some directory structure where CMAKE_INSTALL_LIBDIR is different from Qt's lib dir, we need to set the RPATH of installed plugins such that Qt libraries are found. We do this using CMake's undocumented file(RPATH_SET) command and pray that this command is safe to use across current and future CMake versions. For CMake versions < 3.21, we use patchelf, which must be installed on the host system. The adjustment of rpaths can be turned on explicitly by setting QT_DEPLOY_FORCE_ADJUST_RPATHS to ON. The usage of patchelf can be forced by setting QT_DEPLOY_USE_PATCHELF to ON regardless of the CMake version. Change-Id: I62ced496b4c12bf6d46735d2af7ff35130148acb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Don't set QT_PLUGIN_PATH in the deployment test's run environmentJoerg Bornemann2022-10-151-14/+26
| | | | | | | | | | | | | Otherwise we don't properly test whether the deployed executable can run without adjusting the environment. We temporarily adjust the test_widgets_app_deployment test and set CMAKE_INSTALL_LIBDIR to make the test pass. It would now fail on Linux distros where CMAKE_INSTALL_LIBDIR defaults to "lib64" but Qt is built with lib dir "lib". The next commit removes this hack. Change-Id: I63c79ef1ee23ffaeed881337fde6e9d889ecc0fe Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QLibrary: merge duplicated setFileName{,AndVersion} codeThiago Macieira2022-10-141-14/+2
| | | | | | | | | The code was in triplicate. Once is enough. Pick-to: 6.4 Change-Id: I12a088d1ae424825abd3fffd171ce375892457fc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QDir: use QFileInfo::exists() directlyAhmad Samir2022-10-141-3/+3
| | | | | | | | | static QFile::exists() calls static QFileInfo::exists(). Mention QFileInfo::exists in the QDir docs details. Change-Id: I35ba9b00f33376a4ceb2f27ab587d368a95e4fe5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTabBar: add note about hidding the close buttonAhmad Samir2022-10-141-2/+3
| | | | | | | Drive-by change: improve another sentence. Change-Id: Iaefa9d9eca95e1ce39e566e4b91ec9ed82410323 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* SQL/OCI: fix compilationChristian Ehrlicher2022-10-142-2/+3
| | | | | | | | | | | Fix compilation error introduced with 917b4d3802f3c2102021610cbf977403a3d4c21a and add a missing override Pick-to: 6.4 Fixes: QTBUG-107544 Change-Id: I53571a0a113dc0f1e65f8773e66c02c1764739ee Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Update QMutex-noexceptednessMårten Nordheim2022-10-141-1/+1
| | | | | | | | | | | Platforms where we use futex do not allocate. Windows gained support in 6.2, but the noexcept macro was missed. Amends 91f6460aff0a6ab5142f16d5f4fc1f559ca1c325 Change-Id: I76da48fbaac5749fdec4ec76de6a0ff891b78442 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix DBus cmake component nameMaxime Roussin-Bélanger2022-10-141-1/+1
| | | | | | | | If a user would copy paste the cmake line shown in the documentation it would fail to find the package because it has the wrong case. Change-Id: Ia5354cf408a5744bcb1c13f2624b10a6a1dbea4b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* SQL/OCI: add missing overide()Christian Ehrlicher2022-10-141-1/+1
| | | | | | | | | QOCIDriver::hasFeature() missed a 'override' which prevents compiling it with '-Werror' Pick-to: 6.2 6.4 Change-Id: I73a30134415947475e8f378fdb51bdd3f7fdd989 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: remove QWasmClipboard::m_isListenerMorten Sørvig2022-10-142-12/+3
| | | | | | | | | | Similar to isPaste (removed in previous commit), m_isListener is set when handling external clipboard events, and is no longer needed now that QWasmClipboard::setMimieData() is no longer called for that case. Change-Id: Ib44612e3bd1d59bac95b041ccffdd2ae97f5f879 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* wasm: remove QWasmClipboard::isPasteMorten Sørvig2022-10-142-12/+9
| | | | | | | | | | | | | | | | QWasmClipboard::setMimeData() was used to move clipboard data for two different cases: 1) On programatic QClipboard::setMimeData() call from application 2) On paste event from the browser However, we are free to not call it in case 2) above, which means it can be used to handle programatic setMimeData() exclusively. Change-Id: I5bb452538027ee8eab36be6e405ae416f350a08e Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QComboBox: remove dead codeVolker Hilsheimer2022-10-121-20/+1
| | | | | | | | | We used to explicitly fade out combobox popups on macOS, but even the cocoa platform plugin no longer implements a fadeWindow function. Pick-to: 6.4 Change-Id: I5cd61da2c755ec0f312c451f0ea966aa48399385 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Allow programmatic closing of windows that are modally blockedVolker Hilsheimer2022-10-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | In Qt 6, after changes such as 121fddcf5ae2ab238ef802e44b45ce62c56015f5, we go through the QPA layer to close widget windows properly. Closing and hiding of windows is now done in when we receive and handle the window system's CloseEvent. Such an event to a modally blocked window should be blocked, so that users can't close a modally blocked window. However, if the event is the result of a call to QWindow::close, then it should not be blocked. Luckily, we know that the event is the result of such a call, so let such events through. This restores compatibility with Qt 5, where it was possible to first open a new dialog, and then close the previous dialog. Add a test case. Fixes: QTBUG-107188 Pick-to: 6.4 6.2 Change-Id: Id812c1fc36aa0e1a10dfb8d3a16a11d387289b05 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-11171-433/+433
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Short live q20::fill{,_n}!Marc Mutz2022-10-112-25/+28
| | | | | | | | | | | It just adds constexpr to it (we're ignoring the range version). Apply it to QStaticByteArrayMatcher, where it replaces rather lengthy initialization code. Pick-to: 6.4 Change-Id: I1d60216fb04c94fa66fce5cc01313b3e9ba856ac Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QString: rename parameter clashing with member function of the same nameMarc Mutz2022-10-111-2/+2
| | | | | | | | | | | The size parameter shadows the size() member function, so rename it to newSize. Prepares for a follow-up change that ports from count()/length() to size(). Change-Id: I0ca8af57d6351f85a568409a8d02b66371bb05e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVariant/Doc: expand what toList & toMap conversions may succeedThiago Macieira2022-10-111-5/+14
| | | | | | | | | | | | | I don't know when conversion through sequential and associative iteratables was added, probably some time in the 5.x. QString and QByteArray got conversions to sequential iteratables for Qt 6.1 with commit c9a11022692f9a4bd36beb0cd001686694a48915. Since that was intentional, I'm just documenting reality. Fixes: QTBUG-107246 Pick-to: 6.2 6.3 6.4 Change-Id: Id8d5e3999fe94b03acc1fffd171b863b1a0ead68 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSharedMemory/doc: update docs to be more modernThiago Macieira2022-10-111-17/+95
| | | | | | | | | | | | | - We don't support HPUX any more, so no need to talk about it - Clarify that it's the QSharedMemory destructor that releases the resources on Unix systems - Explain the System V and POSIX backends and how to detect them - Add a note about Android not being supported. - Add a section about using QFile for shared memory Change-Id: I413ea647c2a5453b8307fffd17174c8083416529 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* doc: Add docs for QPointingDevice::GrabTransition and grabChanged signalShawn Rutledge2022-10-111-0/+42
| | | | | | | | Pick-to: 6.2 6.4 Fixes: QTBUG-97697 Task-number: QTBUG-102160 Change-Id: I6b782206a873bfe1837c419d15b0d6949d5b819d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix clazy warnings in QPointingDevice::grabChanged signalShawn Rutledge2022-10-111-1/+6
| | | | | | | | | | | | | - a signal does not need to be marked const; but fixing it would be BIC, so has to wait until Qt 7 - QPointingDevice::GrabTransition should be fully qualified - wrap the long line while we're at it Amends 2692237bb1b0c0f50b7cc5d920eb8ab065063d47 Change-Id: I5d518bbbcb62d336bae0d59647b16018d83b9479 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix broken Text rendering when noantialiased NativeRendering is usedDominik Holland2022-10-111-1/+4
| | | | | | | | | | | In case antialiasing is disabled the QFontEngine::Format_Mono is used to render in the glyph cache. In this format the padding needs to be 8-bit aligned. Fixes: QTBUG-107038 Pick-to: 6.4 6.3 6.2 5.15 Change-Id: Icf69150b6b446099ad05d706ddcab0a57f8fe0c0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Update UCD to Revision 30Ievgenii Meshcheriakov2022-10-116-5288/+5608
| | | | | | | | | | | | | | | | | | This corresponds to Unicode version 15.0.0. Added the following scripts: * Kawi * Nag Mundari Full support of these scripts requires harfbuzz version 5.2.0, this version adds support for Unicode 15.0: https://github.com/harfbuzz/harfbuzz/releases/tag/5.2.0 Fixes: QTBUG-106810 Change-Id: Ib06c526e49b0f01ef9f21123bcf875c6b19f2601 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix file which had SPDX-License-Identifier on two linesDmitry Shachnev2022-10-111-2/+1
| | | | | | | | This breaks our automation in Debian. Pick-to: 6.4 Change-Id: Iee035dee8e0d89e22540a2691689da46c4c301a3 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Add a configure option to exit on poll errorsDominik Holland2022-10-112-0/+12
| | | | | | | | | | | | | | If an error is returned from qt_safe_poll inside the event dispatcher the error is currently printed and ignored. For most cases this behavior seems to be fine, but when used in critical systems e.g. automotive or medical, a error might indicate a more severe problem and the application should be stopped instead. The system can then decide itself what to do e.g. restarting the application using a watchdog. Change-Id: Iaf5abb20bb3941eaeff19d14e41c395c88fa088d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSystemSemaphore: make it a Q_GADGETThiago Macieira2022-10-102-0/+4
| | | | | | | | So we can have Q_ENUM. Change-Id: If4c23ea3719947d790d4fffd17152a37d0fe551b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* dbus_minimal_p.h: copy the libdbus-1 copyright to the topThiago Macieira2022-10-101-1/+3
| | | | | | | | | | | See qt_attributions.json too. Pick-to: 6.4 Fixes: QTBUG-107128 Change-Id: I810d70e579eb4e2c8e45fffd1719fbf448154abf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPrivateSignal: disable implicit conversions from initializer_listGiuseppe D'Angelo2022-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The whole point of QPrivateSignal is to forbid anyone but the class itself from emitting a certain signal. This is a "workaround" introduced in Qt 5.0, due to the fact that the PMF syntax for connections requires users to take the address of a signal, and that is only possible if the signal itself is public. (In fact, signals were protected in Qt 4.) The Q_OBJECT macro defines the private QPrivateSignal class. A QObject subclass that wants to "protect" its signal emissions can declare a signal carrying an argument of type QPrivateSignal: signals: void aSignal(int, QPrivateSignal); If the class itself wants to emit the signal, it can do so: emit aSignal(42, QPrivateSignal()); But if "someone else" wants to, they can't use the QPrivateSignal type because it's private. emit obj.aSignal(42, SomeClass::QPrivateSignal()); // ERROR Here's a hair in this soup: list initialization. If a braced-init-list is used, [over.ics.list] simply *ignores* access control. This allows an "untyped" initializer-list to match QPrivateSignal and perform aggregate initialization: emit obj.aSignal(42, {}); // works! This kind of defeats the whole purpose. Therefore: make QPrivateSignal not an aggregate and give it an explicit default constructor, disabling copy-list-initialization for it. This means that using `{}` will fail to compile (class is no longer an aggregate, a constructor must be selected, and copy-list-initialization will not select an explicit constructor). This isn't a complete fix by any means. There's always the possibility of using enough template magic to extract QPrivateSignal's type (e.g. as a local alias) and then create an object of that type; but that sounds extremely unlikely to be happening "by accident" (whilst it's super-easy to just type {} as the argument and not realize that you were not supposed to do so). [ChangeLog][QtCore][Potentially Source-Incompatible Changes] It is no longer possible to use `{}` to construct a QPrivateSignal object (specifically, QPrivateSignal's default constructor is now explicit). This means that emitting a signal that carries a QPrivateSignal argument (i.e. a "private signal") cannot any longer be done by using something like `emit aSignal({})`; instead, such usages must be ported to `emit aSignal(QPrivateSignal());` or equivalent. Change-Id: Iac379aee3a8adca5a91d5db906a61bfcd0abc89f Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* JNI: add generic support for array-typesVolker Hilsheimer2022-10-101-32/+45
| | | | | | | | | | | | | | | | | | | The typeSignature for a type T[] is always "[" + typeSignature<t>, so we can just implicitly support arrays of any known type. To prevent support for multi-dimensional arrays, make sure that the underlying type is not also an array. By adding a QJniTypes::isArrayType in addition (that is true for any type with a signature starting with '['), methods like QJniObject::callMethod could then return a special QJniArray type that provides array-specific functionality. As a drive-by, and since all lines need to be touched to add braces, replace std::is_same<>::value with std::is_same_v. Change-Id: Iccadf03cfceb8544381a8f635bb54baeddf46c99 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QGuiApp: Set QStyleHints's appearance based on platform themeDoris Verria2022-10-101-0/+2
| | | | | | | | | | | QStyleHintsPrivate::setAppearance was only called when the theme changes, and up until then the reported QStyleHints::appearance() was Unknown. To fix, the QGuiApplication should set the appearance once the platform theme is created. Change-Id: I5353031628d1f1a8b1e23bed0b2fb0bc0622cbe8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* QIOSTheme: Set appearance based on UIScreen if no windows created yetDoris Verria2022-10-102-6/+19
| | | | | | | | | | | | | | | | | | | Set the theme's appearance based on the UIScreen's, which follows the app's or system's configuration, if no UIWindows are created yet. The UIWindow and UIScreen will have the same appearance (the traitCollection change is propagated hierarchically from screen to window) unless UIWindow's overrideUserStyleInterface is explicitly set to differ from that of the screen. In that case, traitCollectionDidChange will be called for the window (but not the screen) and when we update the palette calling the UIColor API, the colors will be resolved based on UITraitCollection.currentTraitCollection property, which follows the window's appearance. That is why we need to set the theme's appearance based on the window's. Change-Id: I43207f351559fb82efc2f281eafb3cd1c96bbf75 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* WindowsKeyMapper: Fix unsigned/signed mismatch errorMårten Nordheim2022-10-101-1/+1
| | | | | | | | | | error C2220: the following warning is treated as an error warning C4018: '>': signed/unsigned mismatch Pick-to: 6.2 6.4 Change-Id: I4ba59f3aa6bbd7b37fe469e6271df207a7d11c99 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Use the target output name for test targets on WASMMikolaj Boc2022-10-101-1/+1
| | | | | | | | Since all tests can now be run by the batched test runner, rename the main resource to a more suitable {_target_output_name}.html Change-Id: Icda80ce95ac9ae51851d52ebb4b1ce668c528324 Reviewed-by: David Skoland <david.skoland@qt.io>
* qpoll: disallow file descriptors bigger than FD_SETSIZEThiago Macieira2022-10-101-0/+5
| | | | | | | | | | | I don't know which platforms qpoll.cpp is still used and if in those there's even a way to increase the file descriptor limit above FD_SETSIZE's. But this is an easy change and protects against buffer overruns. Pick-to: 6.4 Change-Id: I810d70e579eb4e2c8e45fffd1718ca1aac8e6bef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtRhi: make two plain arrays inline and constexprYuhang Zhao2022-10-102-2/+2
| | | | | | | | | In the current case they can be inline and constexpr. Pick-to: 6.4 Task-number: QTBUG-100485 Change-Id: I8c200c0a756edbff914c4be8ba08fe6afbd61114 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* [Linux] Remove workaround for glibc to actually unload a libraryFushan Wen2022-10-101-6/+1
| | | | | | | | | | | | | | The workaround was added to fix a bug in glibc prior to 2.25, which was released on 2017-02-05. Since the supported platforms of Qt6 at least have glibc 2.26 (SUSE Linux Enterprise Server 15 SP2), it's time to remove the workaround. See also: http://sourceware.org/bugzilla/show_bug.cgi?id=11941 Pick-to: 6.4 Change-Id: Ia2aab5b0a512c44d4a4312877a0177b6b5df6428 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qforeach.h: do not include qglobal.hIvan Solovev2022-10-101-2/+3
| | | | | | | | | | | | | | | | The qforeach.h header was extracted in ffcf4f400102aa3626bcf1dda6f8a703553f59f7, so this is not a new header. Still, it does not have any usages in Qt itself (except for the include in qglobal.h), and the influence of the user code should also be minimal, considering that Qt is built with QT_NO_FOREACH by default. [ChangeLog][QForeach][Potentially Source-Incompatible Changes] The qforeach.h header no longer includes qglobal.h. If you relied on the transitive include, you may have to include qglobal.h explicitly. Task-number: QTBUG-107046 Change-Id: I2588b2e774c456d926b6a63d0377e0a7991bf973 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Send string to Atspi DBus interface on name/description changedFushan Wen2022-10-101-4/+22
| | | | | | | | | | | | | | | | | Orca only accepts string or list type for object:property-change:accessible-name and object:property-change:accessible-description events. This fixes NameChanged and DescriptionChanged not being announced by Orca. This also adds check for accessible interface and will ignore events from invalid interfaces on name/description changed. See also: https://gitlab.gnome.org/GNOME/orca/-/issues/255 Pick-to: 6.4 6.2 Change-Id: Iaaa50678e7223951e0f3af99c5e04aa7458e4d0d Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add M68k detectionPino Toscano2022-10-094-0/+23
| | | | | | | | | - detect the M68k architecture (Motorola 68000) and define Q_PROCESSOR_M68K - set the right machine type in QElfParser for M68k ELF files Change-Id: Ie5694abbe1ae2bfeb5692defba0ca6062c1d60ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusMarshaller: ignore false-positive -Wformat-overflow gcc warningAhmad Samir2022-10-081-0/+3
| | | | | Change-Id: Icd5d21ec7ebd16476a1070a18ac618b87575d5f6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [docs] QMap: fix missing toStdMap()&& overload docsMarc Mutz2022-10-081-0/+9
| | | | | | | | | | | | | | | | Amends 14090760a87f23509b7bb5ad846537c766cb44a5. I tried to find a linkable definition of valid-but-unspecified on en.cppreference.com, but failed, so I'm using partially-formed like everywhere else in Qt docs. Ideally, we'd have the discussion of partially-formed (and valid-but-unspecified) in some extra page and simply link to it. Created QTBUG-106251 to track the issue. Pick-to: 6.4 6.3 6.2 Change-Id: I04c60cf903b2617c89467d1d040d5aebb7eccd53 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [docs] Adjust qExchange() docs for the present, where C++17 is required ↵Marc Mutz2022-10-081-2/+2
| | | | | | | | | | | | [2/2]: 6.3+ In C++17, std::exchange() is unconditionally available, so focus attention on the missing constexpr and noexcept. Pick-to: 6.4 6.3 Change-Id: I5eb466b784bd741a7313a1554d8b7b67711d2cbc Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* [docs] Adjust qExchange() docs for the present, where C++17 is required ↵Marc Mutz2022-10-081-2/+3
| | | | | | | | | | | | [1/2]: 6.2 In C++17, std::exchange() is unconditionally available, so focus attention on the missing constexpr. Pick-to: 6.4 6.3 6.2 Change-Id: Ia09bf6da7bd62e5a41083cfc5253e30a0298099f Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPluginMetaData: replace manual loop with q20::copy_nMarc Mutz2022-10-081-3/+3
| | | | | | Pick-to: 6.4 Change-Id: I7061b18efd2ff905cc36df41d680c0612a505a76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>