Qt 5 compatibility details are not relevant for Qt 6.
Instead, make it explicit that the binary builds require
OpenSSL 3.
Pick-to: 6.9
Change-Id: I610254026e35def8f8206cd7c7e3015b2197852c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
Most of QString's API take by signed values, so let the tests match
reality.
Also, as pointed out in the code review, use qsizetype instead of int.
Pick-to: 6.9 6.8 6.5
Change-Id: I03cba8e35d080454506a35a956ad106fd9bb3246
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Don't call style->unpolish()/polish() when the old and new style did not
change which might happen when setting a style sheet as this might
create an infinite loop and the style (re)sets some window attribute.
Bailing out early is not an option here as newStyle might be a nullptr so q->style() will fall back to the application default style.
Pick-to: 6.9
Fixes: QTBUG-133332
Change-Id: Ifa9ee4fdfa64b2768337e2d90b7bbaac5f3fcd70
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
By default, QXmlStreamWriter continues writing even after encountering
an InvalidCharacter, EncodingError or CustomError, which contradicts
expected behavior.
This change introduces property stopWritingOnError with two new
functions: setStopWritingOnError() and stopWritingOnError(), allowing
users to control whether output halts immediately after the first such
error.
[ChangeLog][QtCore][QXmlStreamWriter] Added setStopWritingOnError() and
stopWritingOnError() functions.
Fixes: QTBUG-135861
Change-Id: Ia3ba894fc5bd8c5ff3a548e2585af9d435dec9b2
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The push_back(get()) / Q_UNUSED(release()) was an attempt to separate
the reallocation from the release of the unique_ptr, to avoid memory
leaks in case the reallocation fails inside push_back(), at a time
when unique_ptr::release() had already been called.
Coverity doesn't understand this pattern (and many human readers
won't, either), so change this into an emplace_back(), followed by a
release() into the return value of emplace_back().
Since assignments evaluate right to left, we need to separate these
two actions into separate statements, otherwise we'd end up in the
same situation as described for push_back(release()) above. Add a
comment explaining the problem.
Amends the start of the public history.
Coverity-Id: 425479
Pick-to: 6.9 6.8 6.5
Change-Id: I727aaf791d7b523cd6e7301c49c152b4b6e80dd2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Space-assignment syntax in Groovy DSL has been deprecated.
This is scheduled to be removed in Gradle 10.0.
Pick-to: 6.9
Change-Id: I2029af79b25351337c32db96053548ce5f4f47ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Requested by Ivan Solovev in review.
Pick-to: 6.9 6.8 6.5 5.15
Change-Id: I2f3dee8aad16af6748faa7660e2508e8ecd1709f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This patch updates the clang compiler detection to
allow Clang version 2010 and above to use C++26
macros.
This will allow Qt Android x86_64 build on dev to compile.
Fixes: QTBUG-136968
Pick-to: 6.9
Change-Id: I0988169e6e10357f0e210c3911843e6d04a43c0d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When the additional path did not point to cmake path, the
loop was using non-existing variable.
Pick-to: 6.9 6.8
Change-Id: Ie9599231599c3b90125825414956e345634c85ef
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Grabbing a QQuickWindow (software backend) cleared to something
semi-transparent is not going to be correct otherwise.
Pick-to: 6.9 6.8
Task-number: QTBUG-136755
Change-Id: I59f378b177154af25b1d7bff878435c715e3d114
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When destroying a value created by QMetaType::create(), pass the size
to operator delete. This allows allocators to potentially optimize the
deallocation.
The size passed is always the one used during allocation, iface->size.
As a drive-by, make the operator() function const.
Change-Id: I3224af525671d98327d21033d059f52620fbb837
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Return early if `pos` is out-of-bounds.
Amends 57d91d8029064b592dee8adf819bde676763df28 (also part of this
commit message was borrowed from it).
[ChangeLog][QtCore][Important Behavior Changes][QByteArray] replace()
is now consistent with QString::replace() in its treatment of
out-of-bounds indexes.
Change-Id: Iae8cf795364654fd6438b2a4ed3162925a73cb9e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Processes usually crash due to invalid pointers, but sometimes it's hard
to know if a given value is valid or not just by eyeballing it. So let's
ask GDB to print it.
I don't think LLDB has a way to do it.
Pick-to: 6.9
Change-Id: I35e35bd3b79eeba49192fffd61474054cd089301
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The TID field can be used to differentiate the threads of a process
where the message originates from. This allows to create a timeline
of events when identical messages are created from multiple threads,
or filter out messages from "uninteresting" threads in post-processing.
The file/line/func fields are typically empty for non-debug builds, so
storing these in the journal with dummy values is a waste of CPU time
and storage.
Use sd_journal_sendv instead of sd_journal_send, as that allows to vary
the number of sent fields, and skip the ones without actual information.
It is also slightly more performant, as it avoids the var-arg handling,
sprintf parsing and formatting etc. done by sd_journal_send.
[ChangeLog][QtCore][Logging] Qt now logs the thread id (TID) in journal,
allowing separation of identical messages from multiple threads.
Fixes: QTBUG-120047
Fixes: QTBUG-120048
Change-Id: Iccf3fe708dc4b896161693e13fb9012686bd1871
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QXmlStreamReader(QAnyStringView) constructor, as well as the
QXmlStreamReader::addData(QAnyStringView) method were almost always
converting the UTF-16 and Latin1 data to UTF-8.
This commit tries to avoid unnecessary conversions by storing the
data together with its encoding.
As a result, we now have two decoders:
* a chunkDecoder is used when the encoding of the provided chunk
is supplied along with the data;
* a document-global decoder is used when decoding raw data that
is provided by QBA overloads. It tries to infer the encoding
from the content, or explicitly uses the "encoding" attribute,
if it was provided. This is the pre-existing behavior.
This patch has several corner-cases, mostly related to the fact
that the XML parser tries to read the XML prolog and extract the
encoding from it.
For example, what happens if we pass a QString (UTF-16 encoded)
that has an XML prolog with Latin1 encoding?
const QString data =
u"<? xml encoding=\"iso-8859-1\"?><foo>ÄÖÜ</foo>"_s;
QXmlStreamReader reader;
reader.addData(data);
reader.readNextStartElement();
const QString text = reader.readElementText();
QCOMPARE(text, u"ÄÖÜ"_s);
The data inside the "<foo>" block can be represented by Latin1,
but because we used QString to store it, it's already in UTF-16.
This patch uses UTF-16 chunkDecoder to decode the data, but at
the same time sets the document-global decoder to Latin1, so
that the next raw data will be interpreted as Latin1.
At the same time, if the provided encoding is not recognized,
the document-global decoder is set to UTF-8, for backwards
compatibility.
The code path that uses an underlying QIODevice is unmodified.
The patch does not add any new public APIs, so theoretically can
be cherry-picked to older branches, but I'd prefer to have some
testing on the current dev to make sure that it does not introduce
any regressions.
Fixes: QTBUG-124636
Change-Id: I89bf0cbbcf21d7533d99e56b2522dcced9f675eb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The protocol is used by services that interact with content in the
application on behalf of the user.
So far we have only been able to deal with plain text content,
which resulted in wiping any formatting if the user tried to
use a service to rewrite text in a rich text document.
We now support rich text, by teaching our IM protocol how to
deal with rich text for both reporting of the current text
selection, as well as text insertion (commit).
Unfortunately this doesn't help us for Writing Tools, as in
15.2 it no longer uses the NSServicesMenuRequestor protocol
for insertion if we also implement NSTextInputClient. As
a result we get insertions via insertText:replacementRange:,
which is not prepared for rich text yet.
[ChangeLog][macOS] Text services via the Services menu now
support rich text extraction and insertion.
Task-number: QTBUG-126238
Change-Id: I3d2933d766af8fe29e4f17636f703a257bf389fd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When left-alt + num lock activated + number pressed the number
was inserted in the text. However in this input mode a 4 digit
keycode is used to insert a special character, it is wrong to
insert the individual digits in addition
Fixes: QTBUG-136799
Pick-to: 6.9 6.8
Change-Id: Iebafd1dfe5df1701a87a824ed99a440b122f0c57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
aria-description is more rarely supported than aria-describedby.
So switch to the latter. Create a new container inside the
a11yContainer.
Handle DescriptionChanged to update description in one place only
Task-number: QTBUG-134657
Change-Id: I0d025e5739451e6fab133c2590fd20ea13e2d946
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The supported configurations for running tests on WebAsssembly
are:
* -device-option QT_EMSCRIPTEN_ASYNCIFY=1" [old way]
* -feature-wasm-jspi -feature-wasm-exceptions. [new way]
(Non-asyncify/JSPI configs may work for some tests, especially
non-GUI tests).
In general all tests are now enabled for the wasm build so that
we can run the tests locally, even tests which fail/crash/hang.
Use QT_BUILD_WASM_BATCHED_TESTS to disable tests which should
not run on CI.
Task-number: QTBUG-121822
Change-Id: I20fac091d4d55bd1c947eeeb128a42a382dc11f0
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Use QT_ADDITIONAL_PACKAGES_PREFIX_PATH to look for qmltestrunner.
Needed if module install is using separate staging prefix, like is
done on Yocto builds.
Change-Id: Icfe972a7ab1d0c99518383eab1c885e490cdb4d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Not the default constructed QSurfaceFormat.
If the window had alphaBufferSize set to some value, we want that
value returned from the platformwindow too.
Pick-to: 6.9 6.8
Task-number: QTBUG-136755
Change-Id: Ie0b51b773e0127cac797607a52947bba7ec5eba0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Prior to switching the protocol handler to use QHttp2Connection this
particular issue (see bugreport) was not a problem because the handling
of the IO-device being destroyed was simply to drop any pointer to
it.
QHttp2Stream, however, also has to keep track of the lifetime of
the IO-device, because it needs to abort the stream if the data
it's uploading is destroyed earlier than expected.
Now, since QHttp2Stream might also have other errors come up, we
have to connect to the generic 'errorOccurred' signal from it and
handle whatever issues arise, notifying our users that the request
for some reason cannot be fulfilled.
It's thanks to this part that we were now, in certain cases,
grabbing a stale pointer to the HttpNetworkReply and trying to
call functions on it.
We fix this somewhat indirectly. Because, after a HttpReply is
destroyed, we shouldn't even have any references to it in the
first place. And while it would usually be done as part of
handling the deleted() signal, we actually disconnect from
HttpNetworkReply's signals when we have processed one of the
finished*() functions. But since we were still connected to the stream's
signals we would still try to handle it.
For the http1 protocol handler this was already handled in
QHttpNetworkConnection::removeReply, which the HttpNetworkReply itself
calls at start of destruction. The function will go through any place
that the reply can be referenced and removes it. For http/2 it would
remove it from the list of requests yet to be sent, but not from the
in-progress list. So, we now add a new virtual function to the
AbstractProtocolHandler and specialize it in Http2 to handle exactly
this.
Fixes: QTBUG-136549
Pick-to: 6.9.1 6.9
Change-Id: Ie41863677a3b163f77d10bc3904ca515f6840be3
Reviewed-by: Mate Barany <mate.barany@qt.io>
When entering surfaces, there are some internal states which
should be initialized before update.
When updating states, 'commit' will always be called by needsCommit
without checking flags.
It amends ea32a4946ac517031b70237a831c99e02acc4361,
but surface enable will make needsCommit true when 'enter'.
Moved from 4cc415157d09534aede41829c5c7cf0aac578720
Fixes: QTBUG-135921
Task-number: QTBUG-131983
Change-Id: Id48d64579adc49e4ecb929a892f9dfe742578dad
Reviewed-by: Liang Qi <liang.qi@qt.io>
Some compositor calls send_keymap with WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP
and it repeatedly makes "unknown keymap format" warnings.
Moved from 7f78afdc9657d2393e98a8244bafc076b569d845
Change-Id: I92564fbe579bac5a56f0a842ac1b065330343ab5
Reviewed-by: Liang Qi <liang.qi@qt.io>
The fix for QTBUG-131574 aimed to make it possible to have
multiple fonts in the same family with the same style name.
It, however, inadvertedly made it impossible to have multiple styles
of a font for which the typical font properties did not differ. This
was especially bad for variable fonts.
So in the case of e.g. Roboto Flex, where the "Italic" is not
recognized as an italic font, as it does not set the "ital"
axis, we would overwrite the default subfamily (Regular) with
the Italic, because these would be seen as the same.
This was not intentional, and this patch fixes it so that when
we enter fonts into the database, they have to match both on
style name and properties, otherwise we will register them as
a new font. So identical subfamilies will still be supported.
Pick-to: 6.8 6.9
Fixes: QTBUG-135977
Fixes: QTBUG-135315
Change-Id: I9fd673e7b1061af69cd27049311565a14a145aa4
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Current Windows 11 24H2 build version is 26100. It is assumed Windows 11
25H2 build version will be >26200, this is added to the if-condition so
>25H2 will not be skipped.
Task-number: QTBUG-136628
Task-number: QTBUG-135599
Change-Id: I2d39fd4f9db546f2d7c7db17f6569708255579b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The WS_EX_LAYERED state of a window can be determined on creation, and
the logic to do so should be centralized to QWindowsWindow::setWindowLayered,
so that we don't have divergence.
This fixes an issue where child windows would only support transparency
if they had Qt::FramelessWindowHint set, as the QWindowBackingStore had
a different idea about when to enable WS_EX_LAYERED than QWindowsWindow.
Task-number: QTBUG-122590
Task-number: QTBUG-135859
Pick-to: 6.9 6.8
Change-Id: I453967a5a2ce8974cdd1dbf6e36327e97384c33d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
The hard coded value of 20 used in various QAbstractScrollArea
subclasses does not represent the default behavior on all of
our platforms. On macOS e.g. the native NSScrollView has a
default line scroll value of 10 pixels.
The default value isn't changed for macOS in this patch, as it
has to be done in coordination with other changes to make the
behavior change atomic.
Task-number: QTBUG-130667
Change-Id: I532dbd3e2e946a00f426475adfa851d35a656c1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
An array of 1 or 2 quint64 will be the typical case for ASCII searches.
Change-Id: Ic144352cbb5746c1a353fffd410ffad4168684d1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When enabling a surface(including entering a surface),
set_cursor_rectangle can be missing if the previous value
is the same as the current one.
Moved from 31762ec9b7ee9de84d85cb9be77c9f50a3c8d2e7
Done-by: lilydjwg li
Fixes: QTBUG-135341
Change-Id: I2356a24fcc44a71211b53a3a8c73192895a0de02
Reviewed-by: Liang Qi <liang.qi@qt.io>
When running the user's main() we retarget the stack pointer to a custom
stack, with half the size of the main thread stack (i.e 512K instead of
1MB). During execution of the user's main() we want code that reads
RLIMIT_STACK to be aware of the limited stack space, as this might impact
where memory guards are placed, or how stack overflow is detected, such
as in the V4 QML engine.
Once we return from the user's main() we restore back to the original
stack size limit. We also handle re-entry into app.exec() as well as
app termination, by always making sure RLIMIT_STACK reflects the available
stack space.
Unfortunately we can't do the same for pthread_get_stacksize_np, as once
the main thread has been created we can't tweak the stack size, and the
pthread_get_stacksize_np function does not query the rlimit on iOS, as
it does in some cases on macOS.
Change-Id: I48e92e762e125cff0f7da2003c7a1e796835d391
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It improves readability of the public header significantly.
No functional changes.
Change-Id: I47aee378dddf2c08890d55f8bd617f577eb151bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Also, use a consistent syntax for when the pointer is null.
Fixes: QTBUG-135856
Change-Id: I2f5c80a5650b1be6cc0d70cde7cd1e1c1990df9a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
High contrast themes not only change the colors that native applications
use, but they also make various UI controls look different by adding
additional outlines and other elements.
The following improvements are made in this patch, for users using high
contrast themes:
* Menus have an outline, similar to native applications.
* Selected MenuItem's text and background uses different palette colors,
in order to look more similar to native applications.
* The ComboBox popup menu will have an outline.
* ComboBox will highlight the outline with the accent color when
hovering over it with the mouse.
* MenuBarItem's have an outline, similar to native applications.
Pick-to: 6.9 6.8
Task-number: QTBUG-133595
Fixes: QTBUG-134978
Change-Id: Ic99a76a6986bc987e6b6b9f6a6db4d3efc432b33
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
When a QtWayland client window is initialized or resized, set_window_geometry
may be called multiple times with the same geometry, resulting in redundant
protocol messages to the compositor.
According to: 904a00fc9e8e0547dce3f70b5b205f6c70cfd414
Fixes: QTBUG-136723
Change-Id: I2e993e2b185f30d57503b5a3ce7ab63ba46afec2
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Pass the correct devicePixelRatio to QIcon::pixmap() to make sure the
best pixmap is used for the current dpr.
Pick-to: 6.9
Change-Id: I70014b649457cee819228fa0ead7beb7de944471
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>