Otherwise we will fail to resolve the symbol and will not create
a forwarding header for the class.
Change-Id: I34922d8458bdb994a194108183ac9b9d14530c5e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
lupdate can deal with Objective-C++ sources nowadays, most
likely due to appending them to SOURCES instead of the
deprecated OBJECTIVE_SOURCES.
Task-number: QTBUG-30125
Change-Id: Ifc6b06f13e0f679a011d999f11c2e6d25dcf27ed
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The double-swap technique I used was flawed and broke on
self-assignment. What I had meant to use was the move-and-swap
technique. Thanks to Peppe for pointing it out.
This also fixes a compiler bug in the Green Hills compiler. It was
finding the wrong "swap" function in qSwap:
using std::swap;
swap(value1, value2);
It's supposed to find swap(QCborValue &, QCborValue &) due to argument-
dependent lookup. It's instead finding std::swap<QCborValue>, which
recurses.
Fixes: QTBUG-83390
Change-Id: Ibdc95e9af7bd456a94ecfffd1603e1bee90cd107
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Followup to ed3ed0b9db68916fede4 and
3c159957f8.
In QWindowSystemInterfacePrivate::fromNativeTouchPoints() and
QWindowSystemInterfacePrivate::toNativeTouchPoints() we continue using
struct TouchPoint's QRectF area as storage for the screen position +
ellipse diameters; as the comment says, this is _unrotated_, meaning
that rotation is stored separately, and area should not be construed as
the bounding box of the rotated ellipse. (In Qt 6 we can make the
QPA touchpoint look the same as the QTouchEvent::TouchPoint to
eliminate the need to calculate the center of the rect.)
In QGraphicsScenePrivate::updateTouchPointsForItem(), setRect() sets the
position and the ellipse diameters, but the latter is redundant because
the purpose of this function is to localize a touchpoint to the
coordinate system of a particular QGraphicsItem. Ellipse diameters
should stay the same.
In QApplicationPrivate::updateTouchPointsForWidget(), as in
QGraphicsScene, we are localizing touchpoints to a widget
and to the screen that the widget is shown on, so only the position
needs to be set, while preserving the sub-pixel resolution that
mapFromGlobal(QPoint) loses.
Fixes: QTBUG-83403
Change-Id: I61d29e14cbe38567767b164af6ae895082c5e1a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Clear Linux containers running as root may have no /etc/passwd. But
they'll have /etc/machine-id because systemd creates that. Also test
/proc/version (a Linux-specific file) because that isn't writeable even
by root.
Take the opportunity to check with access() instead of assuming root and
only root can write to the file.
Change-Id: Ibdc95e9af7bd456a94ecfffd1603e8359604752b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This was never tested. The infinite loop in QCborContainerPrivate::grow
is the proof.
[ChangeLog][QtCore][QCborArray] Fixed an infinite loop when operator[]
was called with with an index larger than the array's size plus 1.
Change-Id: Ibdc95e9af7bd456a94ecfffd1603df3855c73f20
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Similar to the QJsonObject issue of the previous commit (found with the
same tests, but not the same root cause). One fix was that copying of
byte data from the QByteArray to itself won't work if the array
reallocates. The second was that
assign(*that, other.concrete());
fails to set other.d to null after moving. By calling the operator=, we
get the proper sequence of events.
[ChangeLog][QtCore][QCborMap] Fixed some issues relating to assigning
elements from a map to itself.
Note: QCborMap is not affected by the design flaw discovered in
QJsonObject because it always appends elements (it's unsorted), so
existing QCborValueRef references still refer to the same value.
Task-number: QTBUG-83366
Change-Id: Ibdc95e9af7bd456a94ecfffd1603df846f46094d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The refactoring to use CBOR missed two places where we could assign from
the same object and thus cause corruption. In fixing this issue, I found
a design flaw in QJsonObject, see Q_EXPECT_FAILing unit test and task
QTBUG-83398.
[ChangeLog][QtCore][QJsonObject] Fixed a regression from 5.13 that
incorrect results when assigning elements from an object to itself.
Fixes: QTBUG-83366
Change-Id: Ibdc95e9af7bd456a94ecfffd1603df24b06713aa
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Avoids ASAN warning of ODR violation:
SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for
QSocketEngineHandler' at ../../../../../src/network/socket/qabstractsocketengine.cpp
This trick has not been needed since we got Q_AUTOTEST_EXPORT. The main .pro
file has:
requires(qtConfig(private_tests))
Change-Id: Ibdc95e9af7bd456a94ecfffd1603e598932b88ad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Normally people shouldn't create temporary files on /, but if you're
running as root, why not?
Caught when running tst_qtemporaryfile as root:
openat(AT_FDCWD, "", O_RDWR|O_CLOEXEC|O_TMPFILE, 0600) = -1 ENOENT (No such file or directory)
Change-Id: Ibdc95e9af7bd456a94ecfffd1603ebfc17cea220
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Get rid of double negation to make the configuration easier to understand.
Change-Id: I5dfe256c2ac2ef131c3db20dce9ff492c529a5b1
Reference: https://emscripten.org/docs/tools_reference/emcc.html
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This caused false alarms in fuzzing tests.
The lifetime of the screen is the same as that of QMinimalIntegration.
But failure to call handleScreenRemoved() also causes a warning; so
as on "normal" platforms, the screen has to be separately allocated.
Change-Id: Iad0cc53b8d09687400ced28bc2353b7500b01110
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
It's required as a response to upgraded protocol and apparently some
servers would wait for it, not sending any frames. Becomes a problem
in case only one request was sent.
Fixes: QTBUG-83312
Change-Id: I90dc5c04095f0b78baa404466625d329dc4c6e21
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The global variants of the manipulators have been deprecated in favor of
the ones in the Qt namespace. However, only one set was documented (the
deprecated ones).
Ensure documentation for both sets is generated, and link to the Qt::
manipulators in QTextStream documentation.
Fixes: QTBUG-82532
Change-Id: I430d15f6d9a34411d1d7265031249e600f6874ef
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
io/qfilesystemengine_unix.cpp:1420:9: error: 'futimens' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]
if (futimens(fd, ts) == -1) {
^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/stat.h:396:9: note: 'futimens' has been marked as being introduced in macOS 10.13 here, but the deployment target is macOS 10.12.0
int futimens(int __fd, const struct timespec __times[2]) __API_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));
^
io/qfilesystemengine_unix.cpp:1420:9: note: enclose 'futimens' in a __builtin_available check to silence this warning
if (futimens(fd, ts) == -1) {
^~~~~~~~
Change-Id: Ib52adf7b1ec4f1057d8cb260a00da509429cfaed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2f030c2cf3fe368be217c0e0b157e050d1c27afc)
We used to need to consult /etc/timezone for the zone name back when
Debian, up to Jessie, used a copy of the zoneinfo file as
/etc/localtime, instead of a symlink. Jessie's end of life is this
May, but Thiago reports that its gcc can't build Qt 5.14, so we may as
well remove this fall-back. Newer versions of Debian use a symlink.
We used to need to consult /etc/sysconfig/clock for this information
back when ancient Red Hat distros copied zoneinfo to /etc/localtime
instead of symlinking, but Thiago believes that's now ancient history.
So, again, remove this old fallback.
Change-Id: I73cb40b926186b311dac6f00fe8743d37a9dfce5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTzTimeZonePrivate::init() was coping with empty and then saving the
system ID if the ID it looked up was empty. Better to have its caller
ensure it's passed the system ID in place of empty. The system ID is
always non-empty, as it falls back to "UTC" if it would otherwise have
been empty.
Change-Id: I5c74e23f01ef578de0dc1f6d558e9c8c7e65ff53
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Commit ae6f73e856 inserted a mutex around
the entire load_sys(). We had reasoed that deadlocks would only occur if
the object creation in instance() recursed into its own instance(),
which was already a bug. But we had forgotten that dlopen()/
LoadLibrary() executes initialization code from the module being loaded,
which could cause a recursion back into the same QPluginLoader or
QLibrary object. This recursion is benign because the module *is* loaded
and dlopen()/LoadLibrary() returns the same handle.
[ChangeLog][QtCore][QLibrary and QPluginLoader] Fixed a deadlock that
would happen if the plugin or library being loaded has load-time
initialization code (C++ global variables) that recursed back into the
same QLibrary or QPluginLoader object.
PS: QLibraryPrivate::loadPlugin() updates pluginState outside a mutex
lock, so pluginState should be made an atomic variable. Once that is
done, we'll only need locking the mutex to update errorString (no
locking before loading).
Fixes: QTBUG-83207
Task-number: QTBUG-39642
Change-Id: Ibdc95e9af7bd456a94ecfffd160209304e5ab2eb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Callers and definition were out of sync.
Change-Id: Icda26887cb64c61c7e373766f25559b0d450d112
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
std::function does not have deduction guides in older libc++ (presumably older
than version 10). Omitting the template parameter isn't essential for the test,
so just give it.
Change-Id: Ia9bb91f961b0928203737ec976913effd06433e0
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
A special restriction of threads on WebAssembly is
that you should not block the main thread, also not
to wait for worker threads.
For example, blocking the main thread may prevent the
browser from starting a new web worker to service the
pthread the main thread is waiting for.
We may be able create an abstraction to support use
cases like this (most likely using emscripten asyncify),
but for disable use of threads to avoid deadlocking.
Change-Id: I35edd5e1bb465e2549fa7cc4288b47dcd2e4244b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Use QTRY_COMPARE in the flaky tests instead of waiting.
Change-Id: Ic18fc5fde3fa47f3b3ef21e6acd876bd6990981d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 0ae6803d39)
Show and activate the widget, otherwise we can't rely on geometry
and gesture event delivery. Use QTRY_ macros in a few more places.
As a drive-by, fix coding style.
Change-Id: If3a13732ae6b07a137fec89e78b7e6b39e066bed
Fixes: QTBUG-82947
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
To avoid livelocks, posted events should be delivered when all pending
messages have been processed, and the thread's message queue becomes
empty. Although the logic of the previous patch is correct, it turned
out that determining the moment when the message queue is really empty
is not so simple. It is worth noting that the GetQueueStatus function
sometimes reports unexpected results due to internal filtering and
processing. Indeed, Windows docs say that "the return value from
GetQueueStatus should be considered only a hint as to whether
GetMessage or PeekMessage should be called". Thus, we cannot rely on
GetQueueStatus in unambiguous logic inside the qt_GetMessageHook.
To solve the problem, this patch introduces a guard timer which
guarantees low priority processing for posted events in foreign loop.
The wakeUps flag reset logic has also been changed to provide clearer
synchronization of the Qt internal loop.
Fixes: QTBUG-82701
Fixes: QTBUG-83151
Change-Id: I33d5001a40d2a4879ef4eb878c09bc1c0616e289
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
I had originally developed ae6f73e856 in
5.13, where this code for Android didn't exist. I didn't notice the use
of pHnd there when I merged up for the push.
Change-Id: Ibdc95e9af7bd456a94ecfffd160208dfaa596d95
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
DeleteLaterWidget is a main application window of the test. So, its
show() function should be called explicitly before starting the main
event loop. Otherwise, it remains hidden for the whole time, which
causes an incorrect emission of QApplication::lastWindowClosed signal
when a dialog window is closed in the middle of the test.
Also, fix synchronization between deferred deletion and timer event.
Change-Id: Id3ce5adbcd9e5e22508825c52025eeea70202354
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After 99ace38d22, all plugin files are
included automatically, not only the ones ending in Plugin.cmake.
Thus the extra inclusion done by the QmlConfigExtras file should only
be done if strict mode is set.
Amends 99ace38d22
Amends 2f2dd3b0c28db210ea1f00d569f6c1626894c5f4
Task-number: QTBUG-83282
Change-Id: I416cbad6c4788d605a9a74f21062543c9c98e968
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
./configure […] --device-option EMSCRIPTEN_ASYNCIFY=1
Set QT_HAVE_EMSCRIPTEN_ASYNCIFY as a feature flag,
enable optimizations for asyncified debug builds.
Change-Id: I81c887a411780e328aed48ec09ff6b9277c3bccf
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
On emsdk 13.9.x WASM_OBJECTS_FILES is always on,
and BINARYEN_TRAP_MODE is not needed
Change-Id: Id1da1db0278e131f95045bc0902f5cc4c22c1522
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>