The test already exercised the function here and there, but it lacked
a central place to test the static hash() method, so add one.
Pick-to: 6.7 6.5
Change-Id: I229bc8a8ed07e0036f60de62ecc4d11ef88dd20e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
GCC 11 doesn't understand that 'i' isn't ever read from (because all
spans created over it have size zero), but initialize it nonetheless
to suppress the warning.
Amends f82cf6333e.
Pick-to: 6.7
Change-Id: Ibfb3e9b7fdcbe93c43b7873986c74b4b5a0c9e54
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
They didn't work due to qdoc bug QTBUG-118080, which has since been
marked as fixed (for 6.7FF).
Remove the protection.
Task-number: QTBUG-115022
Task-number: QTBUG-118080
Pick-to: 6.7
Change-Id: I1b792676754074dd85611e647d4e2c372de3a647
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are some architectures where
sizeof(qregisteruint) > sizeof(size_t)
so this could be a minor performance improvement.
Change-Id: If05cb740b64f42eba21efffd17cf30c3ae5bd88f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
It was used in a single place, in each of these files, now that the
forward indexOf is moved to qbytearraymatcher.cpp. There's another copy
in qstring.cpp.
Task-number: QTBUG-125283
Change-Id: If05cb740b64f42eba21efffd17cf30607317877a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The public, inline QtPrivate::findByteArray() function duplicates some
of the entry conditions that this does (including the negative from), so
help the compilers.
Task-number: QTBUG-125283
Change-Id: If05cb740b64f42eba21efffd17cf3034ce9ab9b8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
The former is the only place where the latter is called and both were
doing duplicate and redudant work. So merge the two functions again...
and split off the actual hashed searching into a new qFindByteArray.
That simplifies the diff and Git history.
Drive-by adding the Q_NEVER_INLINE to the Boyer-Moore search, which will
be reached via tail-call.
Task-number: QTBUG-125283
Change-Id: If05cb740b64f42eba21efffd17cf2ed2bbc64b17
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
We have a public, inlineable one, so use that one instead of the private
copy. They do the same thing.
Task-number: QTBUG-125283
Change-Id: If05cb740b64f42eba21efffd17cf2ded689e0691
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This works better with the current Gradle 8.3 and supports
Android api 34 builds.
Task-number: QTBUG-106907
Change-Id: I816a1aa163a9aee0a5859872129cff62f81a2dea
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Coin is currently missing support for arm64 signing. Drop the signing
on arm64 for time being to allow packaging flag to be added to export
arm64 builds.
Change-Id: If684fa4d787fccb99ac9a0ebad56ec723faba354
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
On VxWorks, its pthread implementation fails on call to
`pthead_setspecific` which is made by first `QObject` constructor during
`QThreadPrivate::finish()`. This causes call to `QThreadData::current`,
since `QObject` doesn't have parent, and since the pthread is already
removed, it tries to set `QThreadData` for current pthread key, which
crashes.
The aforementioned `QObject`'s instances are created in multiple places
during `QThreadPrivate::finish` method, first one in during call to
`qCDebug()`.
The sequence currently leading to call to `QThreadData::current` starts
with `qCDebug` call in `QThreadPrivate::finish`, which:
- creates `QDebug` object, which
- creates `Stream`, which
- creates `QTextStream`, which
- creates `QTextStreamPrivate`, which
- creates `QDeviceClosedNotifier`, which
- is a `QObject`, which
- calls `QThreadData::current()` because its `parent` is nullptr.
Even ignoring debug print, next line calls
`QCoreApplication::sendPostedEvents` which calls `QThreadData::current`
directly.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I4d405eebdff0c63c6cd66fba4eaa95c3818ceaea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids linter warning like in
5dc9692e48ea15ab3da4283997547a2849f1944e:
Obsolete Gradle Dependency
Brings back the commit 3bae65e7d6
that was reverted earlier.
Pick-to: 6.7
Task-number: QTBUG-106907
Change-Id: Ia1e3362853b5d43299acf21d5f3ac099a478b396
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal(). In this case this results in a wrong position
for QCursor::setPos() which lets the test fail.
Fix it by waiting for a move event with a position != 0,0 before calling
mapToParent/Global().
Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-123998
Change-Id: Ic5e989c4497ccf3ed720a521f9d7e73632b4b1fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Use QFlatMap for standardButtonMap and hiddenButtons - these two
container normally don't hold more than 5 elements so QFlatMap suits
much better.
Change-Id: I70f1a0471ec3cb118120805973bab28568d48317
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
VxWorks doesn't have implementation of QStorageInfo and uses stub.
Remove tests of it from building and running, since these can't work.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idd63d20c2dda1ae09838a7d371ae5b713180cb96
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As an optimization when calculating the safe area margins for child
widgets we look at the parent hierarchy, and if we find a widget that
is in a layout, and that layout respects the widget's contents rect,
we assume the safe area margins are accounted for already.
But this relies on the widget the layout is operating on to not opt out
of the safe area margins affecting the contents rect. If it does, the
layout can't help us, and we need to fall back to computing the child
widget's safe area margins.
Task-number: QTBUG-125345
Change-Id: I2e2f7d292d2b2c3ecd2e2e95316c4d72b92db5d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Nothing there should rely on the network testing server.
Part of this will also be testing the local/unix domain socket support.
Task-number: QTBUG-102855
Change-Id: Icf3b0bd9370ec62e003862caf4cd3ed38d875bac
Reviewed-by: Mate Barany <mate.barany@qt.io>
We can do both conversions with the logic from
applyElementListTransform with a few simple changes.
Change-Id: I560a2954b3a4c1acfee57813fa0caa418b1fc5d6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Wayland provides fractional device pixel ratio without using QHighDpiScaling
so it should work when QHighDpiScaling::isActive returns false.
There are also invalidation adjustments given that high dpi backing
store's device pixel ratio could lead to different native sizes
depending on platform's device pixel ratio.
Fixes: QTBUG-115462
Change-Id: Ib799272cd0108af6a5886496874349ff04352333
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
It can happen that we are not able to determine which
Emscripten version Qt is built with, for example if
the detection code runs at a time when qconfig.h has
not been created yet.
In that case skip printing a warning since we are not
able to offer a sensible recommendation.
This fixes Qt configure when building for shared libraries,
where we would previously print this warning several
times:
Qt Wasm built with Emscripten version:
You are using Emscripten version: 3.1.50
The recommended version of Emscripten for this Qt is: 3.1.50
This may not work correctly
Change-Id: Ie15300e89c0e4b6f22650e662dd30fd32828e60c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Q_AUTOTEST_EXPORT to access it from tests
Task-number: QTBUG-122312
Change-Id: I4f7b93d476ac9cdb4b9d8338680cd681c949b039
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Previously, the sig member was used to indicate successful
construction of the QSignalSpy (incl. successful connection to the
monitored signal), so it was set only after all other initialization
had taken place, preventing it from being marked as const, which would
indicate that accesses to it need not be protected by the mutex.
Now that we have it, we can instead use the d_ptr's value to indicate
success, and mark sig const.
[ChangeLog][QtTest][Important Behavior Changes][QSignalSpy] The
signal() method no longer necessarily returns an empty byte array when
the connection failed. Use the existing isValid() method to determine
whether a given QSignalSpy object listens to a valid signal on a valid
object.
Change-Id: Ia08fe3b383681f3f203cf1a121c0e1ce08ad268b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The TZ backend was instantiating an ICU backend to look up display
names, which entailed locking of the lazy-evaluated ICU
member. Instead, break out how ICU looks up display names into the new
timezone_locale feature's code, so that it can be shared between the
two backends. Linux thus only needs to build one backend.
Task-number: QTBUG-115158
Change-Id: I37ebc9a30f1c0ab6fd32d45dffa9f21355fb868d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We should only use the isoOffsetFormat() version of offset name for
QLocale::C - while other locales may coincide with it, we don't know
so shouldn't just assume. Add a query for whether a locale is the one
used by the backend for the abbreviation in its data() and, when it
is, use that abbreviation as short name. The TZ backend was searching
its transitions for help with the abbreviation; we can do that also in
the base-class, so introduce a data(TimeType) that will search
transition history (if available) for a suitable transition from which
to take the abbreviation (when appropriate).
This shall make displayName() return an empty string in various cases
where it did not, before; this is more honest than returning a string
that's inappropriate for the locale for which it was meant to be
answering.
Task-number: QTBUG-114914
Task-number: QTBUG-115158
Task-number: QTBUG-122448
Change-Id: I523229def63aafcd2009b8406b2c3d13f7c01d9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Builtin testdata packages all test files into resources. This is used
on mobile platforms by default, but it can be useful on other platforms
as well. Add CMake option to force this on other platforms.
Change-Id: I67c82bc735960be53b351ed16526cbfacfbe9bb6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Allow setting the package name directly from CMake properties.
If the package name is not set manually under AndroidManifest.xml
nor build.gradle, then the value set by this property is used.
The value is passed to build.gradle as "namespace" which is the
way to set the package name after AGP 7.4 instead of
AndroidManifest.xml "package" attribute.
Task-number: QTBUG-106907
Change-Id: I94bd73c294d751eabfd96c0a10a6b3ff270d8137
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Since the change to use compose render-to-texture widgets through QRhi,
the RasterGLSurface is not existing anymore and it was used in QNX QPA
to check the support for using backingstore with non-raster windows.
With the use of QRhiBackingstore the QNX QPA now supports
render-to-texture widgets for non-raster surface windows.
Fixes: QTBUG-114938
Task-number: QTBUG-114938
Pick-to: 6.5 6.6 6.7
Change-Id: I01d4a34efe4902a527051776b0460ccf22e5d232
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marianne Yrjänä <marianne.yrjana@qt.io>
Use new term in examples, code comments, error messages and and mime types.
Task-number: QTBUG-122253
Change-Id: I355452d6eb02a7a0ffbb20acf82ddb8ebbfa4837
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
VxWorks doesn't allow mapping file beyond EOF, adjust tests to encompass
that.
Additionally, for testing on VxWorks we use use builtin /tmp which is a
RAM disk (in case of VxWorks-supported imx.6 bord which have 1GB of
RAM), set max size of tested large file to 256MB, 28 bits.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I73cbe112331b7cb95d80bb44b792578a1eb88a07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are some systems that do not support millisecond resolution in
timestamps.
An example of such system is VxWorks.
POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.
VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.
This leads to setFileTimes failing, because the test tries to
save the current datetime as the modification time of a file, but the ms
part is cut off.
Fix the problem by checking if the timestamp read back from the
filesystem contains milliseconds and only check it if it's not zero.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: I8c8a3b1c8e97955f13f059bcebf66d1b5af174fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Similar to what we did for androiddeployqt, port moc's output file
handling from raw FILE* to unique_ptr<FILE> with an fclose() "deleter".
Introduce a openFileForWrite() helper function to abstract away the
difference between Unixoid and Windows FILE handling.
Keep the actual type of the unique_ptr instantiation local to
openFileForWrite() function so that creation and destruction are
defined close together, notwithstanding the occasional need to spell
out the type of the return value in callers.
NB: The moc copy in qtscxml does not contain this code.
Pick-to: 6.7 6.5
Change-Id: I0c9bca0bf3e29c137c02cc563098c5f2e2708cf3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Since commit 91e70f23 introduced separator to uiLanguages(), the system
locale id still does not respect the separator parameter and hardcodes
dash as separator. Fixing this should make the format consistent.
Pick-to: 6.7
Change-Id: I1ab8edfa49117bdc9c4353228e73c2d1e5becffc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
Remove the code that was already commented out by
37a25fce94 for Qt versions ≥ 6.6.
Pick-to: 6.7
Change-Id: I40a3e974430add17b52307781d092bd4f58c0c35
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Now that the private ctor that calls this function is finally
out-of-line, this function need no longer be part of the ABI.
Task-number: QTBUG-123544
Change-Id: Ia4656bf8bfd4d68d6925f93ef150593cd2de6ddf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
POSIX2008 demands that `stat` contains an `st_mtim` field of type `timespec`.
That field holds modification time with a nanosecond resolution.
VxWorks reports _POSIX_VERSION as 200112.
The `stat` struct does not contain `st_mtim`, but rather an `st_mtime` which
holds a `time_t` which contains seconds.
Because of that, when the test creates and modifies a file within one
second, the polling watcher does not detect any changes.
Fix the problem by postponing the watcher by 1s.
Pick-to: 6.7
Task-number: QTBUG-115777
Change-Id: Idfc1d7b2e111967a42c93c0adaffaa7d28ee20a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports local connections using the uri schemes unix+http: or
local+http:.
Fixes: QTBUG-102855
Change-Id: I1f47b74ab42b51d97b3c555cc3afd6ccd272e1ed
Reviewed-by: Mate Barany <mate.barany@qt.io>
Accept tags between 8 and 12 bytes long, and move the check for 12
bytes to where it is needed.
Pick-to: 6.7 6.5
Fixes: QTBUG-125241
Change-Id: I1a46852a9ab60e7c63f8d74de1809d731912ab5b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QDirSortItem contains three implicitly-shared members (two QStrings
and one QFileInfo), so the mere default-initialization of the
QDirSortItem[n] array with which we initialize the QScopedArrayPointer
will take quite some time.
Using QVarLengthArray, OTOH, delays construction until we have the
data to initialize the sort items, saving n default constructor and n
move assignment operator calls, plus the memory allocation for the
case where we have less than 65 elements to sort.
This code precedes the start of the public history, but the
emplacement won't work before 905bc62933
introduced the QDirSortItem ctor, so not picking back further than
that.
Pick-to: 6.7
Change-Id: I262217eabaded2a6aef08b87fc6369812bc8958a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make the method handle all the different possible
paths in a more clean way.
Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: If0ed1b529011b942c0fb67d0ad7a940896e03c85
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This adds new aar target, as we do with apk targets, and an option
to androiddeployqt, --build-aar, which builds an AAR instead of APK.
AndroidManifest.xml of an AAR does not include application or activity
nodes, so we add an AAR specific manifest. Also the plugin type in
build.gradle will be com.android.library when choosing to build an
AAR.
Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: Id33ac236f44038a8411ebfecdcc4e404c976e277
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This allows to later change the plugin type based on the options
provided for the androiddeployqt, such as when building an AAR.
Task-number: QTBUG-116955
Task-number: QTBUG-65567
Change-Id: I6314c8ab9edccbf953ae48543d5a002a9f807581
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
AGP version 7.4 deprecated the use of "package" attribute in the
manifest to specify the unique package name, it's instead been
moved to build.gradle file and set using "namespace" property.
This patch adds support of that to androiddeployqt.
Removing the "package" attribute from the default manifest would
break Qt Creator 13 and below because Qt Creator would fail to
deploy apps without such attribute in the manifest. For that reason
we'll defer removing it until a later version, for example Qt 6.10,
to allow some buffer for a Qt Creator that can handle that to be
adopted by users to reduce breakage.
[ChangeLog][Android] Add support for namespace in build.gradle instead
of the package attribute in the manifest.
Pick-to: 6.7
Task-number: QTBUG-106907
Change-Id: Ib0f0d6a6fbb3b38f605aadfdcc497067daf90297
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Coverity found several FILE* leaks (since fixed) in the code, so make
sure that those can't happen anymore, by using unique_ptr to manage
the pclose() of the openProcess() FILE handles.
Keep the actual type of the unique_ptr instantiation local to
openProcess() so that creation and destruction are defined close
together, notwithstanding the occasional explicit pclose() calls to
capture the error code.
As a drive-by, port a naked popen() to openProcess(), make some
variables const and replace 0 with nullptr.
Pick-to: 6.7 6.5
Coverity-Id: 378357
Coverity-Id: 378442
Change-Id: I2b06b99cba1e4eb5b8963a9c5d2cb398eb25a8b3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
The QWindowsScreenManager's m_displayChangeObserver window would still
be alive at the time ~QWindowsContext would unregister window classes,
resulting in a warning that was hidden by the default verbosity of
QWindowsContext::verbose. The result was that we would get a warning
when then trying to re-register the already registered window class.
We now do what we do for m_powerNotification and m_powerDummyWindow,
which is to destroy them explicitly before unregistering their class.
Fixes: QTBUG-125058
Pick-to: 6.7 6.5
Change-Id: Id3b02237fdd81f734a58a2314a157cad1289a82c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
SVG has special properties for stroke styling. Those are usually
supported by different browsers, because SVG documents can be
used inside HTML files. This kind of styling is already supported
by QPen and all need to be done is some plumbing to save and
retrieve those values in QTextDocument when it is stored as HTML.
Change-Id: I291efab5483ac5e852d117e762e203257c64b47f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>