I had designed this to be fast for the common, new case of using
QNativeIpcKey objects with a key, a type and maybe in the future we'd
need a flag or two. Turns out that the very first thing I'll need is a
QString, so enable this code path.
This isn't currently exercised because it's not possible to enter it,
yet. It'll come in the next commit.
Change-Id: Idd5e1bb52be047d7b4fffffd17506af2f2de3060
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of pretending to be QUrl and doing a poor job at it. I'm not
going to implement QUrlQuery parsing and I'll need one option now to
store the original, legacy key.
Change-Id: Idd5e1bb52be047d7b4fffffd175068c6a82c039b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Removes extra semicolon from floating point array metadata.
Pick-to: 6.5
Change-Id: If3e8b8097ff0c08c1f1f84cadbe389c7f7a2b1aa
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Let's be more explicit with QPartialOrdering's showcase of its
functionality in the docs and define a possible function-declaration.
Also change all parameter names to lhs and rhs, respectively.
Pick-to: 6.5 6.2 5.15
Change-Id: Ibc5c0b418bff3278e10e415c7f5bfa86227fc066
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Force UTC date-time and use ISO date-time. Also isMonotonic is
always true so the conditionals can be removed.
Change-Id: I7419d62ee7a526c3c6d4b7628d52d45b601e84d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
While std::vector::assign() returns void, std::basic_string::assign()
returns std::basic_string&. In Qt, we want to be consistent between
{QVLA,QList,QString,QByteArray}::assign(), and returning *this is the
more general solution, so do that.
Task-number: QTBUG-106196
Task-number: QTBUG-106200
Change-Id: I2689b4af032ab6fb3f8fbcb4d825d5201ea5abeb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Both the libresolv and the Win32 API operate in 32-bit quantities, so we
could be aliasing with low values. In any case, RFC 1035 limits to 255.
Various objects and parameters in the DNS have size limits. They are
listed below. Some could be easily changed, others are more
fundamental.
labels 63 octets or less
names 255 octets or less
Pick-to: 6.5
Change-Id: I3e3bfef633af4130a03afffd175e8957cd860bef
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This removes the last use of QtPrivate::convertToMilliseconds().
Change-Id: I6f518d59e63249ddbf43fffd1759fee2e00d36f4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
The parent nodes of the leaf ShortcutEditorModelItem nodes
do not have an action item.
Pick-to: 6.5
Change-Id: If9f8554101974a96f95db048b1bd691f3e89a23a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QModelIndex's qHash is really bad. It was retained from Qt 5, but ends
up producing poor results in large hashes.
This can't be fixed in Qt 6.
Task-number: QTBUG-113613
Change-Id: I5f7f427ded124479baa6fffd175f7810e1dc2580
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Simplifies arguments and will allow me to add stateful helper methods.
Change-Id: I3e3bfef633af4130a03afffd175d6044829a96f2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The Unix code doesn't do that.
[ChangeLog][Important Behavior Changes] QDnsLookup on Windows will no
longer append the system's configured domain name for look ups that
contained only a single label (that is, no dots). This matches the Unix
behavior.
Change-Id: I5f7f427ded124479baa6fffd175f69e537cf9ca2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is neater with a simple offset and avoids the potential UB code this
was carrying in:
p += size;
(p < response + responseLength)
It's UB to add to a pointer a size that moves it past the end of its
array. In practice we don't expect this to happen because of
construction (p is always pointing to a heap or auxiliary-thread stack
buffer), but in theory it could happen that said buffer is too close to
the end of the virtual address space and adding `size` causes it to
overflow back to small values.
Change-Id: I5f7f427ded124479baa6fffd175f59939c15c666
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This will be useful for implementing QString::assign(), which
otherwise has the problem that it's d_ptr is based on char16_t, but
it's assign() is supposed to be able to deal with iterators whose
value_type returns QChar.
Task-number: QTBUG-106198
Change-Id: I87882bf749b4e21b7b32391167962d3e6bae9983
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Implemented assign() methods for QList 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][QList] Added assign().
Fixes: QTBUG-106196
Change-Id: I5df8689c020dafde68d2cd7d09c769744fa8f137
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This file, like the majority of qtbase, uses a space between template
and the opening of the template argument list. Add it.
Change-Id: I927cb2b1b9620ae108e913343d995373493e8981
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The network reply is a QIODevice, so the QXmlStreamReader can be set
to read from it directly, which it might potentially do incrementally,
rather than by reading all the data in one go.
In the process, change the set-up of the reply to first check that it
got a valid URL, then check it got a reply, before doing things with
that reply.
Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: I3642e24e0d10721e4a0325b35a94dcb5dfbcd4e6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Whislt the documentation says "base name" there are lots of examples in
the wild of clients using the wrong name here. Writing it explicitly
might help.
Task-number: QTBUG-75521
Pick-to: 6.5
Change-Id: Ic17ca161cf58449e85e25d9b6b8ace44fe14f18a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If an application added an "About" menu action, and then loaded
the qtbase translations, we would try to match the incoming menu
title ("About") against QCoreApplication::translate("QCocoaMenuItem",
"About"), which since qtbase provides translation in the QCocoaMenuItem
context would fail, and we would not detect the menu item role
successfully.
For this to work, the application developer would need to add their
own translations for every menu item, and these translations would
have to match the QCocoaMenuItem translations in qtbase.
By also comparing the menu titles against the untranslated heuristics
we now account for the situation that the app has not translated
its menu items.
If the app does add translations of its menu items these still need
to match the QCocoaMenuItem context translations.
Change-Id: Ic2f019cd42b7e080187f9738840f84b0cec239df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
INTERFACE scope propagates the '-utf-8' flag to the target dependencies.
So if Qt is built using MSVC, but the depending targets use different
compiler this flag will break the compilation.
Guard the flag using genex.
Amends e3cc2487ce63cae42d8054b38fdb54abe8545007
Pick-to: 6.5
Task-number: QTBUG-112737
Change-Id: Ie0576667108820dd61035debfc1fcc030ef3536a
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It adds nothing new to what the trivial and license wizard examples
show, other than a bunch of somewhat messy and outdated code to generate
C++ code files based on the input.
The example is referenced in a few parts of the documentation, but there
are equivalent snippets in the trivial and license wizard examples, so
point at those instead, and add some relevant API usage where needed.
Pick-to: 6.5
Change-Id: If1ff57e775bad28920d9e019aeccae69d1f4d127
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
We don't intend to make QGenericRunnable public API, so prevent people
from using it outside QRunnable::create().
Change-Id: I49f182463ca307aaf6370adfa43bae14b4ce0df8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The workaround also is no longer needed on Windows so it can be removed
completely.
This patch amends 6a28b391f7.
Task-number: QTBUG-113556
Pick-to: 6.5
Change-Id: I69155e54da26acd49faf72816d1439fb3e322de9
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
While the comment behind the else already had the correct value, the
actual check and the comment behind the endif had the wrong one. This
would cause build /headers clean check failures when using older
compilers in C++20/2a mode.
Also, remove the check for __cplusplus: A sufficiently high enough value
of __cpp_lib_chrono already implies __cplusplus > 201703L; the only
thing the check did was to hide the issue on more modern compilers.
Fixes compilation with e.g. gcc 9.3.
Amends bde5eeecaf
Change-Id: I74e761d9dc4048e9abf9cea9ea7e63260ea1111e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Rename it to "Translucent Background", as that's what the example shows
how to do. And modern applications shouldn't use a (binary) mask to
create shaped windows. Instead, set the TranslucentBackground attribute,
don't paint pixels that should be fully transparent and use anti-aliased
or semi-opaque painting for pixels that should be translucent.
Adjust the example and documentation accordingly. Move the statment that
widget masks create coarse visual clipping to the QWidget::setMask
documentation.
Pick-to: 6.5
Change-Id: Id49d854093f2cb471afb178d32723081c7543543
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Update handlers should get informed about accessibility updates even if
the platform's accessibility bridge is not activated. E.g. an analytics
or test framework (like Qt Insights) might want to use the handler to
record relevant events.
While many events are only delivered if QAccessible::isActive returns
true to avoid spending computing time on creating the relevant event
data (e.g. in item views that can be expensive), the most important
events are still delivered. And requiring activation of accessibility
before events can be recorded through a handler has side effects on
performance, which we want to avoid.
Change-Id: I896b873574f6ad2527f755912d4950aa1f898097
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Depending on the build configuration, just using <QScreen> will not find
the header.
Pick-to: 6.5
Fixes: QTBUG-113619
Change-Id: Iaaf6f75ce82f8e32a1b1835614accd898b45824e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It can't unless you really have so many elements that it should
overflow. When growing, we call bucketsForCapacity(), which won't
overflow; when copying/detaching, we allocate the exact same amount of
memory that we've previously allocated, so that has to be good too.
There was nothing wrong with the previous code. The warning was showing
how the compiler had detected a possible overflow and caused a call to
operator new(-1) to force std::bad_alloc to be thrown. Disabling the
warning did not work in LTO mode. So we mimic it: Q_CHECK_PTR will call
qBadAlloc() for us if exceptions are enabled, or qt_check_pointer() if
not but assertions are (if neither are, then we have no means of
reporting the error, so let's just assume that it can't happen).
In function ‘allocateSpans’,
inlined from ‘__ct ’ at qhash.h:581:48,
inlined from ‘detached’ at qhash.h:596:20,
[...]
qhash.h:551:19: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
Commit 1d167b515e is the likely source of
this warning.
Fixes: QTBUG-113335
Pick-to: 6.5
Change-Id: Ieab617d69f3b4b54ab30fffd175bb8d36228209c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Deduplicates code and will allow me to insert some magic.
Pick-to: 6.5
Task-number: QTBUG-113335
Change-Id: Ieab617d69f3b4b54ab30fffd175bb4a2af610ff8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The Qt getting started tutorial is based on the "notepad" example files
in this directory, the gettingStarted/gsQt files are completely unused
and not referenced in documentation.
Pick-to: 6.5
Change-Id: If8caebd2c8359c81f94f72ef40a1cf92a021a83f
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
There's nothing saying the server can't supply those to us, so let's
explicitly skip them. The Windows version already does this because the
windns.h API only supports records of class IN.
Test for this after setNameserverPort() is added.
Pick-to: 6.5
Change-Id: I3e3bfef633af4130a03afffd175e6ddc756c91c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Do this by making the actual child-execution code common between
startProcess() and startDetached(). It does mean we've moved the chdir()
operation from the child to the grandchild process, though.
[ChangeLog][QtCore][QProcess] The modifier function set with
setChildProcessModifier() will now also be executed when the process is
started with startDetached().
Change-Id: Icfe44ecf285a480fafe4fffd174d9aa57dd7dfff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There are two types of stack unwinding that can happen on Unix systems:
C++ exceptions and PThread cancellations (on some systems, like Linux,
PThread cancellations can be caught in catch(...) statements). We call a
variety of PThread cancellation functions from inside the child stub,
like close(). To avoid problems, we disable PThread cancellations
completely before fork() or vfork().
The C++ exception case is simpler, because we can be sure of catching
them with the catch (...) statement and simply transform them into an
error message. This is also testable, which the PThread cancellation
isn't.
The error message isn't ideal because we're string-frozen. I'll improve
it for 6.6.
Pick-to: 6.5
Change-Id: Icfe44ecf285a480fafe4fffd174d97a475c93ff1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We already know the Symbol while parsing, passing a reference to it to
error() makes it simpler to construct the error message.
This fixes an issue where reporting an error about "NONSENSE" in e.g.:
Q_PROPERTY(Foo* foo NONSENSE foo)
would be off-by-one and the error message would say:
path/to/file.h:11:1: error: Parse error at "foo"
instead of 'at "NONSENSE"', which is where the parser actually found an
unexpected attribute.
Fixes: QTBUG-36367
Pick-to: 6.5
Change-Id: Ief70e544af41f7575fbeea9b936fa8197c3ef43d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Refresh screenshot of the example, and remove "Example" word from title.
Pick-to: 6.5
Change-Id: I88c00db5b25536c45622bc580a9da5aaf01610bc
Reviewed-by: Liang Qi <liang.qi@qt.io>
The logic was introduced in 186589abd48b17fdb9b631211008753e2d1701b3
due to Windows supposedly not supporting NoSystemBackground. It's
not clear whether this is still the case, but as this workaround
causes problems on other platforms, such as bringing up the screen
capturing permission dialog on macOS, it should be limited to Windows.
Fixes: QTBUG-113556
Pick-to: 6.5
Change-Id: I197adb5fc177faebc0f2fcd28612e3daa0c22ed5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's returning milliseconds not nanoseconds.
Change-Id: I7dbc3f4043694b6ddf87c6ad9e4d20d3a9af0fd1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Apply optipng -o7 -zm9 -strip all to the image to make it more compact.
Change-Id: Iebfc1f767759b5beac47bd7efa61d1c655163f03
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The Objective-C runtime supports autorelease pools via a language
specific ABI supplement, akin to the “Itanium” generic ABI for C++.
https://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime-support
These interfaces are used by NSAutoreleasePool internally, as well as
inserted by the compiler when using the @autoreleasepool syntax in
Objective-C code.
We have our own wrapper, QMacAutoReleasePool, which allows us to
set up pools in C++ code as well. We now use these lower level
interfaces in the implementation, instead of NSAutoreleasePool,
as this reduces overhead due to not needing to allocate and destroy
a NSAutoreleasePool.
This also opens up the possibility of using Automatic Reference Counting
(ARC) in Qt down the road, as explicit NSAutoreleasePool usage is forbidden
in that mode (while @autoreleasepool is not, and uses the runtime ABI
internally as before).
Change-Id: I06fdb4a24ae4972820f866e0a129a1b355bc8a6b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
There's a few orders of magnitude of overhead using QMacAutoReleasePool
with the tracker enabled, so disable it even for debug builds, unless
explicit auto release pool debugging has been enabled via the environment
variable QT_DARWIN_DEBUG_AUTORELEASEPOOLS.
Pick-to: 6.5
Change-Id: Iec00c703eb21e1914903954cfd02f9f6b1ec2a1f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It adds overhead that is noticeable, especially in tight loops that
rely on an auto-release pool. For example, this improves the QLocale
date to string transformations an order of a magnitude.
Task-number: QTBUG-104785
Pick-to: 6.5
Change-Id: I246dc4e114bd75dd4e3e9e42b061c4c20c94d522
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This is handled by the Objective-C runtime nowadays, where it will
abort if the situation is detected, with the option to break on
objc_autoreleasePoolInvalid to debug the situation.
Pick-to: 6.5
Change-Id: Idf2c4aacc77e41a3deebf270303f4f13cfb0819b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The tutorial is building an elaborate UI around a QMap. It doesn't use
structured data, and it doesn't use model/view (which the dedicated
addressbook example in itemviews does).
It's not a good way of building an application, and the individual APIs
for creating layouts, dialogs, or import/export are explained well
enough in other examples.
Pick-to: 6.5
Change-Id: Iffe47a0f6e04a933edb917c877ae845f50b74b4a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>