... and bindingStatus()
QBindingStatus* is the final state of the value chain in
m_statusOrPendingObjects, so we can use the Double-Checked Locking
Pattern to avoid locking the mutex when we already have a status - it
won't go away again, unlike the vector in the List state.
To enable the change, make the data member an atomic<>. All loads and
stores can continue to use memory_order::relaxed, except the loads of
a potential status, which have to acquire, and the store of the
status, which has to release. This creates the necessary
synchronizes-with relation. So even though we synchronize out of
middle of the mutex critical section in QThread::exec() this way,
there's no data race between QThread::exec() and a potential
bindingStatus() call.
Change-Id: I0e0b7bd305649fa5f56a0f8723fb75f2577b90dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows to set up everything first - without paying for the layout
calculation at every step - and only then trigger the layout once.
Results:
0.065 msecs to create a QGraphicsTextItem with some text (layouted)
0.036 msecs to set everything up in a QGraphicsTextItem with 0 width
Change-Id: I138bd1d58941d029bc0a36d2730216778f1fbd97
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This way we can handle keyboard shortcuts for actions in that menu as
well in our menuHasKeyEquivalent implementation. This allows the focus
widget to accept the override, and e.g. a QKeySequenceEdit to record
Cmd+Q which with a plain NSMenu will just quit the application.
Pick-to: 6.3 6.2
Fixes: QTBUG-103590
Change-Id: I84597307aef8f0ab65d97d78e5aa15e5cf2e707d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The "ReleaseId" key's value stopped updating since
Windows 10 20H2, so we should query the new "DisplayVersion"
key when running on Windows 10 20H2 and onwards.
Change-Id: Ifaa8287f9812126bde0390337af0cda23ff8e529
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Before it was only tested indirectly as part of the qcolorspace
tests. This also fixes a rounding for maximum RGB64 values.
Pick-to: 6.3
Change-Id: I6106e662c0f9d00c0b3a0c13213cb051ea39e14e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The GNU binutils ld linker needed a patch after the tagging of 2.38 to
make the new feature work. Before this patch, the linker will fail to
link when protected visibility symbols are used in the library, so don't
enable the feature unless the linker is recent enough.
GNU binutils gold from that version passes this test.
LLVM lld is unknown (I didn't test), but LLVM was consulted in
developing the feature.
Fixes: QTBUG-103493
Change-Id: Ibcde9b9795ad42ac9978fffd16f1c80ca20953ff
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This class is dllexport'ed and has members that refer to classes that
are only forward-declared in the header (such as QRegularExpression,
used in std::vector). GCC and MSVC appear to emit the destructor at the
point where it is used, which I guess is the vtable, which probably
means where the constructor was inlined because I don't see any virtual
overrides. Clang (at least in the form of ICX) appears to emit it at the
class declaration point.
C:\Qt\qt-everywhere-src-6.3.0\qtbase\src\gui\itemmodels/qfilesystemmodel_p.h(94,20): note: in instantiation of member function 'std::vector<QRegularExpression>::~vector' requested here
class Q_GUI_EXPORT QFileSystemModelPrivate : public QAbstractItemModelPrivate
^
C:\Qt\qt-everywhere-src-6.3.0\qtbase\src\gui\itemmodels/qfilesystemmodel_p.h(94,20): note: in implicit destructor for 'QFileSystemModelPrivate' first required here
C:\Qt\qt-everywhere-src-6.3.0\qtbase\src\gui\itemmodels/qfilesystemmodel_p.h(94,7): note: due to 'QFileSystemModelPrivate' being dllexported
Fix by defining both the default ctor and the dtor out-of-line.
Task-number: QTBUG-45582
Fixes: QTBUG-103605
Pick-to: 5.15 6.2 6.3
Change-Id: I77c8221eb2824c369feffffd16f08ee39004a825
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the opportunity to modernize the code to use an
initializer list instead of stream operators.
This then makes it easier to generate a comma-delimited
list that works for Python as well.
Fixes: PYSIDE-1942
Change-Id: I5291b55bd0685e06ad62e52c7ebccffce98e9c23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
C++20 added this as a more light-weight alternative to std::decay.
Task-number: QTBUG-103739
Change-Id: Icbb973d9500a0d1425859f8f104b7aef1ec917f1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We don't want to require users to say
#include <functional>
#include <q20functional.h>
because that would leave duplicated <functional> includes after a
mechanical s/q20functional.h/functional/. Mechanical transformation is
the major design goal of the qNN namespaces, so fix this before we use
the header in ever more places.
Pick-to: 6.3
Change-Id: Id258c36a042214f41b737fb7ab60906cc8e76ca6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The body was still referring to the Qt 5 QMap where the same key could
be mapping to multiple values. That's no longer the case in Qt 6.
Change-Id: Idb1786ac45f328c318878fa52bf5d43d79c0178a
Pick-to: 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Useful for tests that request permissions and need to ensure these
are requested on behalf of the app itself, and not its parent process,
regardless of how it's invoked.
Change-Id: Iac493e95440a3a04df4fa466c1d700ba1233e393
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Attempting to use an invalid QStringConverter would so far have resulted
in a crash, as we would dereference the null iface pointer.
Fix this by inserting adequate checks, and ensure that hasError returns
true if we attempt to en/decode with an invalid converter.
Pick-to: 6.2 6.3
Change-Id: Icf74bb88cd8c95685481cc0bd512da99b62f33e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The issue is that when someone is trying to use the following code:
QKeySequence keySequence(Qt::Key_Shift);
qDebug() << keySequence.toString();
This will print seemingly gibberish output. It is unicode in practice. For
Qt::Key_Shift, this would be: "�_@\uDC20"
The reason why this is happening is because we have platform-specific ways to
handle this due to Mac glyphs which are not available on Linux or Windows. This
works fine on Mac.
But for the Linux and Windows codepaths, there is not really any mapping like
for other keys. It seems that modifiers were left out.
The solution is to simply amend the list of mapping from these modifier key
codes to raw strings for Linux and Windows like it is done for other key codes.
So, now, modifiers will also be included in the list.
So, the expected output will be generated for the above code, as: "Shift".
[ChangeLog][QtGui][QKeySequence] Added missing modifier names
Fixes: QTBUG-69715
Fixes: QTBUG-40030
Change-Id: I460d54bc8e593b350ff95894f23c5b4a7c819a44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We should prefer to test this unless we know it won't work, but this is
very hardware and implementation-dependent anyway. So I declare that
we'll only guarantee FP exception cleanliness on a best-effort basis for
a few platforms.
The notable difference in this commit is the removal of QNX. I don't
know why it began producing an FP exception with one of my changes, but
since the toolchain isn't public, I can't debug and will not devote any
time to figuring it out. If users of QNX require this, then someone with
interest in that OS will need to spend time after my changes integrate.
Change-Id: Ibcde9b9795ad42ac9978fffd16f1cb9c03a0ff66
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
There are no commented out test cases remaining, so the normal
test vectors are identical to full test vectors.
Fixes: QTBUG-97537
Pick-to: 6.3
Change-Id: I987f178f192e1c8e2d998d36499fdce84f237e77
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
UAX #14, revision 45 (Unicode 13) has changed rule LB30 to only
trigger if the open parentheses is non-wide:
(AL | HL | NU) × [OP-[\p{ea=F}\p{ea=W}\p{ea=H}]]
This fixes the remaining 24 line break tests.
Task-number: QTBUG-97537
Pick-to: 6.3
Change-Id: I9870588c04bf0f6ae0a98289739bef8490f67f69
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This property is needed to properly implement the line breaking
algorithm from UAX #14.
Task-number: QTBUG-97537
Pick-to: 6.3
Change-Id: Ia83cc553c9ef19fae33560721630849d2a95af84
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Implement part of LB30b introduced by UAX #14, revision 47
(Unicode 14.0.0):
[\p{Extended_Pictographic}&\p{Cn}] × EM
This fixes one line breaking test.
Task-number: QTBUG-97537
Pick-to: 6.3
Change-Id: I3fd2372a057b7391d8846e9c146f69a54686ea61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Word breaking rule WB3d should not be affected by WB4.
This fixes the remaining word break test.
Task-number: QTBUG-97537
Pick-to: 6.2 6.3
Change-Id: I99aee831d7c54fafcd2a9d526a3e078b12c5bfad
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Disable break between sequences of WSegSpace characters (rule WB3d,
introduced in UAX #29, version 33, Unicode 11.0.0). Also disable breaks
between WSegSpace and (Extend | Format | ZWJ) due to rule WB4.
Adjust "words4" test to take the above changes into account (space
character belongs to WSegSpace).
Mention the full class name in a comment inside the word break table.
This fixes 34 word break tests.
Task-number: QTBUG-97537
Pick-to: 6.2 6.3
Change-Id: I7dfe8367e45c86913bb7d7fe2adb053711978487
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This rule was simplified in version UTS #14 version 45 (Unicode 13.0.0)
to read:
× IN
Re-enabled 28 fixed line break tests.
Task-number: QTBUG-97537
Pick-to: 6.2 6.3
Change-Id: I1c5565a8c1633428c22379917215d4e424ff0055
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
ZWJ is handled separately by rule LB8a. The code for rule LB10 was
adjusted to handle ZWJ as AL as required by the specification.
Task-number: QTBUG-97537
Pick-to: 6.2 6.3
Change-Id: I814cbb4a26f2994296767cca0443d8a1a1aaf739
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Adjust implementation of rule LB8a of UAX #14. The rule was changed
in version 41 (corresponding to Unicode 11.0.0):
ZWJ × (ID | EB | EM) ⇒ ZWJ ×
Fixing this rule fixes 9 line break tests. Those are re-enabled.
Task-number: QTBUG-97537
Pick-to: 6.2 6.3
Change-Id: I1570719590a46ae28c98ed7d5053e72b12915db7
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
After the 6.4 changes for QRhi-based compositing in widgets there
is now a good chance that a different context is current after
recreateFbo in case it actually created a new texture and fbo.
This is not great if we immediately call resizeGL() afterwards
since the contract for the reimplementable functions is that
the QOpenGLWidget's context is current. Make sure this contract
is followed.
Fixes: QTBUG-103319
Change-Id: I59a5fa9500df34b86787927e1114d0a80297678a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
In an earlier commit, painting on such coordinates was rejected, since
it would overflow the internal calculations using QFixed. Instead,
avoid the overflow by translating the painter to avoid the huge
coordinate values.
Also reduce the max value somewhat, so that pos stays well away from
QFIXED_MAX, to avoid overflows in the other QFixed variables that have
values offset from pos.
Fixes: QTBUG-103745
Pick-to: 6.3 6.2
Change-Id: Iebdec32bed57fe8e65551c7d278da9fd6c041b37
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Amends ba6c1d2785, which made
m_statusOrPendingObjects already atomic, but did not handle concurrent
deletion/push_back of the pendingObjects vector correctly.
We use the existing lock in QThreadPrivate to prevent data races.
Pick-to: 6.2 6.3
Fixes: QTBUG-101681
Change-Id: I0b440fee6ec270d762e6700a4fe74f28b19e75e8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Amends d88da0b2b0 where I forgot
updating the attribution.
Note that the original change was never picked to 6.2 after all,
since that is on an even older version of Harfbuzz, therefore this
one is only picked to 6.3. Given the phase 6.2 is in, I decided it
was better to leave it, since it didn't get the 3.0.0 update either.
Pick-to: 6.3
Task-number: QTBUG-103603
Change-Id: Ie323d931b49158776c2b9fcc4835b69ca4e2f905
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use the widget screen dpr in calculations rather than
qApp->devicePixelRatio(). The screen may have been
directly set (without the window handle being initialized)
Task-number: QTBUG-103309
Task-number: QTBUG-49663
Task-number: QTBUG-101947
Task-number: QTBUG-102982
Change-Id: I2af2073640b171baf68575e3bc93b29b6a9a471d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I9f95542fd6a0326985744503a71e36448961d6fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
Always invert scroll deltas. This is what the code did
before, expect for on non-Safari macOS. There is no
need any "smart" code here: correct deltas are provided
by the native API regardless of macOS scroll direction
setting.
Reading webkitDirectionInvertedFromDevice is still useful
for certain use cases, such as 3D scene zooming or spinbox
value change, where upwards motion on the trackpad should
always correspond to "increment" regardless of scroll direction.
Propagate this to Qt using one of the handleWheelEvent()
overloads
Finally, we were sending pixel deltas as angle deltas;
fix by sending pixel deltas as well, but keep existing
angle delta behavior for compatibility.
Change-Id: I7a7104c30da057fefc0377816e551a9e7e2fa0e7
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: David Skoland <david.skoland@qt.io>
We were drawing window decorations at an incorrect location in
cases where the QScreen was not at (0,0) (i.e. at an offset on
the web page). Window content was placed correctly.
Correct canvas geometry can be fond by offsetting window geometry by the
negative screen position. Implement this for drawWindowDecorations(), and
also simplify the existing code in drawWindowContent().
Change-Id: I1347d325a58dae5e2bb950b93902123f64199ee8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: David Skoland <david.skoland@qt.io>
If we don't do this then applyWindowState() will apply the
original window geometry from QWasmWindow::initialize().
Change-Id: I4a0fb7aa7984ba21c64364e0bf00d70513232d5d
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: David Skoland <david.skoland@qt.io>
A new option is added for SPNEGO/Negotiate authentication with
SSPI backend to customize the SPN that is used during the procedure.
Fixes: QTBUG-88869
Change-Id: If034ef451a61593445d8e79e7f82b9d3610ed653
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Simplifies the test a little.
Pick-to: 6.3
Change-Id: I77c8221eb2824c369feffffd16f0a7fc44215aaf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The utf8.txt file was only 21 bytes and contained exactly two non-ASCII
characters. It wasn't very good.
This commit brings back the UTF-8 test rows that existed before commit
18ec53156e deleted tst_Utf8. There's a lot
of overlap with some of the other rows in this test, though.
Pick-to: 6.2 6.3
Change-Id: I77c8221eb2824c369feffffd16f094619b69faef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The QLocal8Bit implementation assumes that there's at most one
continuation byte -- that is, that all codecs are either Single or
Double Byte Character Sets (SBCS or DBCS). It appears to be the case for
all Windows default codepages, except for CP_UTF8, which is an opt-in
anyway.
Instead of fixing our codec, let's just use the optimized UTF-8
implementation.
[ChangeLog][Windows] Fixed support for using Qt applications with UTF-8
as the system codepage or by enabling that in the application's
manifest.
Discussed-on: https://lists.qt-project.org/pipermail/interest/2022-May/038241.html
Pick-to: 6.2 6.3
Change-Id: I77c8221eb2824c369feffffd16f0912550a98049
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
They used to in Qt 5. And now they do again:
$ grep . include/QtCore/Q*Vector*
include/QtCore/QMutableVectorIterator:#include "qvector.h"
include/QtCore/QVector:#include "qvector.h"
include/QtCore/QVectorIterator:#include "qvector.h"
Pick-to: 6.2 6.3
Fixes: QTBUG-103742
Change-Id: I77c8221eb2824c369feffffd16f128a983f4866c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This removes one middle-man and a 512-byte variable in favor of a simple
32-bit enum. This was done in a way so we can extend to use either gdb
or lldb in any OS.
I've renamed the debuggerPresent() function to make its meaning clearer.
Pick-to: 6.3
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eba561628ff89b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of piping stuff via the shell into them, just use batch mode.
And also take the opportunity to tell them not to read their user-
provided configuration files.
Pick-to: 6.3
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eba21e71afaefa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>