Mention that flake8 and black can be run via Makefile targets.
Remove the outdated list of flake8 warnings. The Makefile ignores more
warnings/errors, and it doesn't seem to be useful to duplicate this list
here.
Also remove the description of the black tool's arguments for the same
reason.
Change-Id: I941c3ab68b7a3d2477f7fbb5d28603987d0b2cab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For example projects, change the generated project() call to
project(foo VERSION 1.0 LANGUAGES CXX)
Some CMake API derives default values from the project version, and it's
generally advisable to set a project version number.
The version number is read from qmake's VERSION variable. That's
actually a target version number, but it might be the right thing in
most cases. Fall back to version 1.0 if VERSION is not set.
Task-number: QTBUG-96799
Change-Id: Ia0c551cf62621eb217e1dd541dcbd8945f78138e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Unfortunately qmake does not have operator precedence in conditions,
and each sub-expression is simply evaluated left to right.
So c1|c2:c3 is evaluated as (c1|c2):c3 and not c1|(c2:c3). To handle
that in pro2cmake, wrap each condition sub-expression in parentheses.
It's ugly, but there doesn't seem to be another way of handling it,
because SymPy uses Python operator precedence for condition operators,
and it's not possible to change the precendece.
Fixes: QTBUG-78929
Change-Id: I6ab767c4243e3f2d0fea1c36cd004409faba3a53
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change the expected value from None to [], because that's the value of
the if branch. It has been like that since v6.0.0 at least.
Change-Id: Iefdb22a772fc5540ad5a38566be5a7f529e00cb1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If the flavors argument is an empty list, this function becomes the
identity function.
Change-Id: I534df079578ff27d24ae15760ea12464e3961f93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When the android-embedded scope was removed in
7a4b586f4b, the conditions in
test_scope_handling.py were adjusted following the laws of logic.
However, the scope handling code does not follow the same laws.
Effectively revert the part of said commit in test_scope_handling.py but
use "UNKNOWN_PLATFORM" instead of "ANDROID_EMBEDDED".
Change-Id: Ic090451e2a28b50f5be5668503e216cbe3871633
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
...to have a consistent baseline for further improvements.
Change-Id: Iba8e83a7a5cf5ca0cdf509f79e7d2dc2d8f42fec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There are many different wordings for how to use the module across the
module landing pages. The goal here is to provide consistent wording
and code formatting, which can be used across all landing pages.
The style and wording is based on what has been implemented in the
Qt CoAP module landing page.
This is the syntax in a qdoc file:
\include {module-use.qdoc} {<snippet-id>} {<argument1>}
Inside qdocinc, you can then get the value of the argument1 using the
parameter \1.
Task-number: QTBUG-100369
Change-Id: Ib25e509e119008157e69db629eb011e5a9074022
Pick-to: 6.3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
After the update to the CMake based build system the ability to
generate pkgconfig files, like it was with QMake, was lost.
This patch adds pkgconfig generation again via a new internal command
named qt_internal_export_pkg_config_file.
The functionality of this command consists in checking if the target
is internal. Then gets the compile definitions. It performs a search
for dependencies that is somewhat similar to
qt_get_direct_module_dependencies, although it won't recurse down for
more deps. Each dependency is then again, checked if it's internal or
has a public interface. Later these deps get deduplicated and lastly
a pkgconfig file is filled.
The resulting pkgconfig files of many of the Qt6 packages were
validated via invocations of `pkg-config --validate` and
`pkg-config --simulate` commands and later used to build local
projects plus tests that use the pkg-config provided details at
compilation time.
Although it has some limitations, with qt_internal_add_qml_module if
it specifies non-public deps these won't be listed and with non-Qt
requirements, notably in static builds, not being appended to the
PkgConfig file.
Task-number: QTBUG-86080
Change-Id: I0690bb3ca729eec328500f227261db9b7e7628f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QHeaderView creates persistent indexes in
_q_sectionsAboutToBeChanged(), called by the slot connected to
rowsAboutToBeMoved/columnsAboutToBeMoved.
In the case of rows, QAbstractItemModel emits the signal *before*
preparing to update persistent indexes in itemsAboutToBeMoved(),
so it can see the ones newly created by QHeaderView, all is well.
In the case of columns, the emit was done *after* calling
itemsAboutToBeMoved(), so the additional persistent indexes created by
QHeaderView were ignored, and in endMoveRows() we could end up with:
ASSERT failure in QPersistentModelIndex::~QPersistentModelIndex: "persistent model indexes corrupted"
This bug has been there since the very beginning of beginMoveColumns(),
but was undetected because moving columns in a model is pretty rare
(in my case there's a QTransposeProxyModel that turns columns into
rows in the underlying model, and a proxy that handles dropMimeData...)
Pick-to: 6.3 6.2 5.15
Change-Id: I74bad137594019a04c2a19c2abb351ff3065c25a
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
While switching to the 'momentary push in' button type, the old code that
shows button as pressed/checked was removed. Since 'square' buttons
were sharing this part with rounded push buttons, the change broke
checked square buttons. So we retain the old code for this particular
case.
Also, add a minimal baseline test for this scenario: square button,
triggering 'toolbutton' style with/out 'checked' state.
Fixes: QTBUG-100802
Pick-to: 6.3 6.2
Change-Id: Ib7b15b13ead834c7bb2cd36de76ccd5bedb07810
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
At least one OS (QNX) can't dlopen() a library that is still
open for writing elsewhere
Pick-to: 6.2 6.3
Fixes: QTBUG-101020
Change-Id: I84ca709a65fc824ec4b3e3f1ea03704bf1cc0414
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On Android we had 10 failing unit-tests in tst_qaccessibility
One of them was failing because on Android QMdiSubWindow is created
maximized by default, so we need to explicitly call showNormal() on
it before doing all the checks.
Other 9 were failing because we didn't get A11Y events when expected.
This is a bit more tricky.
On Android a11y state is not explicitly set by calling
QPlatformAccessibility::setActive(), there is another flag that is
controller from the Java side. It is set to 'true' only when some
of the a11y services are enabled on the device. The state of this
flag is queried during event processing, so a11y state can be reset
to false while we do QTest::qWait().
This logic is absolutely correct for real applications, but it is
a problem for the test case, because we can't easily enable a11y
services in the CI.
To overcome the issue in unit-tests, re-enable a11y before each test.
A more precise fix will require re-enabling it after every qWait() or
processEvents() call, but the current tests pass with such condition.
Fixes: QTBUG-87674
Pick-to: 6.3 6.2
Change-Id: I6f765bc6d3aaeaa19aba3a64473ea25e9cbdb0f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The sscanf implementation ensured NUL-termination of the input data,
by copying it, and appending NUL.
Since this function is ignoring trailing garbage and reports the
progress back, we could be parsing the first double in a multi-MiB
buffer. And we'd been copying and copying the buffer for every double
scanned. This is clearly not acceptable.
An alternative is to use the max-field-width feature of scanf. By
giving the size of the input data as the maximum field width in the
format string, we stop sscanf from reading more than the available
data.
This code should let everyone's alarm bells go off: a format string
constructed at run-time is really the last thing one should consider,
but I haven't found a way to pass the field width as an argument, so
bite the bullet and go through with it. Copying potentially MiBs of
data is the worse of the two evils.
Pick-to: 6.3
Fixes: QTBUG-101178
Change-Id: Ibaf8142f6b3dab4d5e3631c3cc8cc6699bceb320
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>
This is what native Win32 applications usually do.
Pick-to: 6.3 6.2
Change-Id: I19f1170113b4064f1d683dbd13b7de7d263105f0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Pick-to: 6.3
Change-Id: Ibf03fa82f14cf704267b85348ce11ee2d505ff24
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When FEATUREs getiffaddrs and ipv6ifname are not enabled variables are
unused.
Pick-to: 5.15 6.2 6.3
Change-Id: I0fde7ef3a4ee1e89927e2c5550ac24fba76ba155
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These two pairs already exist as hidden friends inside the two classes.
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d4a3bc633e6d53
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Instead of proxy-testing for the OS, test for the thing you're going to
use. Fixes the build on FreeBSD.
Pick-to: 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d693df09871492
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The content of the window was intended to trigger wrapping.
On Android, the window is larger, so more content is
necessary. This patch adds more content.
Fixes: QTBUG-87401
Pick-to: 6.2 6.3
Change-Id: I33a2fe4560c358f2b0b83523ee4ab26bb5dd2513
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When calling QLabel::setPixmap() with a 1bpp pixmap (i.e. a bitmap), and
that pixmap didn't have a mask set, QLabel would then set the pixmap as
its own mask.
This seems to be a no-op due to how QPixmap::setMask is coded:
void QPixmap::setMask(const QBitmap &mask) {
// ...
if (static_cast<const QPixmap &>(mask).data == data) // trying to selfmask
return;
}
Moreover, in order to convert the pixmap to a QBitmap, the code would just
straight downcast it, triggering UB (if the input to setPixmap wasn't a
QBitmap to begin with).
I *guess* this was done this way to avoid a QBitmap::fromPixmap call,
which however is not expensive at all if the pixmap is already 1bpp,
which QLabel::setPixmap checks explicitly (before attempting to mask the
pixmap). I don't know the historical reasons for the code to have the
shape it had (and the code history is from before open governance).
So get two birds with one stone: remove the no-op and also the UB.
Change-Id: Ibab20492c2945bd1d01f98a18b168fabc56292b0
Pick-to: 6.3 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's in <sys/random.h>. The header exists on Linux and on FreeBSD and
declares getrandom(), which we don't use, so it's harmless.
Pick-to: 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d69005ab59df3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Since it's a private header, qglobal_p.h makes sense.
Change-Id: Ibf4acec0f166495998f7fffd16d5d8a38ee8f1f8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
See script in qtbase/util/includeprivate for the rules.
Since these files are being touched anyway, I also ran the
updatecopyright.pl script too.
Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The stored layout direction used to get changed during initialization
to what was auto-detected based on the translation. Changing the
translation then overwrote that stored value, even if an explicit call
to setLayoutDirection was made by the application.
Calling QGuiApplication::setLayoutDirection(Auto) has so far been a
no-op.
Change this logic so that the stored layout direction continues to be
LayoutDirectionAuto also if it's set based on auto-detection, and only
overwrite it when explicitly called with a non-Auto value. This way,
applications can set a layout direction that stays unchanged even when
translators are installed.
Add test coverage that uses a QTranslator.
In practice, this is not a change of behavior, unless applications called
setLayoutDirection(Auto) (which is no longer a no-op), or called
setLayoutDirection() and then installed a translator and expected the
translator's layout direction to come into effect in spite of the explicit
setting.
[ChangeLog][Gui][QGuiApplication] Calling setLayoutDirection with a non-
auto value now disables the auto-detection based on installed
translators. Applications that explicitly set a layout direction and also
want translators installed afterwards to take effect should reset the
layout direction to Auto, which is now no longer a no-op.
Fixes: QTBUG-100632
Pick-to: 6.3
Change-Id: I1fdcebd43a9b1b468ff95bf15f53f441bb214e08
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Introduce a new -no-prefix option that can be used to build Qt without
having to install it.
Currently, -no-prefix is already implied by -developer-build, but
-developer-build also implies -warnings-are-errors and
-feature-private-tests, which not everyone might want to use.
Some Qt builders likely use -developer-build for the no-prefix
behavior, hence we introduce a standalone -no-prefix option to offer
a nicer user experience without -Werror and friends.
Previously it was possible to achieve the same by specifying
-prefix $PWD, but that relies on $PWD expanding property in the used
shell.
The new -no-prefix doesn't depend on the type of the shell and
is shorter to type.
Internally this gets passed by configure as -DINPUT_no_prefix=yes to
CMake, and transformed into a -DQT_FEATURE_no_prefix=ON feature.
The feature also gets automatically auto-detected to ON if
developer-build is set, -prefix is either unset or $PWD.
CMake code should still query QT_WILL_INSTALL to decide whether
files need to be installed or not.
As a drive-by, we now also export QT_FEATURE_developer_build to
be available for querying during configuration of other repos
(previously it was only possible to query FEATURE_developer_build).
Pick-to: 6.2 6.3
Change-Id: Iaa6c8d8ae2b736282e9949d2a5d7f412e290a253
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This program was replaced by psl-make-dafsa.
Task-number: QTBUG-95889
Change-Id: If52d92734ad362364c6250473281886e1ea5545d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This saves 91kiB of text size and makes it easier to use
a locally installed database when available.
[ChangeLog][Third-Party Code] Moved attribution of
The Public Suffix List from Qt Core to Qt Network.
[ChangeLog][Third-Party Code] Added attribution of new libpsl
library to Qt Network. libpsl is available under
the BSD 3-Clause "New" or "Revised" License.
Task-number: QTBUG-95889
Change-Id: Ibd37c7a94fdf235e75d96fec20d427fb5c2bd2a4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This format will be changed by the next commit. Also it is an
implimentation detail that can be changed at any time.
Task-number: QTBUG-95889
Change-Id: I00b1133078f1035e03e2cd6fae28192de54d2154
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The compile-time check for /permissive- only works from Visual Studio
16.7 onwards. Older compiler versions will fail the check, even if
/permissive- is passed.
Let's rather bail out with a more explicit error in this case.
[ChangeLog][Windows] The minimum MSVC version was raised to
Visual Studio 2019 version 16.7 (VC++ version 14.27). Trying to use
an older version will now result in a compile time error.
Pick-to: 6.3
Task-number: QTBUG-101049
Change-Id: Ibfa2930e1186eb63d8fed69efe161a9d79ccb1be
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Combine two flag-like enumerations using a bitwise OR, not a plus.
Cleanup for the follow-up commits.
Change-Id: Iceb05bf5ea0635d623ba9a7d145606e80b7f21f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Hiding a row in a form layout is inconvenient to do as access to the
widgets in each row is cumbersome. In addition, a row might include a
layout for the label or the field column, and we can't hide layouts and
instead need to navigate to the widgets inside the layout. And even if
an application developer does all that, the spacing calculation doesn't
ignore hidden rows.
Add setRowVisible and isRowVisible APIs with the usual overloads.
Implement the logic to traverse a layout item to its contained widgets,
so that they are explicitly hidden when a row is hidden, and skip hidden
rows in the spacing calculation.
[ChangeLog][Widgets][QFormLayout] New APIs setRowVisible and isRowVisible
to hide and show rows in a form layout.
Fixes: QTBUG-6864
Change-Id: I6af98409802f331c4523e91d7dac8a97762c579d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
For cross-compiled conan packages we need conan to export QT_HOST_PATH
as an environment variable. The Qt build now picks up this environment
variable if no QT_HOST_PATH cache variable was specified.
Pick-to: 6.2 6.3
Change-Id: I0c3e15e82842061d5db81949ffcc1c240f6ed6a4
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
All variables that are used in qt.toolchain.cmake should be recorded in
__qt_toolchain_used_variables. This is mostly done for consistency and
to avoid surprises in future configure checks.
Pick-to: 6.2 6.3
Change-Id: I1ae18c5dfe9677c5f46a102e434e32187cb0d703
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The test is not only flaky on Windows 10 but also on Windows 11.
Pick-to: 6.2 6.3
Task-number: QTBUG-100412
Change-Id: I27e8179dafd4743c3eaf2c0dd8b70b804612c7c2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
tst_qtextdocument was disabled because it crashed.
It does not any more.
Task-number: QTBUG-87671
Pick-to: 6.2 6.3
Change-Id: Ie1bd75c21e481c2ecb8607c04ce9370fc6d7b00e
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Pekka Gehör <pekka.gehor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
tst_qgraphicsview was disabled because it crashed.
It does not any more.
Task-number: QTBUG-87671
Task-number: QTBUG-87397
Pick-to: 6.2 6.3
Change-Id: Ib604274d098c271e22b010e6cb822fdf9553df1c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
There was a test for Qt4 compatibility in tst_qheaderview.
We don't run it since Qt 6.
This patch removes the unused code.
Change-Id: I751829ac5a142e79379e81e9e739107544cf7406
Reviewed-by: Arnaud Bienner <arnaud.bienner@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Currently test relies solely for external test server. This makes it
not possible to run test successfully with environment where docker is
used.
Pick-to: 6.2 6.3
Change-Id: Ie2974a0e2fec9b16d9d023730b76fa2a32f77e65
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
As QNX claims to support abstract Unix-domain sockets, its getsockname
always returns for socket that has not been bound to local name
address_len of sun_path as maximum length (106) even when it does not
contain valid address.
https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.lib_ref/topic/u/unix_proto.html
Pick-to: 6.2 6.3
Change-Id: I0f0f5c05611c8db6af35377dde16450f58c83c56
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If qt6_android_add_apk_target is called manually in user project this
might cause duplicated targets issue when calling the finalizer(either
manually or in a defer call).
Skip the qt6_android_add_apk_target body if target is already
registered in _qt_apk_targets list.
Pick-to: 6.3
Change-Id: I36ef569227e0c5f0f077446bbe5d7e8d8fc0bfc6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Fix a typo from da1720485e,
where mm_cvtsz_si128 was undefined when building for a 32 bit
target. The code would make it seem this was a typo, with the
listing of defines didn't match between 32 and 64 bit.
Change-Id: Ica24d88e7f71ecd1d24ed990773711f9105f3ec8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Only clearCache() is used by tests. Ubsan build also passes.
Makes it easier to reason about the mutex handling in the class' ctor
and dtor.
Change-Id: I917991cfecda71dcd0a5bea7705a7f7f3a3e75b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>