Commit Graph

54383 Commits

Author SHA1 Message Date
Volker Hilsheimer
b886a7ca65 Add unit test for moving of opaque widgets
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>
2021-12-08 23:06:42 +00:00
Friedemann Kleint
9ad00e4b3f Windows QPA: Fix cursors getting out of sync after restoring override 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>
2021-12-08 23:41:24 +01:00
Liang Qi
c8609d1e7a tests: add a capability check for QWindow::requestActivate() call
This amends b65159a5ea.

Pick-to: 6.2
Change-Id: I6055004375b440997ea41b3e4538854780202e10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-12-08 21:08:04 +01:00
Eskil Abrahamsen Blomfeldt
ee7573f61f Callbacks for begin/end of a frame on OpenGL
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>
2021-12-08 21:08:04 +01:00
Volker Hilsheimer
b393370ebb Code tidies: improve variable naming and add const where possible
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>
2021-12-08 21:04:43 +01:00
Craig Scott
5cdc82e364 Fall back to include() method for finalizers with CMake 3.17 or earlier
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>
2021-12-08 19:50:21 +01:00
Craig Scott
22c92f3967 Add documentation for CMake deployment support
Task-number: QTBUG-98545
Change-Id: Ifd5c0f4ce278c683bb0d3ba6a259ec14a7f24181
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-12-08 19:50:21 +01:00
Craig Scott
3ee79be628 Add CMake deployment support
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>
2021-12-08 19:50:21 +01:00
Tinja Paavoseppä
1e64b58c35 Recognize system apps also when apk has parent directory
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>
2021-12-08 19:22:36 +02:00
Lorn Potter
3bbbd4ae12 wasm: update recommended emscripten to 3.0.0
[ChangeLog][wasm] Recommended emscripten version is now 3.0.0

Change-Id: I9ae082509415d8f00b8e9970b730ad4a472da310
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-12-09 03:22:36 +10:00
Andreas Buhr
1f2f61d808 Fix typo in QAbstractItemModelTester
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>
2021-12-08 17:39:27 +01:00
Marc Mutz
d4a88e4ea4 QVarLengthArray: fix size update on failed append()
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>
2021-12-08 16:39:27 +00:00
Yuhang Zhao
0f88e79ed8 QCoffParser: Replace windows.h with qt_windows.h
Change-Id: I9aeeb2cef4d068020e0c176a70ad86c9e28b0e68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-12-09 00:35:09 +08:00
Liang Qi
493a85a9e4 Widgets: setTransientParent() when a QMenu is a window
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>
2021-12-08 13:45:36 +01:00
Laszlo Agocs
9c05fdac81 evdevkeyboard: Try opening as read-write first
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>
2021-12-08 13:45:34 +01:00
Joerg Bornemann
d8b943849f Revert "Compile: Work around false positive on gcc >= 900"
This reverts commit d62e9d3c5b.

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>
2021-12-08 12:13:23 +00:00
Christian Ehrlicher
64449abe17 QTableWidget doc: remove wrong comment for itemExpanded()
Since Qt5.1 (80fa4b6c8e) 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>
2021-12-08 10:33:55 +01:00
Karsten Heimrich
c7248a3879 Implement fetching physical QStorageInfo::blockSize() under Windows
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>
2021-12-08 09:29:02 +01:00
Lorn Potter
f0be152896 wasm: improve clipboard support
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>
2021-12-08 13:39:58 +10:00
Volker Hilsheimer
3b24713098 Fix incorrect rendering when moving widget into screen
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>
2021-12-08 00:40:21 +01:00
Volker Hilsheimer
ec267a4c7c Add unit test for QWidgetPrivate::overlappedRegion
Added to QWidgetRepaintManager test case, which is the only place where
the function is used.

Includes a helper that creates a complex scene with opaque children,
which will be used in additional unit tests.

Change-Id: I0e0188dd560923a552a8967d8e992dc17cc849d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-12-08 00:40:21 +01:00
Volker Hilsheimer
30b0b72453 Test for nullptr before dereferencing the screen
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>
2021-12-08 00:40:21 +01:00
Ivan Tkachenko
e65c29fffc Doc: Reword, fix typos and some formatting
Change-Id: I0929f7653cb07665842d0aa7bf18dc80471febdc
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-12-08 02:28:34 +03:00
Marc Mutz
cb00db5a7e QVarLengthArray: add some basic checks for default-ctor
There seems to have been no-one that checked a simple empty()/isEmpty()...

Pick-to: 6.2 5.15
Change-Id: I7fa567f556532dfa21db759719f1303a768a9732
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-07 22:53:14 +01:00
Marc Mutz
adcc68fd59 QVarLengthArray: remove unneeded copy in replace()
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>
2021-12-07 22:53:14 +01:00
Marc Mutz
ac4c0e1f02 QVarLengthArray: don't mix iterator/const_iterator in offset calc
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>
2021-12-07 22:53:14 +01:00
Marc Mutz
dbf836738a QVarLengthArray: port internal users from at() to op[]
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>
2021-12-07 19:24:05 +01:00
Giuseppe D'Angelo
84fba93ebb QThread::create(): request interruption and join on destruction
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>
2021-12-07 16:56:49 +01:00
Marc Mutz
f898128ee2 tst_qmetatype: factor the most expensive test into its own TU
The PRINT_2ARD_TEMPLATE macro expansion alone is responsible for about
50% of the compile time and RAM requirements of tst_qmetatype.cpp. By
factoring it into its own TU, we reduce the maximum memory load on my
machine from 4.0GiB to 2.5GiB, provided we don't parallelize the
build, then we take 0.5GiB more.

This is a quick-fix for the QNX build problems currently plaguing the
CI. Going forward, we should probably have a better solution, whatever
that may be.

Task-number: QTQAINFRA-4669
Change-Id: I2732b4c25b369b15cce1c7afe222d041ecb6795a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-07 15:57:33 +01:00
Eric Lemanissier
70e765b1c5 use short_path attribute
it avoids global conan configuration in conan.conf
or via environment variables

Pick-to: 6.2
Change-Id: Ia54cbfe95e0864e7107ea3bb53ff9ba4f1df7b60
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2021-12-07 14:19:38 +00:00
Friedemann Kleint
49a8ab50ba uic: Generate parameters for ambiguous signals
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>
2021-12-07 14:01:58 +01:00
Volker Hilsheimer
c001216eed Revert optimizations and fixes for moving/scrolling overlapped widgets
This reverts the QtWidgets changes made in commits
22634e0079 and
5b09346cf4 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>
2021-12-07 14:01:58 +01:00
Marc Mutz
ab1180a2b0 QVarLengthArray: merge remove(idx [,n]) into one function
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>
2021-12-07 09:06:19 +01:00
Marc Mutz
31f155d985 tst_qmetatype: move an #ifdef to the header
... so it can be used by multiple .cpp files.

Task-number: QTQAINFRA-4669
Change-Id: I7212b9b08cd3bfa44ee741ee4789d1d0024e4708
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-12-07 09:06:18 +01:00
Marc Mutz
20ab12d181 QLogging: mark all warning() and critical() functions as cold
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>
2021-12-07 09:06:18 +01:00
Morten Johan Sørvig
1f7f8c35c4 wasm: make the compositor draw the window icon
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>
2021-12-07 09:06:18 +01:00
Marc Mutz
06ba067a34 QVarLengthArray: centralize index checking
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>
2021-12-07 05:33:40 +01:00
Mårten Nordheim
78df625510 QMultiHash: fix erase returning the wrong iterator
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>
2021-12-07 03:07:49 +01:00
Ivan Tkachenko
b781915c39 Drop Qt4 support
Last pieces of code guarded by these defined were cleaned up back in 2016.

Task-number: QTBUG-98650
Change-Id: I52d971c2b476b7d8d362be7807b71b71e657c70b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-12-07 01:56:17 +03:00
Igor Kushnir
d797e3c88e Optimize QMimeDatabase::mimeTypeForFile(f, MatchDefault)
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>
2021-12-06 22:55:06 +02:00
Ulf Hermann
6d6fb7846c Add a const overload for QMetaType::iface()
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>
2021-12-06 21:55:06 +01:00
Volker Hilsheimer
220510a885 Fix qtdeclarative baseline test failure for text tables
Amend 97cfd49401, 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>
2021-12-06 21:55:06 +01:00
Edward Welbourne
d69a4e95b1 Revert "Don't allocate an OCIDateTime object unless we're going to use it"
This reverts commit 064c3d35e6.

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>
2021-12-06 20:16:17 +00:00
Mårten Nordheim
6f542f19bf QFontDatabase (Windows): Sanitize font requests early
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>
2021-12-06 20:06:06 +01:00
Tatiana Borisova
eba9196304 Fix tst_qfloat16 runtime failure for INTEGRITY
- 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>
2021-12-06 18:53:50 +00:00
Edward Welbourne
be63c3011b Suppress test set-up and tear-down in callgrind parent process
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 3ee6d8d336, 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>
2021-12-06 19:06:30 +01:00
Edward Welbourne
9e835fe5a4 tst_BenchlibCallgrind: fix x86 preprocessor check
Its twoHundredMillionInstructions() test has #if-ery to limit it to
gcc and x86; however, it was testing only __i386 for the x86 part,
where gcc defines __x86_64 instead on modern 64-bit systems. In the
process, invert the condition and the branches it controls - positive
tests are easier to comprehend.

Change-Id: I8e906c606c48aa5034e02e3ed5d042fbb1f2ecbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-12-06 19:06:30 +01:00
Marc Mutz
d5c605b148 QMetaType: port the BC fix for id() to new QT_REMOVED_SINCE
The allows qmetatype.cpp compilation to enjoy PCH again.

Change-Id: I47c5af33a5dbc930ee4c120b254e732c52bc2369
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-12-06 19:06:30 +01:00
Morten Johan Sørvig
d3646d2b05 Say hello to qtwasmserver
Development web server for web applications. Supports
http and https. Sets COOP and COEP headers.

The web server script supports certificate generation using
mkcert (github.com/FiloSottile/mkcert). Briefly, mkcert
supports generating server certificates for the current
local ip address(es), using a certificate authority
which can be installed on devices where the app should
run.

The COOP and COEP headers are required to enable the
SharedArrayBuffer API, which is required for Emscripten’s
pthreads implementation.

The server serves the current directory on localhost
by default. Use the “-a” argument to bind to an additional
address, or "--all” to bind to all IPv4 addresses found on
local network interfaces. Change the directory by passing
it as a positional argument.

Task-number: QTBUG-79087
Change-Id: Id0cba649e42af53ed8106e336a77e78398bcf901
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2021-12-06 16:36:09 +01:00
Gatis Paeglis
9ef69efb3b qxkbcommon: UCS-4-encode surrogate characters in QKeyEvent::key()
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>
2021-12-06 15:41:33 +01:00