When we use GetWindowPlacement, the showCmd parameter will NOT be
SW_HIDE, even if the window is hidden. To prevent showing a hidden window
with SetWindowPlacement, change showCmd if the window is currently hidden.
Amends 21e4116874
Fixes: QTBUG-120415
Pick-to: 6.7
Change-Id: Ib7de369a6d1a530fdeb5ff930097ae06e25761f3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
Commit c4f7dba81e reworked the C++20
QDate constructors and introduced a helper stdSysDaysToJulianDay()
method. However, the QT_POST_CXX17_API_IN_EXPORTED_CLASS was not used
on this new helper function.
As a result, an application which is built with C++20 but uses a
pre-built QtCore that is built with C++17 cannot call QDate constructors
with the new std::chorono types.
An obvious fix is to add the missing macro to the function.
However, we cannot do it directly, because the function is exported
in C++20 builds, and adding the macro will unexport it.
Use QT6_{DECL,CALL}_NEW_OVERLOAD_TAIL macros to add a new overload of
the stdSysDaysToJulianDay() function and mark it as
QT_POST_CXX17_API_IN_EXPORTED_CLASS.
Keep the old function under the QT_VERSION < Qt 7 check to keep BC.
Amends c4f7dba81e.
Fixes: QTBUG-125610
Pick-to: 6.7
Change-Id: I999354da51ee58c3691dbc1c0351be15a18a268b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Drag-dropping and image from for example photoshop didn't work in Qt6
due to a (probably?) copy paste error in the commit
8fa91c75ad
Pick-to: 6.7 6.5
Change-Id: I18dedc09596fe590e915e3aa526131f2d6957d8b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
To allow using Android 14 APIs, this affects only Java
code.
Amends 7b84cd62b0.
Change-Id: Ie79df773499976ba5c847be98ff5d21ee55036e9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
... to avoid coloring mismatch in the generated doc page
of the tool.
Change-Id: I4334d49632c5f119a874e9112d4f13cd4d60e27a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Make classes that don't need to be public as package private
* Remove dead code that serves no purpose now.
* Use lambdas when needed.
* Use @UsedFromNativeCode for methods called from native code.
Change-Id: Ie34eec079366fb3ef048e0f49e03f507cdf90e97
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Recent zstd versions provide the libstd target but not only libzstd_shared
or libzstd_static. Attempt to use it as the WrapZSTD::WrapZSTD counterpart
if the target exists.
Task-number: QTBUG-119469
Change-Id: I47916bfa6f10883d099184a497800277c8026b14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
MSVC compilers that could use both branches ended up
using one branch for some things and another branch for
other things, which didn't mix and caused build failures.
And in the header the #include was inside the Qt namespace
and caused internal build errors during parse.
Amends 9d693dbfb1
Change-Id: I1a77abe1fefd21ea3256f5b2d5a55998257762e5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This will build a multi-abi Android AAR target and verifies
its content using a customer target "verify_aar" by running
zipinfo on the AAR, and comparing its content with a subset
of files that are expected to be present in the package.
Task-number: QTBUG-125483
Change-Id: I19ad132bbad1a75c40b00de173ca09ad56500076
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
clang's fallthrough detection is a little stricter than gcc.
Pick-to: 6.7
Change-Id: If1052275f035a8e8a496cc5a40a21137d18712e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I9e1c26749579d645699a180dac88a00e8653ed65
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Implement partial support for SQL_INT128 datatype which is used for
DECIMAL/NUMERIC columns with a precision > 18. This support is only
available when QT_SUPPORTS_INT128 is defined and for MSVC.
Binding values to columns which need SQL_INT128 is supported but
numbers given as QString will be converted to doubles even if
QSql::HighPrecision is set.
[ChangeLog][SQL][IBASE] Added support for SQL_INT128 datatype.
Task-number: QTBUG-124575
Change-Id: If3fb1eb0f19dc60f000d163f3bf45da7acb08c87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
The old behavior was that calling begin() calls
QDirListingPrivate::advance(), if you call begin() again, it would call
advance() a second time. Not the most intuitive of APIs, but it wasn't
any worse/different from QDirIterator Java-style hasNext()/next() (if
you call next() twice, you advance twice).
Now (c)begin() always starts iterating from the very beginning.
Amends c39a0d1e89
pushDirectory(initialEntryInfo) is now called from beginIterating(), so
don't call it in init().
Not using a std::stack because beginIterating() needs to clear the
iterator containers; for some reason on INTEGRITY something like this
won't work (std::stack doesn't have clear()), complaining about the
constructor being explicit:
nativeIterators = {};
The above works just fine on Linux, so instead of having to spell out
the type... just use std::vector directly (back(), pop_back() and
clear()); this is private API so we have full constrol on how the
vectors are used.
Change-Id: Iaaa849f989b2724bf070730f6273263289dd4d9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
clear() will shed any stored capacity, so that's a waste for the few
people who actually use setNum(). The majority use it from number(), in
which case the clear() is superfluous anyway.
And append() does an extra strlen() check, which we don't need.
This considerably reduces the size of both QByteArray::setNum() in a GCC
LTO build (though the compiler chose to not inline assign()). Moreover,
it now does inline setNum() in the number() functions and in a lot more
places (searching for "qulltoa2" in the disassembly finds it in
QFileSystemEngine::id, for example).
Change-Id: If3345151ddf84c43a4f1fffd17d28f2fc79aa072
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Mårten made this code ready for QByteArray in commits
e5e8e4f59b and
5d0542a356, but never actually made
QByteArray use it.
The simplest change of moving qulltoa2() is sufficient, instead of
moving the template to the header and using it in qbytearray.cpp.
qulltoa2() is called in three places and we don't want the compiler to
inline the function there, so having the function in a separate TU
accomplishes that for us. GCC won't inline it in LTO builds either.
Change-Id: If3345151ddf84c43a4f1fffd17d28682445fbdaa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This prevents e.g. gtk3 platformtheme from hanging.
Pick-to: 6.7
Change-Id: I68593ad54fa5530366d590309c10621e5a48bd22
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
It is available in POSIX.1-2008 but is not worth it. The Linux man page
says it only works up to PATH_MAX anyway and the POSIX documentation
says it's UB if PATH_MAX isn't defined.
This cleans up the source code out of these messy #if and should be
faster, because we avoid a heap allocation (stack is always faster).
Instead, we only relegate the heap version to the case where PATH_MAX
isn't defined (i.e., GNU HURD), because in that case the realpath()
function can't be used with a stack allocation.
Pick-to: 6.7
Change-Id: Ie30a3caf09ef4176bb36fffd17cde1ed5c5dad59
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports using full local server name, as in, named pipes on Windows or path to
socket objects on Unix.
Task-number: QTBUG-102855
Change-Id: Ifc743f5025b3d8d0b558ecffff437881897915d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As the classes do not use the common naming pattern, qdoc suggested
some weird non-existend includes when generating the docs for these
classes.
Explicitly use the \inheaderfile qdoc command to point to a proper
include.
Amends bdd41f491c.
Pick-to: 6.7
Change-Id: Ia721658df38f1006fdc2fa1de1fab7eb381ceb0b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Decided to keep the strong_ordering semantics, as user code is very
much guaranteed to rely on it.
Update the docs.
[ChangeLog][Potentially Source-Incompatible Changes] Made several
operators (relational, QDebug streaming, etc) hidden friends. This may
break code that calls these operators a) with types that require
implicit conversion on the arguments, or b) using member-function
syntax (lhs.operator<(rhs)). The backwards-compatible fix for (a) is
to make at least one of the argument's implicit conversions
explicit. For (b), use infix notation (lhs < rhs).
[ChangeLog][EDITORIAL] Replace all "Potentially Source-Incompatible
Changes" items that mention making operators hidden friends with the
catch-all one from the QPersistentModelIndex change.
Fixes: QTBUG-117660
Change-Id: I8175af5e2cb3c77e7486e972630b9410b3a0896c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Use Milian's asTuple() trick and compareThreeWayMulti().
The pointer variable presents a challenge, because, like op<, op<=>
cannot order unrelated pointer values. Trying to is UB; one is
supposed to use std::less and std::compare_three_way instead, but, you
guessed it, less<tuple<T*>> uses op< to compare the tuples, which, in
turn uses op< on the T* member, causing UB.
[ChangeLog][QtCore][QtCompare] Added a Qt::totally_ordered_wrapper
class whose relational operators use the std ordering types. Use
it to wrap the pointers when doing the comparison to avoid UB.
This allows a smooth migration once we depend on C++20 and class
authors start using lhs.asTuple() <=> rhs.asTuple() or even start
to =default op<=>. The wrapper type is robust against all these
transformations.
Update QModelIndex comparison documentation part.
Task-number: QTBUG-117660
Change-Id: I126b2ebff458800134ed6e774a389d85d76a395f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
I'm not 100% sure we still support WebKit, still leave a note.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I45d4351fd4a106763f26685a5510ed630d752745
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
- CHECK name is too common, it turns out webengine uses it
widely
Amends ef964c254c.
Fixes: QTBUG-125627
Change-Id: I53d90621c09c0f50b7bea910875192bc49095987
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The word "main" here is confusing. use "most recently started" instead.
Fixes: QTBUG-86203
Pick-to: 6.2 6.5 6.7
Change-Id: I3fd4e49204fac8a2f97cdfc57d5f7901fa7b96a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In Qt 5, we had QVector<QRect> QRegion::rects(), but it was
deprecated, because just iterating over the QRegion as a container of
QRects was more efficient (QRegion has a SSO for the case of one
rectangle). With QSpan, we can now bring it back with the same
efficiency as iteration, supporting Qt 5 code that never made the move
away from rects() and new code that wishes to make the conversion into
rectangles more explicit. Re-add the Qt 5 tests, which show that the
function is nearly a drop-in replacement for the Qt 5 rects() (QSpan,
at the time of this commit, doesn't have relational operators, yet).
Also add a QSpan overload of setRects(). The old (ptr, n) function
(now obsoleted, but not deprecated) allowed nullptr + n != 0, which
QSpan doesn't accept, so print a warning in that case. Also, QSpan can
hold more than INT_MAX elements on 64-bit platforms, but QRegion's API
was never ported from int to qsizetype, so we need to catch oversized
spans used as inputs, too.
[ChangeLog][QtGui][QRegion] Added QSpan overload of setRects();
re-added Qt5's rects(), but returning QSpan instead of QVector now.
Fixes: QTBUG-124712
Change-Id: I24570c886cbf77abd8d1f4a3f42ae53c892cd9ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Updated Gradle to 8.7
Updated AGP to 8.4.0
Updated same versions in examples and docs macros
Task-number: QTBUG-113383
Change-Id: Ib2e841f2e57e576c5d689a208a275ce5e9e4b80f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Explain where the colors come from for unset roles, and add a see-also
for isBrushSet.
Pick-to: 6.7 6.5
Change-Id: I35e58e6b0f3ff9e57d9df95879859dd10424dc92
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
There was a stray '}' character in the value.
Amends 8f03bb6bd8
Change-Id: I06f9200b1449bc54ec07ace1336bb97a8f132158
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
They don't work unless #! are the first two bytes of the file.
This is a fix-up for commit d6bc7613ac
Change-Id: I83c976a538a67eef3d40b50674a255d6e2f3205a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
The QFrame::frameRect property is implemented in terms of the QWidget's
contentsMargins, and when the QFrame is resized it recalculates the new
frame rect by reading the contents rect and then setting the widget's
content margins based on the new value.
This conflicts with the implicit inclusion of safe area margins in the
widget's contents rect, as those implicit margins are then persisted as
user-set contents margins. If the safe area margins later change (to 0),
the frame will still reflect the old safe area margins.
We may find a way to untangle this for QFrame, but in the meantime let's
set Qt::WA_ContentsMarginsRespectsSafeArea to false. This avoids the
issue above, and also informs child widgets of the QFrame that they
themselves need to potentially take the safe area margins into account.
Disabling Qt::WA_ContentsMarginsRespectsSafeArea in this manner should
not cause any major behavior changes, as a QFrame is typically part of
a parent widget that does respect the contents margins, and so the frame
will not need to apply any margins of its own once the layout settles
down.
Task-number: QTBUG-125345
Pick-to: 6.7
Change-Id: I936ff5ec9056d05676560cc7659ba31105fdc224
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We were reusing the QRhiMetalInitParams when falling back to OpenGL,
which caused crashes at runtime.
We remove the fallback altogether, as tests or clients that rely on
a specific RHI backingstore backend should do feature-testing before
requesting the specific backend.
Pick-to: 6.7
Change-Id: Iee38348ae06ea118aafcada33a8956ae07bb2228
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Replace some 'native' for loops with range-base for loops or use
qsiztype instead int, mark some helper functions as const.
Change-Id: Ib3f368d6c07bc170ab4ed7cbf28181a226dbeac5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When connecting to an old Firebird instence with a Qt Firebird plugin
linked against Firebird >= 4 the timezone table is not available and
therefore open() will fail. Therefore downgrade the non-existence of
this table to a qCInfo().
Fixes: QTBUG-125467
Change-Id: Iae6d110bc2a48b5b90ffb9cb38f3fba60f30770f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
For std::span, these are free functions in namespace std and therefore
work for anything implicitly convertible to std::span,
incl. QSpan. But they're C++20, QSpan needs something for C++17
builds.
By adding them as hidden friends for QSpan, we allow unqualifid calls
to transparently resolve to the respective overload, ensuring
source-compatibility between std:: and QSpan, and, eventually, a
transition back to std::as_*_bytes.
I considered the alternative to add these functions in the q20
namespace, but q20::as_bytes() would have to take QSpan, and QSpan is
convertible from more types than std::span, so we wouldn't be able to
guarantee that std::as_bytes(t) works for all T t for which
q20::as_bytes(t) works, the fundamental guarantee for namespace qNN.
[ChangeLog][QtCore][QSpan] Added std::span-style as_bytes() and
as_writable_bytes() functions.
Fixes: QTBUG-125489
Change-Id: Ia9a7560c7843e182892608178433be7349c825ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The current docs describes the function name, when, in fact, it should
refer to the argument.
Fixes: QTBUG-123838
Pick-to: 6.7
Change-Id: I36e3bdff66712b8f35ac19859acb65e6fdcdf355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Bump the minimum supported Android API from 23 to 28 i.e.
Android Oreo 9. This is done to focus more and more on
recent versions.
Fixes: QTBUG-125023
Task-number: QTBUG-124890
Change-Id: I4d510b771f413e5711dd44de454211e019c63db6
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
We weren't handling it at all, emscripten already supports it.
Fixes: QTBUG-125222
Pick-to: 6.7
Change-Id: I761eed2c8c034604cd02ba436db68cec4fdeb784
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Move the constexpr fromArray() check from fromArray() to constExpr()
and there add the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, copied from
tst_QByteArrayView.
As a drive-by, add the test for constexpr construction from a char16_t
array, which was missing here (probably because of the GCC bug) while
the corresponding test was already in tst_QByteArrayView.
Amends 107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02(!).
(iow: 6.0, and no, I don't know why it became a problem only now)
Pick-to: 6.7 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Move the constexpr fromArray() check from fromArray() to constExpr()
where there is already the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962.
Amends bbe7570ddcc6fcce707a355b76d2d0024c44ea38(!).
(iow: 6.0, and no, I don't know why it became a problem only now)
Pick-to: 6.7 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e714
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, and
because marking constExpr() as __attribute__((no_sanitize_undefined))
doesn't fix a thing, we opted to disable the triggering parts of
constExpr() from all GCC builds.
This is, of course, unfortunate, since it meaningfully reduces
compile-time coverage in the general case for a rather obscure build
type most won't ever use.
While GCC doesn't give us a predefined macro to check for in the .cpp
file, the cmake build system knows whether we use ubsan, so just
define a macro of our own.
As a drive-by, simplify GCC detection by using Q_CC_GCC_ONLY.
Amends de6a004bc5.
Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-101307
Change-Id: I4be5bd103b9d2386b2ac9fd22e0c34f9c63fee04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace public friend operators operator==(), operator!=(),
operator<(), etc of QUuid and GUID with friend methods
comparesEqual() / compareThreeWay().
Use Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE, because
the (in)equality operators are constexpr.
And then we use helper macros, because the other relational
operators are not constexpr. Cannot make relational operators
constexpr, because it requires to make variant() and isNull() methods
constexpr and QT_CORE_INLINE_SINCE. But the experiments
show that it does not work with adding constexpr to
QT_CORE_INLINE_SINCE.
Put relational operators under !QT_CORE_REMOVED_SINCE(6, 8) to prevent
an ambiguity. On Windows the metatype for QUuid is created
in removed_api.cpp. That leads to an ambiguity, and as a result
the compiler fails to create the equals methods of QMetaTypeInterface.
This, in turn, leads to the failed comparisons.
The usage of !QT_CORE_REMOVED_SINCE(6, 8) solves the problem.
Task-number: QTBUG-120304
Change-Id: I640bdeb8f1f7306ba06b9e4193d008cf2bb6dbfb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This bridges the 2 currently existing attribute types for
the newly added QAccessibleAttributesInterface to UIA.
As described in the AT-SPI bridge implementation already,
QAccessible::Attribute::Level semantically matches
the "aria-level" ARIA attribute, and is mapped to
a "level" property for the UIA_AriaPropertiesPropertyId
as described in the Core Accessibility API Mappings
specification for both, headings [1] and non-headings [2].
Map all attributes set in QAccessible::Attribute::Custom
to that property as well, keeping key and value as they
are.
As described in the UIA Element Properties Identifiers
doc [3] for UIA_AriaPropertiesPropertyId:
> AriaProperties is a collection of Name/Value pairs with
> delimiters of = (equals) and ; (semicolon), for example,
> "checked=true;disabled=false".
In addition, if the level attribute is set for an object
of role heading, report the corresponding
StyleId_Heading for UIA_StyleIdAttributeId, as also
described in the Core Accessibility API Mappings spec [1].
For MingW, add UIA_StyleIdAttributeId and
StyleId_Heading<NUMBER> defines
to qwindowsuiautomation.h, as the MingW headers
apparently don't have them yet (see log of
failed MingW builds without those defines: [4] [5]).
[1] https://www.w3.org/TR/core-aam-1.2/#ariaLevelHeading
[2] https://www.w3.org/TR/core-aam-1.2/#ariaLevel
[3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
[4] 051e46739b/build_1716364832/log.txt.gz
[5] b8e6241678/build_1716370445/log.txt.gz
Fixes: QTBUG-119057
Change-Id: I00b15e95c35c0f31ba34161bc061a3085fc28682
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Focus abstraction in 58d5d4b7c2 was
supposed to be behavior-neutral. QWidgetPrivate::reparentFocusChildren
used QObject::findChildren() to find children inside and outside the
current focus chain. If the re-parented widget had only direct children
and the focus chain was equal to creation-order, the result was
identical to previous behavior.
When the re-parented widget had grandchildren, the behavior differred.
While not being detected by existing tests, it caused a regression.
Re-implement the previous logic: Iterate through the focus chain,
instead of relying on QObject::findChildren() returning a complete and
well-ordered list.
Modify tst_QWidget::focusChainOnReparent() in order to cover the
regression.
This amends 58d5d4b7c2.
Fixes: QTBUG-125257
Change-Id: Iff4f1d0d9b6117c50c8980dfb6eebfc6f6d4a710
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>