Originally we thought that exposing the string literal through the API
would be useful for people that want to know what icon they will get
when using a specific constant. But since the mapping from platform
independent icon name to platform specific icon name is anyway hidden
in the engine implementation, this is no longer useful.
Based on header review comments, simplify this by making the ThemeIcon
list of constants a scoped enum.
If it's really useful for e.g. designers to know which exact icon they
get on a specific platform, then we could, in a future release, add a
static QIcon::themeIconName API that returns the platform specific icon
string for a ThemeIcon constant.
Pick-to: 6.7
Change-Id: I231eb98fefb4ac82d38209b4e1257bb3caadeb08
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This amends commit db9009721a11f482b601a228eb6d0e1658d997b0, which fixed
the *-metatypes.json creation for Makefile generators. User feedback and
the comments in the underlying CMake issue #19005 suggest that all
non-Ninja generators are affected.
Fix this by activating the work-around for all non-Ninja generators.
Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120317
Change-Id: I537ff7be9c658b7053f7f5df6cbced460be43270
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Previously we had four-ish locations where the CMAKE_BUILD_TYPE was
force set.
Twice in QtBuildInternalsExtra.cmake via
qt_internal_force_set_cmake_build_type_conditionally(), depending on
some conditions. This was executed right at
find_package(Qt6 COMPONENTS BuildInternals)
time.
And twice in qt_internal_set_default_build_type() via
qt_build_repo_begin() / qt_prepare_standalone_project() that goes
through QtSetup.cmake. This was executed only if the relevant functions
were called, rather than directly at find_package() time.
The exact logic of which build type ended up being set was very
confusing.
Refactor the code to decide the build type in one single location
when qt_build_repo_begin() / qt_prepare_standalone_project() are
called, rather than directly at find_package() time.
The actual logic when we override the build type depends on many
factors:
- when an explicit CMAKE_BUILD_TYPE is given, honor it, unless it's
a multi-config build
- when it's a multi-config build, don't set any CMAKE_BUILD_TYPE,
use the value of CMAKE_CONFIGURATION_TYPES
- when it's a qtbase build, compute a default unless an explicit value
was given
- the default is Debug if FEATURE_developer_build is ON
- otherwise the default is Release
- when it's a top-level build, only choose a build type for qtbase
- when it's another repo build, use the original build type unless
another was given explicitly (including in a top-level build)
- when it's a standalone tests build
- if qt is multi-config, the tests will be single config, due to
various CI failure reasons, this hasn't changed
- if qt is single config, use the original unless an explicit
value was given
- when it's a single standalone test build, use the original unless
an explicit value was given
To determine when an explicit CMAKE_BUILD_TYPE was given in contrast
to when it was default initialized, we now have one single function
that uses a few heuristics.
The heuristics are needed because we can't reliably determine an
explicitly given 'Debug' build on Windows, because CMake default
initializes to that.
The heuristics include:
- checking whether CMAKE_BUILD_TYPE_INIT is different from
CMAKE_BUILD_TYPE
- checking what the CMAKE_BUILD_TYPE was before the first project()
call when CMake default initializes
- we save the previous value in the qt.toolchain.cmake file
- also in QtAutoDetect during qtbase configuration
- also when building the sqldrivers project
- honoring the value of QT_NO_FORCE_SET_CMAKE_BUILD_TYPE
As a result of the above changes, the build type will be set exactly
zero or one times, for a particular build directory.
Note that the configure script also has some logic on which
CMAKE_BUILD_TYPE / CMAKE_CONFIGURATION_TYPES to pass to CMake
depending on whether -debug / -release / -debug-and-release /
-force-debug-info were passed. But once the values are passed,
CMake will honor them.
Amends 48841c34d2e86a741ec9992b9704c0fa5973503c
Amends 8c912cddebe544010e7da3f87af5b21f3328d7ec
Pick-to: 6.7
Task-number: QTBUG-114958
Task-number: QTBUG-120436
Change-Id: I30db14d1e8e9ff9bd2d7ea1d2256cdeb9493ca0d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use QHttpHeaders::reserve() and QHttpHeaders::isEmpty() instead of
going directly to d->headers. Will help in enabling a nullptr d.
Pick-to: 6.7
Change-Id: Id530f8922b17058ec47530523ed43e08927c3ce3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Before calling a mutable member function (in this case,
QList::reserve()) on one of the Private members, we need to ensure
exclusive ownership of our external state, otherwise we have a Data
Race, because QList::reserve() is not thread-safe (only re-entrant).
Pick-to: 6.7
Change-Id: I1249de9449865cbf6ab519b0d38b3bf4e743f16d
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
According to the documentation for DirectComposition, there are four layers
associated with each window:
1. The contents drawn directly to the window handle (this is the bottommost layer).
2. An optional DirectComposition visual tree.
3. The contents of all child windows, if any.
4. Another optional DirectComposition visual tree (this is the topmost layer).
Creating an IDCompositionTarget as the topmost layer can cause the DirectComposition
content to cover all child windows. This results in child windows becoming invisible,
which is particularly problematic when a user embeds an external window into a
QML-created round rectangle window.
Fixes: QTBUG-121403
Change-Id: I6807ea578276a9518b57afea1c21ca89239deeaf
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Amends 7bbe79fe5f54ed7542d935600036d3c8b401505f, which dropped
QAbstractFileEngine from the public API.
Change-Id: I1877eb32a61c0457d2fa0d4dadf3a98cb78c78ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On RHEL variants, if coreutils-single is installed, ls is a script
that contains:
#!/usr/bin/coreutils --coreutils-prog-shebang=ls
Replace ls with sh, which is supposed to be a binary (or a symlink
to one) everywhere.
Pick-to: 6.7 6.6
Change-Id: I2a43ac9e3332a470951bbf3335f2fdf3ae5c698c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
EventCallback would previously set the on<Event> property
on the event target, which is a singleton property where
there can be only one event handler.
This was OK if the event target was owned by Qt, for
example the canvas element, where we could guarantee
that there was only one event handler.
However this approach fell through when registering
event handlers for global event targets, such as for
window.onLanguageChange, where setting a singleton event
handler may conflict with other users.
Fix this by using the addEventListener() API instead,
which has a variant which takes an event listener object,
which gives us the ability to provide C++ context for
the listener.
The C++ context in this case is a std::function that
contains the event handler callback. Attempts to pass
this type to JavaScript was met with some resistance
from Emscripten, so as a late night hack pass it as
a uintptr_t for now.
Change-Id: I1a547b49af467882ae4f57f8d909ffdff0be6b51
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The code did not handle the path where we didn't have a challenge.
We cannot recover from that so we just have to fail the request.
Amends fe1b668861e8a3ef99e126821fcd3eeaa6044b54
Pick-to: 6.7 6.6 6.6.2 6.5 6.2
Fixes: QTBUG-121515
Change-Id: Ie39a92e7439785a09cad28e8f81599a51de5e27f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This amends c4e550703c2bdc1ee710507b8df9c0c9a118402e. The data version
update was just forgotten when updating to Unicode 15.0.
Pick-to: 6.5 6.6 6.7
Change-Id: Ibb3e9cb81e9bbcb5d4aaf4e4df6231485531c128
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Move static assertions for StandardButton and ButtonRole enums from
header to cpp file.
Use qToUnderlying instead of casting and assert types where possible.
Amends 773f9ab0189bbb439c3066695c947b11a20c484f.
Found in API-Review.
Change-Id: Ia52886e6e33a3b94b327d17d1453e18febe6dd50
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.7 6.6 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We can't have a QTEST_FAILED_ACTION in a try-block if we intend to
allow QTEST_FAILED_ACTION to be a throw statement.
We could, of course, add a whitelisting catch-block for the eventual
TestFailedException, but as of now, the intent it to give users full
control over the definition of QTEST_FAILED_ACTION, and they may have
their own idea of what to throw.
So add a bool variable to record whether no exception was thrown and
use it to drag QTEST_FAILED_ACTION out of the try block. It's ok to be
in catch blocks, no action needed there.
Change-Id: I0b004e43b1db82cd8b5b12f900ed985e58a56807
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The only implemented virtual function, convert(), is inline, so the
vtable and type_info for this class were duplicated in QtGui,
QtWidgets, and any other library that may use this.
Fix by exporting the class and de-inlining convert(). The vtable is
now pinned to qmetatype.cpp.
To prevent MSVC from exporting the trivial static helper function and
possibly rendering its constexpr non-functional, make it a template.
We have two macros for this purpose, with different semantics: The
Q_WEAK_OVERLOAD macro is related to overload set management, not to
keeping function out of the ABI, even though it does that, too. And we
have QT_POST_CXX17_API_IN_EXPORTED_CLASS for ABI control, but this
function is not using post-C++17 features, so since both macros need a
comment, and both don't fit 100%, I used the shorter one.
Task-number: QTBUG-45582
Pick-to: 6.7
Change-Id: I2ce4a7110e09def1a595d717c073df844213611c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
All of the implementations will attempt to perform a filesystem rename,
so the runtime is constant for a single file and possibly for a
directory full of files too.
The macOS and Windows implementations use the OS API so they run with
slightly elevated privileges. That means they don't fail under normal
conditions. The XDG implementation will fail if the file or dir being
trashed resides on a volume which doesn't have an existing trash
location for the current user and one such cannot be created either, or
if the hardlinking/renaming fails (usually with EXDEV).
Pick-to: 6.6 6.7
Change-Id: I76ffba14ece04f24b43efffd17abd67e20196f2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Found in header review.
Pick-to: 6.7
Task-number: QTBUG-119952
Change-Id: If98415f7c5115e8d1875f5f03e399b2919bb250b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We should avoid int-based timeouts nowadays, and prefer std::chrono,
or for timeouts where Forever is a valid state, QDeadlineTimer.
Discovered during API header review.
Pick-to: 6.7
Change-Id: Ia56a67084c7a2f989951755fed5ffc161ed8f79e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Previously we only warned about unsupported cmake generators when
configuring qtbase.
Now we do it for other submodules as well.
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-120602
Change-Id: I9d78db546bcf1238604362b248d41d4516b60b2a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Amends 922d195020d54d7e599d135f6a5e0338100e08f1.
Another infinite recursion was found in the case of populating
font families for cases where the typographical name is different
from the populated name.
The specific font triggering this had two "preferred name" entries
in its name data. This was one for Chinese (PRC) and another for
Chinese (Taiwan). Our GDI backend does not do matching based on
locale, but will prefer the English if available, otherwise it
will just pick the first one. The font in question does not have
the English preferred name.
For this particular font, we would select the Chinese (Taiwan)
name as preferred and since it had not been populated, we would
populate this. However, on Chinese (PRC) locale, Windows would
report this according to the Chinese (PRC) name. We would once
again translate this to Chinese (Taiwan) and go into an infinite
recursion populating it.
The quick fix is to mark the preferred family as populated before
entering the recursion, so that we do not re-populate it a second
time later.
Ideally, the font database would match the preferred name based
on locale, but since we are moving away from the GDI font database
and this is already handled better with the DirectWrite database,
just fixing the recursion is sufficient here.
[ChangeLog][Windows] Fixed an issue where an infinite recursion
could occur if the system had a font with multiple preferred names
in non-English languages.
Pick-to: 5.15 6.2 6.5 6.6 6.7
Fixes: QTBUG-118238
Change-Id: I6ded369f1c908e51c0ba2ad9127538faf07e192e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This follows up on commit d59e539b3a1252aa22783c4fdf1e22b35e5a4292,
doing the same for one of its callers. The mapping from windows IDs to
IANA ones is hard-coded (using CLDR-generated data), so the
(now unchanging) availableWindowsIds() list shall always map to the
same list of IANA IDs.
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-120682
Change-Id: I4d610c24110064236b375cab04cde90bbe07735f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When a QTextLine consists of multiple different scripts and the
fonts had negative bearing, the background for a script item could
overdraw the previous item's text, causing it to look clipped.
This was because the background and text was drawn in a single pass,
and moving the background drawing into its own pre-pass fixes the
issue.
[ChangeLog][QtGui] Fixed an issue where drawing text from different
writing systems in the same line and including a background could
cause parts of the text to be clipped.
Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-121040
Change-Id: I3f79e6d33c09a2a92853bc8752dbe11a0bea2dd0
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
... defaulting to "return".
This allows customizing these actions, incl. to eventually make them
throwing exceptions instead (but that won't work for
QVERIFY_THROWS_EXCEPTION, yet).
Change-Id: I078a4ce48135bda2cf98fce78318a12d757d7aa5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As part of the API review process, in QNetworkRequestFactory:
(set|clear)Headers() were renamed to (set|clear)CommonHeaders(), and
request() was renamed to createRequest().
In addition, QHttpHeaders::has() was renamed to contains().
Update references to the old names in the documentation.
Pick-to: 6.7
Change-Id: Ib79ae99de26be2f3af60787c8b86c3c20cb30067
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
This ends up in out of bounds exception.
Pick-to: 6.7 6.6 6.5 6.6.2
Fixes: QTBUG-120469
Fixes: QTBUG-121008
Change-Id: Id895f311bbb59a3734ecadd0d2472a4018332e16
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QHttpHeaderParser::headers() method is changed to return QHttpHeaders.
QAuthenticatorPrivate::parseHttpResponse() method is changed to work with QHttpHeaders.
QHttpNetworkHeader::header() method is updated to return QHttpHeaders.
Tests are updated.
Task-number: QTBUG-120133
Change-Id: I20a18b509acd7a8b8d93884cff8349519d64293e
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
In md4c 0.4.8, three or more hyphens immediately after text were seen as
a thematic break:
some text
---
But in 0.5.1 it makes the text into an H2 heading (even though this
style of heading would normally have the text fully "underlined" with
hyphens). The CommonMark spec 0.30 says
If a line of dashes that meets the above conditions for being a
thematic break could also be interpreted as the underline of a setext
heading, the interpretation as a setext heading takes precedence.
Thus, for example, this is a setext heading, not a paragraph followed
by a thematic break:
https://spec.commonmark.org/0.30/#example-59
So the new behavior seems more correct. But rather than testing so
deeply, just disambiguate by adding a newline, since Qt may be expected
to work with various versions of md4c, and such minor behavior
differences are not expected to come up often in practice.
QTextMarkdownWriter already adds a newline when writing such markdown.
Pick-to: 6.2 6.5 6.6 6.6.2 6.7
Change-Id: I5a4bf8720d994616274eb8534b4d7085399130fc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.
Task-number: QTBUG-120566
Change-Id: I3803f5246c1814d627a16fa2569d1342b54f6adf
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Add bool QObjectPrivate::moveToThread() which returns the success state
of the attempt to move the object to the new thread. For Qt7 the public
signature of QObject::moveToThread() should be changed to directly
return this value.
[ChangeLog][QtCore][QObject] QObject::moveToThread() now returns a
boolean success state.
Pick-to: 6.7
Change-Id: I8441c8155a76b804b473ab9c45c2be6840ef1677
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.
Task-number: QTBUG-120566
Change-Id: Iaf844eb6f60427dab7fba6ac20b16ffa11f217b8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
There is no need to know if a function was added in Qt4 or earlier so
remove all \since 4.x tags.
Amends 747581e0bf491376e39d56f6ce3ce72f0bb9c434
Change-Id: I470bc785b1e31685caec561dafaec0ba97208d99
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The QT_INSTALL_DOCS is configured with incorrect path sometimes,
especially while configuring qtbase with QT_HOST_PATH,
which also lets you build documentation for the essential modules
such as QtCore, QtGui, and so on. If the default QT_INSTALL_DOCS
path is wrong, a way to override the path would enable building
documentation for the essential modules without having to build
parts of qtbase.
Change-Id: I686e0bc103f9722aa98f3c02d2a5af9e645cc9d9
Done-with: Topi Reinio <topi.reinio@qt.io>
Task-number: QTBUG-121459
Pick-to: 6.7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The current implementation of the API accepts only two
arguments, {target} and {qdocconf}. It passes a few
environment variables to build targets, providing info.
about the Qt version being used. QT_INSTALL_DOCS is one
of these environment variables, and it is the install
path for all the Qt module/addon documentation sets.
QT_INSTALL_DOCS is also the path where the global QDoc
configuration files are available.
If a project uses the qt_internal_add_docs to create
the build targets for the documentation, and the Qt
version used to configure the project is a pkg installed
using the qt-online-installer, the QT_INSTALL_DOCS path
is always wrong. Such projects should either maintain a
CMake setup for documentation or configure and
build Qt from source with the correct QT_INSTALL_DOCS
path, which is then passed to qdoc.
This change enables passing additional indexdir
and other arguments to QDoc, which is useful. For example,
if QDoc cannot find all the cross-module link targets,
you could either pass extra indexdir argument to resolve
the links or turn off the link errors.
For example, if your qdocconf has the following depends
entry to enble linking to other modules:
depends += qtcore qtmultimedia
And the documentation for these modules are not part
of the Qt installation used to build the projects, you
could pass additional index dirs to enable cross-module
linking.
qt_internal_add_docs{target_name qdocconf
INDEX_DIRECTORIES /absolute/path/Qt6/Docs /one/more/Qt6/Docs /another/Qt6/Docs)
Change-Id: Ieac271ddf92990d722602487c41af7f18546d096
Done-with: Topi Reinio <topi.reinio@qt.io>
Task-number: QTBUG-121457
Pick-to: 6.7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
VxWorks does not implement utimensat function
Change-Id: I4c507b76636c912c8b6161292f73e020b29da49b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends 7c5cf8cae054954975a3e262f7fe3cd9897d67f4, which
removed the old function that didn't have any parent parameter
from the API, and added a new one with the parent parameter in
its stead.
However, to make sure that the new function is source compatible
with existing code, the parent parameter must be defaulted to
nullptr (which it already is in the new version of
saveFileContent).
Found during header review.
Pick-to: 6.7
Change-Id: I3e734905be9788ae1b206c7a65328e604667f5e4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Don't export both, the one is just calling the other, so make it inline.
Give parameters descriptive names that match the documentation.
Found in header review.
Pick-to: 6.7
Change-Id: I48b221a4fcc476483fee2842ec0a5cadd628b803
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This reverts commit 09afa7575276d7b500f17671a1ca9ca677767b44.
It broke Qt Designer, which creates QDrag objects without any mime
format. It's likely that user code does the same to support internal
drag'n'drop.
Pick-to: 6.7 6.6 6.6.2 6.5
Task-number: QTBUG-119216
Change-Id: I8b74f2d9b89588cd35bca9ca20973810036a2635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use "Constructs" instead of "Construct" in the initializer_list ctor
docs, because it's what all other ctor docs also use.
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ie84d208b81a062851d95fb336553e8e7c57d4b73
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QtLoader now calls the correct methods when initializing static classes
and retrieving ContextInfo based on the type of the Context (Activity
or Service). This is done to avoid the need for code duplication when
introducing other QtLoader sub classes that deal with the same Context
types, such as the loader for the use case where Qt is used from a
native Android app.
Abstract methods and their implementations in subclasses
aimed at handling this removed as a result.
Pick-to: 6.7
Change-Id: I6cda8e4733594a6a3963cf0fd8217de2fbd408f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
All usages of "cmake" in BLACKLIST files have been removed, and the
keyword can be removed.
Fixes: QTBUG-90545
Change-Id: Ief1d307490b2673a4e1081d277c1e34264eb3107
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>