A QVariant(QString) was not convertible to an enum not registered with
Q_ENUM() which worked fine in Qt5.
The same problem exists for QVariant(enum) to QString.
Fix it by not bailing out when no metatype for the enum was found and
try to convert it to a qlonglong instead (which is then correctly
converted to the enum type).
Fixes: QTBUG-109744
Pick-to: 6.5 6.4
Change-Id: Ie7bb016a860455b69508f0f46b36474c9c294f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Implemented assign() methods for QVarLengthArray to align
with the criteria of std::vector, addressing the previously
missing functionality.
Reference:
https://en.cppreference.com/w/cpp/container/vector/assign
[ChangeLog][QtCore][QVarLengthArray] Added assign().
Fixes: QTBUG-106200
Change-Id: If671069808ff561b0f4c77b6c7f7aca360a0c663
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This fixes a use-after-free in QPropertyDelayedNotifications::notify.
Before this patch, evaluateBindings or a notify from a property index
might have caused the originalBindingData to become reallocated.
However, at that point, we've already restored the original bindingData
in evaluateBindings, so we won't track updates, and thus won't adjust
originalBindingStatus, which will then point to already freed data.
To remedy this, we no longer do the notification with data fetched from
originalBindingData, but instead use the information we have in the
proxyData.
We also need to enure that referenced bindings do not get deleted; for
that we keep the PendingBindingObserverList alive for the whole duration
of the endPropertyUpdateGroup.
As we now have the PendingBindingObserverList, we use it for the
notification logic, and only notify change handlers in
QPropertyDelayedNotifications::notify. That will allow a follow-up
cleanup of QPropertyObserverPointer::notify, and aligns the logic for
grouped updates with the logic for "nornal", non-grouped updates.
Amends f1b1773d0a.
Task-number: QTBUG-110899
Pick-to: 6.5 6.4 6.2
Change-Id: Iae826e620d9614b7df39d86d8a28c48c8a5c4881
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
That use case for the class never materialized, and it was actually
meant for internal use. However, we put it into the public header, so
we cannot remove it (and while undocumented, someone actually used it at
some point, compare e4d62651c2).
Mark it as deprecated instead so that it can be finally be removed in Qt
7.
Change-Id: I058c5831a44610121fbec6eaddebd8b33d4a16c9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
qt_ntfs_permission_lookup is a global, non-atomic variable which
could cause problems in case of multiple threads. Introduce a
new atomic variable to handle permission lookups but instead of
manual incrementation/decrementation, implement a class to manage
the variable.
Since the atomic variable is not directly available to the user,
implement helper functions to increase/decrease/check the status
of the variable.
Task-number: QTBUG-105804
Change-Id: If6cbcdd653c7f50ad9853a5c309e24fdeb520788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Introduce the qt-cmake-create script. The script generates the simple
CMakeLists.txt based on the source files located in the current or
specified directory. The initial version can generate a CMake code for
the following file types:
- .c .cc .cpp .cxx .h .hh .hxx .hpp - generates the qt_add_executable
call with prerequisites.
- .qml .js .mjs - generates the qt_add_qml_module call with
prerequisites.
- .ui - adds the found ui files to the existing executable. Requires
C++ files be present in the directory too.
- .qrc - generates the qt_add_resources call and adds the resources
to the existing executable. Requires C++ files be present in the
directory too.
- .proto - generates qt_add_protobuf call with prerequisites.
The QtInitProject.cmake script contains the 'handle_type' function that
allows extending the script capabilities and establish simple relation
chains between the file types.
Note: The initial implementation doesn't deal with sub-directories, so
all files from sub-directories will be added to and handled in the
top-level CMakeLists.txt file. This can be extended by user request.
Task-number: QTBUG-104388
Change-Id: I5abd9e07da109e867ff95986572ed2bf02ef9d3d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The adaptor is a server-side implementation that must exist anyway and
is called by the QtDBus runtime. We don't want warning on the server
side because it must call those methods to implement the client API.
Since we have the XML introspection saved in a class property anyway,
the runtime won't be inspecting the method tags to see if
Q_DECL_DEPRECATED is there, to add to the XML (which it isn't
generating).
Pick-to: 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17416596135d26ca
Reviewed-by: David Faure <david.faure@kdab.com>
Commit 93dad2bf91 (6.0) changed
Q_DECL_DEPRECATED to use the [[deprecated]] attribute, which must appear
before inline and other keywords.
To keep it next to Q_NOREPLY, I also moved the "inline" into the next
string.
Added missing tests for both.
Pick-to: 6.2 6.4 6.5
Fixes: QTBUG-110979
Change-Id: I9671dee8ceb64aa9b9cafffd1741656e86f40453
Reviewed-by: David Faure <david.faure@kdab.com>
This addresses two different issues:
- Firstly, we were casting the resolved binding data pointer to
QPropertyProxyBindingData, instead of the d_ptr of
QPropertyBindingData. Fix this by introducing a helper function,
and consistently using it to access the proxy data.
- Secondly, we were not resetting the originalBindingData when the
pointed to object was destoyed. Fix that, too.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-110899
Change-Id: I7691c9df5cc26e761f6b0e5f16d152f7f2183208
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
New languages (and one local for each) added with v42
- Haryanvi
- Moksha
- Northern Frisian
- Obolo
- Pijin
- Rajasthani
- Toki Pona
It also appears that Canada has changed its date format. Modify the
relevant test case to reflect this change.
Task-number: QTBUG-110333
Pick-to: 6.5
Change-Id: Ia8975c2866cd54c9e565543d05bacd52f4987909
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- The optional nice-to-haves DebugMarkers, Timestamps, PipelineCache
are not yet implemented (features reported as false, to be
implemented later, although buffer/texture resource name setting
already works as-is, regardless of DebugMarkers).
- Mipmap generation for 3D textures is missing. Won't matter much
given that 3D textures are not used in Qt for anything atm. For
generating mipmaps for 2D (or 2D array) textures, the MiniEngine
compute shader and approach is used. 3D support for the mipmap
generator may be added later. 1D textures / arrays are supported
except for mipmap generation, and so the
OneDimensionalTextureMipmaps feature is reported as false.
- Qt Quick and Qt Quick 3D are expected to be fully functional.
(unforeseen issues are not impossible, of course)
- Uses minimum feature level 11.0 when requesting the device. It is
expected to be functional on resource binding tier 1 hardware even,
although this has not been verified in practice.
- 2 frames in flight with the usual resource buffering
(QRhiBuffer::Dynamic is host visible (UPLOAD) and always mapped and
slotted, other buffers and textures are device local (DEFAULT).
Requests 3 swapchain buffers. Swapchains are mostly like with D3D11
(e.g. FLIP_DISCARD and SCALING_NONE).
- The root signature generation is somewhat limited by the SPIR-V
binding model and that we need to map every binding point using the
nativeResourceBindingMap from the QShader. Thus the root signature
is laid out so each stage has its own set of resources, with shader
register clashes being prevented by setting the visibility to a
given stage.
Sampler handling is somewhat suboptimal but we are tied by the
binding model and existing API design. It is in a fairly special
situation due to the 2048 limit on a shader visible sampler heap, as
opposed to 1000000 for SRVs and UAVS, so the approach we use for
textures (just stage the CPU SRVs on the (per-frame slot) shader
visible heap as they are encountered, effectively treating the heap
as a ring buffer) would quickly lead to having to switch heaps many
times with scenes with many draw calls and sampledTexture/sampler
bindings in the srb.
Whereas static samplers, which would be beautiful, are impossible to
utilize safely since we do not have that concept (i.e. samplers
specified upfront, tied to the graphics/compute pipeline) in the
QRhi API, and an srb used at pipeline creation may change its
associated resources, such as the QRhiSampler reference, by the time
the shader resources are set for the draw call (or another,
compatible srb may get used altogether), so specifying the samplers
at root signature creation time is impossible.
Rather, the current approach is to treat each sampler as a separate
root parameter (per stage) having a descriptor table with a single
entry. The shader visible sampler heap has exactly one instance of
each unique sampler encountered during the lifetime of the QRhi.
- Shader-wise no different from D3D11, works with HLSL/DXBC 5.0
(i.e. existing .qsb files with DXBC in them work as-is). But unlike
D3D11, this one will try to pick 6.7, 6.6, ..., down to 5.0 from the
QShader, in that order.
- Uses D3D12MA for suballocating. As a result it can report vmem
allocation statistics like the Vulkan backend, and it does more
since the DXGI memory usage (incl. implicit resources) is also
reported. This is optional technically, so we also have the option
of going straight with the heavyweight CreateCommittedResource()
instead. That is what we do if the adapter chosen reports it's
software-based or when QT_D3D_NO_SUBALLOC=1 is set.
- PreferSoftwareRenderer (picking the WARP device) and the env.var.
QT_D3D_ADAPTER_INDEX work as with the D3D11 backend.
- It is not unexpected that with large scenes that generate lots of
draw calls with multiple textures/samplers per call the performance
may be slightly below D3D11 (probably mostly due to descriptor
management). Similarly, the reported memory usage will be higher,
which is partly natural due to creating heaps, descriptor pools,
staging areas, etc. upfront. Will need to be evaluated later how
these can be tuned.
Change-Id: I5a42580bb65f391ebceaf81adc6ae673cceacb74
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Failing test functions fastMove, moveAccross, moveInOutOverlapped seem
to be stable in the meanwhile. This patch removes the blacklisting.
Task-number: QTBUG-109036
Pick-to: 6.5
Change-Id: I9a2b015572e4d8a4eac196d3985c052030fd84e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The new name better matches the names of existing functions there.
A comment on the old code noted that such a move should really be
done, so as to correctly share the environment-mutex locking.
In the process, move the (now three) time-related internal functions
from qglobal_p.h to a new qtenvironmentvariables_p.h since that's the
natural place for them given where they're defined (and the fact that
they're for internal use only).
Change-Id: Ib028baebaf31a806a2c0c97caaaba0a466c11cea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We must check that the path is an actual file on the filesystem before
using native APIs. This regression was introduced by commit
047d8f36de.
[ChangeLog][QtCore][QMimeDatabase] Fixed a regression from 6.4.0 that
made certain QMimeDatabase functions that inspected file contents to fail
on Unix systems, if the file was not a native file (e.g., a Qt resource).
Fixes: QTBUG-110707
Pick-to: 6.4 6.5
Change-Id: I570832c9ac8b4e03bde8fffd173f7b4c6b164192
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This test is calling mimeTypeForFileNameAndData(), so it doesn't
actually use the files.
Change-Id: I570832c9ac8b4e03bde8fffd173f77f138ef3434
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
When calling a ctor this way, an object is created in the memory pointed
to by _a[0] using the other arguments for the ctor.
This allows separate allocation and initialization of an object through
the metaobject system.
Fixes: QTBUG-108879
Change-Id: Ifb154373ee42faab281cfb62aa14334980ec6b7d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The QChar::toLatin1() args in:
str.replace(index, len, QChar(after[0]).toLatin1())
s2.replace(ch.toLatin1(), after, cs)
will be converted to QChar, so it's always calling the same QString
overload, I argue that we're not testing QChar implicit conversions
here.
Change-Id: I3962cab2b34684f970638575e6bd15dd1067a8c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fact that read-access is always included makes a bool readWrite
property a little awkward to document and explain. An AccessMode enum
with values ReadOnly and ReadWrite is much easier, and will also lend
itself more easily as a constructor argument than a boolean.
Found in API review.
Pick-to: 6.5
Change-Id: I4f20dbe9f19c7bdb52248a6e544e36d731d5a2ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The aim is to have fewer files including <windows.h>.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id9cc08f54b5daf6d7e317fad27036dc2efaacbb8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is a continuation of commit 5c9d671bfb.
[ChangeLog][QtCore][QStandardPaths] Improved conformance to the
Freedesktop basedir spec by ignoring any relative paths in XDG_*
environment variables.
Fixes: QTBUG-58043
Change-Id: I7c34143ced97d6d3de6ecbf13bccf9e935462d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The test function used only the left button to test mouse event
propagation.
This patch adds the right and middle buttons to the test data.
Task-number: QTBUG-110055
Pick-to: 6.5 6.4
Change-Id: I02683168216843919e889987a8b0e8a0f1592d3a
Reviewed-by: Doris Verria <doris.verria@qt.io>
It causes clashes in CMake Unity (Jumbo) builds.
Change the function to be Q_AUTOTEST_EXPORT'ed helpers.
Pick-to: 6.5
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I2e4032e07e1c39432cae1eb2dfff94be33846c09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the match finds a surrogate pair as the first true Unicode character,
then we need to skip both code units of the pair in order to restart the
search. PCRE2 does not allow us to search for individual UTF-16 code
units.
That actually means that counting "." gives us the count of Unicode
characters.
Fixes: QTBUG-110586
Pick-to: 5.15 6.2 6.4 6.5
Change-Id: I194d0a32c94148f398e6fffd173d5b5be8137e19
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Note: This requires an update to the tst_qtextlayout test, because
the test assumed that the Arabic string would always yield a run
of two glyphs. This was a side effect of how Harfbuzz handled
Qt's test font, which has zero font tables and cannot be used for
shaping. With the Harfbuzz update, the Arabic text here yields a
single cluster instead, which actually makes more sense, so the
test has been made a bit more robust to support both cases.
Pick-to: 6.2 6.5
Task-number: QTBUG-110338
Change-Id: I93d4cf8e3046dc93224e144d4c81d86bef4918d1
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If the string is shared, instead of detaching, create a new string and
copy the characters from this string, replacing the ones matching "before"
with "after", to the new string.
Change-Id: I2c33690230d40f3121e60e242666460559258b7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
TIME_NOSECONDS doesn't really switches to short time format,
just removes the seconds from long time format
Fixes: QTBUG-110627
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ie799958f3942c657f00bc8196588258661ddc1d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It seems that on macOS 13.2 and newer, it requires explicit activation,
just as on the offscreen and minimal platforms.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-110703
Change-Id: I519eec872505ea3673111ae300c2494113f85c36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This reverts commit cebcb7991a.
Reason for revert: We need to enable BIC tests again
Pick-to: 6.5
Change-Id: Ibabe2c50547972d040d933a1027833426b018e81
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Says Clang 15:
tst_qurlquery.cpp:193:11: warning: explicitly moving variable of type 'QUrlQuery' to itself [-Wself-move]
moved = std::move(moved);
~~~~~ ^ ~~~~~
It's amazing how little it takes to throw this warning off guards:
just use an alising reference instead of the same variable. Makes you
wonder whether the time spent on detecting such trivialities in the
compiler is really well spent.
Amends fc8dad2f10.
Pick-to: 6.5
Task-number: QTBUG-109842
Change-Id: I165af2a786aa0ba28b8dcd039a500f3494bc29a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of the System V one. An important difference is that
QSharedMemory does not clean after itself.
Updated the configure summary output to include this information.
Drive-by update to sorting order and I removed cpp-winrt from the
listing because there's a warning at the end if it is not set.
Change-Id: I12a088d1ae424825abd3fffd171e0eadcfd33426
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
If a previous test in the same process or previously leaked a shared
memory or semaphore handle, tests could fail and cascade down. They
could also interfere with one another. So prevent this issue by
assigning a monotonically-increasing identifier per test function or row
tested and improving how we clean up those we did create.
This shows we need the API to explicitly clean up.
Change-Id: I12a088d1ae424825abd3fffd171db61d6b68a411
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native key.
Documentation in a new commit, when the dust settles.
Drive-by updates to the tst_QSharedMemory::attach row names, to fix
grammar and remove spaces and apostrophe.
Change-Id: I12a088d1ae424825abd3fffd171d3025c77f94d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
And deprecate the non-native key support API. Qt 7 may not even store
the old, non-native Qt.
Documentation in a new commit, when the dust settles.
Change-Id: I12a088d1ae424825abd3fffd171d2b549eeed040
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Common to both QSharedMemory and QSystemSemaphore, this will hold the
native key and will replace the concept of non-native key in those
classes.
Change-Id: Id8d5e3999fe94b03acc1fffd171c03197aea6016
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
This removes the second portion of the #if mess of shared code between
QSharedMemory and QSystemSemaphore for SystemV.
Change-Id: Id8d5e3999fe94b03acc1fffd171c073c2873206e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's not a lot of files, but it's actually more in the same dir than
mime/ does right now. I'm about to add two more files, though I'll also
merge a few more later.
Change-Id: Id8d5e3999fe94b03acc1fffd171bfe2ea36a35a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QWidgetTextControlPrivate::mouseReleaseEvent() has early returns
implemented, e.g. when link has been right clicked or no selection
anchor has been found. These early returns, however, still consume
the event.
This leads to events getting lost instead of getting propagated:
As an example, a QLabel with rich text uses QWidgetTextControl. While
it propagates mouse press events back to its parent, mouse release
events get lost. A QLabel with plain text propagates both events
back correctly.
This patch adds QEvent::ignore() to the early return.
Since no test class exists for QWidgetTextControl, it adds a test in
tst_QLabel.
Fixes: QTBUG-110055
Pick-to: 6.5 6.4
Change-Id: I950f8c3f135793b01c59832835bb429db2282169
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The 'WITH OIDS' was deprecated some time ago and removed with
PostgreSQL 12 so we have to adjust our test table creations. Don't know
why it was used in the first place at all.
Pick-to: 6.2 6.4 6.5
Change-Id: I6e18ac01e64368b1dd64e02bcb75fa70e05467a3
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The growBy() function takes the _increment_ of the size(), so needs to
add size() to increment for the call to realloc().
Add a test which hangs (vanilla build) or explodes (valgrind build)
without the fix.
Amends 26b227e128.
Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Pick-to: 6.5 6.4
Fixes: QTBUG-110412
Change-Id: I7ea91342fdcb779825c88013a3f86ba6d90ef530
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>