summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Add unit test for moving of opaque widgetsVolker Hilsheimer2021-12-081-2/+3
| | | | | | | | | | | | | | | Expose QWidgetRepaintManager's data structures so that we can write unit tests, and verify that they are correct after moving opaque widgets (which triggers the accelerated move code path). Improve the compareWidget logic to not rely on screen grabbing (which requires permissions), but instead use QPlatformBackingStore's toImage function, which is faster and more reliable, and also doesn't require us to show the UI we want to grab full screen in order to avoid issues with overlapping windows etc. Change-Id: Iff2ea419f03a390ab6baca26814fef6ff45f7470 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Windows QPA: Fix cursors getting out of sync after restoring override ↵Friedemann Kleint2021-12-085-5/+24
| | | | | | | | | | | | | | cursors on native windows Introduce a flag to QWindowsWindow which forces the cursor to be applied after restoring override cursors. Fixes: QTBUG-98856 Pick-to: 6.2 5.15 Change-Id: Id62cdc2dd01f45324503a542446b1c11a1fe6f44 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io> Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Callbacks for begin/end of a frame on OpenGLEskil Abrahamsen Blomfeldt2021-12-083-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The background for this is that when running Wayland, the Mesa driver has an issue which makes it crash if we call eglDestroySurface() while we are rendering to it. This is not according to the documentation, and it only seems to happen on Mesa and only on Wayland, so it is probably related to something in the Wayland implementation in the driver. Since this driver is very popular, we want to work around it, which can easily be done using existing locking mechanisms in the Qt Wayland QPA plugin. But in order to do so, we need reliable callbacks for the start and end of a frame. The RHI already has this, so we just need to channel the information to the QPA plugin. Having beginFrame/endFrame hooks in the QPlatformOpenGLContext could be useful in other cases as well, especially knowing that there are OpenGL implementations that require some extra thread protection. QPlatformSurface would be a more general location for these hooks, but since the issue is only seen on OpenGL and multi-threading is handled more explicitly in other APIs, we don't want to expose this API in a more general location than necessary. Task-number: QTBUG-92249 Change-Id: I97ce7d4f744c4b28eec457e919d1c9652ff00079 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Code tidies: improve variable naming and add const where possibleVolker Hilsheimer2021-12-081-19/+17
| | | | | | | | | Remove obsolete check for valid sourceRect, we never get into the accelerated code path if it's not. Pick-to: 6.2 Change-Id: I872685fca8cba3a09ed856d727d5baafddee161b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fall back to include() method for finalizers with CMake 3.17 or earlierCraig Scott2021-12-081-5/+9
| | | | | | | | | | | | | | | | Functionality is being added in other repos which require finalizers to be run for non-static builds. That means we now need to ensure finalizers always run even with CMake versions before cmake_language() was added. The fallback method of writing to a file and including it is slower, but that's better than missing important functionality altogether. Task-number: QTBUG-98545 Pick-to: 6.2 Change-Id: Ic8668c91c26d0c30de084b1b803032088c10fcf4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add documentation for CMake deployment supportCraig Scott2021-12-0810-5/+717
| | | | | | Task-number: QTBUG-98545 Change-Id: Ifd5c0f4ce278c683bb0d3ba6a259ec14a7f24181 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add CMake deployment supportCraig Scott2021-12-084-0/+561
| | | | | | | Task-number: QTBUG-98545 Change-Id: I581c1173cdfc92c09fd2cf0bbe7ec6bc8d52b868 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Recognize system apps also when apk has parent directoryTinja Paavoseppä2021-12-081-2/+7
| | | | | | | | | | | | | When checking if the apk is being deployed from system partition, account for possibility of the apk not being installed directly under /system/app or /system/priv-app, but in a directory of its own. Otherwise, system applications that are not directly under system app/ priv-app directories will not be recognized as system apps, meaning they will not use the system library path to load their libraries. Pick-to: 6.2 Change-Id: I1e778b18cae3c0406e087b8c78fd31d521f7be73 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix typo in QAbstractItemModelTesterAndreas Buhr2021-12-081-1/+1
| | | | | | | | | | When recursively checking children in QAbstractItemModelTester, the currentDepth of recursion was incorrectly increased. This patch fixes it. Pick-to: 6.2 5.15 Change-Id: Ia79508f358e2fcb6b90780a79baec053522e871c Reviewed-by: David Faure <david.faure@kdab.com>
* QVarLengthArray: fix size update on failed append()Marc Mutz2021-12-081-6/+5
| | | | | | | | | | | | | If the in-place constructor throws, the old code had already updated the container's size(). Fix by delaying the update to after the in-place construction. [ChangeLog][QtCore][QVarLengthArray] Fixed a bug whereby a failed append() would leave the container with an inconsistent size(). Pick-to: 6.2 5.15 Change-Id: Ief1e668d945149bd8ba96c8af1398baaa7876880 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCoffParser: Replace windows.h with qt_windows.hYuhang Zhao2021-12-091-4/+1
| | | | | Change-Id: I9aeeb2cef4d068020e0c176a70ad86c9e28b0e68 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Widgets: setTransientParent() when a QMenu is a windowLiang Qi2021-12-082-0/+26
| | | | | | | | | | | | | On some platforms, such as X11 and Wayland with some compositors, QMenu could be a popup window, which should be set a transient parent to get relative position, which is requested by Wayland. Added transientParentWindow() for QMenuPrivate like QDialogPrivate. Fixes: QTBUG-68636 Pick-to: 6.2 Change-Id: I6d8880cb008ecf61a4c005898b38e3953379a13d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* evdevkeyboard: Try opening as read-write firstLaszlo Agocs2021-12-082-1/+6
| | | | | | | | | switchLed writes to the device, and so O_RDONLY cannot be correct. Change-Id: If79814804bcd3c6fb01617be9f1a73e54b9563bd Pick-to: 6.2 5.15 Fixes: QTBUG-80653 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Revert "Compile: Work around false positive on gcc >= 900"Joerg Bornemann2021-12-081-1/+1
| | | | | | | | | | This reverts commit d62e9d3c5bd9d3aae5f4b72ed0688dcbd02134a7. Reason for revert: The -Wstringop-overread option was introduced in gcc 11. This fixes the build for gcc 9 and 10. Change-Id: I96ab5f917d6200cb1681fe6236f1fd4630ef4f7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTableWidget doc: remove wrong comment for itemExpanded()Christian Ehrlicher2021-12-081-3/+0
| | | | | | | | | | Since Qt5.1 (80fa4b6c8ef) expandAll() emits expanded() but within this change, the comment in itemExpanded() was forgotten. Pick-to: 6.2 Pick-to: 5.15 Change-Id: Ic487e5f8999d6af27a4747b861464058faf03889 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Implement fetching physical QStorageInfo::blockSize() under WindowsKarsten Heimrich2021-12-084-1/+240
| | | | | | | | | | | | | | | | | | This is implemented in two passes, first we try the older and always available DeviceIoControl() function. This works most of the time, though it might fail for example for storage devices attached via USB. In this case, we try to dynamically load the newer NtQueryVolumeInformationFile kernel function. Since this is probably more expensive, we do this as fallback. [ChangeLog][QtCore][QStorageInfo] The QStorageInfo::blockSize() will now report the physical block size of a storage device under Windows. Network mapped drives are not supported. Fixes: QTBUG-93976 Change-Id: I08b5b879e5bf79c025e2e305196ec5c5fce8b20f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* wasm: improve clipboard supportLorn Potter2021-12-083-77/+336
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Clipboard API Add clipboard manual test Also includes these fixes: - improve clipboard use for chrome browser - make QClipboard::setText work - html copy and paste - image copy/paste Chrome browser supports text, html and png To use the Clipboard API, apps need to be served from a secure context (https). There is a fallback in the case of non secure context (http) - Firefox requires dom.events.asyncClipboard.read, dom.events.asyncClipboard.clipboardItem and dom.events.asyncClipboard.dataTransfer to be set from about:config, in order to support the Clipboard API. Change-Id: Ie4cb1bbb1dfc77e9655090a30967632780d15dd9 Fixes: QTBUG-74504 Fixes: QTBUG-93619 Fixes: QTBUG-79365 Fixes: QTBUG-86169 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix incorrect rendering when moving widget into screenVolker Hilsheimer2021-12-081-1/+1
| | | | | | | | | | | | When the widget we are moving in was previously outside of its parent's clip rect, then we cannot use the accelerated move code path, as there are no pixels to bitBlt from the previous to the new area. Pick-to: 6.2 Task-number: QTBUG-26269 Task-number: QTBUG-98151 Change-Id: I324c6111de27cdd14cf8de8632a980aa351cc123 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Test for nullptr before dereferencing the screenVolker Hilsheimer2021-12-082-2/+2
| | | | | | | | | | | | | Touch event processing might still be ongoing even after the screen has been disconnected. If that screen was also the primary screen, we would dereference nullptr. Check for nullptr to avoid potential crashes during shutdown. Fixes: QTBUG-95192 Pick-to: 6.2 5.15 Change-Id: I49ccd30c4126fe12cf5bb675e532e6e59b40b9c1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Reword, fix typos and some formattingIvan Tkachenko2021-12-082-7/+8
| | | | | Change-Id: I0929f7653cb07665842d0aa7bf18dc80471febdc Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QVarLengthArray: remove unneeded copy in replace()Marc Mutz2021-12-071-3/+2
| | | | | | | | | | | | | | | QVarLengthArray is neither implicitly shared, nor does it feature a magic resize() on out-of-bounds. Therefore, data() doesn't detach(), so 't' remains stable. The only reason for the copy, then, would be if T wasn't self-assignment-safe, but we don't support such types. Remove the copy. Change-Id: I8dd12e1c9b8131ae17d641354fe362554062b78d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QVarLengthArray: don't mix iterator/const_iterator in offset calcMarc Mutz2021-12-071-4/+4
| | | | | | | | | | | | The functions aren't const so begin() will return a mutable iterator. The function arguments, however, are const_iterators. It doesn't matter for QVLA, which isn't implicitly shared, but code hygiene suggests to use cbegin() instead, to compare const_iterators to const_iterators. Change-Id: I9bfa993780ee4b68d13f6b6410772b0f1ccedad3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QVarLengthArray: port internal users from at() to op[]Marc Mutz2021-12-071-2/+2
| | | | | | | | | In preparation of splitting the class into QVLABase and QVLAStorage. Task-number: QTBUG-84785 Change-Id: Ic0da6c2e110a5b979b78989616b9a2cb0f27463b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QThread::create(): request interruption and join on destructionGiuseppe D'Angelo2021-12-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If one destroys a running QThread, so far the behavior has been to crash (à la std::thread) -- assuming the thread hasn't already signalled that it has finished. This behavior is hostile to solutions such as using QThread::create(), which always require a wait() before destroying the thread object. We can use the opportunity to change the behavior without breaking any valid code. Instead of crashing, inside QThread's destructor we can ask the new thread to quit, and then join it (à la std::jthread). This simplifies the implementation of long-living runnables and the code that manages them. Deploying this solution for the whole QThread class may not be entirely painless. While no correct code would work differently with the proposed changes, incorrect code that deletes a running thread would no longer crash "loudly" -- instead, it might deadlock "quietly", have memory corruptions, etc. Hence I'm limiting this approach to only the threads created by QThread::create(), at least for the time being. This also side-steps perhaps the biggest problem of generalizing the approach, which is that placing such interrupt+join logic into~QThread's destructor would cause it to be run _after_ a QThread subclass' own destructor has run, destroying the subclass' data members too early. This might create an antipattern if one chooses to subclass QThread. With create(), a subclass in question exists, and it indeed has NSDMs, but it's entirely under our control (in fact, I'm placing the logic just in its dtor). [ChangeLog][QtCore][QThread] Destroying a QThread object created by QThread::create() while the thread that it manages is still running will now automatically ask that thread to quit, and will wait until the thread has finished. Before, this resulted in a program crash. See the documentation of QThread::~QThread() for more details. Change-Id: Ib268b13da422e277ee3ed6f6c7b2ecc8cea5750c Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* uic: Generate parameters for ambiguous signalsFriedemann Kleint2021-12-075-6/+47
| | | | | | | | Fixes: PYSIDE-1720 Pick-to: 6.2 Change-Id: I71b77db73471bdec7826bf69c7df521d7686537e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Revert optimizations and fixes for moving/scrolling overlapped widgetsVolker Hilsheimer2021-12-072-80/+28
| | | | | | | | | | | | | | | | | This reverts the QtWidgets changes made in commits 22634e00794e72d68e7578e1962f9f2023870749 and 5b09346cf4322704a866f253b911d467c40df3ba while keeping the auto tests introduced in the former commit. Both commits introduced rendering errors when moving widgets out of or into areas in which they are obscured. Before we apply any further optimizations to this code we need thorough auto test coverage. Task-number: QTBUG-98151 Task-number: QTBUG-26269 Pick-to: 6.2 Change-Id: I9cb82b73776daed59ea0e9f51ff7ddef1c7265b6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QVarLengthArray: merge remove(idx [,n]) into one functionMarc Mutz2021-12-072-16/+1
| | | | | | | | remove(i) is the same as remove(i, 1), and the extra 'n' argument is of trivial type, so it's ok to default it instead of overloading. Change-Id: Id926cd63fde518e002684a41e055edc1004247a4 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QLogging: mark all warning() and critical() functions as coldMarc Mutz2021-12-071-0/+6
| | | | | | | | | Previously, only the printf-style overloads were marked as such. Saves ~7KB in QtCore text size on Linux AMD64 GCC 11 C++ 20 builds. Change-Id: I4ed480e48060b87968f3d15bb5a84bdbcf70a647 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVarLengthArray: centralize index checkingMarc Mutz2021-12-071-13/+22
| | | | | | | | | Factor the assertions relating to sizes and indexes into an inline function, verify(). This hopefully reduces the string data generated for assertions to the bare minimum. Change-Id: Iad5c2e587ad189e7e1a62b9ca61ada4282c44f51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMultiHash: fix erase returning the wrong iteratorMårten Nordheim2021-12-071-2/+3
| | | | | | | | | | | | When deleting the last item in a chain, without it being the last item in the chain, then we re-use the iterator which was passed in as an argument. This is wrong if we detached earlier in the function, and means we return an iterator to the previously shared data. Pick-to: 6.2 Change-Id: I7da6309e23a32073da59e7da0cbfd1d16734f1ca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Optimize QMimeDatabase::mimeTypeForFile(f, MatchDefault)Igor Kushnir2021-12-061-52/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Open the file only if matching on content is needed. Use QFileInfo::filePath() instead of QFileInfo::absoluteFilePath() in QMimeDatabase::mimeTypeForFile(). filePath() does much less work, and so is faster. Thiago Macieira helpfully explained in a review comment why the absolute path is not useful for correctness here: "Nothing needs absolute paths within the same application that would resolve the relative path to absolute. You only need an absolute path if you're communicating with another application that may be in a different directory." QMimeDatabase::mimeTypeForFile() checks fileInfo.isDir(), so the fileName.endsWith(QLatin1Char('/')) check in QMimeDatabasePrivate::mimeTypeForFileNameAndData() was redundant when called from this function. The other two callers of that function now check this condition before opening IO devices. This improves performance of the two QMimeDatabase::mimeTypeForFileNameAndData() overloads in the corner case. Refactor and optimize QMimeDatabasePrivate::findByFileName() and its usages. Previously each caller constructed a QFileInfo object and passed QFileInfo::fileName() into this function. Now the callers simply pass an absolute or relative path to a file into this function, which then uses QFileSystemEntry::fileName() to exclude the path. Constructing QFileInfo is relatively expensive, so this change slightly improves performance. Optimize QMimeDatabasePrivate::loadProviders() by calling static QFileInfo::exists() instead of constructing a QFileInfo object and calling the non-static QFileInfo::exists() overload. Note that the QFileInfo object was always created, even if QFileInfo::exists() under an `if` and an `#if` was never called. The following table contains the average results of the added benchmark tst_QMimeDatabase::benchMimeTypeForFile() on my GNU/Linux system before and at this commit. The numbers denote milliseconds per iteration. data row tag before at MatchDefault: archive 0.029 0.016 OpenDocument Text 0.029 0.015 existent archive with extension 0.039 0.025 existent C with extension 0.033 0.020 existent text file with extension 0.033 0.020 existent C w/o extension 0.076 0.074 existent patch w/o extension 0.11 0.105 existent archive w/o extension 0.069 0.066 MatchExtension: archive 0.012 0.0115 OpenDocument Text 0.0115 0.011 existent archive with extension 0.017 0.016 existent C with extension 0.011 0.011 existent text file with extension 0.011 0.011 existent C w/o extension 0.016 0.0155 existent patch w/o extension 0.013 0.012 existent archive w/o extension 0.013 0.012 MatchContent: archive 0.019 0.012 OpenDocument Text 0.019 0.012 existent archive with extension 0.053 0.051 existent C with extension 0.056 0.0545 existent text file with extension 0.058 0.056 existent C w/o extension 0.0605 0.059 existent patch w/o extension 0.10 0.099 existent archive w/o extension 0.057 0.054 Change-Id: Idb541656e073a2c4822ace3f4da412f29f2351f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: David Faure <david.faure@kdab.com>
* Add a const overload for QMetaType::iface()Ulf Hermann2021-12-061-0/+4
| | | | | | | Change-Id: I865dc51d466d90636e177556d95558ba66f466de Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qtdeclarative baseline test failure for text tablesVolker Hilsheimer2021-12-061-3/+3
| | | | | | | | | | | | | | Amend 97cfd4940157817dd761fd02f2e6da4afc5b4a30, which resulted in incorrectly laid out tables in Text elements. Reported by the baseline test for the scenegraph. Not reproducible using a QtWidget text widget, so no unit-test added here. Pick-to: 6.2 5.15 Task-number: QTBUG-86671 Task-number: QTBUG-97463 Change-Id: I607b1fea3fb5923f81f05a3646bafebec3dcf3b5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Revert "Don't allocate an OCIDateTime object unless we're going to use it"Edward Welbourne2021-12-061-22/+7
| | | | | | | | | This reverts commit 064c3d35e6809672323e8d912e9140ddd0ad48cd. Reason for revert: Causes crashes on querying. Better to endure the non-NULL representations of null QDateTime values. Change-Id: I33dd3b95ab35d8e3accb864aec13d21764b1270d Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QFontDatabase (Windows): Sanitize font requests earlyMårten Nordheim2021-12-063-11/+34
| | | | | | | | | | | | | | | | | | | After the windows font engine was no longer marking everything as scalable we started limiting the font size of requests to the maximum of Courier when it was requested. This was a regression from 5.8 and not in agreement with our documentation. The problem is that we would only make the switch from Courier to Courier New after having already gone through the foundry-lookup and found a closest-available font size for Courier. With this sanitization step in the backend we can make these changes early enough that we haven't yet adjusted e.g. the font size. Pick-to: 6.2 5.15 Fixes: QTBUG-58995 Change-Id: I319e93e6b78c7c3c5539964ac5ab4e05f8902ab6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix tst_qfloat16 runtime failure for INTEGRITYTatiana Borisova2021-12-061-1/+1
| | | | | | | | | | - GHS compiler is not fully compliant with iec559. Therefore we need to update is_iec559 checking for GHS case. Pick-to: 6.2 Change-Id: Ia094509d26bf5f0109f2937547a056267019cffb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
* Suppress test set-up and tear-down in callgrind parent processEdward Welbourne2021-12-061-4/+18
| | | | | | | | | | | | | | | | | | | | | | | When running a test using -callgrind, we recurse into a child process, run under valgrind, to which we pass -callgrindchild; and we only want the output from the child process, since the parent won't actually be running any tests. We also won't be using the global data table for the test in the parent process. So bypass the set-up and tear-down of both logging and the global data table in the parent process. Prior to commit 3ee6d8d336db2d9d15818b234ce16531ea0cdd48, these parts of the set-up and tear-down were skipped in the callgrind parent process, but that refactoring split qExec() up into qInit(), qRun() and qCleanup() to enable QtQuick to recombine them to implement an equivalent of qExec(), calling qRun() once for each built-in style. It needs these pieces of set-up to happen in qInit(), and of tear-down in qCleanup(), to avoid repeating them for each style. Leave a comment in qExec() that might help future readers to understand why it's done the way it is. Change-Id: Ieaca9a125c713b8fcf8dec8f9be0c024a798d504 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QMetaType: port the BC fix for id() to new QT_REMOVED_SINCEMarc Mutz2021-12-064-16/+19
| | | | | | | The allows qmetatype.cpp compilation to enjoy PCH again. Change-Id: I47c5af33a5dbc930ee4c120b254e732c52bc2369 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key()Gatis Paeglis2021-12-061-1/+5
| | | | | | | | | Fixes: QTBUG-72776 Pick-to: 6.2 5.15 Done-with: Liang Qi <liang.qi@qt.io> Change-Id: I9d1f4e34527079c3bc460016fe9b953636b4d6cb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* wasm: make the compositor draw the window iconMorten Johan Sørvig2021-12-062-2/+9
| | | | | | | | | | | | | | | | Currently the compositor draws the Qt logo by default; check if the window has an icon and draw that instead if set. Fixes: QTBUG-86052 Pick-to: 6.2 Change-Id: Ia4f9c03562c15993c86cb8717f27e47ab669353d Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* qBound: add an assert on !(upper < lower)Giuseppe D'Angelo2021-12-061-53/+67
| | | | | | | | | | | | | | It's a precondition and we might just as well check it, given that people have actually got the order of the arguments wrong (cf. QTBUG-69330). Unfortunately, Q_ASSERT is defined below qBound in qglobal.h, so I had to reshuffle some code around. Change-Id: I82e52bcb863ff8c96594817e0cd5d7d2abe2e57e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QPageLayout: do not calculate an invalid marginGiuseppe D'Angelo2021-12-061-4/+4
| | | | | | | | | | | | | | | | | | A default constructed QPageLayout has an invalid QPageSize. When asking for its size, an invalid QSize is returned (-1, -1). This size is then used to calculate the maximum margins the page layout can have, resulting in negative margins. I'm not sure if that makes sense for QPageLayout (in principle, a negative margin is acceptable, meaning to "grow" the size), but then this margin is passed as an upper bound to a series of qBound calls in QPageLayoutPrivate::clampMargins. To fix this, change the calculations of the maximum margins by using a lower bound of 0. Change-Id: I429104acfb2296d9eb1ee54c113e9d7e22d9b6ab Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QListView: fix a broken qBoundGiuseppe D'Angelo2021-12-061-1/+1
| | | | | | | | | | | | | | | | | If a QListView's model is reset to an empty one, its columnCount() below the root is going to be 0. Therefore, the code was doing a qBound(0, d->column, -1) which is meaningless (high < low). Instead, do the two logical operations explicitly: first do an upper bound on d->column (using qMin) and then lower bound the result by 0 (using qMax). The code worked by chance, because 0 was eventually the correct number to use as a bound for d->column. Change-Id: Ic32077cdab01eaa715137c05ed1f9d66c8eb2f67 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove .prev_CMakeLists.txtKai Köhne2021-12-061-91/+0
| | | | | | | | These are left-overs from the initial qmake2cmake conversion. Pick-to: 6.2 Change-Id: Ie15c9ff022ea4566d10c1ba74599de9af83d29a7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* doc: Add details about what to use instead of QMouseEvent::source()Shawn Rutledge2021-12-041-0/+10
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-98875 Change-Id: I2678edccf68d754d191b9eb6cdfe09bba327e85a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Document which header to include for the various native interfacesTor Arne Vestbø2021-12-042-0/+4
| | | | | | | Fixes: QTBUG-98654 Pick-to: 6.2 Change-Id: Ic5ea3cc7d90ed336a5b6e827d1523bdd58fabc13 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QStringBuilder: Add support for QByteArrayViewMårten Nordheim2021-12-041-0/+21
| | | | | | | [ChangeLog][QtCore][QStringBuilder] Added support for QByteArrayView. Change-Id: If2c23549d533dd31c320f3ee455fcd01ea5b460a Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QNAM: Reintroduce h2c with an attributeMårten Nordheim2021-12-045-5/+26
| | | | | | | | | | | [ChangeLog][QtNetwork][QNetworkRequest] Added QNetworkRequest::Http2CleartextAllowedAttribute which controls whether HTTP/2 cleartext (h2c) is allowed or not. The default is false. This replaces the QT_NETWORK_H2C_ALLOWED environment variable. Task-number: QTBUG-98642 Change-Id: I43ae1cc671788f6d2559cd316f6667b412c8e75e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QFile: Add open() overload that accepts permissions argumentIevgenii Meshcheriakov2021-12-042-1/+49
| | | | | | | | | | | | | | | The new overload allows creation of files with non-default permissions. This is useful when files need to be created with more restrictive permissions than the default ones, and removes the time window when such files are available with less restrictive permissions. [ChangeLog][QtCore][QFile] Added QDir::open() overload that accepts permissions argument. Fixes: QTBUG-79750 Change-Id: Iddfced3c324e03f2c53f421c9b31c76dee82df58 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QAbstractFileEngine: Add permission argument to open()Ievgenii Meshcheriakov2021-12-0415-22/+64
| | | | | | | | | The new argument allows atomic creation of files with non-default permissions. Task-number: QTBUG-79750 Change-Id: I4c49455b41f924ba87148302c8d0f77f5de0832b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>