QtCopyFileIfDifferent needs to be both installed and copied to a build
folder as a public CMake helper. Otherwise it's not found when building
tests inside the Qt build tree.
Pick-to: 6.2 6.3
Fixes: QTBUG-101916
Change-Id: I8d081e594fe694f528ebac4c13bbdf6d3b8402b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QMap was a transitive include, apparently; and we have mostly
standardized on specifying the module where each include comes from.
Change-Id: I1a54db879e744120f5b10eb0b16f8ba36cde8300
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
In some situation we want to notify even if the value didn't change.
Task-number: QTBUG-101771
Pick-to: 6.2 6.3
Change-Id: I7d82a9f6e0f7d5eb48065e3f428b814939181ea8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Explicitly move the argument into the return value to silence:
qfuture_impl.h:153:20: warning: local variable 'arg' will be copied
despite being returned by name [-Wreturn-std-move]
return arg;
^~~
[...]
qfuture_impl.h:153:20: note: call 'std::move' explicitly to avoid copying
Change-Id: I49fab7c31efb7d809182c8d56e6a5ed8f05a5622
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Don't use deprecated methods in tests, and don't refer to them in
documentation.
Change-Id: I110480742d9a7b9b0a2e194e3fe610208c1e07da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QTabBar::setTabTextColor's documentation and implementation suggests
that the set color will always be used unless invalid, and that the
foreground role is used otherwise. QTabBar then sets the foregroundRole
palette entry to the specified color before calling the style. The intent
is evidently that the tabTextColor is used no matter the foregroundRole
(which by default is the role that contrasts with the background role).
If the styles always paint the text with WindowText, then the tabTextColor
gets ignored if the foregroundRole is not WindowText (perhaps because
the backgroundRole is set to Base).
Fix this by respecting the widget's foregroundRole when painting the tab
label in the common style (which is the only style that implements
drawControl for CE_TabBarTabLabel). QMacStyle and QStyleSheetStyle
need to be adjusted to prepare the palette consistently with the logic
in QTabBar.
Pick-to: 6.3 6.2
Fixes: QTBUG-101456
Change-Id: I077a2034eebfe3f56cea28917494f4db01e48747
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This has performance benefits when doing comparisons.
The check is only performed at compile time.
Task-number: QTBUG-101014
Change-Id: I55694b045fe5e75d9671d0a3a70c80d998cf98c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some autotest CMakeLists.txts need to know whether the target is webOS.
This change enables that.
Task-number: QTBUG-101933
Pick-to: 6.3
Change-Id: I7b4ebe89622a4ad8bc313e807d9fa50152c96d14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The last 32 timer that could overflow was not used anymore since Qt 5.9,
see also commit aaa3184f8d. This appends commit aaa3184f8d.
Pick-to: 6.3 6.2 5.15
Change-Id: If033a5fa7a58427bcbc643cc19fc73a8dd36a169
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add common function that unifies the check for the DEPFILE support.
Update the check according to the recent CMake version.
Task-number: QTBUG-99354
Change-Id: Ia2abf46fe3a9a3d17ea7a37eaf6c9c6a697c5b84
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Building with Apple clang 13.1.6.13160021 (from command line tools 13.3)
results in
qhash.cpp:754:39: error: passing 16-byte aligned argument to 32-byte
aligned parameter 3 of 'operator()' may result in an unaligned pointer
access [-Werror,-Walign-mismatch]
hash2x32bytes(state0, state1, src, src + 1);
^
Help the compiler with deducing the right type for 'src' and 'srcend'.
Also makes 'src' const explicitly.
Change-Id: Id14a034f0fa4c2a002d9b37729d803a50a0e5e9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QNX raster backend worked on the assumption that child windows were
sharing their parent toplevel window buffer instead, and thus did not
have a buffer of their own. This piece of code dates back from the
BlackBerry days, and I am guessing the motivation was to tackle
mmrenderer/foreign windows.
In fact, not having buffers causes QWindow to malfunction, as
independent buffers are required.
This patch makes sure every QQnxWindow has a backing buffer, as
expected. Foreign widnows shall be dealt with via different means.
Change-Id: I059ac4f8ac684b3577048f874f82b866f21326b1
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Adapt to changes in QWidget::addAction API from 08e4d2db08.
Pick-to: 6.3
Change-Id: If6e05b47de88cf55070238f08b96586b855cc5c1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This is from a fix unrelated to the recent rhi-based composition
work, which means it still had to enclose the block in an ifdef
due to the variables being only present in OpenGL-enabled builds.
Now with the other patches in place, the variables are no longer
conditional, and the similar ifndef QT_NO_OPENGL checks are already
gone pretty much everywhere so the ifdef is not needed here either.
Change-Id: I497c7a4fad7cd7d8fc1a479e7032de3e2cbb3b32
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
And switch to using QLatin1StringView for bootstrap builds and Qt 7.
[ChangeLog][QtCore] Added QLatin1StringView as an alias for
QLatin1String.
Task-number: QTBUG-98434
Change-Id: Iefb860b63eb05ef4755b2e26de265e6e6e4420b3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Instead of using the overly-generic qSwap() monster, use
- qt_ptr_swap() for swapping raw pointers
- member-swap for swapping smart pointers
- std::swap() for swapping scalars
In QtCore, this has proven to give a nice reduction in compile time
for Qt users, cf. b1b0c2970e.
Pick-to: 6.3 6.2
Task-number: QTBUG-97601
Change-Id: I987ff95e8751a22a4f283655d8225dd16de21178
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The underscore symbol prefix is only used on 32 bit x86, not on
other 32 bit architectures such as arm.
Change-Id: Iac82f2d70c8b0c811faa7af5b59805b388b0a00c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This was lost when QtCore, QtGui and QtWidgets were split up. Restored
now via a virtual function on QObjectPrivate.
Chose to return std::string instead of QString or QByteArray because
its SSO is usually sufficient to hold these flag strings.
[ChangeLog][QtCore][QObject] Restored printing of Qt3-style
information from dumpObjectTree().
[ChangeLog][QtWidgets][QWidget] Restored printing of Qt3-style
information from QWidget::dumpObjectTree().
Fixes: QTBUG-101732
Change-Id: I39ff5728ea5f5abbdbf81b5d7e13b8d16b6ee8b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... in preparation for replacing the QString keys in the public API
with QAnyStringView ones.
This removes the "important optimization" that avoids a detach in the
common case where the input is the same as the output of
normalization. But that optimization is beside the point, because it
trades a memory allocation avoided in the library for O(N) allocations
inserted into user code for each call to QSettings::value(), the vast
majority of which are calls with string literals.
With the public interface ported to QAnyStringView in the follow-up
patch, we can then internally optimize memory allocations _in a central
place_ (e.g. by returning std::u16string or QVarLengthArray<QChar> from
normalizeKey() instead of QString). But first we need to get rid of all
the unwarranted allocations in user code.
Change-Id: I45fc83d972c552a220c9c29508001d3f172e1162
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Introduced in commit 705ea62f9e, but
apparently these constructors aren't used anywhere yet.
Change-Id: Ic30914a4448d4bc28974fffd16dc521ab49d3be4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This way, the visitor implementations are directly where they are used,
without the need for a virtual function call. The allocation of the
visitors on the heap was anyway overkill (they could just have been
allocated on the stack where they were used).
Change-Id: Ic41fd285e3a45daaf2e17aa5aeee07e754127a00
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Selection change handlers of the items might call a method that
implicitly recreates the selectedItems QSet, which then invalidates
the iterators of the ranged for loop, resulting in crashes.
Iterate over a copy of the set instead.
Add a test case that crashen without the fix.
Fixes: QTBUG-101651
Pick-to: 6.3 6.2
Change-Id: I6da6f4043fe1906b0186931a37283f635cb5a404
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Add move constructor and move assignment operator.
To allow for the the change to be implemented QTemporaryDir, the
internal d_ptr was modified from a QScopedPointer, which is not movable,
to a raw pointer.
Add member + free swap implementations.
Add tests.
[ChangeLog][QtCore][QTemporaryDir] Enabled move semantics.
Change-Id: I9f196a77c70b4ca0b7f0c06505d00fdd87a9785c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It was added in 375dd7ad34
but never used.
Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-101883
Change-Id: Ibad7e0b1c371bdee63bcdbea0c5280091107408a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
ClipboardManager didn't have any APIs to clear clipboard data before
API level 28.
As a workaround an empty Intent with MIMETYPE_UNKNOWN is created and
inserted into the clipboard for lower API levels.
This makes the QApplication::clipboard()->clear() method work more or
less as expected.
This allows to unblacklist tst_QPlainTextEdit::copyAvailable().
Task-number: QTBUG-87423
Task-number: QTBUG-89402
Pick-to: 6.3 6.2
Change-Id: I454376199cf3b8eed0fa2ecf2f85b87f40892280
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Because setObjectName() now takes a QAnyStringView, passing C string
literals is much more efficient than using QString::fromUtf8().
This patch only deals with setObjectName() as a known property,
probably from a name attribute. If the objectName property is set by a
<property> element (or so I assume), we still emit a
QString::fromUtf8(). Detecting objectName there would be too much
magic.
Besides, I haven't been able to find why sometimes there's a second
setObjectName call right after the first, when in the XML it seems all
kosher (name attribute and objectName <property> agreeing on the
content).
Change-Id: Icf07bad841ac735a9c744bbd955428ba15758089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In a toplevel build, we include qtbase's .cmake.conf twice: Once for
qtbase itself, but already earlier to provide some necessary information
for the toplevel build. We now detect the latter, and skip setting
QT_EXTRA_INTERNAL_TARGET_DEFINES in that case, to ensure that it is only
applied to the qtbase itself
Task-number: QTBUG-101640
Pick-to: 6.2 6.3
Change-Id: I14dbf6110c79331fac38cceb76f669ca329ad33a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Improve the docs for the recently added move operations.
Change-Id: Iae17f5289d30faab4aaaec14a27036f7a03129ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Parent window in sizeLessWindow test was using software pipeline at
least on webOS, causing a QCRITICAL() exit when the test was executed.
Fixes: QTBUG-101869
Pick-to: 6.3
Change-Id: Ie8cc0ea0b6a09729475389be44197e01a45b217f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
When CMake generates compilation rules, it extracts the values from
INTERFACE_INCLUDE_DIRECTORIES and checks if any of the values
are framework paths.
If they are, instead of adding an -I ./lib/My.framework to the
compilation rules, it adds -iframework ./lib or -F ./lib.
The same transformation does not happen when AUTOMOC passes include
paths to moc, nor during a headersclean check. The values there
are passed verbatim, with an -I prepended.
This causes issues when the include file name is the same as the
framework name.
E.g. #include <QtQml> + -I ./lib/QtQml.framework because moc
then ends up silently including the shared library
./lib/QtQml.framework/QtQml
instead of the header
./lib/QtQml.framework/Headers/QtQml
This can lead to a variety of silent issues during moc generation,
because all the definitions of QtQml will be missing.
Unfortunately, there does not seem to be a clean way to fix this in
the build system due to CMake semantics.
See https://gitlab.kitware.com/cmake/cmake/-/issues/23337 for details.
We can mitigate the issue by ensuring that
-I ./lib/QtQml.framework/Headers
comes before
-I ./lib/QtQml.framework
by manipulating the order of values in INTERFACE_INCLUDE_DIRECTORIES.
We might want to consider implementing an additional mitigation in
AUTOMOC, so that it filters out include paths like
-I ./lib/QtQml.framework, thus ensuring that a newer CMake version
will not exhibit the same issue when used with an older Qt.
We could consider doing the same in moc. The advantage of doing it
in moc is that that moc will consider fewer invalid include paths
when searching for headers.
Amends 4b2de41b13
Amends d7efb2a419
Pick-to: 6.2 6.3
Fixes: QTBUG-89545
Fixes: QTBUG-101718
Fixes: QTBUG-101775
Change-Id: Ib2c25b5744bd2b5c9c83813bb04ad88c0179f6ec
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When building Qt we should have warnings of any internal use
of deprecated API, so set it to Qt7.
Also added comments to clarify what the macros do.
Change-Id: Ib47278fed9ab1ec4411ed9f69a9a9c0f811db02d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Unlike the Gui and Widgets pointers, the Core one wasn't needed,
because the only user can inline the variables contents.
Saves one relocation.
Pick-to: 6.3
Change-Id: Ib7535e1a29c5125eea55c66dad6d2d1de72f6bc1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
There is no reason to allow relock() on a locked locker, or unlock()
or an unlocked one, just like we don't allow that on a plain mutex
to begin with. The docs already said that e.g. relock() locks an
_unlocked_ locker.
[ChangeLog][QtCore][QMutexLocker] QMutexLocker allowed relock() and
unlock() on an already closed (resp. open) locker object. These
semantics have always been undocumented and are now unsupported
(in both cases they yield undefined behavior.)
Change-Id: Id5f67beb5dc30d6435dae88a3085fba93ec7d96e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Percent-decoding was previously only present as a static method taking
a QBA parameter; it might as well be an instance method of that
parameter. Change most QBA tests to use it rather the static method.
[ChangeLog][QtCore][QByteArray] percentDecoded() is now available as
an instance method of the byte array to be decoded, equivalent to the
static QByteArray::fromPercentEncoding().
Change-Id: I982101c44bdac5cc4041e85598d52ac101d38fa1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is private and was not called by anything inline, even in 5.15, so
can safely be removed without causing binary incompatibilities, now
that it is no longer used even out-of-line.
Task-number: QTBUG-74286
Change-Id: Iaec3877079746bd9ba7d1a39efbfb2711e7c00a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
After inlining the local static void to which it used to delegate most
of the work, the main loop can access *this and we have no need for
yet another copy of it or the variables to iterate it. We can also
access the result array directly, rather than via a (poorly-named)
pointer.
It turns out that wrapping QBA in QBAV each time we call a lambda on
it costs enough to cause a 50% slowdown, so change the lambda to now
take the const refs we have. (Constructing the views only once is as
good, for reference.)
Change-Id: I81c5996d91415d8a933de714177a89462555ff03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes issue with non working QHash when loading QML plugins in QNX.
Change-Id: I55c9edc58aa27cff694603e6281c980e1fedbeba
Taks-number: QTBUG-101341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>