Commit Graph

51154 Commits

Author SHA1 Message Date
Qt CI Bot
0c6b0fdcc3 Merge integration refs/builds/qtci/dev/1616682375 2021-03-25 18:47:45 +00:00
Qt CI Bot
ee200cc258 Merge integration refs/builds/qtci/dev/1616678767 2021-03-25 17:47:14 +00:00
Qt CI Bot
2220ddddf0 Merge integration refs/builds/qtci/dev/1616675134 2021-03-25 16:40:07 +00:00
Fabian Kosmale
cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.

To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.

One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
Joerg Bornemann
9f444ce533 Add a way to install versioned hard-links for tools
Add the option argument INSTALL_VERSIONED_LINK to qt_internal_add_tool
and qt_internal_add_app. For tools/apps with this argument we create an
install rule that creates a versioned hard link. For example, for
bin/qmake we create bin/qmake6.

Note that this only applies to prefix builds.

Apply this argument to qmake.
The qt_internal_add_app change is necessary for qtdiag and in qttools.

Task-number: QTBUG-89170
Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c19d957f45fa27f61b5ecc566f8dbc19f12a44c3)
2021-03-25 16:31:39 +01:00
Qt CI Bot
9145650302 Merge integration refs/builds/qtci/dev/1616671507 2021-03-25 15:25:08 +00:00
Andreas Buhr
96796f0619 Add example to QObjectBindableProperty change handler docs
QObjectBindableProperty has a callback, which is called whenever
the value changes. This patch adds an example showing this.

Task-number: QTBUG-90511
Change-Id: I56c0bce15af8121159630b5c0922c287c15b7618
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-25 14:52:37 +01:00
Qt CI Bot
14eeb52085 Merge integration refs/builds/qtci/dev/1616667899 2021-03-25 13:40:30 +00:00
Andrey Butirsky
40193c2b69 Fix no mapping for SysReq key
XKB_KEY_Sys_Req keysym is currently unmapped to any Qt::Key.
Implication of this it is uncapable to participate in any keyboard
shortcuts.
This patch adds the missing mapping.

Detected by testXkb KWin unit test

Fixes: QTBUG-92087
Pick-to: 5.15 6.0 6.1
Change-Id: I2440c218e265c5636fc1d2703f14d8bfe033967e
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2021-03-25 16:07:58 +03:00
Qt CI Bot
2d4699501b Merge integration refs/builds/qtci/dev/1616666973 2021-03-25 13:07:20 +00:00
Alexandru Croitor
59c3be7117 CMake: Fix qconfig.cpp embedded prefix in the CI
In the CI on a windows we configure Qt with the following prefix
-DCMAKE_INSTALL_PREFIX:PATH=\Users\qt\work\install

Note the lack of the drive letter.
This is intentional, so that we can abuse CMake's DESTDIR installation
mechanism to install into a custom path.

This causes trouble for static Qt builds in the CI.

Specifically when there is no qt.conf file next to qmake, qmake -query
will report a
  QT_INSTALL_PREFIX:/Users/qt/work/install
and ultimately qmake will fail to locate the module .pri files in such
a path, showing errors like:
  Project ERROR: Unknown module(s) in QT: core gui?

If a qt.conf is placed next to qmake (even an empty one), a differenct
code path is used in qmake to resolve the prefix, which returns a path
with a drive letter.

In a shared build, because the 'relocatable' feature is enabled by
default, a different code path is used and thus the prefix is
also successfully resolved.

So the problem is specific to static Windows Qt builds that have no
qt.conf file next to qmake.

This is the exact scenario that we encounter when running static
Qt tests (tst_qmake in particular).

To circumvent the issue, prepend a drive letter to the prefix
hardcoded into qconfig.cpp. Do that with
get_filename_component(REALPATH) which apparently resolves
to a fully qualified path.

Pick-to: 6.1
Task-number: QTBUG-87580
Change-Id: I17c885f29bfdee45bec1d6aac7c3b26723e761a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-25 12:59:20 +01:00
Alexandru Croitor
04df85bbec CMake: Get rid of the Core_qobject static library
The Core_qobject target was problematic for a few reasons.

In the very beginning, Core_qobject was an OBJECT library, explaining
its existence with the following comment "requires to spill internals
into users". The object library contained qobject.cpp and
qproperty.cpp and their manually generated moc files.
It was was a dependency of Core.

Afterwards it got converted into a static library instead, presumably
to circumvent some issues with metatype generation.

Unfortunately making it a static library was wrong, because it leads
to linker failures (undefined symbols) in a static Qt build when
trying to link a project that uses only QtCore.
Both Core and Core_qobject refer to each other's symbols, and
whichever library came first on the link line, many of its symbols
were discarded by the linker.

Transforming Core_qobject back into an object library could be an
option, but that leads to trouble with creating proper prl files
(our infrastructure doesn't quite support that for object libraries
yet).
Furthermore, there was some internal discussion and concern
about how to merge the two metatype json file lists (Core and
Core_qobject) into a single file.

Instead of using an object library, move qobject.cpp and qproperty.cpp
to be directly a part of Core again and remove the Core_qobject
target.

In order to do that, we have to circumvent some issues with
AUTOMOC.

First, we have to disable AUTOMOC for qobject.cpp and its headers.

qobject.cpp contains Q_GADGET, Q_NAMESPACE, etc keywords
in its doc comments. That confuses AUTOMOC, because it expects a
qobject.moc file which is not included by qobject.cpp.
See e2ff9e3b99 for some details
on the Q_GADGET + AUTOMOC issue.

We still need to run moc on on qobject.h and compile moc_qobject.cpp,
so we manually run moc on the header file. Because qobject.cpp
directly includes moc_qobject.cpp, we need to adjust the header
include path to the generated file.

Second, we remove the direct inclusion of moc_qnamespace.cpp
in qobject.cpp to prevent duplicate symbol compilation, because
the symbols were compiled both as part of qobject.cpp and
mocs_compilation.cpp.

Finally, because manual moc is used on qobject.h, the generated json
file needs to be explicitly passed to Core's metatype generation
step.

Amends e57a94cbd8
Amends 3c4c02b3f1

Pick-to: 6.1
Task-number: QTBUG-87580
Change-Id: I859a7d2f95508eda211a0a0b4ec132540b78bda4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-25 12:59:17 +01:00
Alexandru Croitor
eadfb2cc1a CMake: Remove some dead code
The code was added as part of
a6ccef651d
but the important bits were removed as part of
c431e2d33c

Change-Id: I6ba7bffa2bfdbeae2c92cd9ffeaa5f31771eedde
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-25 12:59:15 +01:00
Alexey Edelev
fef850c51a Extend qtpaths functionally to replicate the 'qmake -query' behavior
'qt-version', 'install-prefix', 'binaries-dir' and 'plugin-dir' are
covered by the introduced qt-query option. So make them obsolete and
hidden in the application help.
Note that the 'qtconf' option will affect the output of options
associated with QLibraryInfo.

[ChangeLog][Tools] qtpaths got new --qt-query argument that can be
used instead of qmake -query. The new --qtconf, --query-format
arguments allow you to further tweak its output.

[ChangeLog][Tools] The qt-version, install-prefix, binaries-dir
and plugin-dir options of the qtpaths tool are deprecated.

[ChangeLog][Tools] The qtpaths tool has been moved from the
qttools repository to the qtbase repository.

Fixes: QTBUG-75870
Change-Id: I949acf79c8ce321811ee81cf707c1ae0eccb547d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-25 12:58:04 +01:00
Qt CI Bot
5fb347c93d Merge integration refs/builds/qtci/dev/1616664803 2021-03-25 11:48:36 +00:00
Alex Trotsenko
82c67623db QProcess/Win: get rid of incremental wait
Introduce QProcessPoller helper class on Windows that implements
waiting for any activity from a child process.

Change-Id: I99414db4424b4342e0fa3d7a3789f85cad76d190
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-25 13:09:25 +02:00
Andreas Buhr
d4fd996363 Adapt Catch2 to Apple Silicon
We are still using Catch2 2.11.3 which is not adapted to Apple
silicon yet. This patch backports the required change
from Catch v3.0.0-preview.3.

Change-Id: Ifa14a1fdd6cd1f661c94a0a78648cb01bd9699c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-25 12:06:31 +01:00
Qt CI Bot
d30f88cbf1 Merge integration refs/builds/qtci/dev/1616661627 2021-03-25 11:01:18 +00:00
Qt CI Bot
3e8092d183 Merge integration refs/builds/qtci/dev/1616659664 2021-03-25 10:30:38 +00:00
Fabian Kosmale
ce83e56cfe QTypeInfo: Handle T::value_type being equal to T
Fix operator checks for containers whose value_type equals themselves.
It does  not make sense to recurse on value_type in that case. Thanks to
std::disjunction having short-circuiting semantics, we can avoid that
issue by checking first whether T is T::value_type.

As a drive-by, check for value_type typedef before checking for
begin/end in is_container. This works around an issue in gcc <= 8.1,
which fails to correctly SFINAE the case where begin and end are private
methods.

Pick-to: 6.0 6.1
Fixes: QTBUG-89456
Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-03-25 11:22:29 +01:00
Andre de la Rocha
f1eccab04e Windows QPA: Fix accessibility focus event for table/tree/list
The focused element within a table, tree or list was not being informed
in the UI Automation focus change events, causing the focused element
to be missed by screen readers.

Fixes: QTBUG-91029
Pick-to: 6.0 6.1 5.15
Change-Id: I738502e6871358508b4510763018837c304b618e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-03-25 11:16:21 +01:00
Andreas Buhr
0aae7b9593 Add documentation for internal Q_OBJECT_COMPAT_PROPERTY
The internal class QObjectCompatProperty and the associated macro
Q_OBJECT_COMPAT_PROPERTY did not have any documentation so far.
This patch adds some initial documentation.

Task-number: QTBUG-90511
Change-Id: Ie55e7d7829363bd5a29430a4250ddba14a761912
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-25 11:14:38 +01:00
Qt CI Bot
e272070047 Merge integration refs/builds/qtci/dev/1616660720 2021-03-25 10:12:07 +00:00
Volker Hilsheimer
42e659b320 Fix deprecated macros
The QTextCharFormat::fontFamily  methods are deprecated as of Qt 6.1,
not as of Qt 6.0.

Mark them as obsolete in the documentation and point to the replacement
there as well.

Address API review comment.

Pick-to: 6.1
Change-Id: Id71ea1ebab6f7a385c8c3f286a35f88ba1177857
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-03-25 11:08:21 +01:00
Joni Poikelin
e287582cba Fix removing columns when QSortFilterProxyModel has not been sorted yet
Fixes: QTBUG-91788
Pick-to: 6.1 6.0 5.15
Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713
Reviewed-by: David Faure <david.faure@kdab.com>
2021-03-25 11:32:22 +02:00
Alex Trotsenko
856e0a187f QProcess/Win: simplify logic inside waitForBytesWritten()
Also, remove obsolete comments and an unnecessary check.

Change-Id: If64fa660d5434de94edfa48aafcaeb755aa8d68c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-25 10:35:04 +02:00
Andreas Buhr
ce8f7e0ebd Fix some warnings
Change-Id: I9460606cefd8c4b5c01e576043c1bc8660b19de4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-25 09:24:03 +01:00
Eskil Abrahamsen Blomfeldt
70251867a5 Fix compilation with experimental x11 paint engine feature
Adding support for vertical subpixel positions in
d79a9b1a4f changed some private APIs
which were used from the xcb-native-painting feature.

This fixes this (it does not implement vertical subpixels but
simply sets the vertical subpixel position to 0). It also
adds a missing "override" which triggered the warnings-are-errors
when compiling for me.

Fixes: QTBUG-92011
Pick-to: 6.1
Change-Id: If214a0d19a41e623ca9ef8e6215bc145f9846ae9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-25 09:06:25 +01:00
Hyungchan Kim
3dcdd89dd1 Fix compilation error when LTTng enabled
Updates tracepoint for qtgui and qtopengl fit to current source code.

Change-Id: I2e8ecc86a37942425734202a11bbc792e8f27bf3
Reviewed-by: Hyungchan Kim <hyungchan2.kim@lge.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-25 15:37:55 +09:00
Andy Shaw
5577cbaac5 Return the result we have already when getting an object with no name
This will ensure that something is set for the AutomationId based on
the actual object and the parents that do have object names until it
reaches one without an object name.

Pick-to: 6.1 6.0 5.15
Change-Id: I205485bc0ba772e321879e00e64ea8e1d8f1ba91
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2021-03-24 07:48:03 +01:00
Zhang Hao
be643a27f4 Account for multiple screens when computing QSizeGrip available geometry
In a multi-screen setup, when the window was resized on one
of the screens, the resize was limited to the available geometry
of the screen the window was on.
Fix this by using the whole virtual geometry of all the screens
as basis for the resize.

Fixes: QTBUG-91714
Change-Id: I28dd241d73f6a68550af88e368f0dbdcb9ebf42b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-24 00:54:02 +00:00
Qt CI Bot
2db455aff4 Merge integration refs/builds/qtci/dev/1616505582 2021-03-23 19:38:31 +00:00
Qt CI Bot
1bf62d37d1 Merge integration refs/builds/qtci/dev/1616510551 2021-03-23 19:37:01 +00:00
Qt CI Bot
7d5a183e9d Merge integration refs/builds/qtci/dev/1616509627 2021-03-23 19:00:59 +00:00
Qt CI Bot
cf4e607098 Merge integration refs/builds/qtci/dev/1616492874 2021-03-23 15:28:39 +00:00
Qt CI Bot
0c97ef1abb Merge integration refs/builds/qtci/dev/1616500234 2021-03-23 15:10:59 +00:00
Fabian Kosmale
932c10fcda Revert "qtypeinfo: make variable templates inline"
This reverts commit 6de9acf779.

Reason for revert: This might cause ICEs in clang

Task-number: QTBUG-91782
Change-Id: I987d2242b04a22208b54ecbc386a1f6cfc625c1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-23 14:32:22 +00:00
Shawn Rutledge
c0e31d6387 Remove QWindowSystemInterface::handleGestureEventWithSequenceIdAndValue()
This was added in fbfc8ffbf3 but left
unused in Qt 5; and we don't anticipate needing it now either.

Change-Id: I3d1f1301c8896df04255ebef5bacb5c5027dc7ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
2021-03-23 15:25:54 +01:00
Qt CI Bot
661fb133aa Merge integration refs/builds/qtci/dev/1616493800 2021-03-23 14:15:29 +00:00
Qt CI Bot
c5d0abdc3b Merge integration refs/builds/qtci/dev/1616491690 2021-03-23 13:58:05 +00:00
Alex Blasche
edfab62cb0 Remove qualification for Julian calendar
The given qualification was wrong but also not needed in the first place,

Fixes: QTBUG-92046
Pick-to: 6.1 5.15
Change-Id: Id28347fee2ef11ffcb0df8320b1025568b59de9c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-23 13:15:01 +00:00
Allan Sandfeld Jensen
35ef3fb009 Test incoming formats more throuroughly
Just to protect against invalid data in d->format.

Change-Id: I5e7cc04d5d8e42bdcb0edd2ab5fa34a08b96b6a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-23 12:49:08 +01:00
Tor Arne Vestbø
df8e1c8e58 cmake: Handle arbitrary configure arguments that contain lists
Passing e.g. -- -DQT_BUILD_SUBMODULES="qtbase;qtdeclarative" to
configure would fail because the module list was not preserved
as a single argument.

Change-Id: If685d0d541201597a2c2a5dc3d55b5d1ae51da22
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-23 11:01:14 +01:00
Edward Welbourne
824d963700 Restore support for reading /etc/timezone for system zone name
This restores one of the two mechanisms removed in
commit b0383cbd38,
transformed to fit in with the new cached system-zone determination.

Fixes: QTBUG-87326
Pick-to: 6.1 6.0 5.15
Change-Id: Ic270acb0d958e17dbc74a0ff93a5a1843c939678
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-23 10:46:33 +01:00
Laszlo Agocs
3c85f8e9fc rhi: vulkan: Prevent a misplaced assert from triggering in debug builds
One place where this popped up was the qrhi autotest (in debug builds).

This check is meant for VkRenderpass objects for texture render targets,
should not bother with it for the "main" renderpass.

Amends 19384f2e8f

Change-Id: I877a2458fe17fe339b4741d4aa8af3fbda4dabcc
Pick-to: 6.1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-23 10:27:10 +01:00
Lars Knoll
22c66e12e4 Provide an inline implementation of currentThreadId() on Windows
As this method is rather critical for performance of some central
parts of Qt, it really should be inline whereever possible. This
commit adds an inline implementation for Windows 32 and 64 bit.

Amends 5e9b2ade67

Change-Id: Iea51ef905b1cb7f91ca64b718d79bdc4f5c02c3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-23 06:42:16 +01:00
Qt CI Bot
47abdbea81 Merge integration refs/builds/qtci/dev/1616458599 2021-03-23 02:21:15 +00:00
Qt CI Bot
e7422db629 Merge integration refs/builds/qtci/dev/1616449672 2021-03-23 00:19:06 +00:00
Craig Scott
5807e1ae81 Add plugins to Qt tools and executables for static builds
In static builds, we cannot allow any part of the main build to make a
call to find_package(Qt6...) where such a call may load a
Qt6*Plugins.cmake file. That would add additional dependencies to the
main module targets, setting up a circular dependency in the set of
*Config.cmake files which cannot be resolved. This scenario would be
triggered by per-repo builds or user projects.

But Qt's tools and other executables still need to load some plugins
in static builds. Sometimes a platform plugin may be enough, other
times we may want all supportable plugins (e.g. Qt Designer).
Therefore, add all plugins we can identify as relevant for an
executable that is part of the Qt build, but add them directly to the
executable without affecting the linking relationships between the
main module libraries.

Also remove the now unnecessary check for QT_BUILD_PROJECT_NAME in
top level builds because there should be no difference between per-repo
and top level builds any more (as far as linking static plugins is
concerned).

Examples that build as part of the main build will still build
successfully after this change, but they will not run if they require
a platform plugin. Examples need to be moved out to a separate build
where they can call find_package(Qt6) without QT_NO_CREATE_TARGETS
set to TRUE to be runnable (see QTBUG-90820).

Fixes: QTBUG-91915
Pick-to: 6.1
Change-Id: I8088baddb54e394ca111b103313596d6743570ba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-23 11:15:33 +11:00
Qt CI Bot
dd7920821e Merge integration refs/builds/qtci/dev/1616448750 2021-03-22 23:46:28 +00:00