The important bits from the example are ~10 lines of code, no need
for building a poor-man's version of a graphics or item view.
Pick-to: 6.6
Change-Id: I7874c66765c5b46230c92846ee3de1ee83f47e45
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
In C++ 11 override keyword was introduced to allow overridden functions
to be marked appropriately. Its presence allows compilers to verify that
an overridden function correctly overrides a base class implementation.
This can be useful as compilers can generate a compile time error when:
- The base class implementation function signature changes.
- The user has not created the override with the correct signature.
This commit improves the D-Bus interface code generation.
Change-Id: I0353575c3f70277d04e41b8fa0096c1b2b28058a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Factor out the four code paths for standardIcon() (windows, mac,
application and resource theme) and use those functions also for
standardPixmap() so the returned pixmap is correctly scaled with the
current devicePixelRatio.
Part1: Add QStyle:: scope to switch statements
Task-number: QTBUG-118122
Change-Id: I39c01612c23a0da61c256c682642ae4e75ed8c43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Fix the link to QIBase.
This amends 3cb5408e9e
Pick-to: 6.6 6.5 6.2
Change-Id: I99820971e4136b2cbbc6ee37d80394e0e016f444
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This ensures that we will succeed in renaming files, because we already
have created a link to it in the right directory. With this, we can
remove the home filesystem check that was using QStorageInfo. The
majority of file deletions we expect applications to perform will use
this code path.
An additional benefit is that we ensure we can't get an ENOSPC when
renaming any more, because we already have the entry in the directory.
This needs a fallback to the existing mechanism for two cases:
* trashing full directories, because you can't hardlink them
* when operating on a volume that isn't a Unix filesystem (e.g., a FAT
filesystem on a removable device)
QTemporaryFileName required a small change to allow non-absolute paths.
openat(AT_FDCWD, "/home/tjmaciei/.qttest/share/Trash", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 5
newfstatat(5, "", {st_mode=S_IFDIR|0700, st_size=18, ...}, AT_EMPTY_PATH) = 0
getuid() = 1000
openat(5, "files", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 6
linkat(AT_FDCWD, "/home/tjmaciei/tst_qfile.moveToTrashOpenFile.MuahmK", 6, ".eRPdPI", 0) = 0
openat(5, "info", O_RDONLY|O_NOFOLLOW|O_CLOEXEC|O_DIRECTORY) = 7
close(5) = 0
openat(7, "tst_qfile.moveToTrashOpenFile.MuahmK.trashinfo", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 5
[../etc/localtime..]
write(5, "[Trash Info]\nPath=/home/tjmaciei"..., 103) = 103
renameat(6, ".eRPdPI", 6, "tst_qfile.moveToTrashOpenFile.MuahmK") = 0
unlink("/home/tjmaciei/tst_qfile.moveToTrashOpenFile.MuahmK") = 0
close(5) = 0
close(6) = 0
close(7) = 0
Change-Id: I9d43e5b91eb142d6945cfffd1786d714fc24f161
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I need to use QTemporaryFileName in a context where absolute paths are
not allowed because they change the behavior of the system call (the
-at() POSIX system calls); see next commit. This required a fix to a
seemingly unrelated test, which depended on the absolute path, because
QPluginLoader and QLibrary assume a file name with no path components
imply "search the standard places".
[ChangeLog][Important Behavior Changes][QTemporaryFile] This class will
now return relative file paths in fileName() if the file template was
also a relative path (it used to always return an absolute path). The
temporary files are still created in the same directory; this change
only affects the length of the path the function returns.
Change-Id: I79e700614d034281bf55fffd178f65f2b3d602d8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Amend 944200b5a9. We have code paths
in Qt that result in a global QJniObject being called from multiple
threads (QtActivity instance, possibly the QAndroidSystemLocale),
so we need to tolerate that until we understand better under which
circumstances this should be allowed, and what tools we can use to
control this better.
Don't instantiate QJniEnvironment to check the JNIEnv, but use raw
JNI calls so that we don't implicitly attach a thread to the JVM
when checking. Use categorized logging to emit log output if we
have an environment/threading mismatch, including the name of the
class we are trying to call, and fall-back to the thread-local JNI
environment pointer instead of the one stored in the QJniObject's
private.
Also, give the threads that we attach to the JVM the name of the
QThread instances if we can, resulting in better logcat output on
the device.
This still results in less overhead than the code had prior to
944200b5a9, as we don't instantiate
multiple temporary QJniEnvironment objects on the stack for each
call.
Change-Id: I98b92edd29162dccfc5c34e6261d4de219b59531
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Make sure this works and doesn't cause any QJniEnvironment or other
JNI object lifetime issues.
Change-Id: I08b55982266dfb1821517449f6eb9f2796cea9b7
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Since the TZ backend resorts to ICU for display names, we got
inconsistent results if they disagree about when transitions happened.
Also, ICU uses the current (or only recent history) names for the
zone, so one currently not doing DST (Africa/Tripoli) doesn't get a
report of its DST name at a historical time when it did DST (but ICU
doesn't know about it). Since the ICU backend, in any case, doesn't
override the displayName(qint64, ...), we can simply use the QTZP base
version instead of overloading in the TZ back-end, so we only delegate
to ICU when it might actually help. This also saves duplicating some
locking and lazy-initialization code.
In the process, turn a unique lock into a scoped lock within a
suitable scope. Also, make a comment more grammatical and less
verbose.
Change-Id: Iaaed1fb6a380be8b4258c43cbc4bacd5784345fb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
While at the moment we don't have aliasing support in QSharedPointer,
introduce owner-based comparisons and hashing. This also fulfills some
use cases in lieu of operator== for QWeakPointer (which got deprecated
by bb23a05905).
I'm using C++26/P1901's spelling of owner_equal, instead of
Boost.SmartPtr's spelling (owner_equal*s*). Given the niche use case,
the lack of interoperability with Qt's own containers, as well as the
Standard comparison objects' semantics (std::owner_less,
std::owner_equal), I don't think we should be giving these a Qt-ish name
as it would be pretty useless.
[ChangeLog][QtCore][QSharedPointer] Added owner_before, owner_equal,
owner_hash.
[ChangeLog][QtCore][QWeakPointer] Added owner_before, owner_equal,
owner_hash.
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I8b792ae79f14cd518ba4a006edaa17786a8352a0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
On iOS, we can use system color variables to adjust the background color
of the LaunchScreen based on user's system preference. In addition, we
can remove the app name labels, since new Xcodes don't add it anymore.
Fixes: QTBUG-118191
Change-Id: I95fef6216f1373c749ea31ff4ed085435e8998f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The tests are suitably #if-ed to be omitted once the property is gone,
but the compiler can still warn.
Change-Id: I20efcf9bb40fe6d7ad7e21b64e5400f71c0a0b15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The currently provisioned OpenSSL for Android, i.e.,
`prebuilt-openssl-3.0.7-for-android-ndk-r25b.zip` has a different
structure compared to what Vcpkg installed directory has. This patch
makes sure that we are considering the Vcpkg structure as well.
CMAKE_ANDROID_ARCH_ABI should be translated to Vcpkg's triplet target
name, and we add a `-dynamic` suffix to them because we are building
android artifacts with a custom triplets with similar names.
Change-Id: Id48a8ad351a64ab18001f729d948fbf1b7e47b29
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Test runner was not properly handling tests which
return the control back to browser event loop.
It was treating such tests as if they exited with
code 0, marking them as succesfull even if they were
eventually failing or hanging.
This commit adds a callback to TestCase so the runner
is notified when a test truly has finished.
As a side effect, two tests need to be disabled for now
as they are failing for wasm, which was not properly
detected previously.
Change-Id: I0eb9383e5bb9cd660431c18747b9e94413629d1e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
It's legacy method marked as internal.
There are zero occurrences of "isSimpleText"
anywhere in Qt or Qt Creator other than qstring.*
Change-Id: I4961b7b2539fb6552484e77fbea58ba0e6656921
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
WASM has been added as a definition.
Add it in the comment section as well.
Pick-to: 6.6 6.5
Change-Id: Id86520cad4c12d83234cc71a00cd3e484e2895dc
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
VxWorks elf.h (nor any other header in its SDK) doesn't contain
definition of PN_XNUM, which meaning is the limit of program headers in
ELF structure, related to `e_phnum` field of `Elf{32,64}_Ehdr`
structures. Since these fields have identical type and seemingly
identical meaning, we can safely assume that its maximum value will be
the same on both systems.
Define PN_XNUM if it's not defined with `0xffff` value taken from
Linux and Solaris related headers.
Fixes: QTBUG-118135
Change-Id: I5a0dab1d1d18e165d01e80823a02f7df644fc7e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's logic in QMessageBox to resolve the default and escape button
if not set by the user. And the user may of course override these.
We now propagate the resulting buttons via the dialog helper, and
pick them up in the macOS native dialog backend. The only common
information we have between the standard buttons and custom buttons
is the button identifier, which for standard buttons is the enum
value, and for custom buttons is an auto generated identifier.
The same identifier is used when reporting the clicked button
from the native dialog helper.
Fixes: QTBUG-118308
Pick-to: 6.6 6.5
Change-Id: I5ca45604b51f0bbf74e56134d7b55bb8911f3563
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QDialogButtonBox has logic to automatically resolve a default button,
in case one is not already set via QPushButton directly, or via e.g.
QMessageBox::setDefaultButton().
Unfortunately, this default button can in some cases be overridden by
the first button in the dialog button box. The reason this happens
is that the first button is the focus proxy of the button box, so
when the button box gains focus, it will transfer it to the first
button. And since QPushButtons inside a QDialog have their autoDefault
property set to true by default, this focus transfer will also reset
the default button to the focused button.
This arbitrarily happens for any role that happens to be earlier in
the QDialogButtonBox::ButtonLayout than the AcceptRole, and can be
very confusing for the user, so we try to avoid the situation by
explicitly setting the automatic default button as the focus
widget of the button box, unless one is set already.
This is also what QMessageBox::setDefaultButton() does internally.
The only case we're not covering is when the user sets a push button
as default via QPushButton::setDefault(), but we conservatively
assume that the user then also calls setFocus() on the button.
Pick-to: 6.5 6.6
Change-Id: Ibdac0a51ba9439321d4fd7a1dac1ed695e11d693
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The native message dialogs are shown in QMessageBox::setVisible,
instead of plumbed via e.g. QWidgetPrivate::show_sys (which is not
virtual). And we try to show the native dialog before we call the
base class QDialog::setVisible(), where we end up sending the show
event.
As the native dialogs might rely on the last minute setup of adding
an OK button or detecting the escape button, we need to do it in
setVisible instead.
We can not switch the order of showing the native dialogs after
calling the base class setVisible (and getting showEvent), as
we need to know whether the native dialog could be shown or not
to decide whether to show the fallback widget dialog.
The part from showEvent that added the detailsButton has been
removed, as we're already doing that in setDetailsText().
Pick-to: 6.5 6.6
Change-Id: I23f1d87d542d9dadfd71924f8119c22720f4b276
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
So far, only accessible interfaces of roles QAccessible::Dialog
and QAccessible::Window were taken into account when trying to
find the top-level window in order to calculate the window-relative
coordinates relative to that one.
However, an app doesn't necessarily need to have any such widget/
window as it's top-level object, but can have any widget there.
Therefore, consider any a11y object that is a direct child of the
application's a11y object a top-level window as well.
For example, in the spinboxes example
(qtbase/examples/widgets/widgets/spinboxes/spinboxes), the top-level
widget is a QGroupBox, which has an accessible role of QAccessible::Client,
which maps to ATSPI_ROLE_FILLER for AT-SPI on Linux.
Since that's the top-level widget, window-relative coordinates
should be calculated relative to it.
(Without this change in place, screen coordinates would be
used for the window-relative coordinates as well, as found by
the script attached to QTBUG-106527.)
Also deduplicate a bit and just have a single loop instead
of the extra check on the interface itself at the beginning.
Fixes: QTBUG-106527
Pick-to: 6.6 6.5
Change-Id: I8d2a00bcc22c71d696e4f48233afddc80e93bc1b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Investigating QCocoaWindow::setVisible idempotence revealed that our
QCocoaEventDispatcherPrivate::beginModalSession() implementation would
happily add the same window multiple times, resulting in trying to
re-start a modal session for the same window when the window was
closed, confusing AppKit's logic for choosing the next key window
when a modal window is closed.
We now bail out if we detect this scenario, even if setVisible has
been fixed. Additional logging has also been added.
Pick-to: 6.6 6.5
Change-Id: I07418c12b421fb0b4ebf875050e32f56fdad6197
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Some of the datatype mappings for Mimer SQL are wrong and some are
missing. Also, fix the datatype documentation for Mimer SQL.
Fixes: QTBUG-111219
Pick-to: 6.6
Change-Id: Ic7edaaca9af9b3b480079b04b05c58ab22f34fa3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use addIconFiles() instead repeating the addIcon() function with every
size to avoid copy'n'paste errors and make the whole stuff more
readable.
Task-number: QTBUG-118122
Change-Id: I71ab5ca0526024c6f96e20871018b4af43dac3bf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The first/last/sliced API may be what we suggest users use, but the vast
majority of the installed codebase uses left/mid/right because they've
been available since time immemorial.
An additional benefit of this is to make left() and right() available as
inline methods.
Change-Id: Ifeb6206a9fa04424964bfffd1788383817ed906c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Those ought to have been the original implementation, when they were
added in commit 38096a3d70, for Qt 6.0.
Because these classes are exported, we need to provide the previous only
implementations for MSVC. All other compilers would provide inline or
emit local, out-of-line copies.
Change-Id: Ifeb6206a9fa04424964bfffd178836a2ae56157d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's by far the most common use, so having to call two things is just
cumbersome.
Change-Id: I79e700614d034281bf55fffd178f454c4e31929e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
- remove unused variable
- port index-based loop to range-based for
- use const method more to avoid implicit detach
Change-Id: I223f6c221d0c6277e94efd2e7b7be0f8d8456c60
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The test that needs this bool is using 2013, so test that year for a
match. (Africa/Tunis toyed with DST in 1990, the year used before, but
thought better of it.) In the process, move the initialization to the
member-initialization of the class and make the member const.
Change-Id: Ib87636cdb0b038fad0cdef9fbe49e96f7bf79d1f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Qt ModuleConfig.cmake files set variables like <package>_INCLUDE_DIRS,
<package>_DEFINITIONS, etc., which can be used by user projects to
acquire the module related information. These variables also accumulate
information from Qt Module dependencies. Since we do not separate the
Private and regular modules in dependency list, the resulting variables
contain values from both. This change puts the information from Private
dependencies to the variables of Private module. The exception is
PRIVATE_INCLUDE_DIRS which will contain include directories from Private
dependencies for non-Private module too.
Fixes: QTBUG-118462
Change-Id: I51e6d63651ed1913005064c90f77eba219cf60ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
BlobIoDevice: Supports reading data from a JS Blob,
which can be a File (on disk) or some other object
which can provide data. The native access functions
are async and using this class requires that asyncify
is available.
Uint8ArrayIODevice: Supports reading and writing to
a Uint8Array / ArrayBuffer. Similar to the existing
QByteArray::fromEcmaUint8Array() API, except that it
supports incremental accesss.
Change-Id: Ic5de3534ff75eb6c745287b73b15ccd92d74ac2c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The loop was breaking one button too early.
Pick-to: 6.5 6.6
Change-Id: Ic5027a2e4e35fbd54bf25b310768fd3278d4874b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As explain in detail in 1bde203605, AppKit
doesn't treat non-direct transient parents of a window modal window as
being blocked by that modal window, but Qt does. To align with Qt, we
worked around it by returning NO from canBecomeKeyWindow for windows
that were blocked by a modal window.
This however had an unintended side effect for native dialogs, due
to the way we hide these dialogs. When a native dialog is closed,
AppKit will look for another window to make key, and as part of that
it checks canBecomeKeyWindow. The problem is that the modal blocked
status has not been updated in QGuiApplicationPrivate at that point,
so we tell AppKit it can't make the transient parent key.
The modal blocked status is only updated once we hit QWidget::setVisible,
at which point dialogs like QMessageBox and QColorDialog has already
called setNativeDialogVisible(false) in its setVisible() override,
triggering the close logic described above.
To fix this properly we need to have the dialogs call the base class
first when hiding, and then setNativeDialogVisible(), and also have
the macOS native dialog helpers react to hide() by ordering out the
window in case it didn't work at an earlier point. This kind of
change is risky for Qt 6.5/6.6 however, so we opt for a simpler
solution for now.
By limiting the original workaround for non-direct transient parents
not being blocked to just those transient parents, and only for window
modal dialogs, we avoid the issue with failing to transfer key status.
Task-number: QTBUG-104905
Fixes: QTBUG-118320
Pick-to: 6.6 6.5
Change-Id: Iabbca0b74a7db4e9821a9b60730d01fbad1425db
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The implementation of QCocoaWindow::setVisible is not idempotent,
as for modal windows it calls beginSheet/endSheet or starts/ends modal
sessions, which will confuse the AppKit modal session stack.
Once a window has been shown QWindowPrivate::setVisible hides/masks this
issue, by returning early if the visibility has not changed, but during
first show QWindowPrivate::setVisible will update the QWindow state,
before creating the platform window. If the platform window then picks
up the QWindow's visible state during creation, it will result in one
QPlatformWindow::setVisible() call during creation, and another one
via QWindowPrivate::setVisible after the platform window has been
created.
To fix this we can check the existing NSView.hidden state and skip
the setVisible call if it's already up to date. But one complication
is that our QCocoaWindow::setVisible has different behaviors depending
on whether the window has been initialized yet or not, due to how
handleGeometryChange skips sending geometry changes for uninitialized
windows. So we need to also bail out if we're still initializing the
window. This is fine, as we know we'll get a follow up setVisible
call via QWindow, both when QWindow itself creates the platform window
as part of setVisible, as well as when the user does a two step create
and then show.
For good measure we throw in a recursion check as well, in case some
of the logic in QCocoaWindow::setVisible before we update NSView.hidden
recurses back into QCocoaWindow::setVisible.
Pick-to: 6.5 6.6
Change-Id: Ibdcf4859e58d6684aac4490126d35eb12fdd5943
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This reverts commit 6a93ec2435.
Reason for revert: Breaks qtdeclarative build, submodules need
to be clean before we deprecate or remove APIs.
Change-Id: Id0726b9bfad6072065b380b44b6ff6dffda79e45
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The test is testing whether the order of creating a child window
of a modal dialog and showing the parent dialog matters. But to
allow child windows of a modal dialog to become active that child
also needs to be a dialog. That's a limitation on macOS, where
only NSPanel subclasses can override worksWhenModal.
Fix the test, and rewrite it using more modern idioms, avoiding
the need for long waits in the test.
Pick-to: 6.6 6.5
Change-Id: Ifb640d0288a3c7ed37f2c61294e34cd96fba49ca
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Amends 2d59f2e8ca, which only checked
this for custom buttons, but standard buttons can also be customized.
Pick-to: 6.5 6.6
Change-Id: Ie8bafcf5007a0b4789b2d0ee1ddbc660a952fee4
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This reverts commit bb23a05905.
Reason for revert: this change resulted in a flood of build-breaking
warnings in submodules that need to be cleaned up before we try again.
Also, the discussion following this change shows that this needs more
clarification of the implications and options. Until that is concluded,
the status quo is acceptable.
Change-Id: Id8f67ed585517935c31e29d48099b1c84b787b74
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Starting from qt-6.6.0, the childStack size has been too small to run
qmake or qsb in the sandbox, which will cause segfault.
This problem can be fixed by changing the childStack size to SIGSTKSZ.
For security reasons, some Linux distributions, such as gentoo, will
use the sandbox when building applications. Previously, qt-6.5.0 could
be successfully built in the sandbox. The problem started with qt-6.6.0.
See also: https://bugs.gentoo.org/915695
Pick-to: 6.6
Change-Id: I229c25397f557dd2fec3e0ec53ac68fda28bab13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the application has already attached to the console, the
AttachConsole() API will fail but we can still redirect our
output to the console. The previous code doesn't take this
case into consideration, now it's covered by this patch.
Please refer to the "Remarks" section:
https://learn.microsoft.com/en-us/windows/console/attachconsole
Pick-to: 6.6
Change-Id: I1c5033cc962dcd5a757ff15cc677a51e21330e0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These special member functions have no purpose.
We never *documented* their semantics. Any code using them is
unconditionally wrong (which semantics was it assuming?), so we can
accept the SIC (type A). If a user needs such a copy, they would have to
reason on the intended semantics (relaxed? acquire/release?) and be
explicit in their code. Especially for assignment, they would need
understand the consequences of the memory ordering that apply on _each_
atomic object involved and not on the assignment operation as a whole
(there are no such semantics).
Testing this change on qtbase has already found bugs.
From a purely technical point of view: we don't guarantee lock-free
atomics nor we require them from the underlying platform. An atomic is
therefore allowed to be implemented as a mutex protecting a value, and
mutexes are not copiable. std::atomic follows the exactly same pattern
(not copiable nor copy-assignable) for exactly the same reasons, and Qt
atomics are implemented on top of std:: ones.
[ChangeLog][QtCore] The copy constructor and assignment operators of
Qt atomic classes (QAtomicInteger, QAtomicPointer) have been removed.
Their usage in user code should be considered a programming error, as no
memory ordering semantics were ever documented for these operations (and
therefore relying on any specific semantic would be relying on
undocumented, unportable behavior). This matches the API of the
std::atomic class in C++. Note that you can still use explicit
load/store operations to transfer a value across two Qt atomic objects,
and therefore use the memory ordering specified for the load/store
operations.
Change-Id: Iab653bad761afb8b3e3b6a967ece7b28713aa944
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>