Some parts of qt6_add_executable() need to take into account certain
target properties, but the target is created within the function.
The caller doesn't get the opportunity to modify those properties
before they are used. This change provides a way to defer those
property-using steps until either the project explicitly calls a
function to finalize the target or the end of the current directory
scope is reached.
Automatic deferral to end of scope is only supported for CMake 3.19+.
With CMake 3.18 or earlier, deferring the finalization step has to be
explicitly requested with the new MANUAL_FINALIZATION keyword. The
caller is then responsible for also calling qt6_finalize_executable()
later. When the keyword is given, automatic finalization is disabled
even when using CMake 3.19+.
Note that while this could be implemented without CMake 3.19 features,
other work relating to qt6_import_qml_plugins() will require it so we
may as well use this method now.
Fixes: QTBUG-88840
Task-number: QTBUG-86669
Pick-to: 6.0
Change-Id: Ic3854672ba18cff5af2ffd7f63596aa3ac492f33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is the most basic way to represent custom transfer functions.
Change-Id: I529fb647ece82c03e85ef77b056d9daf13fe5a61
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
gcc 9.x (but not 10.x) issues a bogus warning when strlen is used on a
string literal; disable the warning for those versions.
Upstream bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91490
Change-Id: I7a2a4d0f6ddafcafcd9fcc62fc41ad5d78e61627
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Otherwise, it would report that lastIndexOf of an empty pattern
in an empty string doesn't exist. Next commit adds extensive autotests;
for now, disable a broken autotest (which already features a comment
about why it's broken).
Change-Id: I9a0e5c0142007f81f5cf93e356c8bd82f00066f7
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These features must not depend on TIFF_FOUND/WrapWebP_FOUND, otherwise
it's impossible to use the bundled libtiff/libwebp.
The default-converted conditions are good enough.
This reverts 82941a3f1b which tried to fix
the qtimageformats build. More work to fix the bundled libwebp is to be
done in the qtimageformats repo.
Change-Id: I5050a6e5f2b3c95e3d5fea660f7fbb630113b7dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is needed for the qtimageformats build with bundled libwebp.
Change-Id: I4d32392d7362f254e9633197497b6d78e12da559
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We must call qt_set_common_target_properties on Bootstrap too, because
that's were FEATURE_static_runtime is handled.
Change-Id: Ie54f7d599d0c3a54b761e6c679983b475e77c17d
Pick-to: 6.0
Fixes: QTBUG-89201
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
There's an assertion. Found by Google fuzz scan of CBOR data.
Pick-to: 6.0 5.15
Change-Id: I55083c2909f64a1f8868fffd164f1ff3af71605b
Reviewed-by: David Faure <david.faure@kdab.com>
Simplifies the code a little bit
Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd164545632be4590a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This reverts commit c730a29260.
Reason for revert: The original change was wrong and caused
androiddeployqt to skip valid QML resource paths.
Additionally, change log output from "file" to "path" when skipping
an import path.
Pick-to: 6.0 5.15
Fixes: QTBUG-89281
Change-Id: Ic338d147a04a03bb1d7acbede11b647ff036922a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Unlike the previous code, we now entrust the compiler to properly
implement thread-safe statics for this code. That was the main reason
why the old code was confusing, trying to determine if the clock IDs
were positive or negative.
Instead, simply make a call to clock_getres(CLOCK_MONOTONIC) and that
will tell us if the monotonic clock is supported.
Change-Id: I0031aa609e714ae983c3fffd1469522a68fa3b66
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There is an off by one in the implementation of count(): a match
must be attempted even at the very end of the string, because
a 0-length match can happen there. While at it, improve
the documentation on the counter-intuitive behavior of count(),
which doesn't merely count how many times a regexp matches
into a string using ordinary global matching.
[ChangeLog][QtCore][QString] Fixed a corner case when using
QString::count(QRegularExpression), causing an empty in the
last position not to be accounted for in the returned result.
Change-Id: I064497839a96979abfbac2d0a96546ce160bbc46
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
test_QFINDTESTDATA is a test which is built and run in the source
tree. It tests usage of relative paths of the Ninja generator, which
only occurs when building in the source tree, so this test cannot
be done outside of the source tree.
Developer's expectation is, however, that an out-of-source build
does not change the source tree. Having "git status" showing
differences after running the tests is irritating. This patch removes
the in-source build files after executing the test.
Change-Id: Ia9fd368c9d54b97a415b63254b45e17bc95ecf45
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
NSTitleBarView in Big Sur will observe the window it is in, but makes
sure to remove these observers in viewWillMoveToWindow, as it should.
To avoid spamming user logs with this warning we remove it.
It was dubious what cases it would have caught anyways, as anyone
trying to KVO observe properties Z of a child object Y of X.Y would
need to track whether X changes its Y between adding and removing
the observer. There are no guarantees that Y is stable, and this
applies to an NSView's window property as well.
Pick-to: 6.0
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QWidget::isTopLevel() is deprecated and can be replaced 1:1 with
isWindow(). Sadly it's was not marked with Q_DECL_DEPRECATED in 5.15
Change-Id: I4508fbde41927f3b82e47a75011179548325029d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
All APIs are static, so there is no "this" pointer.
Pick-to: 6.0
Task-number: QTBUG-89082
Change-Id: I4bfe6c14304d311b903878acd5b4c8169f4065c7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It makes no sense to poll the I/O pipes if we didn't get a start-up
notification yet. And in fact, all waitFor...() functions except
waitForReadyRead() did already explicitly wait for process startup
completion. So fix that one up, and remove the handling of 'Starting'
state from the I/O loops.
Change-Id: Ibb7eb7c768bef3f9b6c54009c73b91775570102c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
When an eager binding triggers a setBinding call, we end up with a
special kind of binding loop:
setBinding() -> evaluate -> notifyObserver
^ |
| /
----------------------------
We now catch set condition, and set the binding status to BindingLoop
(with a distinct description).
Task-number: QTBUG-87153
Task-number: QTBUG-87733
Pick-to: 6.0
Change-Id: I9f9915797d82eab820fc279baceaf89d7e5a3f4a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Replacing QElapsedTimer with QDeadlineTimer simplifies the code in
waiting functions, which also improves readability.
Change-Id: I56aedd356b547b6735ed0985dc81be706e292437
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Due to how regex matching works, lastIndexOf has to be implemented
by matching from the string's beginning until the from position
is reached. This might not be obvious for users, so document that.
Task-number: QTBUG-89050
Pick-to: 5.15 6.0
Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use high-quality scaling to improve rendering in cases
where the pixmap has to be scaled down, such as when
drawing a @2x pixmap at 150%.
Change-Id: I216b03b61dfa2cc2cc8c573e24a576424f6f5d17
Fixes: QTBUG-88982
Pick-to: 6.0 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
KeyValueObserver and RunLoopModeTracker were causing
“Class is implemented in both...” messages when loading
multiple namespaced Qt versions into the same process.
Change-Id: Idbd2229c61cde6fba2c12b35d045390a371dee68
Fixes: QTBUG-89059
Pick-to: 6.0 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
qt-cmake-standalone-test would be looking for the config files under
the target machine install prefix instead of under the staging prefix
on the build host.
Change-Id: I29850af6d8fe502f4944f689ec10539d17ccdcb9
Pick-to: 6.0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use 'separate_arguments' to explicitly split arguments from environment
that form 'COMMAND' for execute_process. Enclose using bracket syntax
arguments, that propagated to wrapper script as pure strings.
Amends f19266bd02
Pick-to: 6.0
Change-Id: I858ddff7efa281f9cecfda656a02e1fd12361758
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Update some wording to align with QString
and QByteArray documentation
Pick-to: 6.0
Task-number: QTBUG-87962
Change-Id: I8162769c1a5fc94fc8920ad0d4d91e95fe74825f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Accidentally changed to pass-by-value while doing that to QDate,
in commit af837734b2
Task-number: QTBUG-86400
Change-Id: I8d2db532f537e5f82a5f3b36e72fcf7fefdd2ee5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 8db0d701e8b1fe00cdd5d71c18afff84de606013)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QLineEdit::QTBUG13520_textNotVisible checks that text is visible
if a QLineEdit is set to Qt::AlignRight. To do that, it writes
some text into a line edit and checks afterwards that the first
character is in the left half of the window. This fails if the window
is larger than twice the length of the text used and thus might fail
in multiple situations where Qt is not in full control over the size
of the windows created, as is the case with tiling window managers.
This patch changes the test to not check for the first character in
the left half of the window, but instead check for the first character
be approximately at the expected position.
Pick-to: 6.0
Change-Id: I18f6de356ea20f4744f3a58cd2b1d76f6a9545a4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Some links were broken. Some stated to be pointing to OpenGL ES 2.0
documentation but pointed to OpenGL ES 3.2 documentation.
Task-number: QTBUG-88533
Pick-to: 6.0
Change-Id: Iad25d8f709b8fa9421039d5cb51cee21093e3191
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Fix warnings
qstring.cpp(9650): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
qstring.cpp(9654): warning C4267: 'argument': conversion from 'size_t' to 'uint', possible loss of data
QDataStream::writeBytes expects an uint as second parameter, not size_t.
This reverts parts of 744e55b85a, where the explicit cast to size_t
was introduced.
Pick-to: 6.0
Change-Id: I2750a6f48fc09730aa9fa21dcc31f82e33b48b8b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The documentation is only a stub, and hasn't been built since Qt 4 times.
qlalr is also first and foremost an internal tool nowadays, so it's very
unlikely we will fully document it.
Change-Id: I68821bf1f9ca3811ec8adda583f0c7326421c6b6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The font role in the header view was not taken into account when the
text for an item should be elided. This leads to a wrongly elided text
esp. visible when the font size is different to the font of QHeaderView.
Fix it by passing the elide mode to the style since only the style knows
the used font (e.g. bold or not bold) and available rect. This is now in
sync with CE_ItemViewItem where the eliding is also done by the style
and not by the item view.
[ChangeLog][QtWidgets][QHeaderView] QStyleOptionHeader got a new member
textElideMode.
Fixes: QTBUG-86426
Change-Id: If6914fe5aaa5d285e6da55d2129f9249d90da3d7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Calling QCoreApplication::tr() without #if QT_CONFIG(translation)
can cause the build to fail if configured without translation.
Changing the call to QCoreApplication::translate() fixes that.
Pick-to: 5.15 6.0
Change-Id: I48f0e1be14fc81360b8268620afc2f6c8f255819
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This was needed, when the mkspecs directory was not present in the
non-prefix build directory. That's not the case anymore.
Pick-to: 6.0
Fixes: QTBUG-89182
Change-Id: I2b04c2d857b0af324e1d7c41ed1934a62275d6f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>