Compare commits

...

682 Commits
dev ... 6.0

Author SHA1 Message Date
Morten Johan Sørvig
72c609203b macOS: Notify socket notifier on connection error
Enable kCFSocketConnectCallBack to get connection made/failed
notifications. For the error case, the data pointer will be
set (it points to an int with the error code).

Change-Id: Ib51c0ae7c2c74d7bc2fea3c8b7aa9033a860f602
Fixes: QTBUG-91619
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d492245d9f98e410e1748f28a598945244dbafa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-07-02 17:24:26 +00:00
Marc Mutz
9d0bd169bb QVarLengthArray: fix aliasing error in insert(it, n, v)
Taking the copy after the resize is completely pointless: the copy is
there to ensure that `t`, being a reference potentially aliasing an
element in [begin(), end()[ before the resize(), isn't invalidated by
the resize(), so it must be taken before resize().

Add a comment so the next rewrite doesn't cause this to be mixed up
again.

[ChangeLog][QtCore][QVarLengthArray] Fixed an aliasing bug affecting
insertions of objects aliasing existing elements.

Change-Id: I26bc449fa99bf8d09a19147a12a69ac4314cc61d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 6e57e41f9aef5ccfa122c10bc6253d47dafd93d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-06-28 14:22:55 +00:00
Tang Haixiang
ae71fb7fe9 xcb: fix cursorTheme update issue
Clear the cache when cursor theme changed.

Idealy we should subscribe root window's RESOURCE_MANAGER property
to update cursor theme via Xcursor. KDE already has a daemon
KDE GTK Configurator to sync KDE settings to GTK. Then we can
register the fallback there both for KDE and GTK changes. See also
https://invent.kde.org/plasma/kde-gtk-config

Fixes: QTBUG-94538
Change-Id: Ia4de30930a0dc1dc306c61e1553970c3dab67bd6
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7311cdc0d2c10d47511e5b4850e3b348ea10e0d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-06-24 15:42:52 +00:00
Liang Qi
2e00264fe9 xkb.compose: get locale from user env settings
The setlocale call will only give useful results if the program
had previously set the current locale using setlocale...

See also "Compose Locale" section in xkbcommon doc:
https://xkbcommon.org/doc/current/group__compose.html#compose-locale

Fixes: QTBUG-85529
Change-Id: I65b1ac86ea54445bc3a2e1707df79bd9f732ab46
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 73ea9f032864566cc019d286b2f210b78cd70a3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-06-21 18:51:04 +00:00
Kai Köhne
b29941f6db Fix license information for libjpeg-turbo
Fix the license metadata in that libjpeg contains parts under three
different bsd-like licenses. Also, do include the IJG, zlib
license texts in the metadata.

[ChangeLog][Third-Party Code] Clarified that libjpeg-turbo is actually
covered by three licenses, not only IJG.

Change-Id: I6c4e3e8577bdf83e7e73474b34b0553cbe1d9b6d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 467b39d52c9ab59b1e7518330fbb51d5543ada50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-06-04 11:50:59 +00:00
Inho Lee
98fcf3cb61 QtGui/math3d : Fix QQuaternion::getEulerAngles
When rotating M_PI_2 based on x-axis, quaternion to euler conversion
makes NaN for the x-rotation value.  This patch fixes this corner case.

Fixes: QTBUG-93600
Change-Id: Ice321a80ad90dba9cf3ee3a14ec7d3d047c21bd3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 7ea2fbddcf674d49ad7d219cdb8a4b760258360c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-06-01 19:51:59 +00:00
Igor Kushnir
91ec6b1988 QWidgetTextControl: ignore GroupSwitchModifier for BackSpace
"The keypad and group switch modifier should not make a difference" when matches a QKeySequence, see QKeyEvent::matches() implementation.

Qt(xcb) treats AltGr as GroupSwitchModifier in hard code, which should
come from Qt 4 era. Nowadays, with different xkb setups, Mode_switch
could be different keys. When it is AltGr, Qt will get AltGr as
GroupSwitchModifier. When it is not AltGr, another key like
Less/Greaterkey(details in bug report), GroupSwitchModifier will not
be set in the case.

Fixes: QTBUG-36565
Change-Id: I7251963d41a70d61800d25e43d5012b859693f69
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-31 18:17:38 +00:00
Aleksei Nikiforov
98a4861d5d Qt xcb: remove false detects of Qt::GroupSwitchModifier
In some cases, if X11 is configured with CapsLock as
keyboard language switch key, and CapsLock is toggled
via Shift+CapsLock key combination,
toggled CapsLock is falsely detected as Qt::GroupSwitchModifier
for subsequent key events.

This change fixes this false detect,
but doesn't fix detection of Qt::GroupSwitchModifier
which is likely still broken.

Fixes: QTBUG-49771
Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-26 14:17:19 +00:00
Andrey Butirsky
e6b6f49d71 qxkbcommon: Map Super/Hyper to Meta early enough to have an effect
Super/Hyper keys are detected during a direct mapping phase, but the
function returned before the translation to Meta could take place.

Task-number: QTBUG-62102
Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
(cherry picked from commit b45b9090c3b66d541f57f8d049c22247f8c115ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-25 23:29:36 +00:00
Dongmei Wang
b67bbed196 QFileSystemModel fails to locate a host from root's visible children
In QFileSystemModel, in some cases the hostname in a UNC path is
converted to lower case and stored in the root node's visibleChildren.
When QFileSystemModel sets the UNC path as the root path, it tries to
get the row number for the host, but it didn't convert the hostname to
lower case before getting the row number, which resulted in the host
not found in the root node's visible children. As a result, it returns
-1, an invalid row number. Change the behavior to find the node for the
host using the host name case-insensitive and then get the row number.

Fixes: QTBUG-71701
Change-Id: Ib95c7b6d2bc22fd82f2789b7004b6fc82dfcb13b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit e253a30238ed1a93877780428c035d3b7a53e22a)
2021-05-22 13:50:43 +02:00
Karsten Heimrich
1ee5a85843 Fix QUrl::fromLocalFile with long path prefix
After commit 3966b571 the function was kinda broken already, though
this got unnoticed since it was not covered by an the auto-test.
This commit adds another test case with Windows native separators
and removes the use of QDir::fromNativeSeparators. Instead use the
original code from QDir::fromNativeSeparators to replace the backslashes.

Change-Id: I190560d0e75cb8c177d63b142aa4be5b01498da2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 06689a2d7a18882535819ed13ac7248c81330529)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-19 22:05:06 +00:00
Andre de la Rocha
2d84d8a2d1 Windows QPA: Fix dock widget drag&drop failure
A previous change to fix QTBUG-85431 has caused this issue by emulating
the behavior of the non-enhanced mouse event handler in a particular
case, where mouse move events that did not change position were ignored.
However, some of these events seem to be involved in the dock drag&drop
implementation. This issue is also reproduced in pre-5.15 releases,
predating the QTBUG-85431 fix, by disabling the enhanced mouse event
handler by setting the QT_QPA_DISABLE_ENHANCED_MOUSE env var. However,
the ignored events in the current issue seem to be non-client events
only, while the QTBUG-85431 issue was related to client mouse events.
So we can restrict the test added in the QTBUG-85431 fix and have both
issues fixed.

Fixes: QTBUG-92182
Change-Id: I98c0c8597912c7f4fe58af375a5a560695a82746
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 92198efbd2c696470711e7f24c5b6507bb664ce9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-19 14:08:22 +00:00
Allan Sandfeld Jensen
ab7ef94eff Cherry-pick upstream patch for non-gcc/clang/msvc compilers
Fix build w/ non-GCC-compatible Un*x/Arm compilers

Fixes: QTBUG-93779
Change-Id: Ib52e9ded6e2814c7998d6cd798e945da0f87f7a1
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 4341f6763b8a737ebc07bb78ead22bc05a1a515b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-18 15:11:24 +00:00
Karsten Heimrich
9d0be7b1a9 Fix QSaveFile and QTemporaryFile issues with windows network shares
The commit amends commit 3966b571 to take UNC prefix into account as
well. Fixes the weird file name output as reported in QTBUG-74291 and
QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(),
this is another spot where UNC prefix handling needs to be applied.

Also make QTemporaryFile operate on '/' as file separators to fix
creating both file types with native path separators on network shares.

Fixes: QTBUG-74291
Fixes: QTBUG-76228
Fixes: QTBUG-83365
Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ec9e85656339dbc9e6918a1369c981cece7bc97d)
2021-05-17 20:02:32 +02:00
Marc Mutz
a1ad1f35a9 QPageSize: make PageSizeId ctor non-explicit
A QPageSize::PageSizeId is a faithful representation of a QPageSize,
so the corresponding QPageSize ctor shouldn't be explicit.

[ChangeLog][QtGui][QPageSize] Conversion from a QPageSize::PageSizeId
is now implicit.

Change-Id: I2d32da370c032949686757400cb7c28583d9d8ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c8f380bd13f077cd797edbdb55723a2524f55c78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-13 19:35:31 +00:00
Piotr Srebrny
5055a2fb99 Do not remove non-widget items when removeWidget() called with nullptr
child->widget() returns null if the layout item is not a widget.
Thus, calling removeWidget(nullptr) will remove all non-widget items
such as layouts or strechers.

Change-Id: I772c1158d0f7e8e2850b6e571b0405a2896f09b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 867c0b8d8a53974074b1fff5b132f3ae9f150066)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-11 17:42:06 +00:00
Giuseppe D'Angelo
5ece368fa0 QFlags::testFlag: clarify the behavior in the docs
The name made me fall in a trap: I thought that testFlag returned
true if *any* of the bits in the argument were set in the QFlags
object. In reality, it returns true if *all* the bits are set, and
an argument equivalent to 0 is treated specially. Clarify this
in the documentation.

Change-Id: I9e8088c48038b4e6ba5830fdb7e473c6d7884b29
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 89f55f13fdae3aa52614b063ff6ceb8276340d44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-11 15:29:43 +00:00
Chen Bin
26211cca19 Check scrollbar visibility when computing QListView margins
When the listview setWordWrap is true and ScrollBarPolicy is
ScrollBarAsNeeded, if the text needs a newline display and the
vbar is not shown, the width of the item was subtracted from
the width of the scrollbar.

In most cases, the listview needs to reserve the size of the scrollbar.
But if the flow is TopToBottom and the vertical scrollbar is not
visible, the width of the vertical scrollbar cannot be reserved.

Fixes: QTBUG-92366
Change-Id: I73cce691099a253d409019dbb3fe9a16e1830bb1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aeef92c3c33e4ebcb7e5d8dd955020f4f4600e84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-11 12:35:41 +00:00
Eirik Aavitsland
f1b2cf613f Update bundled libjpeg-turbo to version 2.1.0
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.0

Change-Id: I82a58609120923c18f6031fec7d597138ec473ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 127f617387c00139dddbfc9438ab032e24559566)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-05 17:37:06 +00:00
Eirik Aavitsland
ea84cd090c Simplify bundled libjpeg build
Move the config headers of the bundled libjpeg back into its source
directory, where they originally live, to avoid having to trick with
the include path to find them.
The goal is unification across maintained Qt branches, making version
updates simpler.

Change-Id: I5b574446bbd264b0a1cb3efceb4c1cb7203cac7d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5df88b85c6e61409c5c759e78f32edaac7b2022f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-05 17:37:06 +00:00
Tamás Martinec
0eaf920983 iOS: Keep undo/redo widgets enabled on the undo shortcut bar after undo
Having two undo/redo operations on the rebuilt undo stack always enables
the undo/redo widgets on the shorcut bar. This might be more desirable than
the current behavior that only allows one undo from the shortcut bar.

Fixes: QTBUG-63393
Change-Id: I2c99f27895def47b58534035461ceb7b4e5c3057
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 3b155973c494e847b821f0b5675a061f4e424a6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-05 13:42:26 +00:00
Tor Arne Vestbø
975a059a3e Blacklist tst_macgui::scrollBarPainting()
It fails on 10.15 and 11, preventing those from being significant,
and the test is already marked as expect-fail based on QTBUG-20984.

Task-number: QTBUG-20984
Change-Id: I6911166a1c3e9173d6d36f2a3a68b37778fd3406
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit eab286b760bc33e2f90d1f9e94b34d89266d3d74)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-05-05 12:27:49 +03:00
Edward Welbourne
e7a6ad67f7 Update CLDR-derived data to newly-released v39
Routine update with minor changes to locale data, no new languages,
territories or scripts. Various Spanish locales change m_grouping_top
from 1 to 2, reversing a change to a test of Costa Rica's currency
formatting made in commit bb6a73260ec8272647265f42180963604ad0f755.
Includes updates to time-zone IDs.

Fixes: QTBUG-91478
Change-Id: I78ee161275b3c456c5800a7317a96947c932cf8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6235893d54b8fbf5c8bd54e33cd82b55042555f1)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-03 10:53:06 +02:00
Giuseppe D'Angelo
81c6597fc3 QLocalSocket: fix inclusions in namespaced builds
An include statement appeared after opening the Qt namespace, thus
injecting symbols in there. Move it outside.

Change-Id: I8e95e821b36ad4e4ceed5b0645bf8ebf7e531e06
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 99e95a2cc6ddec5ebd7f69489811be2e9aef98b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-02 18:25:52 +00:00
Giuseppe D'Angelo
363c407587 QRandom: drop a usage of std::is_literal_type
It's deprecated/removed, and indeed doesn't check anything that it's
not also already being checked by the previous line.

Change-Id: Ic80ca43f390dd989ced69f196efa7313069e7c6d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6351b5433da083890e47faa62e21fb40fd042c79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-02 16:03:48 +00:00
Andy Shaw
284d15bbec SQLite: Handle tables and fields with a dot in the name correctly
Fixes: QTBUG-91885
Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 66acee69a1563488e5950645c171d6be73dd5f70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-02 13:04:07 +00:00
Mårten Nordheim
8a8e3a501a Let the h2 test server both send and receive DATA frames
And use this in the authenticationRequired test.

Change-Id: I18e991eb67168214c2c4f829afaca5018568e989
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit deda40b8591a387e634ebfcf48287c14162ef332)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-30 16:24:03 +00:00
Mårten Nordheim
7a45372ad4 HTTP/2 authentication required
With Qt 6 we made HTTP/2 default, which exposed missing handling of
401 Unauthorized (and 407 Proxy Authentication Required).

In HTTP/1.* we would handle this after the response had finished, while
handling the status code. For h2 this path isn't used since it is
heavily reliant on the structure we have for HTTP/1.* (one request per
channel). So we must handle the status code and header directly.

Having that part fixed exposed another issue - when resetting/rewinding
uploaded data we were not resetting the 'totallyUploadedData' counter in
the reply (this, in turn, exposed another small issue). Because of that
we did not actually send any data on the retry, only sending the
content-length followed by no data.

Finally, the small issue mentioned in the previous paragraph was how we
check if we have uploaded all our data. It was only checking if the
byte-device was atEnd(), which it was. But only because it had not yet
prepared any data for us.

Fixes: QTBUG-91284
Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 52a0eb4791727157a7b385f7e022faad28da4821)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-29 16:04:04 +00:00
Andy Shaw
4ef45d6640 macOS: Don't override action set during drop handling
When the drop has been handled, the target might have accepted a specific
action by calling QDropEvent::setDropAction. Don't override that with
the operation received by the OS if the drag'n'drop operation takes place
within the same application. If the operation comes from outside, we have
no choice but to trust the OS.

This way the drag-site will get the action accepted by the drop-site when
QDrag::drag returns.

Fixes: QTBUG-77427
Change-Id: I0e4c86adeeea66b345966a03a3251fa62263b3e8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a014300898bd3bd574ef19bba7123d4b5a07789b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-29 08:55:56 +00:00
Alexandru Croitor
9c1b395860 CMake: Fix tst_qaddpreroutine to work with static builds
DEFAULT_IF needs to be true so that in a static build the
built plugin is automatically linked into the test executable
using the special static plugin per-repo behavior in
qt_internal_add_executable.

The QtPostProcess routines are not executed for this test project
because we don't use qt_build_repo. This means that no
QtFooPluginCMakeConfig.cmake file is generated and thus there's no
point in using qt6_import_plugins because the pulic plugin genexes
won't know about this target anyway.

Explicitly set the CLASS_NAME so that the name expected by the
Q_IMPORT_PLUGIN macro matches the name of the plugin instance that moc
generates in QT_MOC_EXPORT_PLUGIN.

Amends 22e967c3049608f82abd32a0beb0b4b36ee134bf

Task-number: QTBUG-87580
Task-number: QTBUG-90341
Change-Id: I5ef361e7e2cebc46b35310c679f15c84cd61b4a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2fccea3b70d8d88ed49cac1c228362a4cf01bb15)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-28 19:26:47 +02:00
JiDe Zhang
38564297e7 fix: The QtStartUpFunction function may be called repeatedly
Don't call pre routine function in qAddPreRoutine if
the qt_call_pre_routines is not called

Task-number: QTBUG-90341
Change-Id: I0ee70561dc57b857f8b3b1cf42c9dfe0cf45bd49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 22e967c3049608f82abd32a0beb0b4b36ee134bf)
2021-04-28 09:24:42 +02:00
Paul Wicking
73621cbf0a Doc: Remove mention of no longer supported format
Fixes: QTBUG-92826
Change-Id: I35950523e41ceaa1ddc59782c4b527707289013b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 069369d86707c89645d63ff36151065c47e6c0ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 21:02:12 +00:00
Alexey Edelev
1c4acb1675 Fix plugin SKIP_INSTALL option
If SKIP_INSTALL option is specified for the qt_internal_add_plugin
function the install_directory variable become empty and finalizer unable
to call qt_finalize_plugin, because of lack of the second argument. It
makes sense to use the INSTALL_PATH single argument instead.

Change-Id: I2d4b40c8cf812a834c0e045569b45a649d339508
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 361daa2990ddb70805d356ce5df7d8cfae8e1954)
2021-04-27 20:43:06 +02:00
Joerg Bornemann
1b6baf49da Fix "qmake -spec foo" call for cross builds
In a cross built Qt, for example Qt for Android, calling "qmake -spec
android-clang" led to an error message:
    "Could not find qmake spec '-qtconf'."

This happened, because:
- the qmake in Qt for Android is a wrapper script that calls
  "qmake -qtconf qt_target.conf -spec android-clang"
- the first stage of command line argument handling in qmake garbled the
  call to "qmake -spec -qtconf qt_target.conf android-clang"

We do not modify the order of arguments anymore.

Instead, we skip the "-qtconf <file>" arguments in the first argument
handling stage that is supposed to determine qmake's modus
operandi (like -project or -query).

This amends commit 661b586a69740bd9a1791622f8b238d290ebe00d.

Fixes: QTBUG-93079
Task-number: QTBUG-85136
Change-Id: I12ec25b17d64c00be2a3904b7c4a975b781500a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 63a812b85191c9cfe0704d400df86ce7961dea12)
2021-04-27 16:42:07 +02:00
Liang Qi
8339054002 xcb: Add more debug info for XCB_INPUT event
Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6a91ad7b5b429a9e277a4eedd7161b052b3acf68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 10:35:42 +00:00
Andrei Golubev
85ae84dc9e Add more tests for QList/QString/QBA
The major part is stability tests for QList operations,
Also added std::shared_ptr to the Custom type. shared_ptr
accesses the memory which does not directly belong to
QList, so using it inside a passed-to-qlist type is
beneficial (e.g. ASan could catch extra issues)

Basic prepend-aware cases added to QString/QBA tests

Task-number: QTBUG-93019
Change-Id: I50e742bdf10ea9de2de66539a7dbb9abc4352f82
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit adb41bbe00b2b853d4dd26cd9ee77ae5ed541576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:58 +00:00
Andrei Golubev
24c75a28a6 Change QList's insert() and emplace() to always invalidate [pos, end())
Drop the "move left if pos <= size / 2" path in favor of reference
stability of insert and emplace operations

Leave the insert(0, ...) and emplace(0, ...) as special cases for
prepend optimization as invalidating [begin, end()) practically means
that we can reallocate behind the scenes

Doing this also simplifies the code a bit

Task-number: QTBUG-93019
Change-Id: I7c248f96d687e94a6a38f81ade901619ff2b4733
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 5e76c2acff2c70f2893306b16aeba230f3d6114a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:56 +00:00
Andrei Golubev
36e0a4a98f Do not shift the data pointer when removing all elements from QList
Because leaving the pointer untouched is a much more expected behavior

The tests for this (and not only) logic can be found in the following commit

Change-Id: Iec9eec9bbce04c9fd90cb6be9627c135cd989b7f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 38bba2a87c6c5c2b8100870add6d0d7ad559e669)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:54 +00:00
Andrei Golubev
802388d074 Add tests for QtPrivate::q_relocate_overlap_n
Test the relocation logic through the QADP::relocate() method which
basically calls q_relocate_overlap_n inside and then ensures that
the data pointers are in good state

Running these locally in fact revealed a bug in the implementation,
so these tests are definitely good to have

Task-number: QTBUG-93019
Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:52 +00:00
Andrei Golubev
8e95bba272 Resurrect data moves in QList
Use the data moves to readjust the free space in the QList,
which ultimately fixes the out-of-memory issues caused by
cases like:
forever {
  list.prepend(list.back());
  list.removeLast();
}

Task-number: QTBUG-91801
Task-number: QTBUG-91360
Task-number: QTBUG-93019
Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:49 +00:00
Andrei Golubev
ad496ea3b5 Add q_points_into_range to container utilities
We already used it in QString and QBA. And implicitly in QADP (see
parent commit). Might as well move to a common location and reuse

Change-Id: I694f0f1dbd109f17c134f64b3f3dc28d19556c88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 10b46e7f0faecc42a94cc2e25ad3edd08ae28083)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 07:39:47 +00:00
Lars Schmertmann
e5b25862ff Fix build error on iOS with the configure option -qtnamespace
qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error:
    unknown type name 'QString'; did you mean 'XXXX::QString'?
    int createUnixKeyFile(const QString &fileName);
                                ^~~~~~~
                                XXXX::QString

Change-Id: I455526503f059efc2f496b159b4cb098385dda00
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d81a9206ac528ad7b5093305d7fe0037053468b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-27 04:43:48 +00:00
Alexandru Croitor
70d3e15c31 CMake: Install prl files from all repo build dirs in a top-level build
Previously, in a top-level build we always generated the final prl
file somewhere under QT_BUILD_DIR (which is qtbase_build_dir). After
each repo was processed by QtPostProcess.cmake, we installed the prl
files found in PROJECT_BINARY_DIR.

For qtquickcontrols2 this meant that qml plugin prl files were placed
under qtbase/qml, but we tried installing the prl files from
qtquickcontrols2/qml, which didn't have any prl files.

In a static Qt build, qmake's qt.prf calls qmlimportscanner to
identify which plugins should be linked to the executable. This worked
fine because the plugin .pri files were installed correctly.

None of the qml plugin library dependencies were linked in though.
This is supposed to happen in qmake's C++ code where it tries to
find the associated prl file of a linked library in order to extract
all its dependencies. Because no prl file was found, linking failed
with multiple undefined symbols.

Fix this by installing the prl files from QT_BUILD_DIR rather than
PROJECT_BINARY_DIR.

Note that this will create multiple install rules for certain files,
but it's harmless. An example is imageformats.

We process qtbase plugins, see qjpeg, issue an install rule from under
the qtbase/plugins/imageformats folder. We then process
qtimageformats plugins, see webp, issue another install rule from
under qtbase/plugins/imageformats.
The first install rule will install both qjpeg and qwebp, the second
install rule will merely say all plugins are up-to-date.

Change-Id: I8a4bb67bfafc1d016eab62f4fe66b6ba378ceeb2
Fixes: QTBUG-93021
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 31ee3c84a78afa67eeb4e4b6da5a8181ea62c387)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-26 20:36:19 +00:00
Pekka Gehör
906da939f3 [Android] Fix select handles misplacement on QDialog
Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangle of anchorRectangle of the selected word/text

Change-Id: I3425104c90f0efe6a1e4337328cf06dc93685b6f
Task-number: QTBUG-90799
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 56b54743e001c4af196c1e4786118d88b1d2cd2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-26 16:53:27 +00:00
Luca Beldi
3081731b02 Fix QTreeModel calling beginRemoveRows twice
For items that are children of other items, removeRows calls
beginRemoveRows directly and then once again inside takeChild()
The signal blocker that dates back to the monolitic import from Nokia
prevents the model from emitting extra signals
but the persistent indexes are corrupted nonetheless.

Fixes: QTBUG-90030
Change-Id: I5bc4b2598bf13247683b113faeec22471f1f04a4
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 6ec3fa2842b5c4714dc9a3953b2721ef70dd957b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-26 16:53:26 +00:00
Luca Beldi
f2e156c137 Fix QAbstractItemModelTester false positive
When inserting rows to a branch with no columns
the tester should not complain about indexes being invalid

Change-Id: I466f4e5140b10f6dcf65a71f109c2d3be7336507
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit fcea8e7aa8a65de9e80136c2d603478831b246d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-26 14:19:13 +00:00
Alexey Edelev
a36a738a93 Skip adding externally added plugins to the plugin meta-sets
Plugin meta-sets are not visible outside of the module build tree, so
there is no point in adding dependencies for externally added plugins.

Change-Id: Ica5b29b57c032f4fc9b128172aaa806392e9e581
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bbe26a766748c00da5e2241a9c7ec5e714dd76ad)
2021-04-26 14:19:04 +00:00
Igor Kushnir
1cb2bb2a28 Optimize quadratic-time insertion in QSortFilterProxyModel
Let N = proxy_to_source.size() before the code modified in this commit.
Let M = (N - proxy_start). Let K = source_items.size(). The algorithmic
complexity of the removed loop is O(N+K+K*M), assuming the number of
O(N+K) reallocations is a constant. The complexity of the QList::insert
and std::copy implementation is O(N+K). This is much faster in practice
when K and M are of the same order of magnitude as N.

For example, this quadratic complexity issue results in noticeable
slowdown in the following scenario:
  * a QSortFilterProxyModel is used only for filtering, not sorting;
  * first set a filter that matches a single item in the middle of a
    huge number of items (about one million) - this is reasonably fast
    (takes about a second);
  * then clear the filter (i.e. set an empty filter so that no item is
    filtered out) and watch your application's UI freeze for a minute.

The "Add QSortFilterProxyModel clear-filter benchmark" commit (with
Change-Id I419a5521dd0be7676fbb09b34b4069d4a76423b1) adds a benchmark
that runs much faster with this performance fix.

Change-Id: Ieaec173e6910f5d21eaee49402087f7711abbedf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 7d92ef63d7c2d9d017d89905a2ee0d1e9226b15c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-24 12:49:14 +00:00
Thiago Macieira
c0d310d996 QThreadPool: obey the docs that say we always use at least 1 thread
Even if the user (usually accidentally) sets a thread count of zero or
negative. The reporter in the bug report did
QThread::idealThreadCount() - 1 on a 1 CPU system...

Drive-by add to the documentation and the missing #include.

Fixes: QTBUG-93007
Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit 885eff053797d56f2e295558d0a71b030fbb1a69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-24 03:28:24 +00:00
Allan Sandfeld Jensen
25d9bf39d9 Do not access internal allThreads data unlocked
Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ffb5635c1a34d23d85e3cb42310e14a81fa24f6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-23 12:43:40 +00:00
Jonas Karlsson
da2a5fd136 Fix infinite loop in qmake option parsing
If calling 'qmake -qtconf file' an infinite loop occurs.

Bug introduced in 661b586a69740bd9a1791622f8b238d290ebe00d

Change-Id: I3ccc067570308227b605d700b41b299800aa872a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6b1a7341fed4b9456ea6bfa2de7412d45ef56c65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-22 20:03:19 +00:00
Samuel Gaist
dc9b55d6b2 Fix case sensitivity handling QSFPM
This patch fixes the breaking of case sensitivity handling. The removal
of QRegExp killed the wrong code paths which leads to inconsistencies
when changing the regular expression throuh methods like
setFilterWildCard or setFilterFixedString. Changing the case sensitivity
also nukes the original options that were set on the regular expression
if it was set through setFilterRegularExpression.

[ChangeLog][QtCore][QSortFilterProxyModel] Case sensitivity as well as
regular expression options handling have been fixed. The original value
is properly kept when using setFilterWildCard and setFilterFixedString.
The regular expression options are now also properly kept when changing
the case senstitivity through setFilterCaseSensitivity.

Fixes: QTBUG-92260
Change-Id: Ifb4732306f0c7d79ad0b18d3f5437c4523bb40e5
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-22 08:45:24 +00:00
Ilya Fedin
e066c4d4bf Don't own unique name for QDBusTrayIcon
Flatpak doesn't allow to own random name with PID. Even after adding
such a permission into manifest, all flatpaked apps have PID 2, so only
one Qt application at a time can have tray icon.

Even though unique name is a part of the spec, no tray hosts really
check it and SNI implementations without unique name run just fine
inside and outside of Flatpak.

This fixes the inability of Qt applications to have tray icon in Flatpak
outside of KDE.

Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 9db7cc79a26ced4997277b5c206ca15949133240)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-21 22:21:48 +00:00
Friedemann Kleint
b4580e9ea9 Documentation: Fix broken links to QIODeviceBase::OpenMode
Previously, QIODeviceBase was not visible in the documentation
and the links from QIODevice::open() were broken.
Fix by fully qualifying the arguments.

Change-Id: I43960ac2ff436251cc3bfad862d82f937b9bd4b1
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 1b1844afef81520520ba75146f835a7dbbbb5fd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-21 15:48:42 +00:00
Ilya Fedin
567e7f1518 Read DPI from X Settings initially as well
Currently, Xft.dpi from X Resources is read initially,
while changes are monitored for Xft/DPI from X Settings.
These protocols are different and can have different values.
E.g. MATE sets X Resources' Xft.dpi to 96.30859375,
while X Settings' Xft/DPI is set to 197240 at 2x scale.

This results in a very weird bug when Qt can't determine
2x scale initially, but if scale is changed at run time,
Qt changes scale to the right value.

The difference could be checked via xrdb -query and dump_xsettings
(the second is from xsettingsd project).

[ChangeLog] Qt now reads Xft/DPI from X settings at startup,
and will prefer this value over Xft.dpi from X resources.

Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 6560778616b090f8cc73700675ec2ef385953fb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-20 17:55:26 +00:00
Tang Haixiang
9b0ffccabd Draw the cursor considering the descent is 0
When the descent of the item is 0, ascent is the
height of the item, base(base = si.ascent)> sl.base.
At this time, sl.descent is not considered. The
calculated y value may be <0.

Fixes: QTBUG-86823
Fixes: QTBUG-92468
Change-Id: I9cf088dec9162595e52ff72aa90ec3153a30fb72
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit e99a883bd382ca950192bd66cafb2a1de6394ce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-20 10:15:45 +00:00
Vincent Baijot
ff9a091241 Correct prefix reported for end element in QXmlStreamReader
Before this change, QXmlStreamReader prefix value was always an empty
string for EndElement when the documentation state : "Returns the prefix
of a StartElement or EndElement."

The error was a missing update of the prefix value when parsing
EndElement.

I updated the tests data which were also wrong because no prefix were
reported even for </a:foo>. No new test is necessary, I think, the test
data already cover the cases of EndElement with a prefix and without one
(unchanged here).

Fixes: QTBUG-86847
Change-Id: I0ad38b9741d760f1ce688a36f969ec14e20a928c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 366bdcde97962cf5804c519e9b605eddb543a592)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-20 02:48:52 +00:00
ChunLin Wang
c701e6bb38 Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRow
Before calling the index function, we need to check the validity of the parameters.

Fixes: QTBUG-91878
Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit b8802071ed00689373da5817fc4824a30b5fcf86)
2021-04-20 10:48:52 +08:00
Allan Sandfeld Jensen
a7b9a9328e Fix ARM and MIPS runtime CPU feature flags
The set values didn't match tested values, as the enum were already
on flag form.

Change-Id: I9e8b0d419682122e8d40cd47bd68d840386c2066
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ccd17fbc57fae0cb2e5c020e00706edc856b13df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-20 00:32:41 +00:00
Luca Beldi
cbec552790 Fix QAbstractItemModelTester false positive
When rows are removed from a model with no columns,
the test should not report a problem if indexes are invalid

Fixes: QTBUG-92886
Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit fed2c0d23614df1b96dcc8746223501b07597a52)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 21:47:32 +00:00
Giuseppe D'Angelo
cf00353f30 Unicode: fix the extended grapheme cluster algorithm
UAX #29 in Unicode 11 changed the EGC algorithm to its current form.
Although Qt has upgraded the Unicode tables all the way up to
Unicode 13, the algorithm has never been adapted; in other words,
it has been working by chance for years. Luckily, MOST
of the cases were dealt with correctly, but emoji handling
actually manages to break it.

This commit:

* Adds parsing of emoji-data.txt into the unicode table generator.
  That is necessary to extract the Extended_Pictographic property,
  which is used by the EGC algorithm.

* Regenerates the tables.

* Removes some obsoleted grapheme cluster break properties, and
  adds the ones added in the meanwhile.

* Rewrites the EGC algorithm according to Unicode 13. This is
  done by simplifying a lot the lookup table. Some rules (GB11,
  GB12, GB13) can't be done by the table alone so some hand-rolled
  code is necessary in that case.

* Thanks to these fixes, the complete upstream GraphemeBreakTest
  now passes. Remove the "edited" version that ignored some rows
  (because they were failing).

Change-Id: Iaa07cb2e6d0ab9deac28397f46d9af189d2edf8b
Fixes: QTBUG-92822
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit a794c5e287381bd056008b20ae55f9b1e0acf138)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 18:40:50 +00:00
Giuseppe D'Angelo
d232de7005 Unicodetools: compile
Add an #include for a header that was only accidentally included
transitively.

Task-number: QTBUG-92822
Change-Id: Ie29bb0e065f2db712e9cf9539b15124ff0ced349
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fd0c3170c890707c5cea63b11895084d149d991c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 15:20:09 +00:00
Qiang Li
731768345f Re-layout QProgressDialog when setting the cancel button
Setting a cancel button on QProgressDialog more than once caused the layout
to be invalid. The layout was only applied when the dialog resizes or the
style changes, but not when a new cancel button is set.

The solution is to update the layout() before showing the dialog when adopting
new child widgets.

Fixes: QTBUG-19983
Change-Id: Id8fb1ac56e94a9bd97d4559a2e8d4835856fd7d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 777053cfff40570282e861527e0e52e22a359629)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 15:20:08 +00:00
Andy Shaw
0dcf8c232f iOS: Protect against a possible crash after the window is deleted
If we are in a case where the original window is deleted before a new
one is shown then we need to make sure that we are not still expecting
that the original one has the focus. So we protect against the crash
by only outputting the address of the object that previously had
focus.

A follow-up patch will be done for inclusion from 6.2 that will fix
the root cause of the pointer being invalid when the only window is
deleted before a new one is shown.

Fixes: QTBUG-92173
Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b050d4867f68c3d35493221d65d343749504c988)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 15:20:08 +00:00
Andy Shaw
1932953334 QODBC: Preserve the whole value when using HighPrecision
Some ODBC drivers do not properly handle SQL_NO_DATA and therefore
decimal values returned with HighPrecision are cut off because the
decimal point is not taken into account.

Fixes: QTBUG-73286
Change-Id: I905c947b4d0266a3245d5735300300ca00f77480
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit c2657f9762e01abd65ac991ba31e3ca085d9540c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 15:20:08 +00:00
Joerg Bornemann
1051db0b01 Fix top-level build repository targets
The directory-level targets missed the first level of sub-targets.
E.g. `qtbase_qmake` did not have a dependency to `qmake`.

Fix qt_build_internals_get_repo_targets to first grab all targets of the
subdirectory and then recurse.

Change-Id: I3604000caec22fac9a4cc5f5aaf651d550d16793
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 82f8519b827ba7fd89f8168632461f47b09605a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-19 10:28:10 +00:00
Alexandru Croitor
19b70c1caa CMake: Warn when using CMake 3.20.1 due to crashes in AUTOMOC
With CMake 3.20.1 AUTOMOC can crash or hang on Windows when used with
a Qt installation that supports moc depfiles due to missing
multi-threaded locking.
Warn and advise to use a different CMake version instead.

Change-Id: I78d2269c48dfc2541bebcd6ab23aaa5595012149
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit aab8a0ac6e5365d97d3c7571b26430776b7b5f49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-17 21:34:51 +00:00
Giuseppe D'Angelo
3159753358 tst_qcborstreamwriter: don't pass char8_t strings to QByteArray
There isn't a QByteArray constructor taking a char8_t*. (I am not
sure if there should be one; QByteArray is not going to anything
special about that information anyways.)

Change such strings to be "ordinary" narrow string literals.
There should be no problems at doing so, as by default we build in
UTF-8 mode under all compilers.

Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b9d0fd3a09c23b410bb8ef228ff5326d118f3069)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-16 21:49:01 +00:00
Edward Welbourne
721f582e5b Fix handling of surrogates in QBidiAlgorithm
Prior code was naively assuming the character after a high surrogate
would necessarily be a low surrogate, which is buggy.
Fixes oss-fuzz issue 29718.

Change-Id: I10f023c4b5024a0d76fea0a3672001063591ec6d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit aeeaab1a5ac0b4d91c9f9b542035b8970e4c61dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-16 19:33:34 +00:00
Fabian Kosmale
5e8e9fded6 QMultiHash: Fix doc
In Qt 6, QMultiHash does not iherit QHash

Change-Id: Iaad8768d681a9aad2bb1f80fd87904f0dd9683d4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit e27390f8e1fb961e783ce1004b3a8caf5eeaeca6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-16 19:33:34 +00:00
Mårten Nordheim
965ad9d181 QNetworkDiskCache: Drop the file mmap-ing
Presumably the code at some point would do a
QByteArray::fromRawData-style thing. But now it doesn't do that so
the current code was a bit strange. It would map the content of the file
to memory only to then copy the content into a QByteArray. Then it
reparents the file to the QBuffer, keeping it alive even if its not
needed.

Fixes: QTBUG-92838
Change-Id: I88f8cd1b64e0fd13d08b5cc4df44661e216da340
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c254d73be63033497838807119cb9cb47ca6c1fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-16 16:50:59 +00:00
Allan Sandfeld Jensen
8e76959c57 Don't parse XML symbols longer than 4096 characters
It is slow and will use too much memory.

Fixes: QTBUG-91889
Change-Id: I45c5e6038357c87bbb85b1ace17ef39a2a814ea0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 38e111158a38507c63fd70f9ee18b9116b537976)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-16 16:50:59 +00:00
Topi Reinio
2818d7ce3e Doc: Fix various documentation issues
- Document QIODeviceBase
- Document QPointerEvent::points
- Fix linking issues

Task-number: QTBUG-90662
Task-number: QTBUG-92273
Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
(cherry picked from commit 00e10f62b55626097e94a2d70a9214c0062fbcd5)
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-04-16 11:59:45 +00:00
Alexandru Croitor
19e72a71d2 CMake: pro2cmake: Use latest project version for qml import version
Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION when setting the
version of a qml module, which extracts the version of the latest
project() call rather than the top-level one.

Using CMAKE_PROJECT_VERSION caused issues in top-level builds where
the qtdeclarative version is 6.2, but the top-level project version is
still 6.1 and hasn't been updated to 6.2, causing qml module import
errors.

This was probably an oversight during initial implementation of qml
support in pro2cmake.
So projects that define qml modules should be adapted accordingly.

Amends cce8ada8141d786c1deda78fdba485b4c67f9687
Amends 28fff4a5519c8e1068450a052cb19fb2149e9726

Task-number: QTBUG-92861
Change-Id: I494784694e997501a5bc4fd0c0eac458ddc248aa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit cf27a23937b108f7f8492a7873f71bc71c368dfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-15 18:29:39 +00:00
Allan Sandfeld Jensen
8eeae7ae07 Fix partial pixel coverage calculation
We want right - left, but the numbers we have are (1 - left) and right,
so we need right - (1 - left) = right + left - 1.

Fixes: QTBUG-91957
Fixes: QTBUG-92485
Change-Id: I238cbbe1eebddff1ce56da38127899cdbd21db0e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 004189b2d8e751021f26d9eb28948f753ea8208c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-14 20:58:39 +00:00
Eirik Aavitsland
6869d2463a Avoid processing-intensive painting of high number of tiny dashes
When stroking a dashed path, an unnecessary amount of processing would
be spent if there is a huge number of dashes visible, e.g. because of
scaling. Since the dashes are too small to be indivdually visible
anyway, just replace with a semi-transparent solid line for such
cases.

Change-Id: I9e9f7861257ad5bce46a0cf113d1a9d7824911e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f4d791b330d02777fcaf02938732892eb3167e9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-14 15:40:19 +00:00
Edward Welbourne
9148c2b010 Make POSIX transition rule parser more robust
The POSIX rule parser used by QTzTimeZonePrivate recklessly assumed
that, if splitting the rule on a dot produced more than one part, it
necessarily produced at least three. That's true for well-formed POSIX
rules, but we should catch the case of malformed rules.

Likewise, when calculating the dates of transitions, splitting the
date rule on dots might produce too few fragments; and the fragments
might not parse as valid numbers, or might be out of range for their
respective fields in a date. Check all these cases, too.

Added a test that crashed previously. Changed
QTimeZone::offsetFromUtc() so that its "return zero on invalid"
applies also to the case where the backend returns invalid, in
support of this.

Fixes: QTBUG-92808
Change-Id: Ica383a7a987465483341bdef8dcfd42edb6b43d6
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 964f91fd25a59654905c5a68d3cbccedab9ebb5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-14 15:40:19 +00:00
Alexey Edelev
c2a06dee19 Add missing compile definitions to the resource object library
The resource object library must be compiled with the definitions
specified in Qt::Core. Missing the required definitions causes linker
problems when QT_NAMESPACE is defined.

Change-Id: If0ca20604e251822279e0d4906c47b94d3b4ceb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9466b3629a391ae93c4f06d3627e3dc9e10bba9f)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-14 15:40:19 +00:00
Eirik Aavitsland
fa2efb8b35 Correct item indent in checkable menus in stylesheet style
Not only the checkable items need to be indented, but all items in the
same menu, so that they line up.

Fixes: QTBUG-90242
Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 96e9c8cc8aae718942f79ac98e775f06501b0e25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-14 12:13:27 +00:00
Zhang Hao
22b9e8f889 Only scroll QMenu when there is a valid active action
When changing the active action via QMenu::setActiveAction
the menu will scroll to the active action, but we were
scrolling the menu also when the active action was null,
resulting in the menu scrolling back to the top.

We fix this by guarding the call to scrollMenu.

Fixes: QTBUG-92096
Change-Id: I998f99ddacec32640834d59a907d569fdda458f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 94e03e506a0e953f72c21c4ca827174a3d1f0d73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-14 03:22:07 +00:00
Tasuku Suzuki
49059a4007 Fix build without features.menu
Change-Id: If7947839b8da5abc8ee84aace60cc7de7a053e04
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d84bf703b505db470e5c7916e3cd630c3e456cef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-13 17:09:53 +00:00
Volker Hilsheimer
6718bdc88c Don't disable menu items that belong to the active modal window
A popup/context menu created via QQuickPlatformMenu doesn't belong to any
menubar, so by disabling items in a menu that doesn't belong to the currently
active menubar (5b9f6862b1), we disabled all menu items in a QQuickPlatformMenu
when a modal window was active.

For such unrooted menus, use the QCocoaMenuObject data structure to record
which window it is shown for, and only disable items if that window is not
also the current modal window.

Amends 5b9f6862b1aa474a392203c69f6db678d633cecf.

Fixes: QTBUG-92040
Change-Id: I56b6d579e5e94689b43ca84d4637e35dc2cbeb4c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2bdaf28034541cd57b0aa7c067fda8cfbffa0e94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 21:45:11 +00:00
David Faure
6d70441d2d QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699cec09458ca9325035d477d4899e8e47b

Fixes: QTBUG-92220
Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b4aac2af19690917553f93660e3ad760fc15d0b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 16:40:01 +00:00
Mårten Nordheim
42c468a199 QtFuture::connect: disconnect signals first
During reportFinished we may call a continuation which might end up
triggering one of the signals.

Change-Id: I19546fcca12be71cd536e4287eb5eddd9d236830
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit bb85831e4de5e2c4951a0c40003ccf36f57cbd93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 16:40:01 +00:00
Mårten Nordheim
99b269f0b7 QtConcurrentIterateKernel: fix warning
src\concurrent\qtconcurrentiteratekernel.cpp(134): warning C5055: operator '*': deprecated between enumerations and floating-point types

Change-Id: I934e767e77e9393e1da3adc390dc8e252e7f5b6a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit b86176abf6a66b20cebbcb53958229590b4c2253)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 16:40:01 +00:00
Christoph Keller
cdd056fded Explicitly set input files for qtpreprocess
This fixes build errors with Xcode 10.
Xcode 10 build system (a.k.a "New Build System") needs to know the input files
in order to build a correct dependency graph. Especially when a build is not run
for the first time and files changed in-between.

Task-number: QTBUG-71035
Change-Id: If8fbad3a1915add9b35c79131b03cdbe6b7ac06d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8115219407fdbe7c01e97c76ccf3aa48b1fd8f78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 13:05:35 +00:00
Edward Welbourne
0b50aaafd8 Restore support for reading /etc/timezone for system zone name
This restores one of the two mechanisms removed in
commit b0383cbd388336f698ceeac11a4f50cdff931dd9,
transformed to fit in with the new cached system-zone determination.

Fixes: QTBUG-87326
Change-Id: Ic270acb0d958e17dbc74a0ff93a5a1843c939678
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 824d963700a91294ba4a543ebb486aedbd650284)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 10:16:38 +00:00
Craig Scott
5748c3ccb1 Warn if using CMake 3.20.0 due to potential cyclic dependencies
CMake 3.20.0 can create autogen-related cyclic dependencies that are
only detected at build time by Ninja, which then fails with a build error.
Warn and advise to use a different CMake version instead.

Change-Id: I9bef973ad2efdb69f28d6a9e0584b543be59f17f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6442116078500b0e7c401430b74bd40f32cfafb4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-12 04:47:24 +00:00
Eirik Aavitsland
79a7137d00 Fix read-only pseudo-state in QPlainTextEdit stylesheet
Was implemented for the other text edit widgets, but not for
QPlainTextEdit.

Fixes: QTBUG-92490
Change-Id: Idd2a1b5c743fc030d3f2d4dd24e98f806b58f4d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f3a042c5ab998c0d283017f3569bb72c392580b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-09 10:06:34 +00:00
Alexander Volkov
2711dc1fe0 Call statx() with AT_NO_AUTOMOUNT
Otherwise it can be very slow in some cases (e.g. 0.5 sec).
Besides, AT_NO_AUTOMOUNT is used by {l,f}stat() internally.

Change-Id: Iae9c8b46dcdc96d21ac6b114a51c382b4949d3dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9667ac1c2d3b3d48cbd154bece36ec1d41d93a59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-08 21:14:20 +00:00
Volker Hilsheimer
1a08642a4b Don't judge other people's writing systems
Change-Id: Ifb8265bad4c8c96c6b20f957c376cec47e28f666
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 2c2b34997468a028de9e9c2de54b21c7e0757fbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-08 14:41:04 +00:00
Milla Pohjanheimo
a55ae07fd0 Add binary compatibility files for Qt 6.0.0
Binary compatibility files added.

Change-Id: I89fe7daae970af697ec57a414e3c90b24d4f9a86
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 9224f8e99fd8be0aaf5971783af4e32e3795ca24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-08 09:30:17 +00:00
Joni Poikelin
6bd89d122e Fix removing columns when QSortFilterProxyModel has not been sorted yet
Fixes: QTBUG-91788
Change-Id: Iddcafd3171f0f3703b94893a32b4ccaaeea9e713
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit e287582cba74ddcfc67f83647e72c0b23bd99c36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-08 09:30:17 +00:00
Doris Verria
01d50715e0 Fix incorrectly-drawn menu indicator for QPushButton on macOS
Because the QPushButton's bevel rect is smaller than its actual
widget's rect, custom styled menu indicators are drawn outside the
bevel frame on macOS. Fix this by drawing the menu indicator inside the
bevel's rect instead of the widget's rect.

Fixes: QTBUG-90250
Change-Id: Ie63d68d8f564a4a640bdb8e7564f028784faab97
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0eb0fc87014b8de06473055bd2298b2423d480f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-08 06:55:04 +00:00
Robert Löhning
917509c914 QTextHtmlParserNode: Limit colspan to avoid segfault
This fixes oss-fuzz issue 29758.

[ChangeLog][QtGui][Text] QTextDocument::setHtml: column spans are
limited to 20480, an arbitrarily high but reasonable value.


Fixes: QTBUG-92463
Change-Id: Ib759e3e3ac0b0d0d483f8e8ce11002e079db3ace
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7473317b52dbc15878d81291faa33f21c20d6ec6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 22:59:52 +00:00
Nikolay Avtomonov
87ab4f66f2 Explicitly set output files for qtpreprocess
This fixes build error with XCode 10.
XCode 10 build system (a.k.a "New Build System") requires all the files
that are generated by scripts and used later on build to be explicitly
defined as output files.

Task-number: QTBUG-71035
Change-Id: Ibec39eee53b0cb3acecf592f1ca53c04b9975cad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3f0858ed10d249acb942597b4065080411281b87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 22:59:52 +00:00
Alexey Edelev
4f042c8262 Fix condition that adds resources for each Android ABI
If we already have the list of Android ABI in BUILDS, it's not
necessary to generate extra resource while Qt build.

Amends: 58556afb6960b442f88649b550aaec8e1a04338b

Fixes: QTBUG-88031
Change-Id: I344efe6c477461659a360281da59c4abeae18fc2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 72d1393c1d88a70c337e87c661bbeefe46346d23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 22:59:52 +00:00
Christoph Keller
9823930482 Only embed launch screen when building an app
Xcode's new build system checks duplicated entries when building. Qmake wants to embed
the launch screen for all types of configurations (static libraries etc.) which makes Xcode bail
out with "Multiple commands produce LaunchScreen.storyboard".

Task-number: QTBUG-71035
Change-Id: I5c028e687f16e046b12156c1a8a89540deba4d3b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9c24ad3b94cb8c67468e947f02dd1f9aaf246085)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 20:32:09 +00:00
Edward Welbourne
cc3cb77f62 Avoid attempting to parse insanely long texts as zone names
There are limits on zone name length and the trial-and-error approach
we're more or less forced to take to parsing gets horribly expensive
if applied to every prefix of a very long string. So apply a loosened
version of the zone-name validity rule that limits the length of the
fragments between slashes and limit the number of such fragments.

Fixes: QTBUG-92275
Change-Id: I83052b1b6888728c81135db22a9c6298ae439375
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0c9fc20e7ff7b4ff0f15e0b2c071ea834625dce9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 20:32:09 +00:00
Ilya Fedin
ae71de40b8 indicator-application hack: fallback to dbus service check
There is a hack to work with Canonical's indicator-application tray
applet. Since it implements the SNI spec partially and doesn't work
with IconPixmap, the icon is broken without the hack.

Unfortunately, this tray implementation is still in active use by
Ubuntu; it's shipped and enabled by default on at least:
* Xubuntu
* Ubuntu MATE
* Ubuntu Budgie
(and maybe even others)

Unfortunately, the check doesn't work in confined environments
providing broken tray icons for snapped & flatpak'ed apps.
Fortunately, snap allows checking all registered services on the host.
It also fixes the check on flatpak if permissions to talk with these
names are given.

Change-Id: Iee5d0bb610c3ff397babee89ef1ee788ac19f477
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 0baa26638d7d14b6609dab191c4ea0cc1d3ff50a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 20:32:08 +00:00
Doris Verria
5a09a21b60 Fix label margins for pulldowns with custom styled menu indicator on macOS
Don't apply the QMacStyle's pulldownButton titlemargins to the
QPushButton's contents rect if the button has a custom styled menu
indicator. This causes the button's text/icon to be misaligned.

Fixes: QTBUG-86134
Change-Id: I6ef95d51071c1d79f1cc07425a46958f50091b7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 37f9f2e7afb2539ead355f1115e10835c2df9f92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 15:23:42 +00:00
Friedemann Kleint
35e6ef6395 standarddialogs example: Fix font handling
The example crashed since it passed the font label text (which
receives the font key) to the QFont constructor taking the family list.
Use QFont::fromString() instead.

Change-Id: I499fc9200b4d817b10c946a7b79ede4e7f7e69af
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit c10159a9a1254992867242897adb19ae1c3c3c35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-07 09:42:31 +00:00
Jani Heikkinen
65760c077d Bump version
Change-Id: Ibb62dae5aad50b6f6855998629defd709ee35467
2021-04-06 08:23:18 +03:00
Fabian Kosmale
687685f649 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.

Fixes: QTBUG-89456
Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ce83e56cfeb2806181ec1daade9690f4c90b901c)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-05 12:39:28 +02:00
Volker Hilsheimer
7304bce4aa Document change to QAbstractItemView::viewOptions in porting guide
We couldn't deprecate and add the replacement in 5.15, so list it
explicitly here.

Amends c501e09efacb8a60deb41f85f3402f6f4c041d95.

Change-Id: I174a7b6214cd8b9579b029ebf57e4d5b2e28e574
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a395372ccf7b6ce5575aeec627b403c4f9af9647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-04 11:11:09 +00:00
Friedemann Kleint
24807f57cd Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows
Move the cursor out of the way to prevent it from interfering.
Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d.

Task-number: QTBUG-89082
Change-Id: I0efbe2b5618a04e92839083a1bd3383e05d6ff93
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ba139603925453bf79994eca48b566d8f15b2af0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-01 14:47:01 +00:00
Alex Trotsenko
438dbb8642 QLocalSocket/Win: fix possible UB in _q_pipeClosed()
We must stop the pipe writer before closing the handle on which it
operates.

Change-Id: I4765dd8393167fe2453653aba76a097b8ace8e3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 64f02ebf05d88eaa8399a5cff85db5a605ede62e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-01 11:56:20 +00:00
Alex Trotsenko
48b0640e39 QLocalSocket: fix signal name in docs
It should be disconnected() instead of disconnectedFromServer().

Change-Id: I2b816e9c92d675ea5a7a26b4752e831c30950ef2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 97877d79487befe050f96aa9ae3b52f20a351e97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-01 11:56:11 +00:00
Laszlo Agocs
f8587a158f Skip a tst_QRhi test case with the Android emulator
Task-number: QTBUG-92329
Task-number: QTBUG-92211
Change-Id: I63ff17b226d502189bc769b0b28640b849b8d39a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9e662a0baf46253fcb88027688587c06b7112620)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ab32956178331bd323b8341129a237ae0030387b)
2021-04-01 10:25:11 +02:00
Giuseppe D'Angelo
59ab5b29b3 tst_qobject: fix the detection for GCC
Q_CC_GNU is defined on compilers that masquerade as GCC (Clang, ICC),
so using it to work around GCC-specific bugs is wrong. Introduce a
local define for _only_ GCC and use it in place of Q_CC_GNU.

Drive by: version-fence a test we now know it's been fixed upstream,
and correct the link to the corresponding bug report.

Change-Id: I9059d6e6bf86157aca71590ac22afb1a1c114313
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8b9c8d417b8ff2d4f60d83f9cc69c148632d1046)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-26 17:16:43 +00:00
Giuseppe D'Angelo
e2a7381641 QPainterPath: fix handling of fill rules
fillRule() contained a major blunder: instead of checking if the
d-pointer was allocated, and return a default value if it wasn't,
it checked whether the path contained any points. This means that

  QPainterPath p;
  p.setFillRule(x);
  Q_ASSERT(p.fillRule() == x);

was failing.

As a drive-by to test this change, fix another mistake in clear():
clear is documented to clear the elements in a path, but instead
it also changed the fill rule.

This commit partially reverses 697910e5fbd382e78bc1bcbac3f5824aded059b4.

Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115
Done-with: Milian Wolff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0b4ccbf81ee2009051169f2f0918442b56512b20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-26 13:12:58 +00:00
Andrey Butirsky
8f7bcbf1c6 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
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>
(cherry picked from commit 40193c2b6919875a714e84f5029ba2bcc1f9e258)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-25 18:49:01 +00:00
Andre de la Rocha
da7c44770f 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
Change-Id: I738502e6871358508b4510763018837c304b618e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f1eccab04e01b3acc1a4b4c6a5fe7b3af3e2dcba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-25 13:40:43 +00:00
Mårten Nordheim
955ce882f7 QEventDispatcher(Win): Always honor interrupted status to avoid races
There may be a race where e.g. thread 'B' is woken up by a queued invoke.
At the same time thread 'A' asks 'B' to quit, which will set various
atomics (some important ones are 'interrupt' in the dispatcher and
'exit' in the event loop), but it does _not_ try to send another wake
since there is already an unhandled wake triggered by 'B' itself.
Sadly 'B' reads the 'exit' atomic before 'A' updates it.
Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to
it, meaning 'A's interrupt is ignored. Then, since there is no
interrupt, 'B' goes back to waiting for events, leaving the thread alive
and running instead of quitting.

Maybe this has unforeseen consequences (one consequence is that it will
return and re-enter the event dispatcher once more, possible
unnecessarily)

Fixes: QTBUG-91539
Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f274f91cebb0a4fd2ebe37bb3a605c47d6acd404)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-25 10:04:55 +00:00
Andy Shaw
4dc30edb4b 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.

Change-Id: I205485bc0ba772e321879e00e64ea8e1d8f1ba91
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
(cherry picked from commit 5577cbaac59e7fc198ea2c98c1e4268779fbf0b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-24 09:07:37 +00:00
Allan Sandfeld Jensen
0ff1dc7110 Fix alpha handling of QImage::setPixel
It was treated differently depending on format, made it consistently
behave the same for all formats (following the behavior of the primary
formats).

Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c32cd44d34910cfd42e32537578e4a573138a282)
2021-03-23 14:16:55 +01:00
Zhang Yu
d3b24a14bb Fix invalid pointer return with QGridLayout::itemAt(-1)
QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c47bb4478a4c3a29c0505d7d89755f40601b326f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-22 15:22:11 +00:00
Timur Pocheptsov
90267af5df tst_QSslSocket::setSslConfiguration - skip if SecureTransport is in use
SecureTransport does not allow deprecated digest algorithms, and
(depending on ST version) it may or may not accept our server's
certificate.
Funnily enough, they 'fluctuate' between versions again and again.

Fixes: QTBUG-89922
Change-Id: Ie5fbfca316806bd5000ce2d128b81b718bb36624
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3d5f86e77d0740d72cd8922c7b1d4f8cde460ee1)
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-22 12:30:55 +02:00
Friedemann Kleint
4c32d983b9 Stabilize test QMenu::QTBUG_89082_actionTipsHide() on Windows, take 2
Use the QWindow-based overloads of QTest::mouseMove(), which do
not move the cursor position.

Amends ba139603925453bf79994eca48b566d8f15b2af0,
3f3d5e6716d9130776b3613ccbd5595de7d4af8d.

Task-number: QTBUG-89082
Change-Id: I2cc62e4d1f24e4baebafd0d76fbf0fbdb6f588c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 65c6fbea242e150d785ea0a7062188fdc090af32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-22 06:34:42 +00:00
Craig Scott
ef2ed2e7c8 Remove unnecessary $<BOOL:...> generator expression
The $<NOT:...> genex already guarantees to return a value of 0 or 1,
so there's no need to wrap it with $<BOOL:...>.

Change-Id: Iff4ad64ed8deaa846e1b5bc22d2e5d9dbcd77cc7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit df121fd7f74ecfb3de20867edea1c1f3ebf035c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-22 01:43:48 +00:00
Andy Shaw
38d4008458 macOS: Don't draw scrollbar handle when there is no range
If the minimum and maximum is set to be the same then we should not
draw the handle. An empty groove should be shown instead.

Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit aac33296e618e617ab9e05b3c71682a13f2d5dfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-20 16:25:23 +00:00
Andy Shaw
d49a37a5e7 SQLite: Update to 3.35.2
[ChangeLog][QtSQL][SQLite] Updated SQLite to v3.35.2

Change-Id: I1e784627d7ed3a226acfbb28d8379d4c69f91a84
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 022fd8e79cfa25049f262bbd6aef4298f14b4d96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-20 12:50:40 +00:00
Alexandru Croitor
eddd692069 CMake: Get rid of the Core_versiontagging object library
We don't currently handle object libraries when creating prl files for
static Qt builds, so it's best to compile files as part of the main
Core target.

Use source file COMPILE_OPTIONS to add the -fno-lto flag to the
global/qversiontagging.cpp source file.

Amends 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967

Change-Id: Iac1d37ecb4caa7c9889d44b3a103a9bdafec49f3
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d68486547aaf05994f39786f8527bcb454c6db3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-20 09:30:46 +00:00
Volker Hilsheimer
0ccabaf827 Consistently check for nullptr in QGraphicsTextItem::inputMethodQuery
If dd->control is nullptr, then it's nullptr all the way, so don't
dereference it in the calls to dd->controlOffset.

Fixes static analyzer warning 9c33d9bc9b8cf438dccb63aa52afcbe0.

Change-Id: I7a61b6438422373678d4fcb66255b750c550724d
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7edf0fbb9e8cca2e2f2695a1b5dc7a0a143bc211)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-19 21:54:20 +00:00
Tor Arne Vestbø
a927e458e3 qmake: Improve error message when detecting macOS platform SDK upgrade
Task-number: QTBUG-85546
Change-Id: I2bce9d22ad826fa73fa4dbfd03c9b1d404c57859
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fca543bcdeb2cb5c6c478e96a7d75010f637d784)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-19 17:22:14 +00:00
Fabian Kosmale
3026440ecc tst_bench_qmetaobject: Fix test
The code has apparently been broken for quite a while, probably since
the change that made the QObject constructor invokable.

Fixes: QTBUG-91710
Change-Id: I8b7e6c8a579913b3d0e2a364ffdbffe8d404c72b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ed3df88846d3d92baf7110063cc7b82b7c45d1ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-19 15:52:41 +00:00
Eirik Aavitsland
774f4542ed Avoid int overflow in QImage rotate90/180/270
Fixes: QTBUG-91223
Change-Id: Ice53c80d695a5ffdf9162df84e7c9b1e43106bae
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8daa94431341afece6beb052e6224d215f8507b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-19 05:40:34 +00:00
Eirik Aavitsland
5463203fa2 Update bundled libjpeg-turbo to version 2.0.6
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.6

Change-Id: I3e308d241853edf3c1d616955cda203220a258d8
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit ede0082f861146d441df641d93f815dbe63a9076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-19 05:40:24 +00:00
Robert Löhning
13c0eee15f QAsn1Element: Avoid overflow in QAsn1Element::toInteger
Fixes oss-fuzz issue 29534.

Change-Id: I51d0b8238c73e5860c40d3b74577ddb8926647a3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 11a3eab1e168256778c45090b56e998e50c08c55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 21:04:59 +00:00
Assam Boudjelthia
b668373477 CMake: make sure to collect Android dependencies for plugins
androiddeployqt relies on *-android-dependencies.xml files to know
what dependencies like jar files and permissions a Qt module requires.
CMake create those files under Qt prefix's lib dir but CMake was not
accounting for module plugins.

Fixes: QTBUG-90812
Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d6367aca869ee30e15a3861b2990baafb9972aa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 11:05:12 +00:00
Craig Scott
7acda93e64 Prevent static plugin triggering autogen dependency on reconfigure
A call to file(WRITE) will unconditionally update the file's timestamp
even if the file's contents don't change. The *Plugin.cpp file was
being written using configure_file() which avoids that, but the .cpp.in
file it was configuring from was being written out using file(WRITE)
every time CMake ran. Autogen saw that file as a dependency and then
regenerated the mocs_compilation.cpp file, which in turn results in
unnecessary rebuilds and relinking when nothing is actually changing.

The file(WRITE) - configure_file() dance is no longer needed anyway,
since the generated *Plugin.cpp file is very simple with no
substitutions required. Therefore, we can simplify that file's
generation with a single file(WRITE) that only executes if the file
contents will change or the file is missing.

Change-Id: I2b7d1ff678b85ea7811969d656555592c9b6865f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 63a0d263cf233ddf85a60678829298b50e8d1f26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-18 06:17:08 +00:00
Mårten Nordheim
51dde4b5cb CMake: Don't attempt to add to a target that doesn't exist
When configuring a benchmark using the standalone-test script the
'benchmark' target is not available, causing a configure error.

Change-Id: I8e480c9e72b47783c0910428187f0092049e89db
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1d6a35c5363944ce59eba114f827b1992f31bde3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-17 17:54:16 +00:00
Sona Kurazyan
049e14870c Remove the unnecessary template parameter from the class specialization
This seems to cause errors when compiling with gcc-11. Although this is
most likely a compiler bug, specifiying the template parameter type in
this case isn't necessary.

Fixes: QTBUG-91909
Fixes: QTBUG-90568
Change-Id: Ib231257ccb2e16cc533f23ca5840d31e26a66d53
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 659f7a06e91c04b239e3f4c0bcfccbe3581af1c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-17 17:54:13 +00:00
Sona Kurazyan
45a6f60aaf Mention QPromise in the QFuture docs
Change-Id: I5f6930116da534dd1dea41c4724c42104de38877
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 0477f6b15a2d71d47c39e52b5da140d19aa76f31)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 09:34:07 +01:00
Oliver Eftevaag
57b59e4628 Add nullptr check
Adding a nullptr check before dereferencing in case q is null.

Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 57f752b30a0f452e9cc079b5a4ede6134719a769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-16 19:54:30 +00:00
Edward Welbourne
de9a97a47a Include minus sign in ImhFormattedNumbersOnly's available keys
UIKeyboardTypeDecimalPad only provides digits and decimal point, no
minus sign, but ImhFormattedNumbersOnly is documented to provide a
minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes
punctuation, which should cover signs as well as decimal separator, so
use that - same as for ImhPreferNumbers. A little more permissive than
we want here, but that's better than more restrictive !

Fixes: QTBUG-91455
Change-Id: I0418946014e0a66d503e61704154fd7798a0b785
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 17bf553b76ebd688e58e4de4271407e2058d89ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-16 13:12:50 +00:00
Laszlo Agocs
c8991d2986 rhi: metal: Stop using BufferOp for no good reason
Do what the Vulkan backend does, and just take the offset
and the QRhiBufferData. There is no reason to store a full
QRhiResourceUpdateBatchPrivate::BufferOp struct within the
backend.

Change-Id: I67528029de40320b3e4f031346d40dfc0bb9ab52
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit adf6ba7eaeba97fb2561394e52ee265d94e1c6e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 08:57:25 +00:00
Laszlo Agocs
90e71575fb rhi: metal: Skip unnecessary writes when updating the entire buffer
Follow the similar Vulkan change in 20eb40bce92c3e5460cd2540547f3c404fe6dccc
and drop the queued up buffer data for a given slot when the current update
covers the entire buffer. This is relevant in particular for Qt Quick 3D
where such dynamic buffer changes are common.

Change-Id: If1e70d78968586b552a5357bc97af10cc61d9611
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 0c6375a346551dbf2effb2ea54e1df7de56f0849)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 08:57:23 +00:00
Eskil Abrahamsen Blomfeldt
e815198402 Support family names that end/start with space
If the family name starts or ends with a space in the actual font
data, then this would not be selectable by Qt. This is because we trim
the family name before matching it against the contents of the database.

Testing on Windows GDI, it actually does trim the spaces on the
family names (matching a request for "Chibola" with a font called
"Chibola " for instance), but since we read the font data ourselves,
we are not doing this.

To ensure we never have font names that cannot be matched in the
database, we make sure we trim the family names before registering
them.

[ChangeLog][QtGui][Text] Fixed matching against fonts which has a
family name that ends or starts with a space.

Task-number: QTBUG-79140
Change-Id: I9cdb50b78a7da2d2697f992ce462033eb1d7ada7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 7fd9ed32012bd9001e78ad692a4802e0e3366e44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-15 06:05:23 +00:00
Fabian Kosmale
022782d371 Fix QMetaType benchmark
The benchmark used to crash because QMetaType::typeName would return an
empty string, which is not a legal value for newRow.

Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 1316af2f3ed7861d0955793261a18f8ebf237f6f)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-12 18:03:30 +00:00
Andrei Golubev
341654213b Fix QMultiHash::count(key) crash
As QMultiHash uses a pointer for the data, nullptr dereference is a
thing, so check for valid d before doing anything in count()

Fixes: QTBUG-91704
Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f226854d256a382a5cc7ff08b10a0d27fbefb0fe)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-12 15:44:26 +01:00
Eirik Aavitsland
4e1c5d980d Avoid undefined color values in corrupt xpm image
Issue reported by Codechecker.

Change-Id: I1a5aa2203fb31e0ce3b630a11e450925aee81fb0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f651e6a26cb59f7b7c7671cded8a10b9f98f5c71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-12 11:41:35 +00:00
Paul Wicking
8182507ac0 Doc: Change section titles that cause bad links
Section titles are valid targets for QDoc's autolinker. When
they are identical to other valid link targets, such as for
example a class, these sections may cause invalid links.

Fixes: QTBUG-91141
Change-Id: Ie9a6258d2bf83932335976d8c0b5fc59f2028ae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 5fa8f5df7bb722c5b7451229f5eecd13bd13326f)
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-12 06:37:08 +01:00
Volker Hilsheimer
1c0c2c4ded Revert "QPushButton: fix support of style sheet rule for text alignment"
This reverts commit 6269438af95bbd988ead08829fa3bc9dc25891e8, and adds a test.

This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The
code already interprets the textAlignment values from the rule, also if no
icon is set. Adding the same, or some default textAlignment to the text flags
if there is no icon doesn't work.

Fixes: QTBUG-91735
Task-number: QTBUG-86857
Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 674747bac1c8b57d4940de2ee68b6b562dfcad61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-11 23:35:53 +00:00
Paul Wicking
e36aa59a17 Doc: Add hyperlink to relevant section
Fixes: QTBUG-91734
Change-Id: I3910c7fcf1625ad08a65e691a8eaf9ed6b61779a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b42df9756a8d72cbdfbf72f15e98385b35148eb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-11 16:57:28 +00:00
Alexandru Croitor
562ee2f3a8 Bump Apple platform minimum versions
Includes both minimum deployment targets and minimum sdk
versions.

As per supported Apple platforms versions which was done
in qt/qtdoc at
8807fdedce29cbbd7662fcd745234da30eace3fb

For Qt for iOS 6.0.x we only bump the minimum
deloyment target because applications seem to crash with iOS 12.4+,
and it's better to have a build error than a runtime error.

The minimum required sdk will not be bumped for 6.0.x, so we don't
accidentally break someone's existing build, given that 6.0 is already
released.

Task-number: QTCREATORBUG-23574
Change-Id: I3046384164f2d7fdbd0cfd16dcb85e0d60bc56ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4b2035cd0f9a7c289c7a9e470fde83dae9351092)
2021-03-11 12:22:44 +01:00
Laszlo Agocs
5a7655832a rhi: metal: Avoid unused argument warning on iOS
Change-Id: I4cb729f3d8dbe7703b89153b742ce2874f35cfd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dd7087342dc73ee7adf7b24fc96f79d9d1056682)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 17:32:52 +00:00
Laszlo Agocs
b130d16a27 rhi: metal: Use the layer as the single source of truth
...when it comes to the output size.

This mirrors what all other backends do. For example, with Vulkan
the only source of size is the surface (VkSurfaceKHR), never the
QWindow, even though we'd expect that the surface size equals
to window_size * dpr, and that's almost always true, but there
are exceptions. (e.g. we have seen bugs on Windows with some drivers
in high DPI situations where the Vulkan surface did not fully match
the window size, yet it is the surface, and only the surface, that
matters for rendering, i.e. viewports and such must match the surface,
not the native window)

With Metal we hit a similar problem on iOS: the QWindow's size*dpr
and what we calculate from the CAMetalLayer have a height difference
of 1.

Mitigate this by making QRhiSwapChain::surfacePixelSize() and the
calculation for currentPixelSize() done via the same route (the
CAMetalLayer). Otherwise, if there is a mismatch between what the
QWindow and the layer says, Qt Quick will think that there is a
resize happening (has happened) whenever starting a new frame, and that
has far reaching consequences (suboptimal performance, increased
memory usage by buffers, etc.)

Change-Id: I114df92bf35622c99f2747420fdce401db7705a6
Fixes: QTBUG-91438
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 83fb8fe208ec816df7d04c8247d5696d95f2cab1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-10 17:32:44 +00:00
David Faure
b9091e4cec QConcatenateTablesProxyModel: skip dataChanged in hidden columns
When the source models don't have the same number of columns, the proxy
keeps only the smallest number of columns across all source models.
Afterwards, if a source model emits dataChanged in a column past
that number (a "hidden" column), the proxy needs to ignore it rather than
assert.
But also, if the source model emits a dataChanged signal across both
visible and hidden columns, then the last column number needs to be
adjusted so that the signal is correctly processed and forwarded.

Task-number: QTBUG-91253
Change-Id: I939e8ec0faf41370472f86785851292e4372f72c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit f6efbd23b59bcf75866ce47fb762c99f2e4a128a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-09 21:16:54 +00:00
Laszlo Agocs
2ed9bae3df rhi: gl: Fix missing uniform data with certain command lists
Following patterns from the other backends is insufficient with OpenGL
because we do not use real uniform buffers. There is currently a
possibility that a shader program will be bound without following it
with setting uniforms. Correct this by having a second level of tracking
of the associated srb object in the pipelines.

Fixes: QTBUG-91630
Change-Id: I74a012daade826dd22c436bde06381c1233bad11
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 80029e0ca65d4bf4575f7a08d186c781ec6c2f0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-09 13:45:34 +00:00
Jan Grulich
75e8b80c6e FileChooser portal: send window id in hex
We send window id in decimal, however, it is expected to be send in hex.
This causes a mismatch and makes portal dialog to show in background.

Change-Id: Ibd77199bbb4a2ad4782a0457ddc5506c6b5608fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit acaabc9108dfe75530960cf8e3ec4f3602cd82e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 21:06:16 +00:00
Qiang Li
3a2fe41c9f Fix the crashes when animated QTreeWidgetItems are hidden
QTreeView's drawTree implementation performs lazy layouting
when calling itemDecorationAt. If animations are enabled,
this can change the list of items, and invalidate the copy
made earlier.

Don't copy the list of items, use a reference instead so that
code iterating over the items later operates on valid data.

Add an assert in the private itemHeight method, it must not
be called with an index that is out of bounds.

Fixes: QTBUG-42469
Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f140ef04a0c54c2c8a699db33433b8d7235d137c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 14:39:05 +00:00
Liang Qi
46b0f3e170 xcb: unset old states and set new ones for window
This partly reverts a02959bb5b43a3f9d881e5213ceedf535202b6a1.

Fixes: QTBUG-87078
Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f61b140482d9578c07410a5979379e44e05352e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-08 10:52:45 +00:00
Paul Wicking
aac5b02e28 Doc: Use correct include for QWGLContext
Task-number: QTBUG-91500
Change-Id: If487a2d14dd61d127dc35aa039f9b71915128da1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 15f934dcea2743ceb59d3c9ad840e2b00b39d043)
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-07 23:06:21 +01:00
Øystein Heskestad
4e1bd90f3f Make qdecompresshelper archive bomb check only trigger for large files
This is to avoid false positives.
By default files are large if uncompressed size > 10 MB. Only configurable internally.
Also add auto tests.

Task-number: QTBUG-91392
Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit be73ca7eb1cebcc15064666e647bc337b5c2baa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-07 07:55:38 +00:00
Andreas Buhr
920ecea06a Add documentation for Q_OBJECT_BINDABLE_PROPERTY
The duo Q_OBJECT_BINDABLE_PROPERTY and QObjectBindableProperty
can only be documented together. The documentation is now with
QObjectBindableProperty. This patch adds a documentation entry
for Q_OBJECT_BINDABLE_PROPERTY which links the user to
QObjectBindableProperty.

Task-number: QTBUG-90511
Change-Id: I9af4a99d49f4b02ee9645a2cc9a9a024a6a1a552
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 89cc39a894dddaa0347ecf08438ea31b4880961c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-06 12:46:30 +00:00
Paul Wicking
081eb5d636 Doc: Fix section titles that confuse QDoc's autolinker
Fixes: QTBUG-91620
Change-Id: I7c407c7158324d1fbbeb78e47d2198e8ddf5daa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c1c61c3bb468b9db7b3bf1ca49e8b71a146ff780)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 15:35:37 +00:00
Ville Voutilainen
e4f9ddc9eb Android: make calling exit() conditional on an environment variable
Task-number: QTBUG-82617
Task-number: QTBUG-85449
Task-number: QTBUG-83043
Change-Id: I5ac67b5d57550e5a1f816e5db01f4aab31127283
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6e0ce4ee8005d36ee5d080212b8d83b42ebcae17)
2021-03-05 10:34:50 +02:00
Jani Heikkinen
3b46aa16b3 Bump version
Change-Id: I3b7582e602fd7408b206bf6f426444b02a749fdf
2021-03-05 07:53:13 +02:00
Volker Hilsheimer
0a69974827 QMenu test: turn tooltip animations off
QTBUG_89082_actionTipsHide() is very flaky if tooltips fade in, as the
mouse move might happen while the tooltip is still appearing.

Fixes: QTBUG-91532
Change-Id: I55305927fcf143d99dfff28d0bc70b2e831a139a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d76d8571e2cc9172d2800e4b53f4b6941842dc6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 01:58:17 +00:00
Paul Wicking
8893205533 Doc: Specify correct include for QWGLContext
Fixes: QTBUG-91500
Change-Id: Ie842c9e911fe5492cc13aeba459d28d6553438fd
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit afde5faf856078d34542da1d4d4db8a0237bfc67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-04 21:09:13 +00:00
Friedemann Kleint
945c607db6 Blacklist test QMenu::QTBUG_89082_actionTipsHide() for Windows
Apparently, ba139603925453bf79994eca48b566d8f15b2af0 is not
sufficient.
Amends 3f3d5e6716d9130776b3613ccbd5595de7d4af8d.

Task-number: QTBUG-89082
Change-Id: I80a00abb330bebd3be8667762c279c2eef595c7f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b62725608bbc1a8924209bd733aefe9f0465c3a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-04 15:58:18 +00:00
Allan Sandfeld Jensen
7b3fb2327f Fix out-of-buffer in ICC curv parsing
After the unaligned ICC profile fix, we could read 2 bytes past the end
of the buffer for curv elements with 0 parameters, though we wouldn't
use or return the data.

Change-Id: Ibea9fa2840c01d690716d8f48e301fbfa67aa163
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 840c8b4de2556c22d8b131573a338268dd0107a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-04 09:13:01 +00:00
Allan Sandfeld Jensen
07a65fecbf Fix logic problems with table based grayscale ICC profiles
White-point was calculated wrongly and some tables could cause bad
behavior in the tables.

Change-Id: I24e8f5f3cc1306f5f898a4acbf7b008e26bd04e2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit f493d41722fc76a04f699ea26128fdf3d215d913)
2021-03-03 08:29:57 +01:00
Robert Löhning
ee2dc9e19d Limit value in setFontSizeFromValue()
Avoids overflows in QFreetypeFace::computeSize and
QFontEngineBox::boundingBox

Fixes oss-fuzz issue 30290

Change-Id: If8e9ff74bf706a701e26832ad21b3439a3b437f7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 976fede67ca4a4d322bc8d2c00266a2e2f1a6e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-02 09:20:12 +00:00
Friedemann Kleint
abba0367fe Brush up the imageviewer example
- Fix the save as file dialog being in "Open" mode by setting
acceptMode
- Fix clazy warnings about detaching QList by using constFirst()
- Fix clazy warning about passing a context to slot connection

Change-Id: I0c800e9829e118fcec477322aa2a13660e3b51d2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit fe1ef3ebcbfe017bdb01e16480a5c38cad6e39b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-02 07:58:19 +00:00
Allan Sandfeld Jensen
60c5f9502f Reduce warnings from ICC parsing
Messages about Qt deficiencies reduced to info, and info set as the
default message level.

Fixes: QTBUG-91401
Change-Id: Ia97438f08de5e0383e77631dca9b253b47ef8167
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 63152571844a15adfa76db5f8a9e7a505da75412)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-25 23:18:38 +00:00
Allan Sandfeld Jensen
4a57534f67 And fix handling and test of QImage::fill(uint) as well
Only RGB444 and RGB666 were treated slighlty different from the rest,
but the test had a few additional mistakes.

Change-Id: I4728b4036affedfffce8bca5c1e7be3869344fbe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c2bec047e281d949015ecd27daf2ba2d51b21526)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-25 11:22:53 +00:00
Eirik Aavitsland
723077eb35 Fix recently added auto test of text layout overflow
Ignore width of trailing space.

Fixes: QTBUG-91038
Change-Id: I74e278366a2c3b170335738bf6d6ee23933b361a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit be4127d6f747742c714914e1b313186422b438f3)
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-02-24 17:42:08 +01:00
Valery Volgutov
d0dbb79363 evdevtouch: Fix wrong addTouchPoint for "mtdev"
Origin patch 359546b069051213a7b337fefbe21b664618f959
has following rule:
"the state for processed released points is reset
to zero at the end of the SYN_REPORT handler"

Patch 4e400369c08db251cd489fec1229398c224d02b4
changed state according new event refactor, but not fully.

Task-number: QTBUG-86013
Change-Id: If35b756d5c726533f11d18e7b73c98fffa17d809
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 462410a08b8bbfb068b6e06573adb0701c527d06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-24 05:49:35 +00:00
Andreas Buhr
7833eae304 Fix handling of virtual/native pixels in QAndroidPlatformWindow
f92e1953699b2529cc6ea2fd399fe4f2b887e83c made sure a new
QAndroidPlatformWindow always has a geometry. However, it did not
take into account HiDPI handling. This patch fixes it and introduces
proper HiDPI handling.

Fixes: QTBUG-91161
Change-Id: Iddf31b7abfd0a1bada3b051ed4de3bf6c2897d8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit dec429e0778493bc4e85d6b18202804d0bbbe5f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-23 16:56:22 +00:00
Andreas Hartmetz
bdfbd4c20b Fix QNetworkInterface IsUp and IsRunning enum documentation
The information is based on common Linux knowledge, StackOverflow
answers (this is just one of them):
https://stackoverflow.com/questions/11679514/what-is-the-
difference-between-iff-up-and-iff-running
an LKML thread about IFF_UP and IFF_RUNNING:
https://lkml.org/lkml/1999/7/9/69
and the FreeBSD manpage for "ifnet" - e.g.
https://www.freebsd.org/cgi/man.cgi?query=ifnet&sektion=9

Change-Id: I50a47b7fb26a63ac9d3f7eeef559fa7f56003cff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e6bd5a5ca3f55765edccf7c667612fb0919e6c94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-23 11:49:37 +00:00
Joerg Bornemann
47be67d65a Fix FindWrapOpenSSL.cmake if OpenSSL::Crypto is UNKNOWN_LIBRARY
The attempt to call target_link_libraries on OpenSSL::Crypto failed when
this target was added as UNKNOWN library by FindOpenSSL.cmake.
Instead, set the INTERFACE_LINK_LIBRARIES property directly.

Fixes: QTBUG-90925
Change-Id: Idbc1379c89480225fc7a8d417416ed20404a1122
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b6b9e54f167aab104600f4d4a2db71ae70561c3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-23 07:52:01 +00:00
Dong Rui
25d8f9da70 QLineEdit: Fix editingFinished() not being emitted when pressing the clear button
When pressing the clear button, the editingFinished() signal was not
received when focussing out.

Call  _q_textEdited(QString()) when pressing the clear button.

Fixes: QTBUG-83295
Change-Id: Ie4bc6d9a2f27f89163c05c4c15175540c7631a30
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit c5904cb96aed3b171c543a2cf0bed8f8ac5f95c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-23 01:06:25 +00:00
Volker Hilsheimer
e1cc406ea4 macOS: don't let windows that are transparent for input become key window
Such windows are typically used as mostly transparent overlays on top
of other windows underneath. Letting such an overlay become the key
window breaks cursor updates and focus handling.

Fixes: QTBUG-83632
Change-Id: I192d419a5bdb8dfa0e9223e9fbbd7876c62fe743
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 24b07b2b2d367c61b911c8f3a72f7209ef7e00d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 18:02:58 +00:00
Lars Schmertmann
aebbf928fa [Android]: Fix exception when using Qt to create a service on Android
Fixes: QTBUG-91194
Change-Id: Idd243c17bf82150fe2ea8b0100f8c432d75ef249
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3466fc5b76a97eabc815a7406f01454e4ac0db4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 14:39:27 +00:00
Morten Johan Sørvig
18fd74c70d QMdiSubWindow: Set correct ControlLabel size
The label pixmap may be a high-dpi pixmap. Set the ControlLabel
fixed size to be the pixmap device independent size.

Fixes: QTBUG-87871
Change-Id: Ib836e322d25599cb5e79011ea597e32ee1f8d093
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 33ddacdd24523acbdafcda0f520dd2d73c879cfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 14:39:25 +00:00
Topi Reinio
41743795ae Doc: Remove styling for hyperlinks from the simplified offline style
Using a dark theme with the simplified offline style in Qt Assistant
results in hard to see links against a dark background. Let the
backend style the hyperlinks instead.

Fixes: QTBUG-32778
Change-Id: I51ca87f8a526a07a385e42a3c978712ac4d1e91b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 6ab1f926504e7e4ad64e439f1bb0f7c0f4d3ba01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 14:39:24 +00:00
Assam Boudjelthia
57dad64fe9 Coin: fix android emulator script to use bash instead of sh
Task-number: QTBUG-91180
Change-Id: I410c6769aac3b3b760ff35aa71d52c8a5d6c1143
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 136324ad623c09f47061b8c47deac90111904f57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-19 12:08:12 +00:00
Assam Boudjelthia
88cb10c41c Coin: remove workarounds to allow running Android tests
We had two workarounds:
* script that adds Gui to tests
* create a symbolic link for the qt install dir to fake_prefix which
androiddelployqt was expecting them to be under

Both issues are fixed, thus removing the workarounds.

Change-Id: Ic022bece15afe92c693d573893d260b13b4227ed
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
(cherry picked from commit bcbdbd50fefd90cc8cfe2c01d8f681dfe690971a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:14 +00:00
Alexey Edelev
4a541564f4 Fix the qmake error when building with qtquickcompiler for iOS
Fix condition when adding qmake_immediate to resources. This condition
was wrongly positive in any non-android case, but also had to check for
BUILD emptiness or build_pass. This cause issue because
qmake_qmake_immediate was added to the RESOURCES variable earlier, than
actually generated.

Fixes: QTBUG-88031
Change-Id: I38dad858a7e81ab709e622ec24baa8f9b80970fa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 58556afb6960b442f88649b550aaec8e1a04338b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:14 +00:00
Assam Boudjelthia
8bab4c9b03 CMake: handle Android features dependencies for modules
QMake used to allow retrieving the Android features list for a modules.
The dependencies are written to *-android-dependencies.xml files and are
read by androiddeployqt. This option was missed at some point along the
way of writing CMake port for Qt 6.

Change-Id: Ic0b82f024567e640968f97aeff2db1888f2b53a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 09fc4f9525740b8c671c036413153d3419750b99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:10 +00:00
Nick Shaforostov
8ba75230ec fix windows build when both whatsthis and tooltip are disabled
msvc produces warning there and it is treated as error

Change-Id: Ic386df615df591fa1563b147342d670bbec771d2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0ad434c2e9c81ae319840b1bc563c9f04efac524)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:09 +00:00
Ulf Hermann
9c90e976b0 QJsonObject: Fix operator<=()
We had a copy-paste error there.

Change-Id: Ib1448197ac4f4641c6559f133f41dcf326f210f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a2e23bca0f2b43a26e2e489f83cfe2e521da63b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:08 +00:00
Lars Schmertmann
4cafeba508 Android: replace stacktrace with debug message in search for setService
Don't print stacktrace when setService is not found but only print a
debug message, QtServiceDelegate will continue to look for setContext
which might actually be a problem if not implemented.

950e628fd842f22ac741b18440fcc99213820587
did this change for QtActivityDelegate.

Fixes: QTBUG-86733
Change-Id: I8f2c6494da9133a3e9dedaabbe5fc931732d0d72
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 15572f9efeb1b7dd609b55f8981eb5b5dc3d3db9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:45:01 +00:00
Edward Welbourne
7e3c646577 Correct qt_mktime()'s check for last second in 1969
It was comparing time->second() to MSECS_PER_DAY - 1, but
time->second() is the second within its minute, so is at most 59.
It should be comparing seconds into the day to SECS_PER_DAY - 1.
Prompted by a PVS-studio article.

Change-Id: I1802c49fa18818f4b4fe74f187da5f799df7d1de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 94b9ee03b5646bf58c12337bbc44e38265ad15a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:44:57 +00:00
Edward Welbourne
8ae64f3d08 Remove redundant code in androiddeployqt/main.cpp
Prompted by a PVS-studio article.

Change-Id: I9699cc9baf9c90a6cf5b9564cd175205a9b2fa6b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 36ea42effc0cb7eee55f0545221e6f8fffaa1179)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:44:54 +00:00
Alexey Edelev
33bc82f466 Do not rewrite boolean INPUTs if they have a corresponding feature
Initial replacement of boolean INPUT_ variables to the FEATURE_
variables was wrongly changed to updating of the INPUT_ variable
value to ON/OFF value. This causes potential issues when INPUT_
variable has explicit check for 'yes' or 'no'.
The feature evaluation step enables FEATURE_ variables in case if
the corresponding INPUT_ variable contains a positive CMake value.
So there is no need to process boolean INPUTs at the argument
processing step.
Also no need to keep the special opengl case, since it will be
processed correctly.

Fixes: QTBUG-91158
Change-Id: I96bb7903a904ae3cf788d7ef7d4e0c019046eb95
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 530b62934923070b5b8b5c5b3c764a2b7d4db039)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-18 15:44:50 +00:00
Jani Heikkinen
3a4f8e4e09 Bump version
Change-Id: Icf461173d5852eb4bc52a12f2ba24200d6026857
2021-02-18 07:33:29 +02:00
Edward Welbourne
3e033a8350 Rework tst_QDateTime::toString_isoDate() to eliminate an XFAIL
Instead of an XFAIL, actually test what we expect will happen for the
test, namely that the milliseconds will be lost. In the process,
verify that milliseconds since epoch also matches what was expected,
change an "expecting empty" condition to check for the "invalid"
test-case to which it's actually relevant and note that this test-case
shall need amended when we update our ISODate support to the 2019
update, which extends the year range.

Task-number: QTBUG-56552
Change-Id: I680aa31ee0dcc8fadabb5d4cd6c083a8afd48573
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cc93dadf772480df3b27fd031a471047a5db0038)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 12:49:49 +00:00
Alexey Edelev
44bc8a6353 Fix qmake_qmake_immediate path for Android
Add missed RCC_DIR to the qmake_qmake_immediate.qrc path,
when generating android deployment settings.

Fixes: QTBUG-90969
Change-Id: If4959581fcc153d9c19d178233297fc7b440b2f7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f8736d34d4ec00d27d05993de2dee661089f0dfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 12:04:31 +00:00
Alexey Edelev
4d1808e502 Remove the corelib_add_mimetypes_resources call for the Core library
Looks like the corelib_add_mimetypes_resources call is redundant and
deprecated. It duplicates the mime-type database in the Core library.

This also fixes the static build of the qmimedatabase tests, since
avoids propagation of the resource symbols by the Core library.

Fixes: QTBUG-89952
Change-Id: I5c0dbd761b7726589fdf6970cd546af89d2ff837
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 01e32d5c4a0ca1da0f31f57b970ef271fe13bd1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 12:04:20 +00:00
Tor Arne Vestbø
3c7db6ce41 tst_qapplication: Prevent desktopaware test from deactivating main test
Applications on macOS are automatically activated (put into the foreground),
when launched from the Finder, or via 'open' on the command line. But when
launched from the terminal, e.g. foo.app/Contents/MacOS/foo, the application
will launch in the background (inactive).

In Qt we override this behavior, activating the app even when launched from
the terminal, as a convenience, as long as the application is a GUI application.

Unfortunately this means that when tst_qapplication launches a subprocess that
is a GUI app, it will steal activation from tst_qapplication, which in turn
will break tests that later try to activate a window and check that the window
is then active. The window will not be active until the application is active.

We can work around it by preventing Qt from activating the application, but
ideally we'd find a better solution to this, as we don't want to sprinkle
overrides all over our tests.

Fixes: QTBUG-90699
Change-Id: If53a86548002b739df0c0a7153d6244924a4a205
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 09cc63d425dabfa37b406e7eb1cee627c2eabb67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 11:58:03 +00:00
Allan Sandfeld Jensen
2f0d44b403 Extend colorspace testing and fix bug it uncovered
When changing transferfunction the look-up-tables needs to be
regenerated.

Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b2631c72c0628e68c0fae7567fd12e6646455efc)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-02-16 12:51:50 +01:00
Friedemann Kleint
2e3b53ef26 QRectF/Documentation: Fix malformed table
The colspan should be 2. Manifests as error in the Qt for Python documentation.

Change-Id: Idec8a2b62a3495e00b7f2b31e8ed9d04b551f22e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 5de72ac9150e4c6a6b5bc52f49fd2a891c4eb20c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 11:49:40 +00:00
Fabian Kosmale
52fc2539e0 Mark QPropertyAlias as internal
That class was only really meant for the QML compiler, and it is dubious
if event that one needs it. The current implementation is also broken.

Change-Id: Ie40d282707f3fabc8079bee9e98f082aeb9d30b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 5481601debd6ce06bb8f0135e3ea4baf8a21cb3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-16 01:24:48 +00:00
Edward Welbourne
8de9fefed8 Fix tst_QDateTime::systemTimeZoneChange() for 32-bit systems
The test verified that a LocalTime's time since Epoch changes when the
system time-zone changes. This works when the QDateTime object is in
short form and recomputes its offset from UTC every time it is needed,
but fails with a pimpled QDateTime, as this caches its offset from UTC
when it is created, saving the recomputation which - in the far more
usual case where the system time-zone does not change in the lifetime
of a QDateTime object - would normally produce the same result.

Changed the test to use a newly-created QDateTime constructed with the
same parameters, which doesn't have the cached out-of-date knowledge
of its zone offset. Removed the XFAIL. Made the test data-driven and
added test-cases: one so close to the Epoch that it should be short
even on 32-bit systems, one so far that it's pimpled even on 64-bit
systems (used in reproducing the issue in order to debug it).

This then revealed that Android 5 doesn't seem to support the POSIX
zone IDs used by this test, so it now verifies that LocalTime has the
expected offset from UTC after zone changes, QSKIP()ping if not.

Documented that the behavior of LocalTime is undefined after a change
to the system time-zone. Cleaned up the existing doc of Qt::TimeSpec
in the process.

Fixes: QTBUG-89889
Change-Id: I1058f47a1ff3ee1c326f3579ac80bd8bab242e28
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 02ae1b522193b60e7a5c8e5eff7a15d25b0f7aae)
2021-02-15 23:39:19 +01:00
Mårten Nordheim
3062902f70 MinGW: fix warning in QMatrix4x4::map functions
The definitions get the following warning (treated as error):

redeclared without dllimport attribute after being referenced with dll
linkage [-Werror]

I take it to mean that because they are labelled 'inline' the compiler
disregards the 'dllimport', but that makes it inconsistent with the
declaration. So we label the declaration inline as well.

Change-Id: I87bb42141a1086b2c565db881077f33acb4aab64
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 10aa4b5c61b0073a76ff22946f1682f021cbd34b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-15 22:39:19 +00:00
Mårten Nordheim
5c63d158c2 Schannel: Fix incomplete downloads with read buffer restricted
When the read buffer has a max size we do our best not to exceed it.
Usually there's no problem and we just read more when the next
tcp frame arrives. However if there's data leftover after the last
tcp frame arrived then we won't receive any more data. To counter
this QSslSocket would try to invoke QSslSocketPrivate::transmit
indirectly if there were any bytes available on the plain socket.
The problem is that with Schannel the last few remaining bytes
would not be in the plain socket, but in the 'intermediateBuffer'.
So let's make QSslSocket aware of that.

Fixes: QTBUG-90625
Change-Id: If56e4cce558f99c9a08a1f6818e005a887712ef2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Norbert Pfeiler <norbert.pfeiler+git@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6d4da1340f18b66e60ed6969aeb7180e00d39077)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-15 16:00:45 +00:00
Friedemann Kleint
2e541d2ae2 dirview example: Show file icons on Windows
Use QFileIconProvider from QtWidgets.

Task-number: QTBUG-66177
Change-Id: I22db2f8671c64d90c45ff7160af9a6925d1cecea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 060fceb2ab7f39d04d977146db2e5f990804e398)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-13 12:21:02 +00:00
Assam Boudjelthia
00a8218a2c Android: set minimum recommended android SDK to 29
comply with the api version used by default with androiddeployqt and
in docs. Google play also requires api 29 as minimum.

Task-number: QTBUG-90943
Change-Id: I05e2a90b4d7f2120b0198e3fb7b8b1b2398eba93
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit e711eb35f54cabf8b0beff49e5b748731d042c63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-13 01:47:24 +00:00
Allan Sandfeld Jensen
17b9fdb400 Fix QImage::fill with semi-transparent QColor
A few formats were not treating the input QColor correctly. Fixed and
added more exhaustive test.

Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 95712c5e5438e4eb5cd205ab4659febf3192137a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-12 20:46:10 +00:00
Assam Boudjelthia
7db44587eb Add build.gradle to easily modifying Java project with Android Studio
Change-Id: Ie030ff0a3569caa0eacfa331d21f59e5455c90ed
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 886a2d4511bdd5705595bcf4a29fb22f84c0e9aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-12 15:37:44 +00:00
Tor Arne Vestbø
5506313d54 iOS: Disable three-finger-tap editing interaction menu when there's no focus object
A typical Qt application, such as a QML application, is a single full
screen QUIView, containing all of the granular controls of the UI.

The view accepts first responder status, so that we can pass on text
input to a possible text field inside the UI. That however triggers iOS
to bring up the editing interaction menu whenever the user taps with
three fingers, as iOS can't know that only parts of our view is suitable
for interaction.

To mitigate that we override the editingInteractionConfiguration getter
of the view, as documented, and dynamically report the correct enablement
based on whether we have an active focus object that accepts input.

This works because iOS queries the getter from the three finger tap
gesture recognizer, before showing the menu.

Change-Id: I0874340c42e437e1d7251896993f2eafe122f09e
Fixes: QTBUG-89735
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f0f00dbd119e0169bc81aa761e4d548e4ecf2214)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 17:13:16 +00:00
Richard Moe Gustavsen
405bf69ebe iOS: close edit menu upon focus transfer
If you select text, the edit menu will show.
But if you tap directly inside another input
field, and as such, transfer focus, the menu
will continue to stay visible.

This patch will ensure that we hide the edit
menu when the input field that it was
requested for looses focus.

Fixes: QTBUG-90937
Change-Id: I1d97bd57fc793826a3170404795b06a1e058d1b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 0bae5fbabbb64371b1b6c646ce0a32e084e42f83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 16:22:06 +00:00
Andrei Golubev
249b310046 Restore pre-Qt6 QList::fill() behavior
Somehow QList::fill(t, newSize) introduced a regression in Qt6:
when newSize < QList::size() we should resize to the newSize.
This is aligned with QVector::fill() in 5.15 and std::vector::assign()

While 6.0 is already out, picking it to 6.0.x could save someone who
haven't migrated yet as well as fix some accidental bugs in Qt's code

[ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in
6.0: calling fill() with size < current list size wouldn't truncate the
list

Fixes: QTBUG-91042
Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 6512a7fc642c65455db770385c67cfa6d71c294c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 10:30:03 +00:00
Assam Boudjelthia
98e9275112 CMake: add Qt::Gui dependency by default for Android tests
Normal Android apps require Qt::Gui dependency and since tests don't
need to handle any special cases for an app without Qt::Gui, let's add
it by default.

This also will allow us to remove some workarounds done on CI side to
run tests for Android.

Fixes: QTBUG-90870
Change-Id: I845650c17a1b73e4c4977043f863ec44e50f06c3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit 85c7a9d3a6710f8487ce4aa1e4e2d7d1d46b6cde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 10:29:55 +00:00
Assam Boudjelthia
dc34954d4c CMake: always pass QT6_INSTALL_PREFIX to androiddeployqt
Qt CMake uses a fake_prefix as install dir when running tests instead of
the main qt install path, this will throw androiddeployqt off since it
expects the real qt install path which has gradle and java sources.

Fixes: QTBUG-88579
Change-Id: I6580470840ae14d4a4a68a95f217b30408d7ab44
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0d42f4df9275897d708ee01ed879ac185aab7360)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 10:19:03 +00:00
Eirik Aavitsland
69e0205bcb Avoid overflow in text layout
Fixes oss-fuzz issue 29313.

Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit bfc09b8d8fa6c1a397aff458c644ed424754adf0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-11 06:18:32 +00:00
Eirik Aavitsland
3fec6597a5 Filter cosmetic lines using transformed, not world coordinates
Lines smaller than 1e-12 would not be drawn even when scaled up.

Fixes: QTBUG-75630
Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 1549dff04c49aa37333e54f8bc45900d0f35b270)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-10 22:33:30 +00:00
Alexey Edelev
9d49f19291 Fix compilation of the QPSQLDriverPlugin plugin with enabled PCH
PostgreSQL package delivers several header files such as pthread, zlib,
zconf, uuid, etc. within Windows installation package. The headers are
exposed to the compiler by PostgreSQL include paths and have different
versions. When compiling PCH of the QPSQLDriverPlugin plugin, MinGW uses
the pthread.h header from the PostgreSQL include paths, that cause an
error related to pthread implementation mismatch.

Disable PCH for the QPSQLDriverPlugin plugin, when using MinGW.

Fixes: QTBUG-90850
Change-Id: I0be91bbefe37731acb2658d679b5b644ef552b23
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 43cb801ccb10e2d9efd230803822761b794fd4fb)
2021-02-10 21:56:27 +00:00
Alex Blasche
128370356f Fix completely wrong init_class and jar_bundle_native values
This prevented androiddeployqt from properly deploying libraries which
specify init class via the ":" delimiter.

Change-Id: Ib9cfa7edc864d7d540577df22284ceb9714a2511
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
(cherry picked from commit 8cceb04232001e51276f1588d9e67f2c696fbe91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-10 20:27:50 +00:00
Alex Blasche
80d094252f Fix typo in android APK generation log
Change-Id: I9e593f35e1c4a51ef2cd4b08fe7e4b7c1a35a5d6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 04eb9b7c3279e7e8c3f6079cc28cee9baea5e944)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-10 20:26:41 +00:00
Assam Boudjelthia
e3ef9f29fb CMake: fix typo in qt_finalize_executable snippet
Task-number: QTBUG-90943
Change-Id: Idea90f1a5fdd2070102ebda85feed79abcba3f70
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ab907053bd7b4c5acc1ddb9220a708b9244f7b0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-10 00:42:36 +00:00
Mitch Curtis
2c797da853 Doc: link to QScopeGuard in QScopedValueRollback documentation
Change-Id: I02b9960fe37b09bc373ed52dec84b1efc8f43397
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1c2aa56cfa2c5648f05aed912dae2bb3ed5d8951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-09 21:59:23 +00:00
Wang Chuan
cc5a1473f1 QPlainTextEdit: adjust scroll bars when showing up
The text of QPlainTextEdit might change when it is invisible, so an
adjustment of scroll bars is needed when the QPlainTextEdit showing
up, otherwise the range of scroll bars might be incorrect.

Fixes: QTBUG-77937
Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 13ae47d98057c2ddca8c865b845973d7e4c8dd8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-09 17:52:06 +00:00
Christian Strømme
56981d3073 Android: Fix the input type for date/time
The default variation of the DATETIME class is to show the layout for
date and time. If either date or time is requested, then only set one
of them.

Change-Id: I5178f5f80490b7b0d7e7011d11da402a316d164a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 86e10e1acd34ae4463bb2b0c24b8bdab71c6ade4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 21:02:54 +00:00
Allan Sandfeld Jensen
bce9a182ad Handle macOS 11 issues in softHyphens test
Calculate the effective width of the hyphen better, and compare with
ceiled sizes.

Fixes: QTBUG-90698
Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 0ffdbb21261eee3a9ec1cd541478ee883a12065c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 15:06:08 +00:00
Joerg Bornemann
59e4fe68e5 configure: Fix handling of -translationdir argument
This is supposed to be mapped to INSTALL_TRANSLATIONSDIR, not
INSTALL_TRANSLATIONDIR (without the s).

Fixes: QTBUG-90946
Change-Id: Icec93ffc0dc80d9ac7cf6cf1b13824bc2a1e795f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit b9d1dc43f2764d765caf9fa8102aafea268ed3bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 15:06:05 +00:00
Assam Boudjelthia
426d62464a Fix compiler warnings for QFontMetrics use
Change-Id: I4c416280cef8c316258817184e94962c250370da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d6b9200e329281269ad8c74177f2b2621798ae56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 14:33:15 +00:00
Peter Seiderer
9d21728290 CMake/QtAutoDetect: fix failure with multiline toolchain file
The unquoted 'string(FIND ${toolchain_file_content} ...)' call fails for
multiline content of the variable toolchain_file_content, so add
quotes around, fixes:

  [...]
  CMake Error at cmake/QtAutoDetect.cmake:42 (string):
    string sub-command FIND requires 3 or 4 parameters.
  Call Stack (most recent call first):
    cmake/QtAutoDetect.cmake:311 (qt_auto_detect_android)
    CMakeLists.txt:19 (include)
  [...]
  -- Configuring incomplete, errors occurred!

in case the given toolchain file starts with multiple lines
in the first 80 characters, e.g. in the case of buildroot:

  #
  # Automatically generated file; DO NOT EDIT.
  # CMake toolchain file for Buildroot
  #
  [...]

Task-number: QTBUG-90980
Change-Id: I8e038e08d83016e8253f2e83b2efb8f06034c6cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8aff901f70def69c2ac56754ef4146150e43bf8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-08 12:11:21 +00:00
Eskil Abrahamsen Blomfeldt
c67eaed846 Fix crash when requesting A32 glyph on Wayland
On Wayland we aren't getting any information about the subpixel
layout of the screen. On Freetype, this triggers an
assert / memory corruption when explicitly requesting a subpixel
antialiased glyph (via QRawFont) because it needs to know the
layout to render the glyphs.

It might be possible to get this information in the Wayland plugin,
but at least we should have a failsafe which doesn't crash when
the problem occurs. This simply falls back to using A8 antialiasing
when it doesn't know the subpixel layout.

[ChangeLog][Freetype] Fixed crash when calling
QRawFont::alphaMapForGlyph() with subpixel antialiasing on Wayland.

Fixes: QTBUG-90236
Change-Id: Iddee2e171a81664ae9e3989115881f23262b2182
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ef763e195892a6d8ce207f5d947fe508f645cb6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-05 16:28:54 +00:00
Tor Arne Vestbø
cdeed3f2ad macOS: Don't assume NSEvent charactersByApplyingModifiers: produces character
In cases where the keyboard layout doesn't have a mapping for a given
event and modifier combination the result will be an empty string.

Fixes: QTBUG-90683
Change-Id: Ice06241f0ae71a19cde041410818decc312bc630
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 7c85a45fde5dd3f84eb033261ccb0d54ee72d30c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-05 15:52:36 +01:00
Tor Arne Vestbø
38c6e5ebbd macOS: Don't wrap key event keys in QChar
Key events have a wider range of possible values than the unicode range,
as they also include all the special keys as defined in Qt::Keys.

Instead of turning the argument to keyMapForKey into an integer,
we can remove the argument completely, as it was only used as a
fallback in the cases where UCKeyTranslate (or in the future,
charactersByApplyingModifiers:), failed to map the virtual key
and modifiers to a character. But in those cases we should not
fall back to the Qt key from the key event, as that doesn't
match what the keyboard layout defines. Most keyboard layouts
explicitly define the base key as the key for these "undefined"
mappings, but if the keyboard layout does not, we should not
produce any input in the application, to match what AppKit does
in this case.

Fixes: QTBUG-90315
Change-Id: Ib9ffd9521049ee8e4b103597c1d34cbe3d23dbdf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 6faa33192c99f3432b28591b991918b47bd6fa09)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-05 15:52:28 +01:00
Jan Arve Sæther
d482d8b1b5 a11y: Report mixed state if QCheckBox is PartiallyChecked
Previously it only returned checked or unchecked for a tri-state
checkbox.

Fixes: QTBUG-84616
Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f4887aca1e5ac7b90abf862d7c9828417a74a1b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-05 07:20:09 +00:00
Giuseppe D'Angelo
d0702bef50 QStandardItem(Model): refactor multiData support
QSI(M) allow users to override their data() functions. This
means that we can't have their data() implemented in terms of
multiData(), or otherwise a subclass that overrides data() will
fall out of sync with its multiData() implementation. We must
keep multiData() implemented in terms of data() instead.

While at it, document QSI::multiData().

Task-number: QTBUG-89423
Change-Id: If30a980d8449135b516745fec73170d53367b4b7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a1e9817cec5e0dccf26040d0b0d24e974841d5b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-05 02:54:57 +00:00
Richard Moe Gustavsen
3409cda1bc iOS: hide edit menu if typing on the input panel
On iOS, if you select some text, the edit menu will show on
top of it. And if you tap on the screen (or inside the menu) it
will hide. But if you type on the input panel, it will stay
open. This is wrong.

This patch will keep better track of whether or not the edit
menu was opened by us, and if it was, ensure we close it also
if the cursor moves by typing on the input panel.

Fixes: QTBUG-90860
Change-Id: I0a51382030560182e7925c8b694b42e50943514e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b39081230428a9cc08389342c4610d11b2ee210d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-04 15:06:20 +00:00
Eskil Abrahamsen Blomfeldt
ed3edec3ba Remove false Q_UNREACHABLE from shaping code
This was added by 9ff76c27b9031ae7c49c4c9e8b5a3bea1e0e3c78 on
the basis that it signifies a shaping error and would later assert
or crash.

But the line is easily reachable by user code. If Harfbuzz returns
0 glyphs, it just means it is unable to shape the string, for instance
if the input string only contains default ignorables (like a ZWJ)
and does not have any appropriate glyph to use for replacement.

Qt expects there to always be at least one glyph in the output
(num_glyphs == 0 is used to indicate shaping is not yet done), so
to avoid asserts later on, we simply populate the output with a
single 0 token, which is a required entry in the font that is
reserved for representing unrepresentable characters.

This also adds a test and therefore a zero-width joiner to the test
font to reproduce the issue.

[ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts
when shaping strings consisting only of control characters.

Fixes: QTBUG-89155
Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit fccd419dd632306a4bd85928223e0a56a59510ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-04 09:11:59 +00:00
Christian Strømme
87fcbbe753 Android: Replace magic number for TYPE_NUMBER_VARIATION_PASSWORD
This field has been defined since API level 11, so no reason why we
shouldn't just use that instead.

Change-Id: I8e3ffde3680e41f26d776e1f0474f632186a6b27
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 8ad66a14889e8e1b79eb7e1ca86faa1c19132fd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-03 22:53:36 +00:00
Liang Qi
4807414ece testlib: Only consider major version for macOS 11 and later in blacklists
Change-Id: I9d3f7ca2022b17559dd5bdd5c6bb8c85e89c3f64
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit faab8f603d2cc34c072ffd0822af68dafcfd686a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-03 21:27:48 +00:00
Christian Ehrlicher
cf848323a3 QSql/PostgreSQL: allow blobs with more than 2^30 bytes
Due to limitations of QByteArray it was not possible to store more than
2^31 bytes. This was fixed in Qt6 so throw away the casts to int in the
postgres plugin

Fixes: QTBUG-79059
Change-Id: I8ae7276a04d4936bcf5ba6c413e3412f6c342ff5
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 4e2a94236998cd05753167953d9167793baf9942)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-03 15:51:34 +00:00
Edward Welbourne
ab669173f8 Update public suffix list to today's latest
Fetched from the authoritative source, verified the content matches
that of the current master revision in the github repository.

Amend one cookie jar test to find the last group in the last chunk
correctly - each group arises from a non-empty hsah-table entry, but
the last few hash-table entries may be empty, in which case the last
group isn't just before the last index, it's earlier by the number of
empty hash table entries. In the process, amend this test and the
related test of the end of the first chunk to iterate all the entries
in the group (in the present version, as it happens, each end-group
has just one entry, but that may vary).

Task-number: QTBUG-90214
Change-Id: I6da365a6ca558124f8275e392735071dc77e04bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ad16f79e5fac13f8a9dab8604de6adb6c46fe7bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-03 15:51:34 +00:00
Christian Strømme
7e6adc1115 Android: Fix input method hints for ImhHiddenText
If ImhHiddenText is set then that should take precedence over the
other input method hints. Also, certain combinations aren't really
possible. E.g., ImhEmailCharactersOnly and ImhHiddenText doesn't have
its own specific variation on Android.
ImhSensitiveData and ImhNoPredictiveText are also likely to not work
as TYPE_TEXT_FLAG_NO_SUGGESTIONS is normally ignored by Android
keyboards. A common workaround is to use the visible password variation
but since this will force the layout to use latin characters it's not
something we can use as an universal workaround, so users will need to
manually enable it through the environment variable
QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT

Fixes: QTBUG-85787
Change-Id: I0ff591ec9acf8dd556c7987e6d997cff3ddfe38e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5e95fab53ffa138c1039c71097e77626483c88a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-02 16:57:12 +00:00
Edward Welbourne
7834756da6 QTzTimeZonePrivate::init(): fix handling of empty ID
We were using the first abbreviation in the list, where the current
time's one is probably more apt.

We look up displayName() using ICU, when in use, but that abbreviatio
may be unknown to it. So ensure, when using abbreviation in place of
empty id, that we get the system zone for ICU, for use if we're asked
for the display name.

This is a follow up to b12d6c6a8ab5f7b01bdd2cb862a66a409700faa1.

Change-Id: I177db55de1ffbc763def8a0423642f2b3da74fa6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3c9013b76a6f4214f469613baf7ae5225b649660)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-02 11:56:17 +00:00
Edward Welbourne
2a2783e824 Update to CLDR v38.1, adding Yukon Standard Time
No change to QLocale's data, one addition to the Windows time-zone
data. What was formerly "Us Mountain Standard time / Canada" is now
Yukon Standard Time.

Fixes: QTBUG-89784
Change-Id: I4c9a23620e74ea379be8a4c5ba0896d35fe9b594
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 05e67fbcab40ae702f58053d18cac567e805047a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-02 11:56:16 +00:00
Edward Welbourne
8b1194edea Correct string comparison in Android's IANA ID matching code
It used QString.compare() and assumed it was returning a bool true on
equality, when it actually returns an int that compares to 0 as the
given strings compare. So it should use compare() == 0.

This fixes several of QTimeZone's blacklisted tests on Android and a
crasher, which we dodged with a QSKIP. Added an id-comparison to a
test. Gave two local variables more informative names, made an early
return into a QSKIP so it explains itself.

Fixes: QTBUG-89905
Fixes: QTBUG-69122
Fixes: QTBUG-69132
Fixes: QTBUG-87435
Change-Id: Icf18ed5a810143d6e65d36e34a70e82faac10b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 6ee13db700eecd8dfed54a9ec2d1081b39511562)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-02 11:56:16 +00:00
Joerg Bornemann
f1efd15d43 Fix duplicate symbols warnings in bundled freetype
Some of the listed source files are already included and must not be
compiled.

Fixes: QTBUG-90777
Change-Id: I80b4ca6a50b882445aca513d800ef8375070d786
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit a4574bfd34d68ac7e670626e21175bf2fb04abb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 23:57:00 +00:00
Friedemann Kleint
b1fbaec04c Windows: Fix flicker when resizing translucent windows with QSizeGrip
Do not use the startSystemResize() functionality in that case.

Fixes: QTBUG-90628
Fixes: QTBUG-73011
Change-Id: I8d4843c1715c7f75f9b41c904e6f1aebbf0e02d7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 90dc13ae5facf97a2760edf054d2e002d0eae5d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 23:56:59 +00:00
Alexey Edelev
eef3fe88d5 Add upstream version of FindPostgreSQL.cmake
Add CMake upstream(3.20.0) version of FindPostgreSQL.cmake, to avoid
server-related headers lookup.
Avoid using the Qt version of the PostgreSQL module, if it's
older than the CMake's one.

Fixes: QTBUG-89639
Change-Id: I71a0c3508000901969933aea8a08d1ad431db711
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e3e1fc482053587811f39dcc9d1be231df00f660)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-02-01 20:12:59 +00:00
Edward Welbourne
976ee88149 Fix handling of Sunday in POSIX time-zone rules
Dating from the origins of our support for the zoneinfo file format,
the mapping of POSIX's day-numbering (0 = Sunday through 6 = Saturday,
see [*]) to Qt's (1 = Monday through 7 = Sunday) was done by mapping 0
to 1, when it should have been 7.

[*] http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

Corrected a QTimeZone test that trusted the results it got without
checking which day of the week those were: they were all Mondays.
Verified that the corrected dates are in fact Sundays.
Checked the zone abbreviations, too.

Fixes: QTBUG-90553
Change-Id: I84b4b14f9892ff687918cd3c42c7c9807e45313c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 38a72af4fd311219779f89b2b78cd56d879f61db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 17:38:57 +00:00
Andreas Buhr
1e1b5c44af Fix compilation of ibase sqldriver plugin, added override
With gcc 10.2, I cannot compile qtbase without this patch.

Change-Id: I5be48947e2301d5befeec397291c0da597f7eb63
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit f1cebefd01e8162846e072daa69e48bebd6bbeec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 17:38:26 +00:00
Alexey Edelev
7b8178c9d6 Remove the 'corewlan' feature
Remove 'corewlan' feature from the network related configure.json.

The 'bearer' component was removed in the Network module. It was
the only consumer of the 'corewlan' feature. There are no
plans, yet, to use CoreWLAN framework in the future.

Fixes: QTBUG-90672
Change-Id: I1afb7b04ea75f8cb09cb570d820d16f54a130cf9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 59252a3a969dcfd07304400f68503a4687292aac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 17:38:25 +00:00
Eirik Aavitsland
0d6aec663c Avoid int overflow in gradient drawing
Fixes oss-fuzz 29348

Change-Id: I3568a0a7a7e8d87881f5b052c6c00831b53b3842
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 93243b5d6a6726087aeec387366ca699cad4e31c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 17:38:24 +00:00
Richard Moe Gustavsen
ddc1805fa2 iOS: always hide edit menu when showing the magnifier glass
Bug: If you do a press and hold on a line edit, the edit menu
will show to let you select a word etc. If you now do
another press and hold to bring back the magnifier glass,
the edit menu will stay open while you move the magnifier glass.

This patch will ensure that we always hide the edit menu when
we show the magnifier. There is never a case where both of
them should show at the same time. By hiding the menu from
the place where we show the magnifier means that we can
remove code from the QIOSSelectionRecognizer that used
to do this for one of the cases from before.

Fixes: QTBUG-90743
Change-Id: If2a92f94422c730c2b223129d96f5bc3bf3deeee
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 3811be28adc9022f7a7ac1a15385ae91beaf9889)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-02-01 17:38:22 +00:00
Andy Shaw
e255716291 Cocoa: When validating menus, account for modal window only if active
When a modal window is WindowModal then it is possible for another top
level window to be active and therefore the menus shown may be valid
for the window. So we can still allow the menu items to be validated in
the context of that window.

Fixes: QTBUG-74088
Change-Id: Ifb9c3fe12654b2972e0e3c368dc093fae1ed4cc8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 115bcdb862ec52ebda04e1337f978096d8879e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-29 14:53:25 +00:00
Bastien Bouclet
b61275ee72 QIcon: Use the @nx pixmaps in the paint method
Make use of the device pixel ratio in the QIcon paint method so the @nx
hi-dpi pixmaps are selected when appropriate when painting to a
QPainter.

Fixes: QTBUG-90042
Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b69b04c4790f319104a1098147cea9405b6e7062)
Reviewed-by: Bastien Bouclet <bastien.bouclet@gmail.com>
2021-01-29 14:18:42 +01:00
Li Xinwei
6e7628821d CMake: Fix HAVE_openssl config test when using static OpenSSL
When using static OpenSSL, HAVE_openssl test will fail, because of
unresolved external symbols. These symbols are from Ws2_32.lib and
Crypt32.lib, which CMake does not link by default. In qmake build
system, we can use OPENSSL_LIBS variable to specify these system
libraries. But there is no similar variable in CMake build system.
Accordingly, we should let OpenSSL::Crypto target link these libraries.

Upstream issue:
https://gitlab.kitware.com/cmake/cmake/-/issues/19263

Change-Id: I5f27790b251d0a0f71aaf2aed2b933aeb3326f1f
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 29a58af4caea921e641c27477e6a255274de27ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-29 08:05:33 +00:00
Zhang Hao
443ce5d073 QLineEdit Cursor show white area
fix QLineEdit Cursor Rect and InputMask area overlapping,
the cursor rect area is white. when inputMask is set,we don't
need draw cursor.

Fixes: QTBUG-89578
Change-Id: Ibec7f8f1f7331a12438fd821c2002903260da10a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 795ea19ca0a7e484793655b35f19de8dbc88e987)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-29 06:43:28 +00:00
Friedemann Kleint
0d92fe119d Stabilize tst_QListView::internalDragDropMove() on X11
The test was flaky in recent test runs on X11. Debugging
showed that the global position of the synthesized mouse
events was not correct due to the window not being mapped
properly. Use QTest::qWaitForWindowActive() instead of
QTest::qWaitForWindowExposed() to ensure that.

Task-number: QTBUG-90016
Change-Id: Ie1bc4157e6d0e807d8530f70dcbd27b5e2fc813c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 58496196071ec817d141c14fe373939ae0df6383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 20:48:56 +00:00
Mårten Nordheim
d85ad71ed9 Don't forward-declare non-Qt things with QT_FORWARD_DECLARE_*
As it breaks in namespace builds

Change-Id: I1a278330eeea6b2b89c8a57c0df828dff94ebf7a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6cd5448404048ffd7194a1f78991e50be3535e07)
2021-01-27 19:55:40 +00:00
Allan Sandfeld Jensen
fada6a1cbd Fix division by zero
Consider a zero we need to divide with illegal input.

Fixes oss-fuzz 29347

Change-Id: I2aae1d765d2dd81c95d423038ef5cb878d4f8026
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 16b8d766abe86868597b30cec03152355ee1a91b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 19:39:28 +00:00
Fabian Kosmale
86af184205 QVariant benchmark: fix crashes
- Skip unused metatype id
- Do not construct a QVariant from an int, when we instead want to
  construct a QVariant for a given metatype (was: metatype id in Qt 5)

Change-Id: I1ac19dec5549b424a9429f69999eaf8e96c022e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 6d3a886f09955fec29e541baa786633cce2b2b9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 19:39:28 +00:00
Allan Sandfeld Jensen
f16f194a62 Protect against sign-change of size on 32bit
Since qsizetype is signed and the profileSize unsigned, it can turn
negative circumventing the test here.

Fixes oss-fuzz issue 29278.

Change-Id: I1e211c78db6f4ff150613f52d8fc29807f0088ff
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 05741b404ad5a8f9a490191a347e67c61456a89c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 15:35:17 +00:00
Joerg Bornemann
54980200c7 Fix output files of the *_header_check targets
Header files of a Qt module are usually found in subdirectories.
Avoid creating object file paths like "header_foo/bar.h.o".
When building with conan, the "header_foo" subdirectory was not created
for whatever reason.

Now, we make sure we have clean object file paths, e.g.
"header_check/foo/bar.h.o", and we create the directory upfront before
invoking the compiler.

Pick-to: dev
Fixes: QTBUG-90529
Change-Id: Ifa5d6b97e07fc4e249c58cda5128439d60b14f5f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-27 08:24:34 +00:00
Thiago Macieira
9b43d8a98a QJsonObject::take: add missing detach() call
We were modifying shared objects.

Fixes: QTBUG-89625
Change-Id: Id6bc735b79cf4beb9454fffd165c56476a5dec04
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 00b759a8d06dbec42232b1b8748c0725da7ced00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 07:21:52 +00:00
ChunLin Wang
191e1bbf37 Fix that the placeholdertext of QCombobox is not drawn
If the current index is invalid,a placeholdertext will be displayed.

Fixes: QTBUG-90595
Change-Id: Id4c6b9c959242b96ee0944b8fc3131a9a2fdcccc
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 6da6b6da4494439dc34e92fee7d69b5ad48a783d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-27 07:06:52 +00:00
Valery Volgutov
39da07a4d3 evdevtouch: Fix normalizedPosition
Set the available virtual screen geometry. This geometry
is needed for QEventPoint::normalizedPosition calculation.

Change-Id: I7e25488d62a5099c14b5c15fa2b4040ea32b9ecd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
(cherry picked from commit f7f618b3125289ab6ad68fe6c4ccf9864c41b02f)
2021-01-27 06:53:30 +00:00
Edward Welbourne
27cde01127 Make QCalendar's backend registration reentrant-safe
Previously, different threads instantiating the same back-end could
collide in the register, with various unwelcome results.

Give Registry an atomic status flag to track whether it has been
populated or is being destroyed; and protect it with a mutex to ensure
distinct threads do not collide during registration or attempt to
register while the registry is being destroyed.

Document the correct way to instantiate custom backends, and that no
code other than the QCalendar implementation should instantiate the
built-in ones. Instantiators that follow these rules should be safe
from failed registrations, provided they don't pick a name that
conflicts with some other backend. They can also use the recent change
to semantics of registerAlias() to verify that registration *has*
succeeded.

Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-88815
Task-number: QTBUG-85692
Fixes: QTBUG-84575
Change-Id: Ie78e700e71d610454152c05cafb38f6f713649ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0180a1ab8229c6a15d19317bf7680663ac402910)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 17:23:09 +00:00
Dimitrios Apostolou
6f1b69adf0 Github Actions: many minor updates
+ Add Ubuntu-20.04 Github Actions runner
+ Use as many system libraries as possible on all
  platforms except Windows
+ Checkout the git repository into a directory named "source",
  so that it's possible to checkout more repositories in the future
+ Configure with install prefix set to a temporary path,
  it will be used for uploading binary artifacts in the future
+ Configure with -pkg-config instead of -feature-pkg-config;
  this was the traditional way and it works for cmake now
+ Split long lines using double quotes instead of backslashes,
  makes the yaml file more readable and does not leak
  backslashes into the command line
+ Adjust cache to work in multiple branches, provided that the
  environment variables at the top of the file are set correctly
+ Do not let homebrew waste time cleaning up
+ Print logfiles in case of failure
+ Typos and other minor fixes.

Change-Id: I1ac8afebbdbea50549a334c07b8b3117a823f0fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a0aaa4ae2e904e62a700ee6b6b73340498df2380)
2021-01-26 17:41:14 +01:00
Andrei Golubev
a6c6d0bb89 Extend alignment of QArrayData to std::max_align_t in allocation
Make stricter alignment requirements for the allocated header

This strict alignment allows reallocateUnaligned() to property account
for the padding occurring in cases when
alignof(QArrayData) < alignof(T) <= alignof(std::max_align_t), which
happens to be the case on e.g. 32-bit platforms with specific alignment
requirements.

This adds 4 bytes (the difference between alignof(std::max_align_t) and
sizeof(QArrayData)) of overhead for QString, QByteArray and certain QLists
on 32-bit systems.

Task-number: QTBUG-90359
Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 37e26d2b3011acc86bbda1e1f46114d7c8441915)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 16:27:37 +00:00
Volodymyr Samokhatko
3947279d68 Fix populating selection clipboard with keyboard
Task-number: QTBUG-59879
Change-Id: I6948919fc90995c60a34b5bd6b4a225c1a59fd9b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 976f28e7bb7cddb11459600f293868abcf7da948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 15:56:09 +00:00
Tor Arne Vestbø
257caeec0a macOS: Don't restrict non-modal file dialogs to open-dialogs only
None of the APIs used for non-modal operation require NSOpenPanel.

Change-Id: I7ea49a8dad6e724a8a0d4321ea443d4cdcc5a6b1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit d7c07578bc02be1f0c3c3c3c3d64b020f2ec50ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 15:56:09 +00:00
Tor Arne Vestbø
a6a8a4e06e macOS: Show system tray icon on mouse button press, not release
This was a regression from 395e2d9bc48941d6.

The system behavior is to show the menu on press, so we follow that.

This is also documented at:

 https://doc.qt.io/qt-5/qsystemtrayicon.html#ActivationReason-enum

Fixes: QTBUG-86518
Change-Id: Ia4dc5356bf0377a9d55f238caf5bf1becd95648d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fce391fefb0bbdea220aa2c935ca6f154f6121cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 15:56:09 +00:00
Dimitrios Apostolou
11ceb901d5 Github Actions: install old ccache version on Windows
ccache 4.0 is crashing consistently. Fix is merged upstream, but it's
not released yet:
https: //github.com/ccache/ccache/pull/736

Change-Id: I27d154a1ff1ea3afe111bd8f931db58c6f518809
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e4194b6f9e90321a62f857434b42b597b2a8e15b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 12:35:46 +00:00
Dimitrios Apostolou
ab279af23c Github Actions: ccache updates
+ Specify the ccache cache directory to avoid the defaults, because
  ccache >= 4.0 puts the cache directory in system-dependent paths
+ Adjust sloppiness to increase cache hit ratio
+ print compression stats but don't err if `-x` flag is missing
  (only available only on ccache >= 4.0)
+ Print ccache config for debugging purposes
+ Enable ccache compression and limit size

Regarding the last point, ccache < v4.0 optionally compresses using the
zlib algorithm, but ccache >= v4.0 uses zstd and compression is enabled
by default.  By forcing compression to true, all platforms will need
similar size cache. We have to limit it because the default (5GB) fills
up the cache artifacts size that Github Actions offers.

Change-Id: Iea72d08b223c611ee4a4443625647a1f01809b08
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ff1123711ea86a3be0654ac6b7648b92b337a7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-26 12:35:46 +00:00
Kai Köhne
236302c44d QMimeDatabase/xml: support both 'xmlstarlet' and 'xml' for minifying XML
Commit 370324f6e2f3 changed the call to 'xml' to 'xmlstarlet' because
some Linux distributions do not provide a binary called xml. Anyhow,
the official Windows packages of xmlstarlet only provide 'xml.exe'.

Therefore just check for both.

Change-Id: I4381b256850e4101b760df21f2b0baffb4414620
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 87ffd79622915509d73c04821ea1d2ada470ba2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-25 21:59:05 +00:00
Tor Arne Vestbø
7d3fee7ca9 macOS: Don't exec file dialogs via runModal unless they are app modal
Non-modal or window modal dialogs are shown at show(), via AppKit APIs
that are non-blocking. If we want to block execution at this point, we
need to spin our own event loop. The runModal API of NSSavePanel is not
meant to be used for blocking execution for already shown dialogs, but
is reserved for application modal dialogs.

This means we no longer trip over AppKit's understanding of what state
the dialog is in, which would result in the dialog not reporting back
any files. It also allows us to remove the guard for closing dialogs
twice.

We now also correctly close and end the application modal session if
the dialog is closed programmatically using Qt APIs.

Task-number: QTBUG-89959
Fixes: QTBUG-85547
Change-Id: Ida3dc404417789d4823822ecfbf0935591c23878
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit aa3b42d6342c6756c3ce941db0bbf1122ae48224)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-25 21:59:04 +00:00
Kai Köhne
4b1153d1a2 Update start of cmake/README.md
Make the document reflect the current status of the port.

Also link to https://doc.qt.io/qt-6/build-sources.html  and
https://wiki.qt.io/Building_Qt_6_from_Git as official sources
on how to build Qt. This document should IMO rather
concentrate on documenting the build system internals.

Change-Id: If62cb966b41b7452edb5b63725756916b66affac
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit cf9683601857bb8ba0a5f24b13affa9de1e27ef8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-25 21:59:02 +00:00
Joerg Bornemann
f193e7a793 Fix QMAKE_PRL_LIBS entries on Windows for modules from other repos
When building a repository != qtbase, like qtactiveqt, QMAKE_PRL_LIBS
contained entries like Qt6Core and Qt6Widgets, meaning the linker line
would contain exactly these arguments.

When building an activeqt example with qmake, the link then failed with
"LNK1181: cannot open input file 'Qt6Widgets.obj'".

The correct entry would have been $$[QT_INSTALL_LIBS]/Qt6Widgets.obj.

Fix this by determining the full path to the import library in the first
step of the prl generation. This enables QtFinishPrlFile.cmake to
recognize Qt6Widgets as Qt module and generate the right QMAKE_PRL_LIBS
entry.

Fixes: QTBUG-90520
Change-Id: Id0d9178da0e0dfc3ea4fadbbe8f5900d792ffc84
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 1ef5016bab3bce06ada14bc961a2a1db93d3060b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-25 09:55:05 +00:00
Christian Ehrlicher
f9f0238557 QComboBox/Fusion style: elide text when it's too long
The fusion style did not elide a very long text in a QComboBox as it's
done in other styles / non-popup mode.

Fixes: QTBUG-86632
Change-Id: I356a61809220d41717a9039d2b33dd706d034941
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1a9095e1fa4bb5d74b91d1661d55893d0e8620e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-23 17:16:33 +00:00
Thiago Macieira
684f26caad Update TinyCBOR
Updated to commit e6a4fa4862bcc3a6f6b07cf9d9b784d0ab6068b4.

Fixes: QTBUG-89650
Task-number: QTBUG-90214
Change-Id: I6edce5101800424a8093fffd15cdf6591cbf809d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit cbdf2ba46aed53d002b90d4d9683c28306f8e0a9)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-22 11:09:53 -08:00
Eirik Aavitsland
1a07e78992 Gracefully reject requests for absurd font sizes
Avoid overflows.

Fixes: QTBUG-89899
Change-Id: Ic1a83c1704fe20be3d032358dc91ee8e751f2281
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 679750684087cad7a48921c4174a53cdf4855049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-22 07:27:14 +00:00
Joerg Bornemann
5463f25586 Fix separately building SQL plugins with CMake 3.16
Also move the cmake_minimum_required call to the top of the file,
because the line before already requires some policy settings, which is
what cmake_minimum_required() is establishing.

For the standard Qt build, we make sure to get appropriate policy
settings by calling qt_internal_upgrade_cmake_policies().

Change-Id: If97556a9dd00646e83957959d0f9f16916625160
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit d95a1a8bd4734df3c2b6b55e5eb7a86108b682d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 20:13:18 +00:00
Edward Welbourne
198a985c09 Hold references to zone IDs alive during use
Restore holding of a getID() call's return in a QJNIObjectPrivate
eliminated in commit 78cde1bfd94521bbe4972f31a79c959d0990ea77; this
keeps the Java internal object alive for its lifetime, where it might
otherwise be garbage-collected before we're done with it.

Fixes: QTBUG-88610
Change-Id: Id65b059012f7bd3377a6562c1b647feb75a13679
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit d5eda37baaea20b2411b6ef1ca0d41a2a71a06a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 20:13:17 +00:00
Andy Shaw
c17643b64f SQLite: Update to 3.34.0
[ChangeLog][QtSQL][SQLite] Updated to 3.34.0

Fixes: QTBUG-90226
Change-Id: I2a489bec1fee2bdee7ea474094ca3db308699753
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 722a7dda56a5ac6d43c686c4fbf7b105b5544d88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 20:13:15 +00:00
Jarek Kobus
e0fecdc7bc Hardcode a special case of using qOverload for slots without arguments
Fixes: QTBUG-90308
Change-Id: I35cd45679ded626654dd0e7e3eea8a7bb14c1d56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 98a89fb711a15fcf9f541f7b4a8ae7492e5a445c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 15:04:34 +00:00
Friedemann Kleint
f2eb4b14af tst_socketnotifier: Fix timeout of QTcpServer::waitForNewConnection()
The timeout defaults to 0, give it 5s.

Change-Id: I975810a1ecee8bb8b3a3f143f1379a9a09589a40
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
(cherry picked from commit ad84332f2bbe10601ba4c21fd6d4a446d16ed94c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 11:16:12 +00:00
Andrei Golubev
f83f4badce Add new special QObjectPrivate::{connect, disconnect} for QML
Original QML-specific connection mechanism ignores the receiver argument
and uses sender as receiver. This causes uncontrollable memory growth
in certain cases as connections on receiver persist even after receiver
is destroyed

New connect() with receiver parameter uses underlying API correctly,
disconnect is provided for the symmetry (not sure it's really needed)

Task-number: QTBUG-86368
Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f520abdab7120789800208dde837b3836f762cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-21 09:06:54 +00:00
Tor Arne Vestbø
563f8bc744 macOS: Only check SDK major version for compatibility
The macOS SDKs now follow the same major/minor version scheme as iOS,
where the major version is bumped for each OS release.

Change-Id: I021421a9c58bb1ae64bc0c63b4215f14e4ada358
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit af0fa5cffe55b3ce9364fa2e6f4b76bc581c08c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 20:40:52 +00:00
Richard Moe Gustavsen
1baf4d9ea4 iOS: ensure we hide the edit menu while dragging on the selection handles
iOS used to close the edit menu automatically when
the user tapped on the screen (even for menus shown
explicitly using the UIMenuController API). Apperently
this has now changed (probably as a part of
[UIMenuController setMenuVisible:] being deprecated in
iOS 13). So we now need to hide it explicitly instead.

Because of this, the edit menu would be showing together
with the magnifier class while the user was dragging on
any of the handles. This patch will fix this, so that we
close the edit menu explicitly whenever the user starts
dragging on a handle.

Fixes: QTBUG-80298
Change-Id: Iff2032d64db1b582fa7f048c6a1f37ec8a1528af
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 2e35a03cd624c006b92cb95847231c8b1efde45b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 18:20:18 +00:00
Eirik Aavitsland
c1cd5dcabe Rasterizer: compute intersection factors only when needed
Fixes oss-fuzz issue 29285

Change-Id: I8f7e0bc898b119d153a36cef5a74371249ed7686
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
(cherry picked from commit e1ed570f9d0ec3998f130e2c3870ef49e7994dbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 18:20:15 +00:00
Richard Moe Gustavsen
a48f500c34 iOS: ensure we close the edit menu when the user taps outside the input area
iOS used to close the edit menu automatically when
the user tapped on the screen (even for menus shown
explicitly using the UIMenuController API). Apperently
this has now changed (probably as a part of
[UIMenuController setMenuVisible:] being deprecated in
iOS 13). So we now need to hide it explicitly.

Because of this, we no longer close the edit menu if
the user taps outside the input area. This patch will
fix this by updating the logic in QIOSTapRecognizer to
close the menu explicitly.

There are some more details around when to show or hide
the menu, which is commented on at the relevant places
directly in the patch.

Fixes: QTBUG-90332
Change-Id: I336e3f4003817b39c7abf63f963fde1f3ef87c20
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 427e639275be379e3577cd3b3c8a63a6b5e46d46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 18:20:14 +00:00
Edward Welbourne
90195292f9 Fix QTzTimeZonePrivate::displayName()'s fallback
It previously fell back on abbreviation, a very poor choice.
The base class does better than that, so use its implementation instead.

Change-Id: I47cbfce815cd8b2b533d9c6aeebcf398e5852d02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f9fff26b2db8152dcae26c92054f031bdebd7bc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 18:20:11 +00:00
Sergio Martins
1580c84e1a Make QStyle::proxy() always return the leaf proxy
For example:

  fusion -> proxy1 -> proxy2

Now returns proxy2.

Fixes: QTBUG-85556
Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 61c3f3539c3d2d7dc867c3fef0270a2f5c9ed376)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 18:20:10 +00:00
Cameron Gutman
7d0cbfc257 QSsl: fix OpenSSL DLL names for Windows on ARM
OpenSSL adds an '-arm'/'-arm64' suffix to the DLL names when building
for VC-WIN32-ARM or VC-WIN64-ARM. This needs to be accounted for in Qt
to find the OpenSSL DLLs correctly.

Fixes: QTBUG-89647
Change-Id: Ibc9b81e06f8e64c0676f335e13024fa7fe3a4fa3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c111aad270f1d51c2e870ee25e9a6bba64b3cecc)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-20 14:41:49 +00:00
Thiago Macieira
b2af6332ea Fix build with GCC 11: include <limits>
Fixes: QTBUG-90395
Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40
(cherry picked from commit 9c56d4da2ff631a8c1c30475bd792f6c86bda53c)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-20 03:42:20 -08:00
Pekka Gehör
8cb8dab030 [Android] Fix Text select handle misplaced on fields inside QDialog issues
Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod

Fixes: QTBUG-65229
Fixes: QTBUG-58503
Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 11:23:02 +00:00
Alexey Edelev
32734f351b Generate Qt6EntryPointAdditionalTargetInfo independent of platform
Move AdditionalTargetInfo generation for EntryPoint target out of
WIN32 specific block

Fixes: QTBUG-90414
Pick-to: dev
Change-Id: I8dc34c939f12ef2073de630d4440a0892d8be909
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-20 10:40:13 +00:00
Eirik Aavitsland
280908398d Fix lancelot GL painting test for GLES
RGB10 internal texture format is not supported on GLES, use RGB10_A2
instead.

Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 167bcafcb6b1988047bec8b4d67c994fc8c85c14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 06:39:56 +00:00
Morten Johan Sørvig
8d51a7a39e macOS: Remove DontConfirmOverwrite workaround
Does not work any more on recent macOS versions.

As a bonus, Qt now handles file names which contain
“___qt_very_unlikely_prefix_” correctly.

Task-number: QTBUG-39791
Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fded886ff4b9869c1a9e016e3fae05cc409c9ccd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-20 02:54:16 +00:00
Bartlomiej Moskal
fe32ed6653 Android: Finish composing text before Key handling
If the sendKeyEvent was invoked, it means that the button not related
with composing text was used. In such case composing text (if it exists)
should be immediately finished.

Fixes: QTBUG-85715
Change-Id: Ifbca067805b8d20f6a90f95b27210595abed964a
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0d5b43bed4d75ce4d1f1c5a7b953288f5570350d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 22:20:19 +00:00
Joerg Bornemann
b5eb77a552 Fix framework path for *_header_check targets
When building a Qt module against an installer-provided Qt on macOS, the
module pulls in the headersclean feature that creates the *_header_check
targets. Those targets try to compile the public headers of the module,
and the compilation command contains the -iframework argument. That
-iframework argument is supposed to point to the directory where the Qt
libs are installed. However, it pointed to the original
CMAKE_INSTALL_PREFIX of the machine where Qt was packaged.

Use the QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX variable instead
that contains the real installation location, even for an
installer-provided Qt.

Fixes: QTBUG-90402
Change-Id: I27de8b3cc816488c2716042383b334d5c421452d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit bd8d74e0e265297d61fe3b42f71a282bf381c379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 22:20:18 +00:00
Nicolas Fella
09606d526c Add missing since to QEvent::copy docs
Change-Id: Idfadc1801b0e97a5030d2784a65ae658900efd12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9b2df27bb3a5e8fb788f7274013aa66d32d1250d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 20:18:10 +00:00
Friedemann Kleint
b4d46881c5 tst_socketnotifier/unexpectedDisconnection: Extend blacklisting to all windows versions
The test has been failing frequently, recently.

Change-Id: I3ae00a64f67e4b6a0b5ade0c660805f4d12f8317
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 0b4717097ebf9614937a03407e741267a6d39a39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 20:18:09 +00:00
Assam Boudjelthia
9e006d6a3c Android: skip tst_QFile::moveToTrash()
Android doesn't have a trash bin, so this test is not valid for that
platform.

Fixes: QTBUG-89398
Change-Id: I119b25682ba18e18466b5687cae369445dc73311
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0392dce4f0a2093987ab45c48f0748c3dd97e7fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 15:34:17 +00:00
Edward Welbourne
d6bca7b198 Fix problems with offset-derived ids for QTimeZone
When creating a time-zone from a UTC+offset name that isn't known to
the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls
back to constructing a suitable UTC-offset backend; however, the id of
this is not guaranteed to match the id passed in to the constructor.
In all other cases, the id of a QTimeZone does match the id passed to
its constructor.

Some utcOffsetId testcases had different id() than the id passed to
the constructor, due to mismatches where a zone was constructed using
the fall-back but the generated id included its minutes (as :00) or
omitted its seconds. The omission of seconds is clearly a bug, but we
also don't want to include :00 for seconds when it's not needed. So
change QTimeZonePrivate::isoOffsetFormat() to accept a
QTimeZone::NameType to configure how much we include in an id. Its
callers other than the relevant constructor (from offset) still get
minutes, even when :00, but will also get seconds added if that isn't
zero; and the constructor from offset now gets the short form obtained
by omitting all trailing zeros.

Since all valid whole-hour offset names that do include :00 for the
minutes field are in fact known standard offset names, the elision of
minutes will only affect zones created by ID in the case of a
whole-hour offset given without :00 minutes specifier, so these shall
necessarily in fact get the ID passed to the constructor. Creating by
UTC-offset with a name that specifies zero seconds will result in a
QTimeZone instance whose id() differs from what was passed to its
constructor (eliding the :00 seconds and potentially also minutes, if
also zero) but this should be the only case where a QTimeZone's id
doesn't match the one passed to the constructor, when constructed by
id.

Fixed inconsistency between the offset-constructor's declaration
(taking offset as int) and definition (taking qint32) in the process.
Added an id check to the utcOffsetId() testcase. Amended two tests of
offset-derived time-zones' IDs, added comments to make clear how one
of those differs from a matching standard name test and converted two
uses of QCOMPARE(, true) to QVERIFY().

[ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset
from UTC (in seconds) shall now only include minutes in their ID when
the offset is not a whole number of hours. They shall also include the
seconds in their ID when the offset is not a whole number of minutes.

Task-number: QTBUG-87435
Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 50c63446f525a8625b6315597cb0897d89908d6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 15:03:07 +00:00
Paul Wicking
f120933e53 Doc: Clarify setLibraryPaths behavior
Fixes: QTBUG-89130
Change-Id: Id8460fd00dcfdcca174d523f8d97baef1a764f6f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit efa5a699729c6ff9f9d7991d12ed70139e3be669)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 12:36:42 +00:00
Christian Ehrlicher
93e4f88204 ItemViews: Don't remove items on internal move
When an itemview only allows internal moving of items it can happen that
the target accepts the drag'n'drop operation since it's out of the
control of Qt (e.g. Recycle Bin or an other application). Due to the
nature of a move, the original item is deleted. Therefore check if the
internal move target is the same as the source and don't delete it
otherwse.

Fixes: QTBUG-86020
Change-Id: I69de4b8d76d1b0f57338b402aee87580226cd6cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 12d8bb0709bf7982061cb0c3e608e4a581892e35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-19 11:35:35 +00:00
Oliver Eftevaag
c855608119 Fix small typo in the QMdiArea documentation
Added missing whitespace character in the documentation for QMdiArea,
in the 'detailed explanation' section.

Change-Id: I6be1d664bc15e3e461c5fc3d8f82311cc6ea60ea
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 3cb2b5bfe3e3c84dcd4c1a04c8c981dbaf85f0a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-18 15:18:48 +00:00
Joerg Bornemann
170a8693d3 QtEntryPoint: Fix linking Release against RelWithDebInfo with MSVC
To be able to link a Release user project against a RelWithDebInfo Qt we
set several IMPORTED_*_RELEASE properties in
the *AdditionalTargetInfo.cmake file of each Qt module.

The EntryPoint module however is a bit special as it is an
INTERFACE_LIBRARY linking publicly against a static
library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file
was almost empty, because qt_internal_export_additional_targets_file was
called before EntryPointImplementation was set up. Also,
qt_internal_add_module, which calls
qt_internal_export_additional_targets_file, does not know that we want
to export the EntryPointImplementation target.

We fix this by telling qt_internal_add_module(EntryPoint) to not
generate the *AdditionalTargetInfo.cmake file and call
qt_internal_export_additional_targets_file later to take the targets
EntryPoint and EntryPointImplementation into consideration.

qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to
turn off the generation of *AdditionalTargetInfo.cmake files.

Fixes: QTBUG-90039
Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b0add5bf2f56c2afc8bdf27ccbb153414617250b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-18 15:18:48 +00:00
Laszlo Agocs
78735236f3 eglfs: Use drmClose in drm/EGLDevice backend
Fixes: QTBUG-90350
Change-Id: I29a71e4abc2df7b777a895792bc5385a89223895
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 957344123672e891a25e55b54dcb012d2017b27a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-18 15:18:48 +00:00
Andrei Golubev
b4937f3295 Add "Q_UNUSED" to (3rdparty) strtod.cc for a 32 bit code path
Accidentally stepped on this thing. Cannot build Qt Core on 32-bit
Ubuntu 16 without this patch.

Fixes: QTBUG-90354
Change-Id: Iab5b2a317ee18b537b416eff008db29932fc043b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b101f84f86e541fa30c0d6d2a4e549cf51118706)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-17 23:35:39 +00:00
Ralf Habacker
f79192815f If available, use a version-specific qt<major-version>.conf
To enable the current Qt version to use a qt.conf that is independent
from the previous version, a file named 'qt<major-version>.conf' is
searched for first. If this file does not exist, a file with the
name 'qt.conf' is searched for.

Task-number: QTBUG-88635
Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit ab2c61e6384bbb5a0d154caa8f4784f9053147fe)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-16 10:51:31 +00:00
Allan Sandfeld Jensen
7133780bc6 Fix XCB launch key mapping
They have been reported wrong since Qt 4, and not fixed for behavior
compatibility, fixing it for Qt 6.

[ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names
and X11 names match, instead of being 2 off.

Fixes: QTBUG-25261
Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
(cherry picked from commit cfd935fe6c26800befc10889afc0aebde311acca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-16 00:47:30 +00:00
Laszlo Agocs
f90b77e101 Document QOpenGLWidget limitations without an alpha channel
Task-number: QTBUG-85869
Change-Id: I20fb70a451fc1ed93089ed699539fa12ac38fe73
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit b5ce973b29875d8cea6302de8ccfaa06d0b7c870)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 19:28:56 +00:00
Morten Johan Sørvig
85fd5b70d6 macOS: Mark QFileDialog::DontConfirmOverwrite as unsupported
The native NSSavePanel does not have an option corresponding
to DontConfirmOverwrite. Qt has a workaround where
the save-file-name is temporarily given a prefix in
order do bypass the overwrite check, however this has
stopped working on recent versions of macOS. (Confirmed
on macOS 11)

Users who want to use DontConfirmOverwrite should use
Qt’s file dialog instead.

Fixes: QTBUG-39791
Change-Id: Id3b9e6de72c2afc9526c96f1d9fdbce78db92aeb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9cd3ff2bdea0d5a009a8284288bbbdaaaec817be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 19:28:55 +00:00
Allan Sandfeld Jensen
978131ba71 Fix convertToRGBA64PM for Grayscale16
The input has been fetch into a set of uint32s, so no longer a
string of ushorts.

Fixes: QTBUG-90246
Change-Id: Id52a6824317b0744310008cc2ce2f726539b4c8c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit ade24763c74ce506276218ec1ce0e307301717fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 19:28:54 +00:00
Sona Kurazyan
d96f00286c Fix setting active window as application's focus widget
When setting the application's focus widget we search for the next
child widget that can hold the focus and call its setFocus() method,
which also updates focus widgets of all its parent wigets.

In case if the focus widget is the active window itself, we only set it
as the application's focus widget, but we don't update the focus widget
of the active window itself. Because of this the focusWidget() method
always results nullptr for the active window. This prevents from setting
the focus back to active window after the focus has changed (for example
after a context menu is closed, as in the bugreport).

Transfer the focus to active window by calling the setFocus() method, as
it is done in case of transferring the focus to any other widget.

Fixes: QTBUG-85846
Change-Id: I91ebf182fd5bb7d451a1186e2f3e38c8d48acc4e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 154573929a76d9051920756b19ed033c4b2ac649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 19:28:52 +00:00
Friedemann Kleint
a24816ade4 QTabBar/Windows: Fix close button icons being too small on high-res screens
Add 32x32 versions. Move the icon creation to a helper function.

Fixes: QTBUG-88230
Change-Id: I6dda2084e0122234eacea17ac191a19f6855f466
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit f3251bcb878d655e5f897335ec6bc6dbf69323e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 13:36:16 +00:00
Qiang Li
16d0e9ab79 Fix the tips still show when cursor move to another action
In this case, the previous action's tip is still displayed
when the cursor moves from one action with tip to another action
without tip.

Fixes: QTBUG-89082
Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f3d5e6716d9130776b3613ccbd5595de7d4af8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 13:36:14 +00:00
ChunLin Wang
c00f52e821 Fix QApplication::font returns the font unstable according to the object
If a default font was not registered for the widget's class, it returns the default font of its nearest registered superclass.

Fixes: QTBUG-89910
Change-Id: I6e6b2c6a0044462f84db9f76a03be0c6cfaaae8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dafd26acbe7b08f5ddfe60432fe0e49422ac085c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-15 08:46:37 +00:00
Andy Shaw
5b3dbd38ca Interbase: Don't error out if closing an already closed cursor
Change-Id: If6964f5ae45c5ca4c0b34e417326fea1f33d7628
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4d3d981144d810fbf1fe263741d36b07a9227621)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-14 22:55:14 +00:00
Ivan Solovev
de74f4fdad Widgets: fix setTabOrder for QAbstractSpinBox-like widgets
setTabOrder was not considering the case, when a child widget has
its focus proxy set to its parent widget. This happens, for example,
for the QLineEdit that is nested inside the QAbstractSpinBox.
For such cases the lastFocusChild was calculated incorrectly, and, as
a result, such child widgets were not correctly positioned in the
focus chain. This could lead to an error while backtabbing.

Here is a brief example. Suppose we have 3 widgets arranged like this:

auto spinBoxOne = new QDoubleSpinBox;
auto spinBoxTwo = new QDoubleSpinBox;
auto button = new QPushButton;

Then the default widget focus order is:
- spinBoxOne
- lineedit (from spinBoxOne)
- spinBoxTwo
- lineedit (from spinBoxTwo)
- button

Before this commit setting the explicit tab order changed the focus
order in the following way:

QWidget::setTabOrder(spinBoxOne, spinBoxTwo);
QWidget::setTabOrder(spinBoxTwo, button);

- spinBoxOne
- spinBoxTwo
- button
- lineedit (from spinBoxOne)
- lineedit (from spinBoxTwo)

In this case, backtabbing from spinBoxOne actually leads us to
lineedit (from spinBoxTwo), which refers to spinBoxTwo.
And so we're stuck in a loop.

This commit fixes the issue by handling such special case, and
preserving correct focus order.

Note: the actual unit-test in this patch uses QLineEdit instead of
QPushButton, because one can't tab to buttons on macOS by default.
However the general idea is the same.

Fixes: QTBUG-81097
Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 00505ed2b57d0a6911c8274af2bff883a93f583a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-14 21:01:53 +00:00
Shawn Rutledge
5d0c1fc29f AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinates
QGuiApplicationPrivate::processMouseEvent() sends a
QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not
accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled.
A QPA TouchEvent always contains native touch points, which is why
it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to
translate the QMouseEvent's device-independent position back to the
raw position that it would have had if it came from a real touchscreen.
Therefore we must give that function touchpoints that are actually in
native coordinates.

It may be that some of this transformation could be avoided entirely,
but here we prove that the existing way works correctly, by adding
coordinate checking to the tst_QWindow::mouseToTouchTranslation() test.

Task-number: QTBUG-86165
Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aeeac48cbdea744406f0c8abefe271f571b61d07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-14 21:01:52 +00:00
Joerg Bornemann
ca4f26320d Lower the CMake minimum required version for single-config builds
Ubuntu 20.04 is a supported platform and comes with CMake 3.16. The
current state of the Qt build works fine with this CMake version, mainly
because the default build on Linux is single-config.

For multi-config builds we have higher version requirements as
documented in cmake/README.md.

This lowers the barrier for users using single-config builds who don't
want or cannot upgrade to CMake >= 3.18.

For Ninja Multi-Config builds, which were introduced by CMake 3.17, we
yield a warning that 3.18.3 is the lowest supported version.

Change-Id: Ia918b9f2b494508e86301ffc0e138d3ad4dbaf86
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 20a17911576297f22b9da9849b677476c2d6e0ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-14 17:57:19 +00:00
Mårten Nordheim
baa0356849 QCache: when overwriting, store the new cost instead of the delta
The delta was clearly intended to be used on the total (and still is)
but it also wound up getting stored in the cache, which wouldn't be a
big problem unless the object was removed, in which case we could
incidentally 'free up more space' than intended.

Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit d2e2d0d3a6249ccbc17ec92acb32fec9a0d71807)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-14 13:44:30 +00:00
Richard Moe Gustavsen
9e4d9fca8a QGuiApplication: use global position to create local position for synthetic mouse events
When QWidgetWindow handles a QTouchEvent, it will call
updateTouchPointsForWidget() for each widget it tries
to deliver the touch event to. This will make sure that
the point's position() is updated to be local to the
widget being processed.

The problem is that we never reset this overwriting of
local positions in the event after we're done. So if we
later try to synthesize a mouse event from it, the local
position in the fake mouse event will be based on the local
position inside a random widget, and not the original local
position sent from QPA.

Rather than trying to store all the original local
positions inside the event before going through this delivery
logic, and reset it afterwards, we base the local position of
the synthesized mouse event on the (unmodified) global
position instead.

Fixes: QTBUG-90033
Pick-to: dev
Change-Id: I1588351482de7cce9c06d102db3686ea8dd0c118
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-14 10:47:02 +01:00
Allan Sandfeld Jensen
3b1cb25eb0 Fix VNC format conversion
Pass the right from depth to the conversion function, and
set the right format before creating the compositor image
for RGB16 support.

Fixes: QTBUG-85621
Change-Id: I76f46a3c2d8f1d2b040b790035dbdb0a960ff1a7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 47c6b5b91e0d1271075d98ded5aa7a25296b5ee3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 23:49:46 +00:00
Jan Arve Sæther
e15d63baa3 a11y: Do not cache classes that don't have a factory plugin
For Qt Widgets we thought it was a good idea to also store in the cache
if a class didn't have a factory plugin. This worked fine there, since
the number of QWidget classnames is quite limited (so the factory plugin
cache will soon reach a limit)

In QML however, classes are often suffixed with e.g. Button_QMLTYPE_123,
Button_QMLTYPE_124 etc.
This number suffix is just increased continuously. This could lead to that
the factory plugin cache will grow ad infinitum, which will cause
"memory leaks" in addition to a performance penalty.

Fixes: QTBUG-75106
Change-Id: I9ba189f989f0b90ab62a2c54a2e9230236a998d8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 583668005d4d6399fc16d165dcb6a5af2b94323d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 21:42:08 +00:00
Eirik Aavitsland
4b3417f0f4 Fix read-only pseudo-state in QTextEdit/Browser stylesheet
Was implemented for QLineEdit but not QTextEdit.

Fixes: QTBUG-83056
Change-Id: I1e67ad0f1c230a062a1e12e8bc0b209c5289dc32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2054f451b1fc182fb3f53976b8f1e0026cfcd89a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 19:34:34 +00:00
Christophe Giboudeaux
133e989cee CMake: Fix build with GCC and ltcg
The porting script could not handle this special case.
To achieve the same thing, we'll use an intermediate 'OBJECT' library
which will get the '-fno-lto' build flag if the conditions are met.

Fixes: QTBUG-89426
Change-Id: Ied62502ce9c7f7fd6b89fab166f7bccfcd6e7433
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 19:34:33 +00:00
Christian Ehrlicher
3f2b5fdf48 QComboBox: fix select all columns in the view
When the QComboBox gets a custom view with multiple columns, only the
first one is selected even the selection mode of the view is SelectRows.
The selection changes afterwards properly honor the mode though.
Therefore check for the selection mode and call setCurrentIndex() with
the appropriate flags.

Fixes: QTBUG-86776
Change-Id: Ieba7b9e009358e7b6e802b7847640161ec776c64
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b3b28faf2627aad3a0c47fb4c7c711e0d19984aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 19:34:32 +00:00
Alexey Edelev
1e5c279c22 Fix warning in generated test wrappers
Since test command variable may contain quotes, there is a warning
in generated test wrappers related to 'message(FATAL_ERROR', that
should display full command in log in case of error. To avoid any
complicated quoting of command to only display it, join command into
single string in wrapper script and pass resulting variable to
'message(FATAL_ERROR'.

Change-Id: Ie990fc0b0bf2c19b119c7c4e2aeec092e5200103
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 7582f7b03d52103c5299812aed8705d21d4f8b9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 19:34:31 +00:00
Christophe Giboudeaux
4bbff3fa21 CMake: Use -ffat-lto-objects for static libraries with ltcg and GCC
CMake <= 3.19 adds the '-fno-fat-lto-objects' compiler flag
unconditionally when CMAKE_INTERPROCEDURAL_OPTIMIZATION is enabled.

This is fine for shared libraries but static ones need the opposite
compiler flag.

Task-number: QTBUG-89426
Change-Id: Ie5f48178803a270f6d94408f7a8e85d379eb123c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9563be2870b85309e163db950fefcb9200cac6f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 19:34:28 +00:00
Volker Hilsheimer
59785478c3 macOS: Add more padding to width of non-editable comboboxes
The width of the combobox took the space for the checkmark and the contents
into account, but didn't provide any padding on the right side, resulting
in the text hitting the right side of the combobox popup.

Add another 12 pixels padding to the sizeFromContents implementation,
which results in a symmetrical padding on both sides of the text.

Fixes: QTBUG-88715
Change-Id: I811da73d11ce935c1fb83efabbe799f9a882e1d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ee409a536e7e1e4da28e235c4979a31cf40bb3c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 17:28:50 +00:00
Friedemann Kleint
c688bcb2f6 Windows font engine: Silence warnings about not being able to enumate font families
Turn the warning into a qCDebug() statement and add explanatory comment.

Fixes: QTBUG-85683
Change-Id: I2a6a7a089a660294f3e9c3096299c75635b3b215
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 29b2387587fe2ed2a73bdcbfa928acb755537284)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-13 14:13:30 +00:00
David Skoland
5370ee5f07 Remove QtDBus includes
Per the discussion of QTBUG-88831, we determined that module-wide
imports are unfortunate, especially for compile times. Following this,
all QtDBus includes have been replaced with the headers for the classes
actually used in each file. Additionally, some cleanup of header file
order and format has been performed in the changed files.

Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 9e09677c1dd4da92735736a0fbcb703416bf4d6d)
2021-01-13 14:53:40 +01:00
Laszlo Agocs
1d7fc87b89 rhi: gl: Reset tracked state upon a buffer update or readback
...encountered in the command list.

Move all, previously local, tracking variables into a struct. This
allows creating helper functions to reduce error-prone repetition in the
executeCommandBuffer() function body.

The only real change in the patch is in the handling of
Command::BufferSubData and Command::GetBufferSubData: here, instead of
calling glBindBuffer directly, use a helper function that also resets
the relevant state tracking variables. A subsequent
Command::BindVertexBuffer or BindIndexBuffer will therefore correctly
rebind the appropriate buffers.

This is particularly relevant with certain command stream patterns
exercised by some Qt Quick 3D scenes:

- A View3D renders a mesh,
- another View3D has some 2D Qt Quick content, as well as a model with
  the same mesh.

When both View3Ds use the default Offscreen render mode, the resulting
command list consists of segments along the lines of:

1. prepare resources for first View3D

2. render content for first View3D - this binds the vertex and index
   buffers for the mesh (state is tracked; all 1-4 steps are within
   the same command list, processed by a single call to
   executeCommandBuffer())

3. prepare the content for the "inline" 2D Qt Quick scene - this may
   update vertex and index buffers, that may lead to adding
   BufferSubData commands to the list (tracked state (last
   vertex/index buffer) may need invalidation/updating - and that's
   where our problem lies)

4. the second View3Ds 3D content is rendered: a model with the same
   mesh as the last (Quick)3D draw call, so same vertex and index
   buffers. If #3 did not invalidate and/or update the tracked state,
   the glBindBuffer calls are (incorrectly) skipped.

Fixes: QTBUG-89780
Change-Id: Icc933252f3993b8727d192e7ba4aa0f842bab51e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 5f8efb259774040303f37d00b6307afd22857af2)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-01-13 09:37:37 +01:00
Morten Johan Sørvig
5aa3cf7b9a Revert "Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for full update only"
This reverts commit a81dfb32d6f9e7a407567511c20b59e537f6a063.

Paint immediately on WM_PAINT in all cases in order to
avoid flicker on resize.

The cases mentioned in commit a81dfb should no longer
apply:
  - QTBUG-38327: QGLWidget is not supported in Qt 6.
  - QTBUG-39842: Fixed by using ExcludeUserInputEvents.

Fixes: QTBUG-89688
Change-Id: If82cf7703d6663982769048e86a7060223730ce7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9f894788dda8407c6221aaa1491cd54a5a2b4cb7)
2021-01-13 07:27:55 +00:00
Andy Shaw
a6aa9bca33 Set the PlaceholderText color in the palette from the stylesheet as well
The color should be used across the board, so the PlaceholderText color
should also be respecting the one passed for Text and so on.

Fixes: QTBUG-89815
Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bb00b63dee85bfe77bd721dd962c768e62c1b1e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 21:20:16 +00:00
Paul Wicking
80a0119012 Doc: Add details to QFont::toString
Add details that explain the return value.

Fixes: QTBUG-81467
Change-Id: Ifad407a27259711fc9abe1bacc7ba9db105bdcc0
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 8c395a20eddc15ae923b7658f275fa87c8d33db9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 17:17:28 +00:00
Tor Arne Vestbø
87bf405331 macOS: Don't try to close already-closed/closing file dialog
Doing so results in a warning about "modalSession has been exited
prematurely - check for a reentrant call to endModalSession:", and
on Big Sur will also result in the file failing to save because the
return code from runModal will no longer be NSModalResponseOK.

This would happen when the completion handler for beginSheetModalForWindow
would call QNSOpenSavePanelDelegate_panelClosed, resulting in calls to
QDialog::done(), which in turn tries to hide the dialog, via
QCocoaFileDialogHelper::hideCocoaFilePanel().

Fixes: QTBUG-89959
Change-Id: I048afe3dcc7fe62e0d0273f12b4b2c0237abb052
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 163d9c7cc46aa9174fdaaac8d64d8050f05c0a1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 17:17:27 +00:00
Eskil Abrahamsen Blomfeldt
9e278ec1f5 Use design metrics when adding text to QPainterPath
When we add text to QPainterPath, we will add the design metrics
(unhinted glyphs) and scale these down to match the target font size.
But the glyph positions we pass in are based on the hinted metrics,
samples at the target font size. Thus, on fonts/systems with hinting,
these do not match the scaled design metrics outlines.

To fix this issue, we make sure the text layout uses design metrics
when determining the glyph positions.

[ChangeLog][QtGui][Text] Fixed an issue where QPainterPath::addText()
would get inconsistent kerning for smaller font sizes when hinting is
enabled.

Fixes: QTBUG-20900
Change-Id: I651997d1a6a86e6271557438afa2cdad078a83ca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 6a3f8cbc3ad47d8585aac25d3775ed2350afe20c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 10:52:41 +00:00
Friedemann Kleint
0b758a57c8 Windows QPA: Fix crashes when using screen reader with Q(Plain)TextEdit
Make sure the search start with valid values.

Task-number: QTBUG-89354
Change-Id: I5b5100db89c62f23748b5c88e9188cfe3811e6e8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7b7dda654acda884b8ebf6e7f2bfed315a566801)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 08:47:57 +00:00
Assam Boudjelthia
4f7790e0b1 Android: exclude failing tests for tst_QPlainTextEdit on Android
The Android tests were marked insignificant for some days, due to an
emulator issue, these tests slipped during that time. Exclude them now
to bring Android tests.

Task-number: QTBUG-89402
Change-Id: I96d0f87b36975b7e2c83956b04b6569a03a781a9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a0ee0118651d97381f892e24b789ac392a2d8be7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 08:27:00 +00:00
Assam Boudjelthia
ae26648db1 Android: exclude tst_QFile::moveToTrash on Android
The Android tests were marked insignificant for some days, due to an
emulator issue, these tests slipped during that time. Exclude them now
to bring Android tests back.

Task-number: QTBUG-89398
Change-Id: Ia65a0ae8d7474fd2554dda299a60371dbbc9dddb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b036ca33475a45298e383aa0d42f072d21e5a9df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-12 08:26:52 +00:00
Robert Loehning
f2091c95e8 QSslCertificate: Guard against accessing empty QByteArray
Fixes oss-fuzz issue 29276.

Change-Id: I57b0c26e5377bd6b82d9f044ae1d1d13acec996a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ce90248882b73b4b816a8550710279e3e55ab64c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 21:20:42 +00:00
Paul Wicking
cf5439c59a Doc: Explain how boundingRect handles null QRectF
Fixes: QTBUG-87107
Change-Id: Ib7f9bd58b0f3454167dc61f95e0d8e6dec52a5ed
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 149ad1e615bf0974e52a681af73e9fb04bc1c762)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 16:57:49 +00:00
Ivan Solovev
87b261a670 UndoFramework example: make the background visible
Existing background image was not displayed correctly due to scaling
(see the description in related Jira task).
This commit increases the thickness of the lines, so that the grid
is displayed correctly

Task-number: QTBUG-89896
Change-Id: Iaa8218a5e9852adbc40715e86862ac3b34e1fbec
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 9b1d769fd0497677ea026c76b8ad65aafacac692)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 16:57:48 +00:00
Kai Köhne
d127036265 Doc: Generalize timer docs
The snippets do not talk about Qt Widgets specifically.

Change-Id: Icc4f243c93189f08124074e4918d535aa37e6560
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 1f53189c29f80c736877333631338670a06ac439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 11:44:25 +00:00
Paul Wicking
6f74e99d97 Doc: Link to correct location
Reflow text to fit style while at it, to satisfy git clang-format.

Fixes: QTBUG-89709
Change-Id: Iab2bf09399adf2cb0f0219ab40978bb238825ae8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 713829b718e3842cec3266838d5692f754582de6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 09:45:24 +00:00
Craig Scott
96dac3e057 Doc: Add partial documentation for CMake API (tech preview)
There are still other parts of the CMake API that are not yet
documented. This change only addresses qt_add_executable() and the
Android-related commands it uses.

Fixes: QTBUG-88839
Task-number: QTBUG-84482
Change-Id: I761b5ce908d1f62284baabe2d414cd37a0efe83d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0be2ecee37ee76f04ff73f782014108c15a5831f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-11 07:52:05 +00:00
Christian Ehrlicher
38159913b8 QPdfWriter: fix embedding fonts in pdf files
The container size change from int32_t to int64_t created a subtle error
during font serialization. The size of a QByteArray was serialized
without a proper cast and therefore now 8 bytes instead 4 bytes were
written to the stream.

Fixes: QTBUG-89727
Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 05706bd2b005dd159be34107cc43c92e7f12eb35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-09 10:56:40 +00:00
Alexey Edelev
7072295159 Remove redundant .qch from installed docs
Use upper-level document build directory for generated .qch files. This
avoids copying of .qch with html documents and duplicating them in
the installation directory.

Change-Id: I63b2de0047005419d352ea259dec6f17a826a477
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4d34314679598078d11508f540fe75f51a879046)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 19:24:01 +00:00
Ahmad Samir
c3b963ae4d QDir/QFileInfo: add doc notes about paths starting with ':'
This is an addendum to commit 0da5726a43b; making the note about paths
starting with ':' being treated as absolute paths by the underlying
QFileSystemEngine, more visible, so that users of the class don't hit
that pitfall.

Add similar docs to QFileInfo.

Change-Id: Ib34d066d31bb673d340ec41422ed4daf911765b8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 138fa9f2f4445832769a126a8ea72686b3687933)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 19:24:01 +00:00
Li Xinwei
9e287b50ee CMake: improve FindMySQL.cmake
On Windows, Qt should libmysql.lib instead of mysqlclient.lib.

Add support for mariadb.

Re-indent FindMySQL.cmake.

Fixes: QTBUG-88661
Fixes: QTBUG-89775
Change-Id: I6bdf195b8976c59230a12af335a838af55df0caf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0c7042defaf3a2a97aebc6f652b4d34229093a5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 19:23:59 +00:00
Allan Sandfeld Jensen
357df7b3a1 Send Qt::Key_MediaTogglePlayPause for VK_MEDIA_PLAY_PAUSE
Speculative fix to get the right keys in WebEngine

Fixes: QTBUG-89915
Change-Id: I79519b715a1415dccfc4601aae5025b3222a79ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d5a980df97051dea4b952a1f7c9558316454ccf0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 19:23:58 +00:00
Volker Hilsheimer
f4a8b2823e Remove irrelevant test row, fix compiler warning
With the introduction of QKeyCombination, the result of |'ing together
a set of modifiers and a key goes always through the same QKeySequence
constructor, no matter the order.

The implicit conversion through int when the wrong order is used
causes a compiler warning as that conversion is deprecated. So remove
that test case.

Change-Id: I04e27bcd51723ee0efc77e52e45ca3eb8bac5fc7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 9963aaacdb8b79ed079baf6425cef3d0347c2c8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 17:29:52 +00:00
Alexey Edelev
26c911a4b4 Add newline to the end of the config.summary
Amends 94b6bec01f250065b28d5528ea9239bafd5253e5

Change-Id: I0d4be9c7f9aff071468a66d7940d6cd2488136ca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 7f5429f2f45bdfb20ea67ebc9a75891bc5ee6549)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 10:56:54 +00:00
Andreas Buhr
600dca77f5 QProperty docs: update macro name
Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones.
Follow-up to 50e1976437f645e9d6571d4498e9d44388e59c19.

Task-number: QTBUG-85520
Change-Id: I138f0775d9804029f2ecd6bd3594ab47b247392e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 618dd6b5a7ed3e9933b3f3a8bf3429caf2506319)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-08 10:56:53 +00:00
Andy Shaw
517450d03a PSQL: Fix the QSqlDatabase test
Change-Id: Ic7956b556f1f0f10574fd79f5cbd283208240353
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit dce43106e2944e14ac86cf3bc7e624795d2c51cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-07 23:23:52 +00:00
Frederik Gladhorn
4460711a80 Revert "Fix invalid text layout data when a full layout run is interrupted"
This reverts commit 09ee4282e5eedf5b44245e8b28b223339f87ddfa.
The commit made the layouting time go from linear to quadratic, which is
problematic when rendering big documents impractical.

I wrote an alternative fix for QTBUG-20354 which will come as separate
change since it approaches the problem in a different way.

Fixes: QTBUG-89599
Task-number: QTBUG-20354
Change-Id: Ie450332f06ee40e60c8e4c6c7d10834bff1acf74
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a62fa9b7cc520f3548356182bf5d6642c05be204)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-07 18:05:08 +00:00
Alexey Edelev
062d42e355 Fix qch install path
Exclude qch_file_name from install DESTINATION

Fixes: QTBUG-89769
Change-Id: I8dba13a0a2c2c92d6b2d6aa438c295b42a04156b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0f38f69d4493d44ef65c4e1ab52f990241139c6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-07 16:07:13 +00:00
Friedemann Kleint
53471c16ec QTestlib: Fix custom toString() implementations for QList comparison
d25589e0529732996e405aaff8d6c46b012e1601 mistakenly changed the code
to use toString() from the QTest namespace. Call toString()
unqualified and move the compareSequence() helper out of the
internal namespace.

Fixes: QTBUG-89737
Change-Id: I8452a0aead7771ad13a5b95438b54e202ccce76b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fca3ea040c9d05f112c6fc018f0c8e8c68892642)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-07 16:07:12 +00:00
Andreas Buhr
c6b6bb5653 Fix segmentation fault in QObject::dumpObjectInfo
There was a check "if (cd && cd->signalVectorCount())" in the code
which was faulty because "signalVectorCount()" could return -1 to
indicate that no signalVector is available. This patch fixes
the problem.

Fixes: QTBUG-89846
Change-Id: I12c512ff8d889ba2bd298789ab6081930f739089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6a664d0660911173c7e85c60b9af195a0ef4f110)
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-01-07 10:41:37 +01:00
Laszlo Agocs
340f777e01 Fix missing repaints with QOpenGLWidget in a QDockWidget
When AA_ShareOpenGLContexts is not set, docking or undocking
will lead to changing the associated top-level window. This
leads to changing the OpenGL context, and tearing down and
then recreating all OpenGL resources (assuming a well written
application). The problem is, there are no paint events after
the Show, meaning the user code's paintGL is often not invoked,
which leads to showing an empty QOpenGLWidget until something
else triggers a paint event. To remedy this, send a paint event
upon Show, which should be harmless enough, while fixing the
case of docking/undocking.

Fixes: QTBUG-89812
Change-Id: I3c4560f8f069d86645a6314bf7ad1b4ee8e2c716
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3ce5128d8062b7eca4925454610bd1df9db9d77a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 19:05:02 +00:00
Tor Arne Vestbø
254aa011b1 Skip already closing widgets when checking whether application can quit
QApplication tries to close all windows on quit using closeAllWindows,
but closeAllWindows skips windows that are already closing. This can
happen when calling quit() from a close event for example.

QApplication then tries to verify that all windows have been closed,
and that logic should skip the same kind of windows as closeAllWindows
does.

The fact that these two logics diverge was identified earlier in
5af73cd9db52, but aligning them required further work. As that
commit notes, the right fix to align them is building on top of
tryCloseAllWidgetWindows(), which already returns true/false based on
whether it could close all windows or not. But, unlike the existing
logic in QApplication::event(), it doesn't skip Popups or Dialogs,
so that discrepancy needs further research.

Fixes: QTBUG-89580
Change-Id: I87bff56f2eb8a539f1c859c957f5f239dc1eb93d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e7370d0583ea8a50b0d5c15bb2b1afee2efc6a7e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 19:05:01 +00:00
Kai Köhne
c236dd456e Doc: Improve QMap, QMultiMap description
Make it clear that the fast lookup is by key, not by value.
See also discussion in

https://forum.qt.io/topic/121907/misleading-documentation-of-qhash-qmap/

Change-Id: I396297e0e4674e0a1f889f4138ab52ff224c0ee2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 05146a77fce7f080eefad3f82a14e60c8e3ec464)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 19:04:58 +00:00
Edward Welbourne
28ba7ac178 Change QLineF::setLength() to work whenever length() is non-zero
Previously it only worked when isNull() was false, which is true for
very short lines, even though length() may be non-zero.

[ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the
length if the line's length() is non-zero. Previously, it was
documented to only set the length if isNull() was false; this is a
fuzzy check, so isNull() could be true for a line with non-zero
length().

Fixes: QTBUG-89569
Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 6974737695eae5a41bc8a3f344a4f1f199006f21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 14:53:24 +00:00
Joerg Bornemann
636fcc4bb2 Remove superfluous OpenGL_GL_PREFERENCE assignment
We did set this variable, however after src/gui/configure.cmake
was loaded (it is early-loaded in src/CMakeLists.txt), meaning the
assignment had no effect.

Also, what this assignment tried to achieve is covered by our global
CMake policies now.

Task-number: QTBUG-89754
Change-Id: Ie7aeee1505d112d799455b2915acbfa7e9a12a64
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 36b1e03ecdaac40aaae5fa42ee9a5b3b50991ea3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 10:52:54 +00:00
Paul Wicking
fd5491ad9a Doc: Use correct include for QtFuture namespace
Fixes: QTBUG-89766
Change-Id: I20c5d3c12490a5eed7bb4e267b2edb5d45dbaadf
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 32a46a1dcf7c06fac4da2a4e6e549e81d0be98f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 08:59:15 +00:00
Craig Scott
54e31e82c3 android: Generate deployment settings file with correct qml-import-paths
The qt6_android_generate_deployment_settings() command had been
creating deployment settings files with the wrong key name for qml
import paths. This resulted in the QT_QML_IMPORT_PATH target property
having no effect.

The QT_QML_IMPORT_PATH property can also potentially hold a list, not
just a single value. This change now handles the list case as well,
previously qt6_android_generate_deployment_settings() was assuming it
always held a single path if it was set.

Fixes: QTBUG-89628
Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ae91e3365b775789fd323301a28ed48619953369)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 05:01:51 +00:00
Zhang Yu
7b356d7367 Fix QMultiHash::equal_range crashes
QMultiHash::equal_range crashes when called in a const member function.
The Data `d` is a NULL pointer when calling equal_range()
before inserting data into an empty QMultiHash.
Then calling`d->find` crashes.

Fixes: QTBUG-89687
Change-Id: I10c3d196cbc72aed8c8c922ef16534bba51037b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 22416ecaaf58619c716229b71cdca558fda0a861)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-06 03:06:52 +00:00
Andy Shaw
91a97187ac TableView: Trigger the resizing of editors resizing a row/column
If there is an editor in the table then this needs to be updated as
the resize happens, otherwise it will not adapt to the new size
correctly and can appear drawn over other cells.

Fixes: QTBUG-85484
Change-Id: I918c37f1ee1b0614c03c6b38f95f0f8b35a571f2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 9d36ee1904114a91a5c08b18ccfb72cd1d33d58f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 20:28:41 +00:00
David Faure
95c72df310 Update shared-mime-info to the 2.1 release, adjust implementation
The spec hasn't changed, but I made the same mistake in xdgmime
(the reference implementation) and in Qt: when multiple globs match,
and the result from magic sniffing is unrelated to any of those globs,
then I used the magic result, but that's wrong, globs have priority
and one of them should be picked up.

This is now fixed in xdgmime
(https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/3)
and in the expected results in shared-mime-info
(https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/99)
which this commit is also tested against.

This change also optimizes QMimeBinaryProvider::addFileNameMatches
to have the same logic as xdgmime for glob matching:
literals > extensions > other globs
As soon as one category matches, we can stop there.
This makes no difference in the overall results, in practice.

The user bug report (against the Qt implementation, actually)
is https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/138
as well as https://bugs.kde.org/show_bug.cgi?id=411718

Change-Id: Ia0a34080427daff43c732609443ee6df8f41447c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0cbbba2aa5b472241d45b4be6959a792062fbc30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 20:28:40 +00:00
Liang Qi
51e940260a QInputControl: accept surrogate category character
See also https://unicodebook.readthedocs.io/unicode_encodings.html#utf-16-surrogate-pairs .

Fixes: QTBUG-89184
Change-Id: I04eff7f42f0030346603a7b31e4ac854a477030c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit e688b99995b8c624dbcea296c99fb89262d29e15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 17:29:40 +00:00
Alexey Edelev
562fb69d75 CMake: Add proactive check of generator multi-config capabilities
Add explicit error, if multi-config build is requested, but selected
generator doesn't support it.

Fixes: QTBUG-88287
Change-Id: I6dba589bb59ad69fa07221c657df272ec75c359b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 52e1603e33db9ef29fe1eff8c689d38166d393f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 10:52:35 +00:00
Alexey Edelev
078bd54a38 CMake: Fix missing report entries
Increment command_count correct way.

Fixes: QTBUG-88054
Change-Id: I0769814ed75ee12db1cab3b1f85635b4d7ee0605
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 01708a44de2c9fe83e554099528b9c2f0a30d731)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 10:52:34 +00:00
Laszlo Agocs
2c3fabfafd Handle maxImageCount 0 in QVulkanWindow
Take the logic we use in QRhi's Vulkan backend.

Fixes: QTBUG-85791
Change-Id: Ifdc2b3d351af71fbc86e20abcede902303e41fc4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f6cb24f4c0f1f48f9010ba78670577ff5643132f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 09:23:24 +00:00
Laszlo Agocs
1176959b47 rhi: shadowmap manual test: use Nearest filtering
Just to avoid validation warnings on systems where the sampling
a D32 texture with linear filtering is not supported.

This is likely not a problem elsewhere: Qt Quick 3D for example
samples the depth texture only with Nearest filtering already.

Fixes: QTBUG-89761
Change-Id: I80bf5b7ecfcb3365f4010daa17f2ef00bb206b74
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 133af89038927d5f1a536619ff2869e8f372a4dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 09:23:22 +00:00
Timur Pocheptsov
0e1114f8e4 QSslCertificate(OpenSSL) - harden protection against nullpointers
An invalid (as input data) certificate may have non-zero number of invalid (nullptr)
extensions (if OpenSSL failed to parse them, for example).

Fixes: QTBUG-89547
Change-Id: I4b93ac9f482f850f02d01b0aea10560dc11b688d
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit f31997448838902eb5237b567f0c80f423f2406e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 08:46:33 +00:00
Christian Ehrlicher
a6e8dd7bf8 QTreeWidgetItem: fix documentation error for childIndicatorPolicy()
The default value is 'DontShowIndicatorWhenChildless' and not
'ShowForChildren'.

Fixes: QTBUG-83648
Change-Id: I5d4dd9f3f58bcac09ed38d8ae451e3b771695ce7
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 39773571202194cafd4992e4fe7c4a33733b53af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 08:46:31 +00:00
Christian Ehrlicher
f0a0c00a0a QAbstractItemView: fix selectionCommand() with no event
QAbstractItemView::selectionCommand() returned the wrong SelectionFlags
when no event is given since c4366ff0183a9a4a5c6eff0312b713e9c5eb97ea.
Therefore re-add the call to QGuiApplication::keyboardModifiers() when
no event is given and add a unittest for them so it's not removed again.

Fixes: QTBUG-89711
Change-Id: I107357df08c4ff1b1a14d49523401c5e7b428f56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 672d2ea8f414fa5f79f1801d965533b705831921)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-05 08:46:30 +00:00
Paul Wicking
696405b7f6 Bump version
CMake edition.

Task-number: QTBUG-89789
Change-Id: I418aa610926bbd7f5ddf1d4db45a4a27c8168598
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-05 09:23:25 +01:00
Joerg Bornemann
efc8ee12ef CMake: Fix glitch in module pri generation for Ninja Multi-Config
With Ninja Multi-Config, QMAKE_LIBS_FOO_DEBUG and QMAKE_LIBS_FOO_RELEASE
are generated, if their values differ. In that case we did not create an
empty QMAKE_LIBS_FOO assignment. That, however, is needed to make the
library 'foo' known to qmake_use.prf.

This amends bd98ba0d17b7a7c14fefc1741e68e8ca945a6655.

Fixes: QTBUG-89387
Change-Id: I80e23746e6ba6ff7f5f4186116232395814cee15
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit e40b31fe6803dea39649c7c61eaca5b8d597dacf)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-01-04 15:34:54 +00:00
Thiago Macieira
cd600d95b1 QCborStreamReader: move helper function to the only place it's used
Simplifies the code a little bit

Change-Id: I7b9b97ae9b32412abdc6fffd164545632be4590a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2bed336599dddd7e7c3cef73107c5ca3e6d6ab27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 14:11:51 +00:00
Tor Arne Vestbø
72bf3234e4 macOS: Simplify and fix issues with QMenuPrivate::moveWidgetToPlatformItem
View embedding when QWidget is involved is a bit finicky. This change
breaks down the steps needed to embed it into an NSMenu item, and
simplifies the process by not relying on a container widget.

The main issue is that QCocoaWindow::recreateWindowIfNeeded() will
potentially create an NSWindow for the embedded view, resulting in
a stray view. To prevent this we set the Qt::SubWindow flag on the
window, but QWidget tends to reset this flag when the widget doesn't
have a parent, so we need to be careful about which order we do the
setup.

Change-Id: I505f7c0a2d8e4350511fdb01a5e9b9c623a40a41
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c30d05e794e49d69cbc981ae2ff21e5713c5a81f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 13:15:18 +00:00
Laszlo Agocs
fc33f71f81 rhi: vk: Fix DS WAW hazard reported from sync validation
Running with synchronization validation (SDK 1.2.154) we get:

Hazard WRITE_AFTER_WRITE vs. layout transition in subpass 0 for attachment 1
aspect depth during load with loadOp VK_ATTACHMENT_LOAD_OP_CLEAR

Attempt to fix this with an appropriate subpass dependency.

Fixes: QTBUG-89760
Change-Id: I67e15a09aab564f63aab646761ccdb1f8b82111d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 8bd58a97d70027575b7f4ec227e7a57ed11990bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 13:15:15 +00:00
Li Xinwei
2491c47458 CMake: Fix error and print summary for standalone building sqldrivers
qt_plugins target is needed by qt_internal_add_plugin function, but when
standalone building sqldrivers, this target does not exist, which causes
configure error. So we need to add this target manually.

Fixes: QTBUG-89714
Change-Id: Ia7d613faabb82399c2f3e5771aab24302b3c8f56
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 173f163ad21835c9cf514f601b72034777ff1b19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 13:14:44 +00:00
Friedemann Kleint
fc36fadeff uic: Do not generate QComboBox::AdjustToMinimumContentsLength into code
The enumeration value was removed in Qt 6 by
1a342b2db14fa92bca717f5daff950b2eef869f7. Ignore it.

Add a check to helper function checkProperty() and move
the code from a5e2f2ddad0cc6b6a06f51e0dce6acf0fecf9de6 there
as well.

Task-number: QTBUG-89093
Fixes: QTBUG-89700
Change-Id: I0890be8fff155d7342e2386b7f6b0783a5f3a192
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 179696fcb809d5335dbbeceefb38a216bff81f5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 13:14:39 +00:00
Tor Arne Vestbø
908bfa7782 Update QPalette() documentation to not mention the application palette
It's an implementation detail that the default constructed palette
happens to use the d-pointer of the application palette, and as a
result has the same colors as the application palette if requested.

The palette has an empty resolve mask, and hence all the colors in
the palette are undefined. Users should not rely on QPalette() to
represent the application palette when for example overriding a
parent palette.

Task-number: QTBUG-85226
Change-Id: Ia6747887eef6e9a5f21b2002066608c433260de2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 74559dccc84ed0f0f7d8f57165fe387c3e112485)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 13:14:34 +00:00
Giuseppe D'Angelo
80bcba5661 XmlStringRef: remove operator<=>
It's defined in terms of operator<=> on QStringView, which does
not exist, causing a compile error.

Change-Id: I64fc60da4e52c7e53be7849d9b42952be139a816
Fixes: QTBUG-89729
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1dc4e5d3ebc265d13fe29657b81b7c44ea5f0ed2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 11:09:51 +00:00
Giuseppe D'Angelo
15787f66b6 Upgrade md4c to 0.4.7
Change-Id: I9400c2df13c30fb0bc14728a0c44851c2d1e9079
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 1f4434a8e2550336b2534301eed105656e7ec12d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 11:09:50 +00:00
Craig Scott
0de85741a3 CMake: Prefer canonical CMAKE_ANDROID_NDK var when writing deploy file
CMAKE_ANDROID_NDK is an official variable provided by CMake. The
ANDROID_NDK variable will be set by the NDK toolchain file, but we
don't need to rely on that (the user could theoretically not be using
the NDK's toolchain file). Using the CMake-provided variable means
we don't have to explain the source of the variable in documentation
for the qt6_android_generate_deployment_settings() command. We should
prefer to use things provided by CMake already where it makes sense
and this seems to be one such case.

Task-number: QTBUG-89651
Task-number: QTBUG-88839
Change-Id: Ieda54de8f5c65c36da6bb55c87a8b8fdd1d5cd7b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1b4d70676c3fed70a826b3a3cda3cd6c8077addf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-04 07:07:06 +00:00
Christian Ehrlicher
d356876a73 QAbstractButton: don't access nullptr in queryButtonList()
When a button has no parent, QAbstractButtonPrivate::queryButtonList()
unconditionally accessed parent which results in a nullptr access. Did
not crash because qt_qFindChildren_helper checks for nullptr and
therefore could only be found with a sanitizer.

Fixes: QTBUG-83865
Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit f0818f6ed8a616dcc94785637039ac21468ef311)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-01-01 16:55:04 +00:00
Alex Trotsenko
d80faf24d7 QProcess/Win: handle more errors in openChannel()
In theory, low-level functions like CreateNamedPipe() or
DuplicateHandle() could suddenly fail. Thus, in order to ensure the
correct configuration of the channels, we must check for these
errors.

Change-Id: I3d6291043e5e394ec5c5a7d85dfb7b09bfdcd172
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit efb3d87700fc057db1e2374c7cf5717df6dc68b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-30 21:36:03 +00:00
Matthias Möller
dbfd3d2892 fix potential mem leak on connection lost
The PostgreSQL driver can change it's connection status
after the first established connection.
In this case, the function "isOpen()" returns false
and the "close()" function would not free all resources.
With this fix, the "close()" function
always frees any allocated resource
independent of the connection status.

Fixes: QTBUG-88984
Change-Id: I7c9add6a183bf46a8573952ab39f8cb1f728c00c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 6e9125608f2c07c6c5f41a7a42ea097d1333e1e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-30 17:54:47 +00:00
Alexey Edelev
96c1380900 CMake: Fix dirty summary file when reconfigure qt
Overwrite summary file during each configuration cycle.

Amends 6baf36d77432dc56a47e50f59ccde93b73cfe204

Fixes: QTBUG-87830
Change-Id: Ie77f9aded4a7395592ff3cefad02265d836bebcc
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 94b6bec01f250065b28d5528ea9239bafd5253e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-30 16:02:39 +00:00
Alexey Edelev
5164cf903e Revert "CMake: Fix missing report entries"
This reverts commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c.

Reason for revert: Issue when command_count is actually 0

Change-Id: I1b2603f25b56e3bd50cfc22a08925930ad231498
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 34c3b12fd58fc1833abd20eb7b222cb6561e1b03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-30 13:33:37 +00:00
Alexey Edelev
294f89890e CMake: Fix missing report entries
Use LESS_EQUAL condition since qt_configure_command_count stores last
added command index but not actual count

Fixes: QTBUG-88054
Change-Id: I8112820f9885bdad5a786a4f6b4890d8f2fbe14b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 642ee46f98c6b3cd98a323f7dc5cac3a738b066c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-29 16:48:39 +00:00
Alexey Edelev
d5c99c7dfc CMake: Store config summary to file
Add generation of qmake-like config.summary in build folder

Fixes: QTBUG-87830
Change-Id: I08dd9b3116c6200f7e9f5de96605118c1ea474ad
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit 6baf36d77432dc56a47e50f59ccde93b73cfe204)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-29 14:51:37 +00:00
Ahmad Samir
1bfefd56a1 QRegularExpression: mention raw string literal in the docs
Raw string literals (since C++11 according to [1]), make writing/reading
regex patterns easier, since one can just use e.g. "\w\d" without having
to escape those backslashes e.g. "\\w\\d"; this is especially useful with
longer/more complex regex patterns.

[1] https://en.cppreference.com/w/cpp/language/string_literal

Change-Id: I119f9566d27222b915af931ee7e13e064baede61
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
(cherry picked from commit 824c726340ed8da0393aa97016682bcfd8c8bdc3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-28 16:38:34 +00:00
Andreas Buhr
dae30b73c5 Add test creating QDateTime in double-DST gap in 1947 Germany
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.

Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 741862875c4bd72ba6d28cf53f6f88579602e4bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-24 20:37:04 +00:00
Christian Ehrlicher
6663d90d19 QStylesheetStyle: fix push button label alignment
Due to a copy'n'paste error in 01ec11507d7ef3de09bad9d1ef8e6d4a3d6c4428
the valign was not properly determined for text-align bottom.

Fixes: QTBUG-89366
Change-Id: I081e1b24bba0edd9dd3754599a111c1658b18746
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 41e665a452166259b5cad64994de3298751eb7f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-24 13:43:04 +00:00
Sona Kurazyan
b02ed9696f Document that QtConcurrent::run doesn't support overloaded functions
After improving QtConcurrent::run() to use parameter packs for the
arguments (see c977e74afd18afff8729070f631e6b7a3f2887f5), calling
overloaded functions is ambiguous. Updated the porting guide and the
documentation to mention this and describe possible workarounds.

Task-number: QTBUG-89648
Change-Id: I4c1f996ae67bce8c13cc1f99f54240295db6ae1d
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit f1f4fd16fdd219701261d305e6d9f7abcb8bf4a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-24 10:04:56 +00:00
Christian Ehrlicher
b14a33ff67 QListView: don't crash when an empty container is passed to itemsRect()
QIconModeViewBase::itemsRect() is crashing with Qt6 when an empty
container is passed.

Fixes: QTBUG-89434
Change-Id: I324f1a34b62e67c7bbd3fe33227f4174df7d3d37
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 6fbcfd9164ae23b221ebce7fc3185505a8a1fb6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-22 23:48:08 +00:00
Alexey Edelev
e0121157db CMake: Add --enable-new-dtags flag support
Remove enable-new-dtags from feature mapping, handle it as regular
feature. Regenerate configure.cmake with 'enable-new-dtags' enabled.
Check for enable_new_dtags feature, add -Wl,--enable-new-dtags if
enabled.

Fixes: QTBUG-89013
Change-Id: Ice57c02dc85f7f9ecf14e3bc65f31a57b589ce24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
(cherry picked from commit bbebfa0be2e51b638459d6d812e4db25a65a0d6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-22 13:49:30 +00:00
Topi Reinio
d598f7b9b7 Offline docs: Improve styling of unordered lists and external links
Use list-style-type correctly and replace background-image with
::before content for external link icons.

Fixes: QTBUG-89470
Fixes: QTBUG-89471
Change-Id: Ib11a45baf5e92565b22e21f3bd1a929cbbbef608
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 1021cbf45b399f7324431fb2c6f30e4c172a3ef6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-22 11:30:06 +00:00
Morten Johan Sørvig
10432c218a macos: Document that Drawer is obsolete
This feature is not much used on modern macOS, and
Qt 5 has never supported it.

Change-Id: I9de195aaf7df954b63f0f816e93c91e870ef5852
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 093e0d452faa56e5cf3c9adfae3b73faea4f400f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-22 00:58:53 +00:00
Alexey Edelev
5d6f223854 CMake: Use Release build type by default
Use developer-build feature to set Debug build by default instead of
.git folder detection

Task-number: QTBUG-89410
Fixes: QTBUG-89476
Change-Id: I2a4f529299d4875e7b0eef5b41dd7a6b9402178b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b4b33846b4dc703e637b7d365676345eda0da460)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 19:42:00 +00:00
Alexey Edelev
f815382114 CMake: Use host variables instead of hardcoded directories
'QT_HOST_PATH' indicates that we use crosscompilation toolchain
to build project. In this case 'Qt6Config.cmake' loads
'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines
correct paths to host tools.

Replace hardcoded paths for host tools by paths recorded
in Qt6HostInfoConfig.cmake.

Correct conditions for QT_HOST_PATH, evaluate it explicitly as
string, but not as boolean expression.

Fixes: QTBUG-86557
Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 56bdef94379479f27858dccc73a95614648735bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 15:38:08 +00:00
Doris Verria
701934d39f Make QPushButton on macOS use QFocusFrame to fix alignment problems
Alignment problems occur for pushbuttons because they appear smaller then their
actual widget geometry, which is used for their alignment in layouts. To fix,
shift the pushbutton's rect to the left, adjust SE_PushButtonLayoutItem
accordingly and use QFocusFrame to render the focus frame ring outside
the widget's paintable area.

Fixes: QTBUG-89133
Fixes: QTBUG-81452
Change-Id: Iee885a4fb3674d966e5ff3b5c04a0845521b2d72
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c6379e34993370e7e2208b51be384b738ce35817)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 15:38:07 +00:00
Craig Scott
3f2b9af98e CMake: Don't rely on versionless commands or targets existing
Commands like qt6_finalize_executable() should not rely on versionless
commands or targets being available, since they can be disabled by a
build option.

Change-Id: I6a9ab6a9b6a6b731590e5b8c43f73b518ed38e81
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 50f939bfe8bdd63beca4aff06cbf1b2be1677624)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 15:38:04 +00:00
Friedemann Kleint
048949e2de Blacklist tst_QDeadlineTimer::stdchrono on Windows/clang
It has been failing consistently, recently.

Change-Id: I71b2e8857c3d5ce86ad17864c95aac7265ed9a8a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ec7eb1eab157ae84992ca20653f48394bb066340)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 13:36:23 +00:00
Michal Klocek
113cd9019d Fix crash on reallocateAndGrow
After 6be398 few tests fail/crash with qtcharts.
Fix issue on reallocateAndGraw and avoid accessing
flags on invalid header.

Data::allocate can return invalid header and dataptr,
which takes place if capacity is 0. In code before 6be398
clone method checks if header is not null before resetting
flags. However after b76fbb4 resetting flags is no longer
needed since it is done in allocateGrow.

Task-number: QTBUG-89092
Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit b770b7517d30dd17d1096a0bb434677a2b3ff630)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 13:36:22 +00:00
Piotr Mikolajczyk
e49e2a4a15 Android: KEYCODE_MEDIA_PLAY_PAUSE translated right
KEYCODE_MEDIA_PLAY_PAUSE was incorrectly translated to Qt.Key_MediaPlay.
This patch changes it to Qt.Key_MediaTogglePlayPause.

Fixes: QTBUG-66448
Change-Id: Icd2747857bc479228bfdffcd8ab8fdef7b79e918
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 096b4590d5aefc16b9c68611fdc1463b4c173f80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-21 11:31:48 +00:00
Igor Kushnir
18e5df3c95 xcb: fix thread synchronization in QXcbEventQueue::waitForNewEvents() again
This patch amends a41701904e880f58e19b352ade1931d6cd1a7112

If peeking into the event queue looking for a clipboard event fails,
QXcbClipboard::waitForClipboardEvent() calls queue->peek for the second
time to "process other clipboard events, since someone is probably
requesting data from us". QXcbEventQueue::peek() in turn calls
QXcbEventQueue::flushBufferedEvents(). This second flushing can acquire
a waited-for clipboard event. The issue was that the code in
waitForNewEvents() ignored this possibility and assumed that there were
no clipboard events before or at its current m_flushedTail. If there
were no more events on the X11 connection after tailBeforeFlush,
the waitForNewEvents() in waitForClipboardEvent() blocked execution
for 5 seconds and eventually timed out.

The fix is to remember QXcbEventQueue::m_flushedTail just after looking
for and not finding a clipboard event in the queue. And then wait for
more events via QWaitCondition in waitForNewEvents() only if there were
no more events after the remembered m_flushedTail.

Fixes: QTBUG-75319
Change-Id: I4919c5b9b9227b3a8a29a11e7094f97960b3a121
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
(cherry picked from commit f2d22d5a5126e7a73da620a60847fc124f724333)
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-12-18 19:09:43 +01:00
Fabian Kosmale
597f0d9681 Disallow construction of QPropertyBinding from a property
This would steal an existing binding from a property, which is most
likely not the intended action.
Alternatively, we could make it equivalent to
Qt::makePropertyBinding(foo), but that conflates properties with
bindings to it. On the other hand, this would avoid a potentially
source-breaking change.

[ChangeLog][Potentially Source Breaking Change] It was possible to
create a QPropertyBinding from a property; this would steal any set
binding from the property or create an invalid binding if none was set.
Use makePropertyBinding if you want to to create a binding which depends
on the property's value, or takeBinding if you want to repurpose the
property's binding.

Fixes: QTBUG-89507
Change-Id: Icd2d3b9261b60f36948f2cea9c33ddbea36efbc1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit c88905f0a947d59c61d9f0f990354ca935d3d4ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-18 14:19:28 +00:00
Jani Heikkinen
3df49a4c55 Bump version from 6.0.0 to 6.0.1
Change-Id: Iad88782fa21c6fef737f620e2dfaf32781abde10
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-18 11:43:47 +02:00
Piotr Mikolajczyk
9ed54aadc2 Android: Fix for accessibility potential crash
When accessibility was not active it was possible to force its
update, causing a null pointer exception in java.

Change-Id: I60f65612d6e9f712ba3c591ffcc6803f06f09efb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fe51137f859948472571ce4c879955eb74c77716)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-18 08:54:09 +00:00
Paul Wicking
6341e89e28 Doc: Clean up changes to Qt XML docs
* Remove heading that causes QDoc's autolinker to link incorrectly.
* Clean up language a bit while at it.
* Drop a double space.

Fixes: QTBUG-89283
Change-Id: Ice778d66deab384b66eb50b790670c9e3c8b0e84
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
(cherry picked from commit 98292b369e88777f51a5fc5c692a5bf48c23dd6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-18 07:37:17 +00:00
Alexey Edelev
10c9e5282e CMake: Add detection of FEATURE_foo change by user
Unset all QT_FEATURE_foo values for every build.
If any of FEATURE_foo is different of QT_FEATURE_foo, mark whole Qt
build as dirty. Reset FEATURE_foo for dirty builds to the calculated
value if it doesn't meet its condition.

Set Qt module as NOT FOUND if its target was not created during
configuration.

Main issue with this approach are generated files, that became trash
once the related features are disabled. This especially affects features
that enable/disable Qt modules. FooConfig.cmake files are created and
generate lots of warnings if feature was disabled. We may introduce a
module cleanup procedure at some point.

Fixes: QTBUG-85962
Change-Id: Id71c1edb4027b24c6793063e40cc9d612c24ebce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 61943aefd68b7d88c5eb395c4e44d08a94a70ad0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-18 07:37:12 +00:00
Mårten Nordheim
6e4892a6c3 Http2: set the reply's error code and string on error
If the error occurs during the call to
QHttpNetworkConnectionPrivate::queueRequest coming from the http thread
delegate then we will not yet have connected to the signal! But the http
thread delegate checks if the error code is not NoError, and handles
those situations. To let that work we must update the replies.

Change-Id: I47188e9439920694aaad1765ab28add1e86ccdff
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit b4d7908d5a623bd0024d290eee6e2226a627542d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 22:53:01 +00:00
Mårten Nordheim
b97001aa1c QCache: fix updating entries breaking the internal chain
After f08492c6fd9818c7d80b1725355453e179b4d85b was
merged this bug would manifest as an entry appearing twice
in the chain when a updating an existing entry (insert with
an existing key). This could sometimes result in crashes later
as the list filled up and the list was used in trim() to remove
various entries.

Fixes: QTBUG-89176
Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0ca46358321f2244386b0b6558a915cda8c6c006)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 22:53:00 +00:00
Tor Arne Vestbø
a0d963f436 Clarify QWindowPrivate::maybeQuitOnLastWindowClosed
We only need to check QGuiApplication::quitOnLastWindowClosed() at
the point where we've actually concluded that the last window was
closed.

Checking for !q->parent() was redundant, as we were already
exiting early when !q->isTopLevel().

Change-Id: I934e186d707361b31d19692c04d2e17b7ba0f49e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 1649137b9311a5ee3d12bc8824f5453294bd6fe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 22:39:43 +00:00
Timur Pocheptsov
acf00dd72d QSslCertificate::operator == - cleanup error queue
Another case when an OpenSSL's call can dump some errors into the shared
error queue discovered. An invalid certificate with non-null X509 * may
result in several errors appended to the queue.

Change-Id: I1278b371bd1edf2d656760c371bfb6da5dcab6ec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3bc398f76669c2532ae6e3f163f994feb7e6a0bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 20:56:12 +00:00
Bartlomiej Moskal
136cbafad5 Android: Pass pending state to ResumePauseListener
It can happen that updateApplicationState() is called before
m_androidPlatformIntegration is set. In such case, new applicationState
will be remembered and propagated later.

Before this change, pending application state was passed only to
QWindowSystemInterface.

ResumePauseListeners that are subscribed for changes to
ApplicationActive/ApplicationInactive state also should be informed
about new application state.

Fixes: QTBUG-84737
Change-Id: I67e79860b340ee5de2d13d148a222e9f1c942b93
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2eb77139a2deeb88c4d517dd5131f3e45d6acc1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 19:40:00 +00:00
Andreas Buhr
b8f9c649df Restore previous QDateTime behavior in DST gap
Historic QDateTime behavior when being asked to create a
QDateTime in the DST gap was to interpret the given date
as if it was in the time before that gap, mapping it to a point
in time after the gap. This has changed with
a04411119ead3d4473e4f0ac4bceedc585977b2f .
Since then, the given date is interpreted as if it was in the
time after the gap, thus being mapped to a point in time
before the gap.
This patch restores the historic behavior.
This was not caught by Coin because machines ran in timezone
"Atlantic/Reykjavik" which does not have DST since 1967.
This patch changes tests to always run in "Europe/Oslo".
Driveby: Test function "findSpring" did some operations in
local time, even though being asked to work in a specific
time zone. Fixed that.

Fixes: QTBUG-86960
Fixes: QTBUG-89208
Change-Id: Iecce5898bf9711a10e7dfc0a25e4bbeaed1c8ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3d785249ba43cf4bd895ed679bac2791e0130dc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 19:38:08 +00:00
Allan Sandfeld Jensen
69f7b6be72 Fix qt_alphaVersion and qt_opaqueVersion in the trivial case
The case no conversion was needed wasn't handled, but was assumed to be
handled by some call sites.

This can speed up QPixmaps on devices with non-standard screen formats.

[ChangeLog][QPixmap] Opaque pixmaps on devices with a non-standard
opaque format will now correctly match format for faster blitting.
Same with semitransparent pixmaps on devices with a non-standard
semitransparent format.

Change-Id: Ia05ff518fea36b7e3ed5c089fa9e8681a02fc574
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 30811f6428549bbdc54c2566b1493f83d3c24a66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 15:52:59 +00:00
Mårten Nordheim
8f0eb2c6b0 QSslSocket_schannel: Don't compare against undefined value
Something defined is always greater than undefined

Fixes: QTBUG-89530
Change-Id: I7633dd4233f7b13c3c5be17352841ec873531ef9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3eb35d324186b17d00f158d71a251f1bf93b6d2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 13:13:04 +00:00
Laszlo Agocs
9fd0c6afc7 Fix typo in QtOpenGL module docs
Fixes: QTBUG-89493
Change-Id: I92255da2f68ec8dc0503654787e7861abe431504
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 494da40f2945bd19449c210c25f7c41fd408d1cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 12:50:27 +00:00
Laszlo Agocs
90d2e3cf6f Prevent copy in texture upload with invalid input
Skip the memcpy when src is null.

Also silences a Codechecker warning.

Change-Id: I5042d725000cb6dff6864408fa9ed9e0ca35145a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 796de4f0668cc4b38f9e8653a0b2f53f0b3423b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 12:50:18 +00:00
Li Xinwei
845a342432 CMake: Fix module separate build error when -DFEATURE_static_runtime=ON
Build qtbase with -DFEATURE_static_runtime=ON, and then separately build
another module, following build error occurs:
error LNK2038: mismatch detected for 'RuntimeLibrary': value
'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'.
That's because all the sources in this module are compiled with 'MD'.

When separately building a module except qtbase, FEATURE_static_runtime
is not exist in cmake cache. So we should use QT_FEATURE_static_runtime
instead of FEATURE_static_runtime in qt_set_common_target_properties.

Additionally, adjust the indentation.

Change-Id: I2cf4737db9d3e8533570039a66c7d277d62a8d14
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 970e54c63d487ff5a334b8037ce0890fceb24e0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:54 +00:00
Li Xinwei
0ba9e3f00f CMake: Fix compile warnings when MSVC and -DFEATURE_static_runtime=ON
When using MSVC compiler and -DFEATURE_static_runtime=ON, qrc_foo.cpp
and qtentrypoint_win.cpp are still compiled with '-MD' or '-MDd' flag,
which will cause following warnings and other possible problems:
warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs;
use /NODEFAULTLIB:library

Change-Id: I6794930a64e9cff4dc1c9632fc3fc64227848af0
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 21e4e85a5798884837b35859f73f1eca4cb976d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:54 +00:00
Ivan Solovev
11ae4beef6 QProperty docs: update macro name
Use Q_OBJECT_BINDABLE_PROPERTY instead of non-existing ones

Task-number: QTBUG-85520
Change-Id: I47e3ff150f54176b42a478fd3ff639754d90e70a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 50e1976437f645e9d6571d4498e9d44388e59c19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:54 +00:00
Fabian Kosmale
5784587508 Move QObjectBindableProperty documentation into snippet file
The \Q_OBJECT macro has been removed but using Q_OBJECT in the file
would erroneously trigger automoc. Avoid the issue by moving
the snippet into its own file.

Task-number: QTBUG-89505
Change-Id: I6630ff4bfcbf33eae348ac3d92aae1878dc573ea
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 2c8d7411ace96f268d0692b366364d606f2608be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:53 +00:00
Ivan Solovev
65893e14f2 QString: update documentation
The QString documentation is aligned with QList regarding common
wording and ideas:
- Extend general class description
- Revise description of several methods
- Fix examples to use qsizetype instead of int
- Wrap descriptions at 80 characters

Task-number: QTBUG-87962
Change-Id: I7d5a7e829ce8b98a0a1a7fae6b7ae0dec4effbae
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 13e2161b7282f995cc702af5d343b5c9d4c03e48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:53 +00:00
Ivan Solovev
bd51959b34 Blacklist tst_QMdiArea::updateScrollBars on macos
Task-number: QTBUG-41343
Change-Id: I782ded140932ab3af52ee5ca9b743fd2a3cdb473
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit f8de5e54022b8b7471131b7ad55c83b69b2684c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:53 +00:00
Ole-Morten Duesund
3896894715 Add sections about std containers and algorithms
Add section comparing Qt containers and std containers.

Add snippets showing use of std algorithms with Qt containers.

Task-number: QTBUG-86584
Change-Id: I1133a5214a5acd086c37658ca11ab205a19a489b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 8183086513ae439220ae1facb1e93fc23b9a116b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 11:37:53 +00:00
Eirik Aavitsland
21bc2d91a8 Fix autotest config in cross-compiled prefix build
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
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e26d2865a718cecd08233e84673c67c5ca3bc765)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-17 08:31:38 +00:00
Alexander Volkov
94e7044067 xcb: Fix available geometry after rotation
QXcbVirtualDesktop::m_workArea is not updated after screen rotation
if _NET_WORKAREA is not updated, e.g. when a window manager is not
running.

Use width of -1 for m_workArea to indicate that _NET_WORKAREA is
not set and thus there is no need to find its intersection with
screens' geometries.

Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit df28d75721f7e57f4421ed8c4b8131da742f3967)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-13 22:35:02 +00:00
Andy Shaw
622a5dc603 OCI: Fix the compilation of the plugin
Change-Id: I9637bab6cc217d4fd9692f6745b4f14db6ffb259
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7b391c0d2c03d8d25449eca3868cd010d75ff81e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-13 13:09:17 +00:00
Assam Boudjelthia
9b3e80cd87 Android: install android test scripts to libexec to test on all modules
The scripts that are used by Android test VMs are now located in qtbase
and are not easily usable by other modules. To fix that and allow other
modules to use those scripts, we install them with cmake into libexec.

Task-number: QTQAINFRA-4052
Change-Id: Ibdd3658fd9fe7e007104a85d9999028a2de99a33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f3cfdb905b926948659f37924837b3c14868ff6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 22:27:27 +00:00
Ivan Solovev
384864e3dd QList docs: lexicographical -> lexical
Lexicographical is not the right word for the comparison description.
Other classes use the term "lexical", so QList is updated
in that way too.
The link to cppreference is left, because QList actually uses
std::lexicographical_compare, so it's completely valid here.

Task-number: QTBUG-87962
Change-Id: I37bd3a92c5a3f857266e9c483d14e64eb90ce2c7
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 91c67b04164cba99189131c7ecad9155815c9199)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 17:19:34 +00:00
Robert Loehning
258f66beb0 Fuzzing: Provide link to oss-fuzz
Change-Id: Iac77faac8bd901504073b1aacd067a42e349eca3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 379799b10de6203be3eb382aa2a66d443e75534c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 17:19:31 +00:00
Assam Boudjelthia
591da39805 Android: restart emulator if it gets stuck during testing
Task-number: QTQAINFRA-4052
Change-Id: Ie1a0d1c6b6c5cd0425b7ccf195ac57408142f3c3
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 86a655387c26cd25dde69cebd18b5ff9379fbe3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 13:17:19 +00:00
Doris Verria
5bfc0e1843 Don't show focus rect for QCommandLinkButton
Since QPushButton sets WA_MacShowFocusRect attribute upon init, this
will be set for QCommandLinkButton too. However, we do not want to draw
the Mac focus frame for QCommandLink buttons so remove this attribute
for them.

Change-Id: Ida7a437a54be078caaebc2c0744243d50e14a87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f8f955151a6a218e1d274663c7c309b8eb6ca92a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 13:17:16 +00:00
Doris Verria
a00fb1c955 Override initStyleOption() for QCommandLinkButton
In QPushButton::initStyleOption() there is no style option feature set
to distinguish QCommandLinkButtons. The QStyleOptionButton::CommandLink
Button feature is only set during the paintEvent, but in some cases we
need to check for this feature before painting.
To fix, override initStyleOption for QCommandLinkButton and set the fea
ture there.

Change-Id: I8831a6be7da642dcf8830812d99681213e7515dc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d3ee976acab59019fdd781691f29e6f12e4dedc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 13:17:14 +00:00
Alexey Edelev
0d72ae7267 CMake: Wrap benchmarks with cmake script
Wrap benchmark executable target with cmake script to run it on windows
without necessity of environment variables set.
Move common logic related to test and benchmark environment to
'qt_internal_collect_command_environment' function.

Make error message of wrapper script a bit more verbose.

Amends 61d5b019727dd1c06366205cb307a2a928a2a29c

Task-number: QTBUG-89076
Change-Id: I6ad3a027dc071176070cf3af4cf306f20d652039
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit cb43c7176b882b33f352fbbab0ea4ba0b5cf66dc)
2020-12-11 13:39:31 +01:00
Alexey Edelev
5b41787c1a CMake: Use test wrapper to run android tests
Refactor test adding procedure. It's expected that for each new
platform we prepare test executable and arguments first and then
pass them to common test adding section.

Rename '_qt_internal_wrap_test' to 'qt_internal_create_command_script'
Rework paramerters handling of 'qt_internal_create_command_script',
make them named.

Add 'qt_internal_create_test_script' to add tests and wrap them using
'qt_internal_create_command_script'.

Amends f19266bd02a01d4b7b277ea769c4c17727b1e661

Fixes: QTBUG-88053
Change-Id: I812f4a295005bf3a85cdcb5b8c41180f8249dc96
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d5bafc80cd38202464576f3e0b38de645bb2dc64)
2020-12-11 13:39:26 +01:00
Alexey Edelev
2e952a22f0 CMake: Improve tests wrapper arguments handling
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 f19266bd02a01d4b7b277ea769c4c17727b1e661

Change-Id: I858ddff7efa281f9cecfda656a02e1fd12361758
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c0ebfb81de8fbd352b5a63973f5dde978599c08c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 10:04:31 +00:00
Assam Boudjelthia
6f0129d205 Revert "Android: print tailored warning if qml dependency path is a dir"
This reverts commit c730a29260eda298683803bfd5306926696eedb0.

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.

Fixes: QTBUG-89281
Change-Id: Ic338d147a04a03bb1d7acbede11b647ff036922a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit fa0dc8313506b993ef0bd43ea5f38739cd58bcbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 08:08:01 +00:00
Timur Pocheptsov
0908175a1a secureudpclient - a speculative fix for non-reproducible crash
Not much information in a bug report: QByteArray is protected from negative
sizes and QUdpSocket too. FWIW - add one more check, similar to what
the server counterpart already had.

Fixes: QTBUG-83457
Change-Id: I585fa90e0a258d2257e4fed2f24c52b47548bcbb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b283ce1e836ab08e602a11ea255ee3d8e537902e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-11 00:57:55 +00:00
Edward Welbourne
b99caf8f26 Check date validity in calendar methods taking a QDate
Previously neglected, in dateFromParts() and dayOfWeek(), which only
make sense for valid dates.

Change-Id: I44879bb441dbf51b96c8fd4d45e8f07423e63047
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ac1008c16f58d95ae4ff0a7864e3bcb0783cc439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 21:19:01 +00:00
Tor Arne Vestbø
4339088503 macOS: Disable WA_QuitOnClose on menu item widget container
Otherwise it will prevent quitting of the application when the last
window is closed, on account of (seemingly) being a top level window.

Change-Id: Ib79615dd1e9394c96d39c8f9851005b4c073c165
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6198ba217f3a9b31d44375b26f3635f15fc01b3d)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-10 21:19:01 +00:00
Eirik Aavitsland
fbcc6a346b Avoid overflowing QFixed in text layout
Fixes: QTBUG-89172
Change-Id: Icb78c8eeb1dbe4c5d4c6476beebafc0115a91e8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 36ccbee34e89d185918a2925444dac11211e5c60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 21:19:01 +00:00
Craig Scott
3c8d95afa5 CMake: Support deferred finalization for qt6_add_executable()
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
Change-Id: Ic3854672ba18cff5af2ffd7f63596aa3ac492f33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b94b7687b0635ee74a3ccd83a234ead0600fd47f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 21:19:01 +00:00
Alexandru Croitor
aba6fcbbf6 CMake: Regenerate projects using pro2cmake one last time
And fix up some wrong qmake project files

Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2304acab5ff3bd3832c2e388cfdab27f2a95caa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 21:19:01 +00:00
Joerg Bornemann
86b72d481f CMake: Fix FEATURE_static_runtime build
We must call qt_set_common_target_properties on Bootstrap too, because
that's were FEATURE_static_runtime is handled.

Change-Id: Ie54f7d599d0c3a54b761e6c679983b475e77c17d
Fixes: QTBUG-89201
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
(cherry picked from commit 88fe9d3d977b865802085fbd6b5a43dbb39b116d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 21:19:01 +00:00
Giuseppe D'Angelo
e9af2a9519 QString::lastIndexOf: fix off-by-one for zero length matches
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
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit be83ff65c424cff1036e7da19d6175826d9f7ed9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 04:04:45 +00:00
Thiago Macieira
9d2788bc86 QUrl: fix parsing of empty IPv6 addresses
There's an assertion. Found by Google fuzz scan of CBOR data.

Change-Id: I55083c2909f64a1f8868fffd164f1ff3af71605b
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 4a1091f489ac3fee9efd81b0f1ffca4275725610)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-10 02:20:57 +00:00
Tor Arne Vestbø
1c37e43a8e macOS: Remove warning about KVO observers on QNSWindow/QNSPanel
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.

Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b58d6831de79ad21463e20c079093667918ee626)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 21:36:17 +00:00
Tor Arne Vestbø
1b5455b979 macOS: Fix crash when showing parent-less platform menus
Change-Id: I80f02da1621e4088eb040bb16a4db3867b6ad4d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7886fa8474bb6fc0274ef05f15981bc795125a47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 21:36:15 +00:00
Volker Hilsheimer
17ff61e898 Don't refer to "this" in QToolTip documentation
All APIs are static, so there is no "this" pointer.

Task-number: QTBUG-89082
Change-Id: I4bfe6c14304d311b903878acd5b4c8169f4065c7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 4aa174ed86db9b8832f6d0447850b9f942aac96f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 17:06:52 +00:00
Fabian Kosmale
0292acf06d QProperty: Handle eager binding calling setBinding
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
Change-Id: I9f9915797d82eab820fc279baceaf89d7e5a3f4a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ddc585b7c773786045f3658d7da5425ed2f2f786)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 14:39:44 +00:00
Piotr Mikolajczyk
2f60a68ca4 Android: Qml accessibility fixes
- Accessibility focus can follow the position of the widget
  (for example when swiping on a scrollview)

- controls are clickable directly after appearing on the screen after
  scroll (previously you had to click somewhere else on the screen,
  and after that you could focus the newly appeared control)

- checkbox and switch react correctly on click action

- fixed combobox behavior with accessibility enabled

Task-number: QTBUG-79611
Change-Id: If36914ab0165f33593e68fd7ecf168693f8538a7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fd20bc2277f98b86bddbd3f8a0ca92457a8c7c70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 09:08:30 +00:00
Li Xinwei
869448d088 CMake: Document some missing configure cmake mappings
Change-Id: I4b15dde581e28aece52d7f98cb3d94827e8bcc33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c9ac82f3b8e37a6db02c63e10b1de6909630c5f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 08:33:14 +00:00
Ivan Solovev
8f1a5d9ec5 QList: update docs
Update some wording to align with QString
and QByteArray documentation

Task-number: QTBUG-87962
Change-Id: I8162769c1a5fc94fc8920ad0d4d91e95fe74825f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit 088c3913860c216790288622d88d2cae173e73ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 08:31:19 +00:00
Andreas Buhr
51d047f9a9 Fix tst_qlineedit for offscreen rendering and tiling window managers
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.

Change-Id: I18f6de356ea20f4744f3a58cd2b1d76f6a9545a4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit aeb5165cb639ab682bbb6c5f778d53c9746c01ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 08:31:19 +00:00
Giuseppe D'Angelo
f19d84f048 QString: improve lastIndexOf(QRegularExpression) docs
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
Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f2dc8d7f27419d13bfbb2af272af99c03c66562)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-09 04:41:55 +00:00
Thiago Macieira
afcb2bb248 QCborValue & QCborStreamReader tests: fix warning about %llx on 32-bit
cborlargedatavalidation.cpp:93:60: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘qsizetype’ {aka ‘int’} [-Wformat=]
   93 |         QTest::addRow("bytearray-too-big-for-qbytearray-%llx", v)
      |                                                         ~~~^   ~
      |                                                            |   |
      |                                                            |   qsizetype {aka int}
      |                                                            long long unsigned int
      |                                                         %x

The cast to size_t is required to make the 64-bit not complain due to
the long vs long long difference.

Change-Id: I00b01c01a66748508ea1fffd164a9add2a2650cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 017e41bb8671ed273fffcd2899c3e963d4dd9445)
2020-12-08 14:20:46 -08:00
Volker Hilsheimer
53497d217f Fix qdoc warning from incorrectly named method parameter
Amends 2eb7d6073d5132a8bf269f5c6fc9f89fde446ab5.

Task-number: QTBUG-87962
Change-Id: I55c9e8cf7db9e1e1644a76f29a9dc61b161ae551
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit cd32e5d746c5fabae443da01d7323cf90bafe222)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 22:18:06 +00:00
Morten Johan Sørvig
6c546342c2 QSplashScreen: draw pixmap with SmoothTransfrom
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
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fdc687913df2dbd92c7469082690381fea55e628)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 20:54:59 +00:00
Morten Johan Sørvig
15d497c38d macOS: Add missing QT_MANGLE_NAMESPACE
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
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c2c163a7d8cb95a4901b742a72184975e791635a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 20:54:59 +00:00
Tuomas Vaarala
7072ce9090 QSystemSemaphorePrivate: Fix a call to tr() to translate()
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.

Change-Id: I48f0e1be14fc81360b8268620afc2f6c8f255819
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 1051e23ce91a980c5e961b4dcb6d61997bc08050)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 16:32:26 +00:00
Joerg Bornemann
491cb6b17e CMake: Do not write Effective[Source]Paths to target_qt.conf
This was needed, when the mkspecs directory was not present in the
non-prefix build directory. That's not the case anymore.

Fixes: QTBUG-89182
Change-Id: I2b04c2d857b0af324e1d7c41ed1934a62275d6f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 192d37099da0db1b7bf7452c44daacc19b85094b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 16:32:24 +00:00
Kai Koehne
49f27c0eaa Fix MSVC warning C4267 in qstring.cpp
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 744e55b85a96b37a, where the explicit cast to size_t
was introduced.

Change-Id: I2750a6f48fc09730aa9fa21dcc31f82e33b48b8b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 189bc8dd1546c56d9c4986024a345dcb2604ed04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 16:32:21 +00:00
Allan Sandfeld Jensen
f60f62f091 Shortcut QImage::convertTo when no conversion is necessary
Avoids a detach when converting to existing format.

Change-Id: I9a4801878ddec295a02f2c88f4a40ec13d513a94
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit cc81aae4b312da40945ddfecb806f4abe6b74048)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 16:32:17 +00:00
Andreas Buhr
ff60a9a2a9 Fix links to OpenGL documentation
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
Change-Id: Iad25d8f709b8fa9421039d5cb51cee21093e3191
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit cd661122987826357adb22684c3d953efadee638)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 16:32:16 +00:00
Alexandru Croitor
d0b1ac0f71 CMake: Disable static plugin imports for non-executable targets
There is no point in generating cpp files containing Q_IMPORT_PLUGIN()
macro calls for non-executable targets like modules, plugins and object
libraries in a static Qt build.
It causes unnecessary compiling of 10+ files for each of those targets.
In a static Qt build, plugin imports should only be done for executables,
tools and applications.

Change-Id: Ied90ef2f6d77a61a093d393cfdf94c400284c4f0
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b3576164f0aedf8d528c3724332a36b0fb6d05e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 13:18:35 +00:00
Aleix Pol
53a14dfae0 Offer to build manual tests through QT_BUILD_MANUAL_TESTS
Disabled by default as they are currently not being built and many are
not working properly, this will allow us to start using them again.

Change-Id: I823368d04e9fde2beccabedc3ca15efd1f355bfb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9d831491334e75f8ccc691edaeb173af81ab80ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 10:16:18 +00:00
Shawn Rutledge
054ef63eb9 Fix highdpi conversion of QTabletEvent coordinates on xcb
Amends 1535fc9fb9ddbfce1680979c0634b4fdf8d75fca : when high-dpi scaling
is enabled, there was an offset from the cursor position to the event
position, because QWindow::mapFromGlobal() works in device-independent
pixels, but we are using actual screen pixels here.

Task-number: QTBUG-77826
Change-Id: Ic8743b9e5c4041065f530ed1d9d6c49337b0207a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 9d51fb579bb4655f6740096f17f1ced50258c28f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 08:05:19 +00:00
Tor Arne Vestbø
46aae17ac1 macOS: Always allow interacting with popup windows during modal session
f4889e63c7b changed the worksWhenModal logic for QNSWindow to
be based on the transient parent relationship of the child window
to the modal session window, to fix many issues where windows that
should be blocked were not.

Unfortunately, some window types do not maintain a transient parent
relationship (e.g. QCompleter, which is itself just a QObject), or
are not common for users to create with a QWidget parent (such as
a context QMenu).

This change restores part of the special-casing that was removed in
f4889e, so that all popup windows are always allowed to be interacted
with during modal sessions. This includes popup windows that were
opened as part of a parent modal session, which would normally be
fully blocked, but we assume that popup windows are intermittent
enough that this will not be a problem.

For now we leave out the other two special casings from f4889e,
namely tool windows and dialogs. The former should in most cases
be created with a parent window, while the latter definitely should.

Fixes: QTBUG-88188
Fixes: QTBUG-88985
Fixes: QTBUG-87849
Fixes: QTBUG-86845
Change-Id: I005a402b21e8dc16c3b18bcd7e67d12b94a66f44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ae3594436b9b0540ef94379a73bf8fec8d3b7465)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 04:39:35 +00:00
Thiago Macieira
091590acdd tst_QCborValue: adjust the size of the minimum string that won't fit
I don't know which of the previous commits caused this: as far as I can
tell, this test should never have passed.

Change-Id: I55083c2909f64a1f8868fffd164e7e8c24eec1f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3c88728b5367f9705a8ff6f62fa66d9f46880084)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 02:39:59 +00:00
Thiago Macieira
400fcd6a60 QCborStreamReader::next: don't allocate too much memory in a QBA
Because CBOR strings are encoded in UTF-8, it's possible that the string
that won't fit a QString in UTF-16 would still fit QByteArray in UTF-8
(e.g., anything US-ASCII and most Latin text).

The previous solution was an improvement because we used to read into a
QByteArray then convert the QByteArray to QString, thus using 3x the
amount of memory (1x in QByteArray, 2x in QString). The previous commit
skipped the middle allocation and made the regular readString() function
do the decoding either directly on source memory or by reading in small
chunks (16 kB).

Future improvement for Qt 6.1: add readStringChunk(char16_t *, qsizetype)
so we can do the validation / skipping at O(1) memory.

Change-Id: I7b9b97ae9b32412abdc6fffd1645458c655cc566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 58bea7f3a2d0a88a56793c3878a7fcef74b4c646)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 02:39:49 +00:00
Thiago Macieira
d7a0f8356a QCborStreamReader: move the UTF-8 decoding into readStringChunk
This allows us to decode long UTF-8 strings in chunks, instead of
allocating a big block of the size of the UTF-8 source and then another
for the full UTF-16 content.

Task-number: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd16452a47b1036ef3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit bab2cd1125a21885bea97079219031ab45861826)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-07 18:39:43 -08:00
Thiago Macieira
8675f81cd8 QCborStreamReader: remove the lambdas from decodeStringFromCbor()
One was only called once. For the other, one of the calls wasn't
necessary.

Change-Id: I7b9b97ae9b32412abdc6fffd16454eec59d72b8a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 895940a42505e4383971e84954a0deaebad3dbab)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-07 18:39:35 -08:00
Thiago Macieira
c5623e5bb1 QCborValue: avoid allocating result if data is insufficient
Similar to the previous commit which applied to QCborStreamReader, don't
allocate too much data before checking that the stream actually has that
much.

Fixes: QTBUG-88256
Change-Id: I7b9b97ae9b32412abdc6fffd16454b7568a063ba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 638171eb10cfb186a6c47ec052a3b0c5b6449386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 02:39:23 +00:00
Thiago Macieira
3caacb2f2b QCborStreamReader: avoid allocating result if data is insufficient
By calling the internal readStringChunk() function with a QByteArray
pointer, QCborStreamReader::readByteArray() can now avoid allocating the
resulting buffer until the internals have confirmed that there is
sufficient data in the incoming buffer. As a result, we first detect the
EOF condition before we conclude the payload would have been too big for
QByteArray (validation()) test. Meanwhile, the hugeDeviceValidation()
test ends up with a few conditions where it would have copied 1 GB of
data, so limit that too.

We make a choice of reporting OOM vs DataTooLarge only if QByteArray
fails to allocate in the first place (QByteArray::resize() ->
Q_CHECK_PTR -> qBadAlloc, QtCore is always built with exceptions on).

The QCborValue unit test needed a temporary work around until we apply
the same allocation fix (see next commit).

Fixes: QTBUG-88253
Change-Id: I7b9b97ae9b32412abdc6fffd164523eeae49cdfe
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9a55f40937d037d06e00b09465d8dad0554692fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-08 02:39:20 +00:00
Alexey Edelev
15abeed116 CMake: Force crosscompiling_emulator to empty string if not found
In some case CROSSCOMPILING_EMULATOR property is not INHERITED and is
set to 'NOTFOUND' by get_test_property. Force it to empty string in
this case.
Add missed 'name' argument to '_qt_internal_wrap_test'. 'name'
previously was used from parent scope.

Fixes: QTBUG-88053
Change-Id: I5286bcb9b11659f638e178ce52172dfee994fc34
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4a9ed410750c8b111d33c52544388904244ec6e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 21:32:18 +00:00
Giuseppe D'Angelo
792caf9824 PCRE: update to 10.36
Dropped the RTEMS patch (upstream now uses posix_madvise).
Drop support for the TILE architecture (dropped by upstream).

[ChangeLog][Third-Party Code] PCRE2 has been updated to version
10.36.

Change-Id: Idb4467bef0ff520605b8b5d9188b9d67d8e4d0f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 509c25752112583e6bc997e8c9442f6b69136816)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:24 +00:00
Andreas Buhr
19fac4f9f2 Fix QPropertyAlias example, which did not compile
The QPropertyAlias example did not compile and comments were out of
sync with code. This patch fixes both.

Change-Id: I5717f8df99f4936d0bcbae8df7d2d17e8086951d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 0e96e1fb752e0b7c99927e77e7ac3244b2e0c118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:19 +00:00
Tor Arne Vestbø
0544d35656 macOS: Don't hard-code x86_64 as the architecture when using qmake
The qmake variable QMAKE_APPLE_DEVICE_ARCHS was added for iOS,
to support universal builds, as the QT_ARCH is a single value.

Since the qmake macOS builds are non-universal (at the moment),
we remove the hard-coded value for QMAKE_APPLE_DEVICE_ARCHS on
macOS, and let the normal architecture test resolve the arch,
like on other platforms.

To ensure that the following configuration tests are run with
an -arch argument, we trigger a commit of the preliminary Qt
configuration after running the architecture test. This is not
strictly necessary, but makes it clearer what's going on during
configure.

The device_and_simulator configuration option was used by the
iOS toolchain, and needed to be moved up in the configuration
test order to not break later tests.

The logic in mac/default_post.prf for both Xcode and Makefiles
to add -arch flags was kept as is, based on the existing
variable, to avoid too many changes to this logic.

The logic in toolchain.prf was amended to make it clear and
ensure that it only applies to iOS builds. macOS builds do
not have this issue.

Change-Id: I70db7e4c27f0d3da5d0af33cb491d72c312d3fa8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9082cc8e8d5a6441dabe5e7a95bc0cd9085b95fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:13 +00:00
Andreas Buhr
f85b900ce1 Fix typo in external-resources.qdoc
C++ comment was terminated by "/" instead of "*/"

Task-number: QTBUG-88533
Change-Id: I560b69602856009509781e56df36fee5879a297f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1c635e805fb449be4687a92c5051d7be118dd9e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:09 +00:00
Joerg Bornemann
8d027bbbf6 Doc: Add -qt-host-path to configure's help screen
Change-Id: Ia32377e08d72f82e71ce6f2c08e61bd8991b3077
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a201ce7f11291cbb6810f295126fb3533edbdc53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:08 +00:00
Alexey Edelev
acfe198d08 CMake: Add extra targets to run single benchmark using CMake generator
Add custom targets with '_benchmark' suffixes to make run of
benchmarks using generators possible, e.g.:

$ ninja tst_bench_qudpsocket_benchmark

Extend '-[no]make' option to pass benchmark. Rework
'-[no]make' processing to unify these options processing.
Also looks like it doesn't make sense to enable benchmarks without
having test enabled. So '-DQT_BUILD_BENCHMARKS' enables test as own
dependency automatically.

Task-number: QTBUG-89076
Change-Id: Ieee9eadaf6d75a1efec120242d6eb786ace1b071
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 61d5b019727dd1c06366205cb307a2a928a2a29c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:05 +00:00
Wang Chuan
01474c31ba QStyleAnimation: make sure the last frame of animation is rendered
Amend to 8738f09b9fc1b35e3dc78211368d87069f3071f7.
The last frame of animation might be lacked if [_skip < fps].

Fixes: QTBUG-89118
Change-Id: Ia0345e2aff7579afe2d60c4e7495bfaa1f36198c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 04fed9f77e3288f69fe89bcb8a3f1cdbe02ce219)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:02 +00:00
Andreas Buhr
fd492d460f Fix QProperty example so that comments match implementation
The comments in the QProperty examples slightly mismatched the
implementation. This patch fixes it.

Change-Id: I03cfb35c024fad8ea4eaa5d5db220e1907f06bc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3fbf922cc5925a13fbfadfe1f5fa8312209c097a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 19:27:01 +00:00
Lars Knoll
391dc40bd2 Make the signal argument in Q_OBJECT_BINDABLE_PROPERTY optional
The intention was always that you can define properties that do
not require a changed signal. But having to explicitly pass
a nullptr as signal parameter into the macro is ugly, so
use the cool QT_OVERLOADED_MACRO to make it optional.

Change-Id: I0ce366d043850f983c968d73c544d89933c48df9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cb39ea05810bc207100018589da658a0cce98edb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 16:23:31 +00:00
Friedemann Kleint
0566e66e88 Fix qtdiag testing helper on Windows
The windows library user32 is no longer a known library for qmake; add
it explicitly.

Change-Id: I61f44e8a2cbccbabbdc5d58bd2615b431097aafd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5634bdf9ce1f3b30637f59f398e6134f75616c5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 15:29:39 +00:00
Timur Pocheptsov
9f03c9304f tst_QTcpSocket: stabilize connectToHostError
It's not _wrong_ to time out when connecting to something unreachable
(it's just a different way of handling it) so we shouldn't fail when
this happens either.

In local testing (windows) it times out after 8 seconds, so bump
the timer to 10 seconds. On systems where it's faster there'll be
no difference as long as things don't go wrong.

Fixes: QTBUG-88042
Fixes: QTBUG-89089
Change-Id: I8437cf8e4fbecedea2391ed87fdce1213085b964
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 27f52942b422b47a1283d918e0a0bc8761382921)
(cherry picked from commit 4111d8e8e789c815ae37eb9903b042124e169078)
2020-12-07 15:33:59 +01:00
Tor Arne Vestbø
953d70c2a3 doc: Remove dpiawareness command line argument
We don't want to (officially) expose customizations like this
to the user, now that high-DPI is always enabled and should
work.

Change-Id: I2f0bd7c625b565896b0766586f191ff5001eb60a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ecb61c17f5f22a997d98da9ce750367bc02d1f96)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-12-07 11:51:40 +00:00
Craig Scott
51c790daff CMake: Enable NEW policies by CMake version with a global default
When a CMake release introduces a new policy that affects most Qt
modules, it may be appropriate to make each module aware of that newer
CMake version and use the NEW policy without raising the minimum CMake
version requirement. To reduce the churn associated with making that
change across all Qt modules individually, this change allows it to be
updated in a central place (qtbase), but in a way that allows a Qt
module to override it in its own .cmake.conf file if required (e.g. to
address the issues identified by policy warnings at a later time). The
policies are modified at the start of the call to
qt_build_repo_begin().

For commands defined by the qtbase module, qtbase needs to be in
control of the policy settings at the point where those commands are
defined. The above mechanism should not affect the policy settings for
these commands, so the various *Config.cmake.in files must not specify
policy ranges in a way that a Qt module's .cmake.conf file could
influence.

Starting with CMake 3.12, policies can be specified as a version range
with the cmake_minimum_required() and cmake_policy() commands. All
policies introduced in CMake versions up to the upper limit of that
range will be set to NEW. The actual version of CMake being used only
has to be at least the lower limit of the specified version range.
This change uses cmake_minimum_required() rather than cmake_policy()
due to the latter not halting further processing upon failure.
See the following:

    https://gitlab.kitware.com/cmake/cmake/-/issues/21557

Task-number: QTBUG-88700
Change-Id: I0a1f2611dd629f847a18186394f500d7f52753bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3859f15ec9fd333089e6eb1152a76592cd5f83c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-07 04:24:41 +00:00
Thiago Macieira
f5dd248de5 QCborStreamReader: move the readStringChunk code to the Private
And add a currently-unused QByteArray pointer parameter. This function
will resize the array as necessary as data comes in.

Change-Id: I7b9b97ae9b32412abdc6fffd16451f5c6b280f3b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from c16ad16bd0a1d51d559eed8a4f2f10ac1518f6aa)
2020-12-06 08:57:34 +00:00
Thiago Macieira
f77caf4c60 QString/QByteArray: add missing Q_CHECK_PTR
So these two classes throw when trying to allocate silly sizes or in OOM
conditions.

We probably want to move these Q_CHECK_POINTER into QTypedArrayData but
I didn't want to do that in this commit.

Task-number: QTBUG-88256
Task-number: QTBUG-88253
Change-Id: Ifc61bb80b9bf48a386abfffd1648176111770174
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit aab5c8e5486a6484feddfae0b04fd39fd244d9b9)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-12-05 18:42:04 +00:00
Aleix Pol
07b6b25c4c Improve the documentation for QElapsedTimer::restart, include units
Specify that QElapsedTimer::restart returns milliseconds

Change-Id: I47d9ffde7b0f73c30b14d2ce8467ec0a553b58f8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 302254f90f41509b3d1111551296134cd76a3db5)
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-05 13:30:02 +00:00
Ivan Solovev
ca389cdecf QByteArray: update documentation
The QByteArray documentation is extended to align with QList and
QString regarding common wording and ideas:
- Extend general class description
- Revise description of several methods
- Wrap descriptions at 80 characters

Task-number: QTBUG-87962
Change-Id: Ie9e8ef47a85d0867c2fa63889a60cafbe76ee47a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2eb7d6073d5132a8bf269f5c6fc9f89fde446ab5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-05 07:18:38 +00:00
Alexey Edelev
622efb8ecc CMake: Add handling of TESTRUNNER and TESTARGS by Qt tests
Wrap Qt tests to handle TESTRUNNER and TESTARGS environment variables.
Variables are handled according to qmake build procedure. All test
now are wrapped by generated CMake script.

Fixes: QTBUG-88053
Change-Id: I339977ce6ce11ddd38a4bf0bd26eb8f2ae463ba3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f19266bd02a01d4b7b277ea769c4c17727b1e661)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 22:43:27 +00:00
Andreas Buhr
edfc1848cc Fix broken link to Zstandard library
The old link zstd.net is not working any more. Zstandard is now at
http://facebook.github.io/zstd/. To ease maintenance in the future,
those links now point to "Zstandard Site" which is maintained in
external-resources.qdoc.

Task-number: QTBUG-88533
Change-Id: Ic8f067fd5d7ce1a088d0272797fca98fd506a26e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 987ee226908fd502589181a30e16e34511bef131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 20:41:10 +00:00
Alexandru Croitor
5b7fd9e4e4 CMake: Build examples with qmake against a CMake built Qt
We want to remove the Qt .pro files for projects, except examples,
because examples are still meant to build with qmake.

To not lose coverage on examples built with qmake, add instructions that
will build the qtrepo/examples folder with qmake when the CMake
configuration has -DQT_BUILD_EXAMPLES=ON.

This means that such configurations will build examples both with CMake
and qmake.

Aside from making sure that our examples will still build with qmake, it
will gives us some some coverage that a CMake-built qmake works
correctly.

Implementation-wise, add new instructions files that can call qmake and
make depending on configuration and target type.

Fixes: QTBUG-85986
Change-Id: Ie8f4cbcda03c94da2aef455e32f48dad41a4bdb0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 24f12d0cefe00adfe1b11cf41efbb146d529a6cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 18:30:12 +00:00
Mårten Nordheim
e9eb05b5b7 QSslSocket: Don't call 'transmit' in unencrypted mode
At the same time I'll add a generic protection against being called in
unprotected mode in the schannel backend (openssl already has it in a
different form).

Change-Id: I97c1be6239c27e306de0af7ad568fbcfde09da71
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit f8badeda72813ee4d32e7672c4a98373cb7b5d60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 18:29:41 +00:00
Liang Qi
fc794d7622 tests: add a shortcut to quit app in allcursors
Change-Id: I6b377cacfe05fc13c9f70e37247ed4da72f3f72e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c48cb3381027779a5d58b02878893d176a83479a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 18:29:37 +00:00
Edward Welbourne
2784e72455 Enable testing for whether a calendar registered its primary name
In registerAlias(), return true if this instance is already registered
with the given name.

Previously there was no way for a QCalendarBackend to tell whether its
primary name registration had succeeded, during instantiation (other
than by devious hackery using a QCalendar instance with the name and
some form of back-channel in the instance).

Use this in backendFromEnum() to catch cases in which (e.g. due to a
race condition) a new instance isn't the one that got registered.

Change-Id: I468ac364a68bf3574cd7f8b8b1e672d8fd969111
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2b7c74d5ff7e835ffa76ed3c80b05cf73af40f4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 16:28:26 +00:00
Fabian Kosmale
4f31aee725 QInputDevice: Parent default keyboard to core app singleton
With this we can avoid leaking the QInputDevice which is created when
the platform plugin does not provide any. The onwership is solved in a
similar way as in the plugins, except that here we have no parent which
really fits, so we use QCoreApplication::instance instead.

Change-Id: I77a212fb592ba3d5a42b2ecd486763e3b4d3410e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit bc093cd294cbf48eb93b776fc0b927f0a43fa603)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 16:28:25 +00:00
Andy Shaw
2e6f34ecff macOS: Make sure that the reserved characters are not escaped
The URL for the PAC proxy that is passed needs to be preserved for the
main URL part and not entirely percent encoded, only the query part
typically needs to be encoded. So use toEncoded instead for a URL to
ensure they are not percent encoded. This amends
c163ec1dbf873781b77ea67d4449d643c166c0c4

Change-Id: Ie41ab55f71be8e25c18775e61ce7b4d110c2ddbf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 94c3c7a491e0c25cf2179efe04c2fbd80b370c1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 16:28:23 +00:00
Allan Sandfeld Jensen
6f125dcf1a Fix QImage::setPixelColor on RGBA64_Premultiplied
QColors were not premultiplied before being set.

Change-Id: Id3765b6932a72374ddfd788fae4bb628a4edf0b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 0c19e3f703a7c3fd59e6db8a9d4ac7091674b552)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 16:28:18 +00:00
Friedemann Kleint
539a16a69f Fix uic/rcc generating outdated export for Qt for Python
Bump version to 6.

Fixes: QTBUG-89124
Change-Id: Ifcf60552b5b6efb86f79da34da9c34b8efae9fa4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit fc9cda5f08ac848e88f63dd4a07c08b2fbc6bf17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:22:37 +00:00
Joerg Bornemann
be61909248 CMake: Work around building dbus 'controller' example with qmake
Similar to what has been done in 5138a970f31, we need to adjust the
remotecontrolledcar/controller dbus example to be built with qmake.

In the CI we first build the examples with CMake in the source
directory. That creates some generated source files in the dbus example
dir.

Then, the examples are (will be) built ouf of source with qmake, and
those generated source files will be placed in the build directory.

When building with MSVC, there's a peculiarity with nmake/jom's
inference rules that lead to picking up the generated car_interface.cpp
from the source directory, instead of the build directory.
See QTBUG-13496 for details.

car_interface.cpp, built with CMake is generated to include
car_interface.moc.
car_interface.cpp, built with qmake does not have this include, but the
build system calls moc on car_interface.h.

All this leads to duplication of the meta object for
OrgExampleExamplesCarInterfaceInterface, preventing successful linking.

Work around this issue by turning off the generation of nmake/jom
inference rules.

Task-number: QTBUG-85986
Change-Id: I0a6ca9f880b63f05a4e9f2032e44d3b391d8a756
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b71c04353dc72e0fb6d384e0d5845524f1547f88)
2020-12-04 13:09:05 +00:00
Fabian Kosmale
87409ce000 QBindable: Disallow mutation if read-only
If a QBindable is created from a computed property, it is not possible
to actually set a value or a binding. If we try to do it anyway, we'd
get a crash. Thus we now check whether the function pointer is null
before invoking it.

Task-number: QTBUG-87153
Change-Id: I5bedb9080ccf79d9b8166b80d5733d095ed76f8d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit e236faa75f446aa3378fb013cce6598c9e076ccb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:08:26 +00:00
Mårten Nordheim
3f94498303 QSocks5SocketEngine: fix reference to dangling data
Following a41c61fb2d2f973fd1cd5e95ee5be1ac1a4f8433 QIODevice may try to
copy the QByteArray itself (rather than the data it points to). This can
lead referencing dangling data when the QByteArray is initialized with
raw data.

Change-Id: I481695b33f251f750ef482d72b81636f0d4bf462
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 710886fbdd993c3a618ea8bc8b59fbb3e18cfbf0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:07:51 +00:00
Alexandru Croitor
3d61869885 CMake: Fix conditions for some subarch features
The AES and SHA features were checking for the wrong TEST_subarch_foo
variables.

Task-number: QTBUG-87376
Change-Id: I46cd14d98832529aebac22cfcb01180330c5e091
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2f1c0875733d849a95c2cc5e40d2e6079ccbdec9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:07:49 +00:00
Giuseppe D'Angelo
8e57a0ef37 tst_qmakelib: link to QtCore's private API
Just like it was done in the .pro file.

Change-Id: I7def52127f4bab6f0ef490ac7eee2de2da479352
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9afb3506b344d5139284e49235d64215b48cee31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:07:44 +00:00
Allan Sandfeld Jensen
d9dc0b177a Improve documented function argument names
Make them less \a fun.

Change-Id: Ief9a572dcbeb029b18b352c89551963bade90198
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 47923f7d4766a3b8943d292798b5b7e8792e598c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 13:07:41 +00:00
Andreas Buhr
e6930edee3 Document QMultiHash::clear function
When QMultiHash derived from QHash, it inherited the clear function
and no separate documentation was necessary. Now, QMultiHash::clear
needs its own documentation. This patch adds it.

Task-number: 88533
Change-Id: I93c59b66aa3d8ccf1888b6e24a4cc47004318e37
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3c0614b7794d917045a496144df506eeeb2a57c6)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-04 13:00:11 +01:00
Kai Koehne
832a3fc4e1 Do not advise using AUTORCC anymore
Task-number: QTBUG-87643
Change-Id: Ib07586cc4206312044c0f0c154fa2ab2aada2c19
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9e1aa7fc5fef04787fcc7f56592104df6103b32b)
2020-12-04 12:24:35 +01:00
Piotr Mikolajczyk
1eda8f9aaf Android: Kill calls to deprecated func in API 29
Since API 29 functions:
 - getExternalStoragePublicDirectory
 - getExternalStorageDirectory
are deprecated and no longer return directly accessible path.

This patch replaces calls to those with suggested call to
Context.getExternalFilesDir(String)

Task-number: QTBUG-87803
Change-Id: I36bc5d5b72a80017996445af0d577aacf5e112d3
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit e1440dd7bc1a5da9a536f88b9733d04ec8fa6e61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 09:19:07 +00:00
Li Xinwei
0a23cab457 CMake: Avoid MSVC C4996 warnings
The qmake build system defines _CRT_SECURE_NO_WARNINGS in
mkspecs/features/qt_module.prf, the cmake build system should do the
same thing in qt_internal_add_module().

Adding this definition can avoid warnings like:
warning C4996: 'strncpy': This function or variable may be unsafe.

As a special case, Bootstrap uses add_library() instead of
qt_internal_add_module(), so _CRT_SECURE_NO_WARNINGS should also be
defined in src/tools/bootstrap/CMakeLists.txt.

Change-Id: Ic82193d177f82785fd84948efa78c49ca8d8db46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 013abe320680b3dcd3f6d7e4fb4880e590ba10e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 09:19:06 +00:00
Alexandru Croitor
56d41d9b8b CMake: Fix arch parsing for oss-fuzz
I'll preface by saying, it's not clear to me why the behavior is
different.

Our qt_run_config_test_architecture function builds a target
executable, and then uses file(STRINGS) to try and parse out some
magic strings that we expect the executable to have (architecture,
abi, etc).

In qmake this was done by matching with a regular expression ending on
a \\0 null byte character.

In CMake, we do a string(FIND) and string(SUBSTRING until the end of
the line) on a *line* returned from file(STRINGS). Notably, I did not
find any regexp syntax provided by CMake to try and match a null byte
character.

Note the docs for file(STRINGS) implies to me that *lines* are
detected by looking for newline characters '\n'. The docs also
mention that binary data in the file is ignored. What's binary
data though?

If you open the executable with a hex editor, at least on macOS, the
strings we are interested in are indeed separated by null byte chars,
not newline chars.

On most platforms file(STRINGS) did end a line on the null byte
character.
Except, for some reason not when building Qt for the oss-fuzz project
with clang under Docker.

Calling message() on one of the lines prints a very long string with
null characters seemingly replaced with semicolons, and of course the
matched architecture string is wrong and fails configuration.

For *some reason*, if I add a "REGEX ==Qt=magic=Qt==" option to the
file(STRINGS) command, the captured output lines don't contain
semicolons even when building for oss-fuzz.

The extracted strings are then correct, and configuration succeeds.

Use the REGEX option workaround, with the aim to quickly fix Qt
building for oss-fuzz for 6.0.1 release.

Fixes: QTBUG-89047
Change-Id: Iad11c1090c1187aadd39082f196050bf3290df95
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit f071ba31b2e441268518217cbe2ec4fe1c978b31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 07:12:21 +00:00
Xiang Xiaojun
cc785b9b68 QPushButton: fix support of style sheet rule for text alignment
Fixes: QTBUG-86857
Change-Id: I7e3e2b5323b1e46f572cacfddae20cb6e7882a47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6269438af95bbd988ead08829fa3bc9dc25891e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:36:22 +00:00
Mårten Nordheim
cfa83bbc15 tst_qstorageinfo: Test the copy ctor
It was previously untested

Task-number: QTBUG-88183
Change-Id: Icc59fc632957a75cac8c7f5e2a1aed88a1c9ff9d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit a7610a0cf79c576b098999822c5070a078e51326)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:35:39 +00:00
Giuseppe D'Angelo
ba291add45 QTestLib: allow for non-zero values in env variables
The usual behavior for env variables is that any nonzero
value means "enable", so do the same for a couple of QTestLib
env vars. While at it: document them.

Change-Id: I854285df5d7af5be771f9d6532ddec5d8a6f8987
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 89def082c6db80e877e2a6a33db41b67f94cdf46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 06:34:57 +00:00
Andreas Buhr
f3d1d963c7 Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.

Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 0440614af0bb08e373d8e3e40f90b6412c043d14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 05:12:56 +00:00
Andreas Buhr
54c9588ce2 Fix documentation of QStringTokenizer
Documentation of QStringTokenizer was broken, mainly because most
parts of the interface were defined in base classes. This patch
gets those members into QStringTokenizer itself in order to document
them.

Task-number: QTBUG-88533
Change-Id: Id00a79db4b293958a9c5ed53a518a97721d228c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 604a8c7acc4351a48b362349cfa7f85006673c47)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 22:28:18 +00:00
Andreas Buhr
a310fc0357 Remove non-existent function QApplication::desktop() from docs
The method QApplication::desktop() was removed. This patch removes
a line mentioning it in the documentation.

Task-number: QTBUG-88533
Change-Id: I123e41c342d64da347b9bd59378e52a8e0301c1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d7828a5ed385f1c4630239922266d5dd554772a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 22:28:17 +00:00
Alexey Edelev
c52d3fe32e CMake: Improve long paths handling for static builds
Use number-based naming of object libraries produced for generated
resources. This reduces path length of subdirectories for object
library targets.

Amends 08eb485a006dc2baca42eb280ae60e9f0fc00dff

Change-Id: I1a449290e8a9b969601a1cc1abc6fdcfc0cd9454
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit af0a9375f3af98573291e78511582bb02a9d4491)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 22:28:14 +00:00
Friedemann Kleint
fae0903fe9 uic: Do not generate QDockWidget::AllDockWidgetFeatures into code
The enumeration value was deprecated by
qtbase/f15aa1fd84e46dfc4d9a78b3a7ba482e42abd9c1 and removed in Qt 6.

Task-number: QTBUG-89093
Change-Id: Iaf46adc1e1bd79e4aaab066c9fa4bf84a8ee34d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a5e2f2ddad0cc6b6a06f51e0dce6acf0fecf9de6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 18:48:26 +00:00
Joerg Bornemann
50fff57377 CMake: Fix QMAKE_LIB_<NAME> variable names in module .pri files
QMake libraries that contain dashes are referenced by QMAKE_USE as is,
but the corresponding QMAKE_LIB_<NAME> variable must be normalized to
contain underscores.

Example from the qmake build:

./mkspecs/modules/qt_lib_waylandclient.pri
11:QT.waylandclient.uses = wayland-client xkbcommon wayland-cursor

./mkspecs/modules/qt_lib_waylandclient_private.pri
12:QMAKE_DEPENDS_WAYLAND_CURSOR_CC = WAYLAND_CLIENT
13:QMAKE_DEPENDS_WAYLAND_CURSOR_LD = WAYLAND_CLIENT
15:QMAKE_LIBS_WAYLAND_CURSOR = -lwayland-cursor

Change-Id: If31bd45764d52f97d80d6388503008dc1ffb16ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e32e4898dde1dc2a5ae19a1c3dc4609064258a43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 18:48:25 +00:00
Lars Knoll
8e7bcedb65 Add a qHashEquals() method and use it to compare keys in QHash
In some cases, the default equality operator for a class is not suitable
for using in hashing (for example because it uses fuzzy comparisons).

Add a qHashEquals() method that by default uses the equality operator, but
allows to tailor the operations that should be used when using the class
as a key in QHash.

Task-number: QTBUG-88966
Change-Id: I346cf0e6e923277a8b42a79e50342a1c2511fd80
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5d8b586e73e37070b0303bee24372550854637eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 15:46:45 +00:00
Lars Knoll
6bc1a1ec2f Dont' return a const ref to QModelIndex
The conversion operator from QPMI to QModelIndex should return by
value, to hide implementation details and so that we don't have to
rely on a static empty QModelIndex.

Change-Id: I92b3f8451422f2b69bf31f28b387a124fd24ec46
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0cd2935ed9d772f0eb06d03201baabd60764ec80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 15:46:44 +00:00
Lars Knoll
2f747bb57c Fix hashing of QPersistentModelIndex
The hash and equality operators used need to be consistent with
each other. Unfortunately, QPMI::operator==() is not suitable to do
this. So specialize qHashEquals() for QPMI.

Fixes: QTBUG-88966
Change-Id: If5f19a722ae9fc4e78e93537e7ea15726f148768
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 83e95956ed58e88b11e2cc3cb61c5beacb7985db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 15:46:43 +00:00
Fabian Kosmale
faaf8f5c0a Avoid signed overflow in moc
moc's preprocessor needs to implement certain math operation to
correctly handle #if conditions. Unfortunately, its implementation is
not overflow safe. However, those are rare enough in practice that we
in general do not need to care about them.
This patch adds a workaround for one case where UBSAN run into an
overflow related issue.
A complete fix would require to make moc spec compliant (do math with
std::max_(u)int_t operands; always wrap on overflow) in all operations.

Fixes: QTBUG-88825
Change-Id: Ic4d2cb097db2fa2f9d4681bbaab3068eaa2745aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit df8fbcf382b086e96082a8eb3622c60273e94c4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 15:36:54 +00:00
Andreas Buhr
0902ff112e Extend container overview documentation, mention Q_DECLARE_TYPEINFO
The container overview documentation did not mention
Q_DECLARE_TYPEINFO and the related optimizations. This patch
adds a short paragraph about it.

Task-number: QTBUG-86584
Change-Id: I5b0b8ce92a47da5f0398cc413fbf3e07b0921e59
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit d545fbb61b699802e9ae1a3c19f4c4bef724fbda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 15:09:12 +00:00
Karsten Heimrich
2537b5c6c3 Fix QTranslator::load() search order not following uiLanguages order
Merge the exact and and fuzzy search loop. This way we prioritize
translations which match a more preferred language loosely over ones
which match a less preferred language exactly. This is likely what
most users want.

Fixes: QTBUG-86179
Change-Id: Id1610c82a2e77edf9a5d4417968dcc4c307810d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit 8df2bf04917e742470bbd1ff69e003811c5975ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 09:57:39 +00:00
Karsten Heimrich
bf88857623 Add test for QTranslator::load() translation file lookup algorithm
Change-Id: I70f4b3d7dbc46d21065eab21a5af8a38d4a60589
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit a0e04e7d2bfc47891a85378a57ceb5dca1d4c558)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 09:57:37 +00:00
Giuseppe D'Angelo
1f96dc553b QString::fromUtf8: remove a stray cast to int
Change-Id: I0dba7ba130c3fa96eda63a0fa1a39c5f0bb863b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1ebccf3426ef407d174fd9cdfd22da742111331e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 09:57:35 +00:00
Assam Boudjelthia
e3e5a0476a Android: print tailored warning if qml dependency path is a dir
androiddeployqt might be misleading when the path is adir
and the warning says that the file does not exist.

Change-Id: I1129f49af58a0637a240fcfd425a61b2ed15c840
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit c730a29260eda298683803bfd5306926696eedb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fb984aaa1e8933cbe08820b9adf51eab3f1825d0)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-12-03 07:47:28 +00:00
Qiang Li
61829b5d39 Adjust the format of code blocks in function mouseReleaseEvent
Change-Id: I8441b1c4f22ec04e34e8c2c5e9ccc69d34c67e01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d6dcf508a6a751c8c32273112957607b062899e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-03 04:52:10 +00:00
Giuseppe D'Angelo
e911d57f24 CMake: mention the QT_BUILD_X_BY_DEFAULT=OFF
Which is probably the direct port of -nomake XXX, as qmake
always offered the way to build tests/examples/etc. after
configuring without, while cmake doesn't.

Change-Id: I85b039e56cde3ddfaf661385100d3c3a8cc2ac16
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b70ddde4b651d0825e7e12fdbc50271bd298eea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 18:39:21 +00:00
Eskil Abrahamsen Blomfeldt
aeb0a36015 Fix tst_QFontDatabase::aliases failure with ambiguous font
If the first font in the families list happens to have been
disambiguated because of duplicates, two things went wrong:

1. hasFamily() would return false for the font family, because
it does not disambiguate when checking for the family name and
only checks if the families list contains the exact string.

2. Adding aliases to the full disambiguated string is not supported,
only the family name.

The first issue has been reported separately as QTBUG-89068.

The test failure is fixed by just avoiding the fonts that
are ambiguous in the test, as it really doesn't matter which
font we pick.

Fixes: QTBUG-89008
Change-Id: I829778c2e7bb6090475c34dcf9cdce58862729d6
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 34fa01be82065241cd9a369ae49749422d8e7831)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 18:39:20 +00:00
Mårten Nordheim
62eb969d38 QDuplicateTracker: remove the appendTo && overload
As a requirement for unordered_set (and QSet) both "iterator" and
"const_iterator" are const, so we cannot reassign or move the key.
That means this overload is no different to the const & overload, so
we can just remove it.

Change-Id: Ia14dccf7f610967649bab38161ce6d963509316b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c19695ab953c979f15bbc72c4f4a453e9a114cf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 13:31:02 +00:00
Mårten Nordheim
3053bc172b Http2: don't call ensureConnection when there's no request available
Previously we only checked if there was something in the h2 queue or
if we had not yet switched to http2. These means in some cases that
following an error it would enter this branch and, because it had not
yet switched to http2, it would call 'ensureConnection' which would try
start a reconnection. This could make the proxy socket engines try to
emit 'auth required' with no replies, meaning nothing happens.

Fixes: QTBUG-88417
Change-Id: If37b8c71ac36597adc305fb1b1ea4fa7b48b0d28
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit def1b9784958dbf4459618d15daeae69ed5af332)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 13:30:29 +00:00
Mårten Nordheim
73534e56ce Http2: Remove errored-out requests from queue
The requests will remove themselves once they get deleted
but since the deletion is done through a _queued_ invokeMethod
to 'deleteLater' we will call
QHttpNetworkConnection::_q_startNextRequest first which may
end up starting a reconnect of the TCP socket which we had the error on.

In this specific instance it manifested as a race condition where we
either don't get a proxyAuthorizationRequired signal at all (it was
emitted while we didn't have any valid replies), or we get the signal
emitted too late and it gets emitted on whatever the next reply was.

Task-number: QTBUG-88417
Change-Id: If3f8ececc5550f1868c90124559cb8e3029646d8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 65bcac95a7a051d4343aaa3c5ff8b39494aa14e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 13:30:27 +00:00
Joerg Bornemann
96ea154b0f Fix undefined behavior in ProString/ProKey::appendTo
We must not pass null pointers to memcpy.

Fixes: QTBUG-88780
Change-Id: Ic1d77b4672310a3f6d0d4fbee5f2889e3e4d219d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 21e77772309df0f2c3fc15f16f9a95214d13f91c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 13:30:22 +00:00
Ivan Solovev
676b912cf9 QList docs: extend prepend() description
Current description was confronting the general description of the
class, which states that prepend() is fast.
The updated description gives more information about the method's
behavior in different conditions.

Task-number: QTBUG-87962
Change-Id: I7b6dfb536d143d78c441214f83320c1bf1263e0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6364194456ec92a2c09a339d20b868bb49bd00e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 11:04:35 +00:00
Ivan Solovev
2f0136d591 QLatin1String: documentation updates
Some updates for QLatin1String documentation:
- Update signatures of some methods
- Update outdated description for several methods
- Add missing docs for friend operators
- Wrap descriptions at 80 characters

Task-number: QTBUG-87962
Change-Id: I1c3c5ce2a6f4f57f92ab503a734c8244fe7cd7c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5545b0f1d3ae6e0f4db56484debe3ac0f25635ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 11:04:34 +00:00
Fabian Kosmale
ee0e17c73c QProperty: Avoid spurious dependencies by suspending binding state
Avoid spurious bindings by resetting the binding state before calling
the setter of eager properties.

Fixes: QTBUG-88999
Change-Id: I1e3b5662307d906598335a21d306be9c606529d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit b21dba98e3e557eece0497aeea0f0beb70cc62da)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-12-02 11:02:22 +00:00
Volker Hilsheimer
66dbe670da Fix link to qHash documentation
Change-Id: Idd72530464aae24fd0e5c144d0de663609632f68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 11bde366e8316f06db88b95dabd397a35c398b7e)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-02 08:25:36 +00:00
Volker Hilsheimer
952eb7a1d7 Fix links to Application Example
The example was renamed in 6cb36d825d365988ea7a601218bdd3a329290469.

Change-Id: Ic9daac60002c9988dfeb5c7dcde74edb69388f37
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 0cc9a99865c4b6dfb1a212a5aba0fc5907f19b24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 07:57:44 +00:00
Andreas Buhr
d8a9a07a60 Add qt5compat as a dependency to qtxml documentation
QXmlSimpleReader was moved to qt5compat. In the qt6 migration guide, we
would like to point to it. This patch adds qt5compat to the dependencies
of QtXml documentation in order to be able to do this.

Task-number: QTBUG-88533
Change-Id: Ifaad595862b80d31310ed594e21168cec56133a0
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit ca5ec3d6b93b1696b8a75fdc4cac8e781df4e3a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-02 07:57:43 +00:00
Timur Pocheptsov
5bfd9c0d75 QSslConfiguration - improve code coverage
By adding auto-tests that were missing/not triggering the paths found
by LCOV.

Change-Id: I472f59e8e7292786c80d7c8dcebde53a2982e1ec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1157167a5c69e253fdeb6c8ad532c5d52e150769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 19:22:07 +00:00
Timur Pocheptsov
0d4beeea64 QPasswordDigestor - improve code coverage
By extending (a bit) an auto-test to cover paths found by LCOV. All of them
is just to trigger the code that checks input parameters.

Change-Id: I62f9a9045038ff8d123fd1396f4bfd85e75c6d8f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 95cbce3e6e0d8a1e82260cfb5b78491a3906be86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 19:21:40 +00:00
Lars Knoll
7edd177828 Silence code checker warnings
Change-Id: I8bd8d830ade3e194f423e00f180c50b176a8adc8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 97abbf3f1fe71886edff3cd5bc42ce3a9057a379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:35 +00:00
Giuseppe D'Angelo
8b7d6a14fc QHeaderView: fix spurious sorting
QHeaderView sorting may be triggered when the user performs
some mouse interactions that should really not result in sorting.

Generally speaking, this happens when the user:

* presses on a non-movable section (A)
* moves on another section (B)
* releases on that section

resulting in B becoming sorted / flipping sorting.

(Non-movable is required, otherwise dragging would cause section moving,
not sorting.)

To make the matter worse, QHeaderView doesn't check that the release
happens within its geometry. This makes sense when moving sections: one
is able to drag a section horizontally/vertically even if the mouse
leaves the QHeaderView.

But when not moving sections, this means that one can

* press on section (A),
* move the mouse anywhere vertically (for a horizontal bar, mut.mut
  for a vertical) above or below another section (B), that is,
  outside QHeaderView's geometry
* release the mouse

and cause B to be sorted.

Fix it by

1) remembering which one was the section that the user originally
clicked on; that's the only one that can possibly become sorted
(if we're not moving and other conditions hold). No other variable
seemed to remember this.

2) on release, check that it happens within that section's geometry.
If so, sort.

Change-Id: Icfb67662221efbde019711f933781ee1e7d9ac43
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit b5b2640a65de20d05890fa9e6462bb7b88f83964)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:35 +00:00
Cristian Adam
b5ecdce605 CMake: Allow WIN32 and MACOSX_BUNDLE arguments for qt6_add_executable
qt6_add_executable will forward all arguments to add_executable, which
works fine on Windows and macOS in regards of WIN32 and MACOSX_BUNDLE
arguments.

On Android however add_library is being used, and those arguments need
to be removed otherwise they will be consided as source files.

Fixes: QTBUG-88926
Change-Id: Id22fdf91d58d9053eaad2d3c080ea72060d928c0
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7b5fd05e8bdfe90af689541b0379289eb54b4079)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:31 +00:00
Andreas Buhr
3356881860 Fix documentation of QPartialOrdering
qdoc did not find the hidden friend comparison functions at gave
errors like
qcompare.qdoc:82: (qdoc) warning:
clang couldn't find function when parsing
\fn bool operator==(QPartialOrdering p1, QPartialOrdering p2) noexcept
This patch documents them as if they were class members to fix this.

Document the constants as \variables.

Task-number: QTBUG-88533
Change-Id: Ife56f16894e454f324060aeb73f66aba2d45e530
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c4d488eeb9f08d48eed76c941ac36b7ab05515ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:30 +00:00
Mårten Nordheim
ebbb7cdfab QDuplicateTracker: add tests
It didn't initially have tests. To avoid relying on realizing
breakage implicitly through other classes we'll just add tests instead.

Task-number: QTBUG-88183
Change-Id: I7449dc1f9a118d4b7a8158a2c34563dbd9c43c66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 1911a4d40ab63d5e314d13d083d505cd3c64f683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:27 +00:00
Lars Knoll
35b2e74fd7 Add a note about where to declare the streaming operators
Streaming operators for types used together with QMetaType should
get declared in the same namespace as the type itself because
of C++s ADL rules. Add a note about that to the documentation.

Fixes: QTBUG-88990
Change-Id: I5d687576c6d926823dd0f1fec0743e877ae271af
Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 5494f0af323a42390f9375c75e9298290ecb7662)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:26 +00:00
Andreas Buhr
54c18ea30a Fix documentation links to High DPI documentation
The documentation on High DPI was recently rewritten, renaming
several sections. This patch fixes the links which were broken
by this change.

Task-number: QTBUG-88533
Change-Id: I5e9417554270a6740986d7cec5e3433d043e5560
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 10b6a87679d02d7cf5dcd2f75d5640ffb1e1303e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:21 +00:00
Fabian Kosmale
e50cd75a77 QProperty: add test case for spurious dependency issue
Task-number: QTBUG-88999
Change-Id: Ifcbf23fedfb795771550762dfed8fc38bce65794
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit cea8b5832c56e92aba2b028afc965ddcf384d37b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:20 +00:00
Mårten Nordheim
b874ff67d0 tst_qtcpserver: Test pauseAccepting/resumeAccepting
Currently untested

The socks case is odd: after accepting the first connection it shows as
unconnected. Details as for why is unknown, out of scope of adding this
test.

Change-Id: I0e7658f23b89f3af8db379b001ee33a844f3bec4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6035fd8f2c23357c46c401fb7120af83e5cf5887)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:17 +00:00
Eirik Aavitsland
2ef324521f Cosmetic stroker: avoid overflows for non-finite coordinates
int overflows are usually avoided by clipping the qreal coordinates to
the device rect. However the clip function did not handle inf or nan
coordinates, so such values would be passed on. Fix by treating any
line with such coordinates a fully clipped away, i.e. rejecting it,
since it cannot be meaningfully stroked anyway.
Fixes oss-fuzz issue 25330.

Change-Id: I4646172fc7a7e0a3a5f5cf03ce10ff0fb56b0d03
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
(cherry picked from commit cfad8a352ae151dd413af1bdea08e25d56309963)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 18:43:13 +00:00
Timur Pocheptsov
7c9cb19282 QDtls(cookie verifier): make sure a server can re-use 'Client Hello'
And extend an auto-test for this. When a cookie verification mechanism is
enabled, and verifier, indeed, verifies that some datagram is a 'Client Hello'
message with a proper cookie attached, we start a real DTLS handshake creating a
QDtls object and calling 'doHandshake'. In case cookie verification
was enabled, we need parameters from the verifier (it's a crypto-strong
'number' and hash algorithm) to 'lock and load' the TLS state machine in
a freshly created TLS session object. This code path previously was only
tested manually and was found by LCOV as untested.

Change-Id: Ieacb8c989997999ea10e15bda6ae106a0338b698
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6a1d9f6fc1e46f7f0af7ec52dc5d6d415c918bf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 16:38:18 +00:00
Timur Pocheptsov
94983639fc QSslSocket::verify: do not alter the default configuration
QSslCertificate::verify() has an undocumented and not very desirable property -
on some platorms it updates the default configuration, which can be surprising.
For example, we deprecated QSslSocket::setDefaultCaCertificates() and recommend
using QSslConfiguration::defaultConfiguration(), QSslConfiguration::setDefaultConfiguration(),
and QSslConfiguration::setCaCertificates(). If an application does this to select
CA roots it trusts explicitly, and then for some reason is calling verify, the
application can have its QSslSockets successfully connecting to a host, whose
root was not trusted by the application. Also, on Windows, defaultCaCertificates()
include system roots already, no need to have them twice.

[ChangeLog][QtCore][QtNetwork] QSslSocket::verify - do not change the default configuration

Fixes: QTBUG-88639
Change-Id: I1cd40b259d0a6dcd15c78d1e7c027ff10859595c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1158ff67b492853b72199ed78bfcf24132e1c7ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 16:37:37 +00:00
Andreas Buhr
ffd9cf7961 Fix documentation of QMetaType::TypeFlag
QMetaType::TypeFlag::IsQmlListType was renamed to
QMetaType::TypeFlag::IsQmlList . This change was not reflected in
the documentation. This patch adapts the documentation to this change.

Task-number: QTBUG-88533
Change-Id: I70be218f5f72b42aacb15ecd46972d5c808d86de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit bb3a53d917a5bc5681df893c8af32db477f41f94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:58:15 +00:00
Assam Boudjelthia
20124ebf2c Android: avoid reflection with ClipData addItem
Task-number: QTBUG-81687
Change-Id: If07fff6f371d2c05cb61a1a7695c96219d0260d2
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 27dbb3ee5477dbfed5fa96a688683744e13cc9cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:58:14 +00:00
Assam Boudjelthia
32aeba4e38 CMake: don't add empty QT_ANDROID_APPLICATION_ARGUMENTS to Json
Change-Id: I471da3f733046aeaa8381bbdeeba3ee2775b97eb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8499718351f3b2068a67c99c7ccd2981f1eeb5c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:58:09 +00:00
Andreas Buhr
48558bbb67 Fix qdoc warning about unknown commands
Qdoc generated warnings like the following:
qt6-changes.qdoc:771: (qdoc) warning: Unknown command '\w'
This patch correctly escapes backslashes to fix these warnings.

Task-number: QTBUG-88533
Change-Id: I7849f49fd0e950c3c366cfa88b299f827b39c05a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit 20e341d495e3c8653ab5dbde83b1d5ab945fb513)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:58:05 +00:00
Assam Boudjelthia
a55783c81d CMake: fix indentations in Qt6AndroidMacros.cmake
Change-Id: I1403101fb2ab6a25ab1a2258f9a832f706b8b547
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a8f6bad1316129467604c946c9f964d8d56b143c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:58:04 +00:00
Kai Koehne
9f8d8ea91b Doc: Use explicit linkage with target_link_libraries
The Professional CMake book suggests always using explicit linkage with
target_link_libraries, so let's use that.

Whether to use PUBLIC or PRIVATE depends on the context. But let's
be conservative and advise on using PRIVATE by default.

Task-number: QTBUG-88935
Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 130b2090147e0d28e35fd736fbefcd588c0014f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 15:57:30 +00:00
Liang Qi
c967ed95a7 Revert "xcb: add xcb-util dependency for xcb-image"
This reverts commit 39b1dea2ec5cde9523df61c78dec5d4b195f66d2.

39b1dea2 is wrong, the bug is for static build of qt with static
xcb. It adds the explicit dependency of xcb-util 0.3.9, which is
not available on Debian yet.

Task-number: QTBUG-86287
Fixes: QTBUG-88688
Change-Id: Iffc821f49bdfcad3f2556951d3677c35a7682266
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 92a57e0b016f811876ec1d62328ca8edfe452a3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 13:28:36 +00:00
Kirill Burtsev
fa51e6cf80 Add widget-based test for TouchCancel event
Follow up for 45a65cbeb2

Change-Id: Idb4f4eaaa3ee583462430c530f88a4cc32378d6c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 6c442ddbf584413fa4228aae4cc277887344e20d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 13:27:29 +00:00
Joerg Bornemann
569385a639 CMake: Fill QT.<module-name>.uses entries in module .pri files
Those entries were always empty. The INTERFACE_QT_MODULE_USES property
was never set.

Map each public dependency to its qmake lib name and place this value
into the module's QT.<module-name>.uses variable.

Take into account the "_nolink" target modifier and translate it to
qmake's "/nolink".

Fixes: QTBUG-88951
Change-Id: Ib6ef65b842a1fe1da3ade55867583343b4ee76ee
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 92d60ae589442cfbe1e7ac1bb4c42334a09af310)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:20:14 +00:00
Joerg Bornemann
55265b7375 CMake: Rename internal variable
Rename QT_QMAKE_LIB_TARGETS_foo to QT_TARGETS_OF_QMAKE_LIB_foo, because
we want to introduce the counterpart QT_QMAKE_LIB_OF_TARGET_bar in a
subsequent commit.

Task-number: QTBUG-88951
Change-Id: I33f00f4fe65c5977da6e74c632ebeab3b891c89a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bf483ca9794c8eaafd9007e7e76117bab5bfa35f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:20:12 +00:00
Topi Reinio
b16f9068c2 Doc: Make \youtube macro work with litehtml help backend
Unlike the QTextBrowser backend, litehtml does not render elements
inside <iframe> correctly. This prevented external links to
YouTube from working in offline documentation.

Move the <iframe> to a macro override specific to online doc builds.

Fixes: QTBUG-88975
Change-Id: Iff7828ddeed353620eaa9ac669a3e0c03749daa2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ca8e9ff2ef0a01248e3bdd718ef9fc06419214a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:18:57 +00:00
Ole-Morten Duesund
1e4c56463f Discourage the foreach keyword
Stop endorsing the foreach keyword, suggest C++11 range-based loops
instead.

Task-number: QTBUG-86584
Change-Id: Icaf537aded6557b7864d731217e967ac56a84928
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 3c3737f88b7f66610fa5d023f3453be9dbb24aa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:18:57 +00:00
Timur Pocheptsov
baeb231d2d tst_QSslError: improve the code coverage, as pointed at by LCOV
And also, reduce the utter sloppiness, weirdness of the test and
make it more a test and not a joke. Since the test itself depends
on !QT_NO_SSL, why bother building and running its main, to create
a useless tst_QSslError and do nothing then? Exclude test from
no-ssl build.

Change-Id: I67879b0de036cbc8c2f75a18f4cf94e6c43c5af0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fe009bd51438877d864d2444f40582508c43c1f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:18:57 +00:00
Lars Knoll
9fda5c4ac0 Bump the type info version in qhooks.cpp
And correct the comment in tst_toolsupport.

Amends change d99fdf17842d914daa41124184c6531c92766cd0.

Change-Id: I94e296f5bb5b57132c887072efb0bb56aafc524f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 95730dd19cddd65588c902255513517556afc49f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 12:18:57 +00:00
Sona Kurazyan
455d009a60 Fix memory leaks in QFuture's continuations
There were two issues:

- Some of the continuations were allocating memory for the
continuation's context dynamically, but deleting the allocated memory
only if they were actually invoked. Since the continuations may not be
invoked at all, this could cause memory leaks. Fixed by postponing the
allocations to the point when the continuations need to be invoked.

- In other cases the parent future is captured by copy in the
continuation's lambda, which is then saved in the parent. This causes
the following problem: the data of the ref-counted parent will be
deleted as soon as its last copy gets deleted. But the saved
continuation will prevent it from being deleted, since it holds a copy
of parent. To break the circular dependency, instead of capturing the
parent inside the lambda, we can pass the parent's data directly to
continuation when calling it.

Fixes: QTBUG-87289
Change-Id: If340520b68f6e960bc80953ca18b796173d34f7b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit 5d26d40a5596be048be87f309df9264bac741be9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 07:27:04 +00:00
Sona Kurazyan
d8d885829d Fix perfect forwarding of callables in QFuture's continuations
Use universal references instead of rvalue references for passing
callables in the implementations of QFuture's continuations.

Change-Id: I1288c78f78f84f30c6607e505e7f9807a9272071
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b002722dabef794da0e80010b115b2c6cd6dc6b8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 07:26:55 +00:00
Joerg Bornemann
2e76a47eba CMake: Do not discard empty QMAKE_LIBS_FOO entries
Consider a qmake lib 'foo' that doesn't have entries in
QMAKE_LIBS_FOO. Then we must not discard this entry in the generated
module pri file, because otherwise any attempt to QMAKE_USE 'foo' will
fail with the error message "Library 'foo' is not defined.".

Task-number: QTBUG-88951
Change-Id: Ibed283857f5f66b1b79459fe7b7cf06c7ce0691d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bd98ba0d17b7a7c14fefc1741e68e8ca945a6655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 03:38:46 +00:00
Joerg Bornemann
47f23efaf4 CMake: Re-generate project files in src
Change-Id: I1f5f822d68129490f1a7c495f718aead0b520ca9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d4e9f0e6332d1ea740e28718d21281099c6d62e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 03:38:42 +00:00
Joerg Bornemann
211ad0f768 pro2cmake: Fix is_public_module calculation
write_library_section traverses the parent/child hierarchy of scopes to
determine whether the scope belongs to a public Qt module. This doesn't
work for scopes that stem from included .pri files, because each
included file has its own parent/child hierarchy.

We already have an include scope hierarchy in the form of
Scope._included_children, but lack a way to get to the including
scope.

Add Scope._including_scope and adjust the is_public_module calculation
to take that into account after hitting the top of the parent/child
hierarchy.

Change-Id: I8fee1cfbf048e7afc6783b0a52eaca75be17072f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1a1d3a9a44e6e5946c375509c3f4a3a0fec5282d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 03:38:42 +00:00
Joerg Bornemann
c765b8f280 CMake: Fix QMAKE_LIB of WrapOpenSSLHeaders library
The correct entry for this lib is 'openssl/nolink', not
'openssl_headers'.

In configurejson2cmake's helper.py we already have
this information encoded such that the no_link_so_name field of
'openssl' points to 'openssl_headers'. Extend configurejson2cmake to
take this into account, and re-generate src/network/configure.cmake.

Change-Id: I9817ea7722503a373d309b7e6fa201448d403e8d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5592204b19a5dc46e308cc31ac035edb78d2d8fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 03:38:41 +00:00
Alexey Edelev
be01af7c34 CMake: Add debug information for 'qt_evaluate_config_expression'
Add '_qt_internal_dump_expression_values' function that dumps all
values evaluated by 'qt_evaluate_config_expression'.
'_qt_internal_dump_expression_values' doesn't evaluate undefined
features, only collect actual values.

Fixes: QTBUG-88476
Change-Id: I9d09ffbd9f9fa91bc4f36536c58e7f118b06f9b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c140b26959038ada22452079ebc6e33195e9957d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-01 03:38:38 +00:00
Alexandru Croitor
62ee1c8504 CMake: Fix resource object file paths in prl files for prefix builds
Before this change, the prl files always assumed that resource object
files are installed into $qt_prefix/lib when doing a prefix build.
That was true for qt_internal_add_resource calls, but not for
qt6_add_qml_module and qt6_target_qml_files.

Change qt_internal_record_rcc_object_files to take a new required
INSTALL_LOCATION argument. The argument takes a path relative
to CMAKE_INSTALL_PREFIX.

Modify __qt_propagate_generated_resource to save the relative path of
the generated resource source file, which will be used in the
computation of the final resource object file location.
This is needed because the Qml resource functions place the source
files in a different directory layout, e.g. .rcc vs .qmlcache

Modify qt_generate_prl_file to prepend $$[QT_INSTALL_PREFIX]/
instead of $$[QT_INSTALL_LIBS]/ for the resource install paths.

A follow up patch is done in qtdeclarative to pass the new
INSTALL_LOCATION argument from the Qml CMake functions.

Amends f9dcade5e795a631b9a2d93c855aa8198d58e24e

Task-number: QTBUG-87702
Task-number: QTBUG-88425
Change-Id: Id17bb517b4cb5d00911bfd10a728ba4e0d44871b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 54d0ca93bca78f8fd31b6761f078e7a96283f183)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Craig Scott
1f443c36f2 CMake: Handle empty INCLUDE_DIRECTORIES in genex for qdoc
Follow the pattern recommended in the CMake docs for the $<JOIN:...>
generator expression. Wrap it in a $<BOOL:...> genex so that if a
target's INCLUDE_DIRECTORIES property is empty, we don't add a
stray -I with no directory following it. This fixes the following error
when running qdoc:

  qdoc: Missing value after '-I'.

Task-number: QTBUG-88838
Change-Id: Ie3ef2625fbb29cc501f7fc22ff7a9cc8ac548322
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit bac73a36e25076a5929c7feac0675860772e7270)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Giuseppe D'Angelo
862b967449 Seedless qHash catch-all: make it SFINAE-friendly
To support qHash overloads without a seed we have a qHash(T, size_t)
catch-all that calls qHash(T) and XORs the seed. The problem is
that this catch-all is not SFINAE friendly. For a type Foo which
does not have any qHash overload, we can't ask if qHash(Foo, size_t)
is callable because it would instantiate the catch-all and fail
to compile.

Add a suitable trait and enable_if.

Change-Id: Idffd48a537eebaf77cee7030b8d91a302643ffde
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 5dab710b90e7041aaa9fcf3631f2ca6af1baab5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Topi Reinio
d9a950aea9 Doc: Fix various documentation warnings
- QList iterators are now nested classes inside QList.
- Drop reference to Qt OpenGL Widgets landing page, there is no such
  page.
- Fix typos and linking issues.

Fixes: QTBUG-86295
Change-Id: I964843deb81aa55ff8ddb9a1c2b004cb72e68de9
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 99abdd180bd6f626f4ca94806fdaddbeb3774325)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Topi Reinio
5fef8c22c6 Doc: Add thumbnail for Widgets Gallery Example
The example won't show up in Qt Creator's Welcome mode without either
an \image or a generic thumbnail. Add the latter for now.

Fixes: QTBUG-88970
Change-Id: Id5ec236ef4760e678921bc2a90608d66ac35394d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 9aa34f3bf2f4dac1b9c0a29a57f0fe863c2bd951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Topi Reinio
fba60d8cbc Doc: Fix QVector[2|3|4]D documentation
The \fn commands for friend functions need to include the class
scope for QDoc to find the declarations.

Fixes: QTBUG-88932
Change-Id: Icbb45c12d7d657d95243231148483c00baf07c36
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 3789ca6c9947d1357641424a5102cdf3fba2dcc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Topi Reinio
2e09a40032 Doc: Document BINDABLE attribute for Q_PROPERTY macro
Fixes: QTBUG-87036
Change-Id: Ia6067d887b9b697dbcb8e02bce5a560a8ac5eaf3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit af7f7732cb52888c468b3e86a67e61b83fee11e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:40 +00:00
Christophe Giboudeaux
6d08f6c031 CMake: strip the executable bit from qt-cmake-private-install.cmake
Despite being installed in the the binary directory, this
CMake snippet cannot be executed.

Change-Id: Ibfd31e51184f0688d19ac063804cc200c95555a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 687bd03d09b42faad4c8790c9508518c3d14b456)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 22:19:39 +00:00
Edward Welbourne
d2e0bfad94 Inline QCollator's QString methods via QStringView
Can't be done before Qt 7 unless we do it now, as it'd be BiC.

Task-number: QTBUG-86400
Change-Id: Ib7b2e7b20b4a80b53dfc6535efe90d1674f38e81
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 53a1e015fdb4082900f306b5e2cca7bd5df77d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 16:34:33 +00:00
Laszlo Agocs
491f67dfa8 Restore QOpenGLVersionFunctionsFactory entry in changes docs
This used to be present in source-breaks.qdoc in qtdoc, but seems this
one note went missing when merging the content to other places.

Change-Id: Idfd165eb1c7616c595f7a6515cc98d8477671e09
Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
(cherry picked from commit 5b3cc25492c68e0eb8cfded9cbe0f6878233fff3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-30 11:07:15 +00:00
Kai Koehne
3872280315 Doc: Linkify all mentionings of QT_NO_CAST_TO_ASCII
This way the user can directly click the link, instead of looking at the
'see also' section.

Change-Id: I50b62fe0b376a3f6462c11abc46a001c334ba82a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 90c3513f375afb668b666d79eb61b852b9143a08)
2020-11-30 08:30:27 +01:00
Tor Arne Vestbø
a4dd0e1831 Update setHighDpiScaleFactorRoundingPolicy docs
The default is now passthrough. And let's not mention the
environment variable overrides, as they are meant for internal
testing.

Change-Id: Ie2409e5411d4bdcdf041834cb5ca9e1215aa173a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 58afadc624cf284cfe93d6a5c85557ed6e4f9765)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:07:11 +00:00
Edward Welbourne
a754477b73 Bounds-check time-zone offsets when parsing
Parsing of time-zone offsets should check the offset string conforms
to the expected format and has valid values in its fields. The
QDateTime parser, fromOffsetString(), neglected the bounds check on
hours; the QTzTimeZonePrivate parser, parsePosixTime(), neglected all
upper bounds checks, only checking against negative valus.

Drive-by - refined phrasing of a comment.

Fixes: QTBUG-88656
Change-Id: If04cdbe65064108eaa87c42310527783ad21b4c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 380d97e1bd15e753907c378a070bdf7f1c1cf06e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:07:06 +00:00
Tor Arne Vestbø
5938396011 Fix warning about copy during range iteration
Change-Id: I6c916d79a5e86502a1fdfd5f2b851f4a4396149a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 39cd65589d8ce70191b5dbc54941fc28060b40e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:06:59 +00:00
Allan Sandfeld Jensen
509d191b49 Also remove 0 initialization from QUrlTwoFlags
Was overlooked when removed from QFlags

Change-Id: If65ff4a07e2f72589d2c32c2d24366ff9dc2405f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 05bb9b1016d981ac3c31c74dc8bc060402b86fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:06:58 +00:00
Antti Määttä
0c23b8823a Fix typo in rhi
Change-Id: I2e920e8e68b7010b565c422bb26708d172d345e8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit aa5839bdcef90d5976cb9e6a4647c5172f51c7e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:06:56 +00:00
Edward Welbourne
d3397c92a0 Return a more useful date-time on parser failure in spring-forward gap
Up to 5.15.0, QDateTime::fromString(), when parsing a string that
matched the format but represented a date-time in a spring-forward's
gap, would return an invalid date-time object that represented a "best
shot" date-time, correcting the error in the string as best it could.

In 5.15, in order to handle time-spec information correctly, we
adapted the date-time parser to have a fromString() variant that
parsed a date-time as a whole, rather than as a date and a time; as a
result, QDTP::fromString() now returns false and QDT::fromString()
returned a default-constructed instance instead of the invalid
date-time that QDTP had produced.

Amend 76054516047d8efb8529443830bb4d9ddf01010f to restore the prior
behavior of returning the invalid date-time object from QDTP instead
of a default-constructed invalid date-time. Also document what this
implies for the caller's ability to recover from the situation, if a
best shot result is better than nothing.

[ChangeLog][QtCore][QDateTime] Restored pre-5.15.0 behavior when
parsing a date-time from a string (and document what it implies): if
the string has the right form but represents a date-time that was
skipped by a time-zone transition (e.g. a DST spring-forward), the
invalid date-time object returned can, none the less, be used to
recover a near-by date-time that may be more useful in some cases.
From 5.15.0 to 5.15.2 and in 6.0.0, a default-constructed QDateTime
was returned in place of this more informative invalid date-time.

Task-number: QTBUG-88633
Change-Id: If0b439038d5fe48eefb951c62f3aae2933bb5651
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3a4115d1236bc78dda078657883283cc92df8e8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 19:06:52 +00:00
Edward Welbourne
f27623c2ed Restore pass-by-ref to QRect QCalendarWidget::paintCell()
Accidentally changed to pass-by-value while doing that to QDate,
in commit af837734b2259201f126b206bd5299497e080f7b

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>
2020-11-27 17:11:08 +00:00
Toni Saario
ddef86babf Add instructions to build documentation
This enables documentation building in add-ons and other modules that
need to build docs.

Task-number: QTQAINFRA-3972
Change-Id: Ic2763d6d36d26e5a1267b312727c3c268ad6d114
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e84e85dd4c59f2c79f81ba4d8d7f04397eb0003c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 17:11:07 +00:00
Allan Sandfeld Jensen
916c2953b1 Limit pen width to maximal 32767
Fixes oss-fuzz 25195

Change-Id: I8c68cf71f6702d8b1b1a2ddda3284c14f02d7972
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit c7a335817e909951bfd142018f855645b4a46168)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 16:41:04 +00:00
Kai Koehne
16c4c10aa0 Doc: Consistently use book style capitalization for QString
Change-Id: I2ab64fe58ad737b23f0829ed91591efaa0c22c6f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit efa05e04176067a2e5b4d133943d854c9c08bbe7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 12:24:34 +00:00
Friedemann Kleint
b93431c7ef QtWidgets: Propagate event device when translating mouse events
There are a few places left over, for example the QTextEdit
creating mouse events in a timer and notably QGraphicsView.

Task-number: QTBUG-88678
Task-number: QTBUG-46412
Change-Id: I7ed23911be3b86b4b39fb478b947ec3b7a60761f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 21fa38b6ad0167673148709faa4907b220853c5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 12:02:59 +00:00
Kai Koehne
9481cb1fc6 Doc: Improve *_CAST_FROM_ASCII documentation
Change-Id: Iba73c0a38e2c4add740aab20036aa39c56eb4d98
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 50873153a70521e138b590a227902876f998270e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 12:02:28 +00:00
Friedemann Kleint
3b58d9814f Windows QPA: Pass device for synthesized touch/tablet events
Add the overloads for mouse events with device/without timestamp
and pass the active tablet or touch device.

Task-number: QTBUG-88678
Task-number: QTBUG-46412
Change-Id: I8695b493540d0cbf50e9c72afe870a7633de3ab9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d3caea04dc6c3a7072a43294b70bec860c199bf1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 12:02:27 +00:00
Fabio Falsini
b88dd5490b Change android target SDK version to 29
Play Store now accept only app with target
SDK version set to 29 or above

Change-Id: If38f20c88fd6b0e6f29939cdf3d2eb793c0e1489
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 88ab9e1800f943b5c4bf06bb68baaff07185eb24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-27 02:35:17 +00:00
Florian Bruhin
1dc65d7bac Fix broken \endcode marker in Qt 6 porting docs
Change-Id: I8dfd72f6a00a6c91a38bb201b14524b0bc7cf100
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e723f0aceb7de3b52fb40de3ef1fe0259fce47a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 21:25:26 +00:00
Giuseppe D'Angelo
54ed4e6b6a QVLA: always use new to create new objects
Even for non-complex types, it makes no sense to use the assignment
operator instead of placement new when constructing new objects.

Change-Id: I5f15fe4b3397cf52d1d35e6c4dcc513b94b3cf14
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit e6e67f31c10da900ec6ecb06c2e827b17283be6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 20:41:22 +00:00
Volker Hilsheimer
362b020ec9 Rename Application Example
Prefix it with "Qt Widgets -" to make it a bit clearer in the list of
highlighted examples which module this one is about.

Change-Id: I0bf65b02db72173f1adfe0bcf8657be7905dbd6c
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 6cb36d825d365988ea7a601218bdd3a329290469)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 20:40:45 +00:00
Lars Knoll
e8ef871e35 Simplify the safeguarding logic in notify()
The logic in notify() was doing quite a bit more work than
it needed to. By inserting a dummy node after the current one instead of
replacing it, we can avoid half of the data shuffling that has been
happening and also don't need a back pointer when executing the
notification.

Also avoid calling a semi expensive destructor of QPropertyObserver.

Reduces the overhead of notify() by ~30%.

Pick-to: dev 6.0.0
Change-Id: I7ce16bcf9cd9c4368c18bf875fc959223452fd4f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-11-26 21:40:03 +01:00
Lars Knoll
c63901c5f3 Inline the fast path for removeBinding()
Save a function call in the common case where we don't have a binding
This makes a rather large performance difference for setters that do
not have a binding.

Pick-to: 6.0.0 dev
Change-Id: I140f29790f6fe868721a33b9fad37205e547b8e9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 20:40:03 +00:00
Lars Knoll
65759c9867 Smaller cleanup in QBindingStorage
Unify code paths and avoid excessive code generation.

Pick-to: 6.0.0 dev
Change-Id: I4a54234dd322bba380cc45d4f9c97d97a0c93303
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 20:40:03 +00:00
Lars Knoll
e165f416a7 Inline the fast path of a few methods
No need to do function calls for the case where we return immediately
after checking a boolean.

Pick-to: dev 6.0.0
Change-Id: I3e449850a10fcf82acb843cce6da6dfd98de32ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 21:40:02 +01:00
Lars Knoll
b1be6e6e6f Remove ExtraBit and FlagMask from QPropertyBindingData
They are not needed and removing it can simplify the code in some places
and avoid a couple of masking operations.

Pick-to: dev 6.0.0
Change-Id: I0e4241a2784026aa89deed35f408b094e89a11a0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 21:40:02 +01:00
Lars Knoll
eda4c29eb2 Inline the QPropertyBindingPrivatePtr destructor
In many cases, it only derefs and does nothing else. Inline the fast
code path.

Pick-to: dev 6.0.0
Change-Id: Ib605c385c1683f7833f7189c84d6cf4eb5b0e59e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 21:40:02 +01:00
Lars Knoll
2721728c90 Optimize code in QTaggedPointer
Don't execute instructions that will never do anything.

Directly add the tag to the pointer in the constructor to avoid
additional masking operations, and avoid a masking op that is in
practice a no-op in setTag().

Do the same optimization in QTagPreservingPointerToPointer.

Pick-to: dev
Change-Id: Ia364f89cbe6ccc876ec9bda0c239fc4f57c10501
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 21:40:02 +01:00
Lars Knoll
98c82fb445 Inline access to the QBindingStorage
And inline the fast checks inside the methods in QBindingStorage.
This allows QObjectBindableProperty and friends to inline all the
fast checks and almost completely eliminates the overhead for property
accesses when no bindings are being used.

Read and write times of QObject based properties when no bindings
are being used:
                                              Read       Write
Old style property:                           3.8ns       7.3ns
QObjectBindableProperty (no notification):    4.5ns       4.3ns
QObjectBindableProperty (with signal):        4.5ns       7.6ns
QObjectBindableProperty (inline accessors):   3.2ns       3.4ns

Numbers without this patch:

Old style property:                           3.8ns       7.9ns
QObjectBindableProperty (no notification):    7.2ns       7.7ns
QObjectBindableProperty (with signal):        7.2ns      16.0ns
QObjectBindableProperty (inline accessors):   6.3ns       6.7ns

Pick-to: dev 6.0.0
Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-11-26 21:40:02 +01:00
Fabian Kosmale
5283ee7104 QCache: Fix crash observed in tst_QAccessibility
Fixes a use-after-free which can reliably be observed under ASAN. In
QConfFileSettingsPrivate::~QConfFileSettingsPrivate we call
unusedCache->insert(conf_file->name, conf_file, ...)
Note that the key is a member of the object. Thus by deleting the object
before using the key, we dereference a dangling pointer.

Amends f08492c6fd9818c7d80b1725355453e179b4d85b.

Pick-to: dev 6.0.0
Change-Id: I3a550fc73446b72dd46456232e85f6d206d64c01
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-11-26 07:52:28 +00:00
Volker Hilsheimer
f4ff1e73b0 Use event cloning rather than copying
Fixes: QTBUG-88834
Change-Id: I8c21b07c9d8491f26589f29b04d552835b3cbd11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 78cbb25b9d70f1617ff6c912a22ac532b0352bde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:44 +00:00
Alexandru Croitor
907edee1a6 CMake: Fix headersclean interaction with header only modules
Before CMake 3.19, we are not allowed to query non INTERFACE_ prefixed
property names from INTERFACE libraries. And it was the wrong thing
to do as well. Prefix the properties with INTERFACE_ as appropriate.

Don't try to add INTERFACE_COMPILE_DEFINITIONS from header only
modules to the headerclean compile commands. This causes configuration
issues with UiPlugin in qttools. Fortunately it seems that qmake
doesn't do that for 'header_module's either.

Finally don't query for the FRAMEWORK property on the passed target
(INTERFACE libs can't be frameworks). Instead just query if the whole
Qt build itself is a framework build.

An issue was discovered regarding QT_NO_ENTRYPOINT genexes breaking
headersclean add_custom_commands for UiPlugin in qttools. To avoid
this the property was renamed to all lower case in
6ca66de9120537134b63d42de6c53c6e5834e8f3. This avoided the immediate
issue, but it's possible it might resurface in the future with a
different property name that wasn't renamed. In particular I thought
it might happen with QT_NO_UTF8_SOURCE but it didn't.

In case something like that happens again, the two possible solutions
are to bump minimum CMake version requirement to 3.19 (where upper
case property names are allowed to be queried from INTERFACE libs) or
to implement recursive include directory fetching similar to our
qt_internal_walk_libs implementation.

Task-number: QTBUG-86053
Task-number: QTBUG-82615
Change-Id: I7815d555ec9ea049a8fd40f2a2f072dcb9f5e9c3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9b84ea6b47979b5d789b72f9f74326ecbe3a579a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:35 +00:00
Assam Boudjelthia
1d30822dea Android: exclude faulty qfilesystemwatcher test
Task-number: QTBUG-88508
Change-Id: I11b845e74e599d3bdae4f9490a591893531bc77b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c7dec2faca476c94a40bd4ac5118915b1a5d9aa8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:15 +00:00
Assam Boudjelthia
e6a37561e3 Android: exclude faulty tst_selftests
This test was failing but was returning a pass because of a bug
in androidtestrunner.

Task-number: QTBUG-88507
Task-number: QTBUG-88508
Change-Id: I4fda7c2ddf8cd1e6858617e7bb447078c5768a75
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 63934f13380c9ed3c455394e2ba863d44239f05c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:13 +00:00
Alexandru Croitor
f86986f61b CMake: Use cmake_language(DEFER) when available for scope finalizers
If CMake version is 3.19 or greater, use cmake_language(DEFER CALL)
for Qt internal scope finalizers, instead of the homegrown
implementation.

Apart from not depending on the hacky homegrown solution, it
significantly improves the readability of --trace-redirect logs.

Task-number: QTBUG-77377
Change-Id: I5ce374bb313865662c536826e86052bc762438b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 69d9b2b6fdd5cd28aa7dca2636eb2f411277ad30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:12 +00:00
Volker Hilsheimer
2061c23ba1 Remove some examples from highlighted list
The Local Fortune examples and the JSON Save Game don't need to be
highlighted in Qt Creator.

Change-Id: I7c7c9997e9a1cfb61f94309f16be65c810b42e14
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 61436f24cbd8219b0442544bd8e162fb8970bfc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:09 +00:00
Assam Boudjelthia
8a42551880 Android: fix tst_android test
Fixes: QTBUG-88506
Change-Id: I938de388fce8ec393b03b2f0f42ddfe9094e6a5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97b914b3e7410ee013ab50680210309524960f55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:05 +00:00
Alexandru Croitor
67bdcb059a CMake: Allow generating documentation for INTERFACE targets
Query the include dirs from the INTERFACE_INCLUDE_DIRECTORIES property
when generating docs for an INTERFACE library.

Amends 2db41fefa006c9aabd577eee98b8a9594d264470

Task-number: QTBUG-88838
Change-Id: Ic8a454ba66b2dbc59bad883e1e0d38ebb26d0370
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit a9d687c63c31b18396247c3e69e6b48211ab0ae0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:02 +00:00
Joerg Bornemann
db2045a0a0 CMake: Fix value of QMAKE_PRL_TARGET in generated .prl files
On DLL platforms, the value of QMAKE_PRL_TARGET should be the import
library (foo.lib), not the actual DLL (foo.dll). The genex
TARGET_LINKER_FILE_NAME provides exactly that.

Fixes: QTBUG-88864
Change-Id: I553930bb840007772fe8f4612f95e0e320f54107
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 89b49e52310c5b5e1549e78b334749c4f486cc7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-26 00:01:01 +00:00
Andreas Buhr
1f7bd5e582 Update container overview documentation - section on growth strategies
The Qt container overview documentation contained outdated information
on container growth strategies. This patch updates the documentation
to reflect the current implementation.

Task-number: QTBUG-86584
Change-Id: I8fd014138f9a2e73925dafaa270d4c98ab672d96
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
(cherry picked from commit 115955069f050d2549d0a341460b1473fd383db7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 12:28:03 +00:00
Giuseppe D'Angelo
647194312f Fix QVariant/QMetaType::compare APIs
std::optional<int> is the wrong datatype to use for compare.

First and foremost, it can't be used in the idiomatic form of

  auto r = a.compare(b);
  if (r < 0) ~~~ // a is less than b
  if (r > 0) ~~~ // a is greater than b

which we *already* feature in Qt (QString, QByteArray).

Also, std::optional<int> (explicitly) converts to bool, which is
a trap, because the result of the comparison can be accidentally
tested as a bool:

  if (a.compare(b)) ~~~ // oops! does NOT mean a<b

Not to mention extending this to algorithms:

  auto lessThan = [](QVariant a, QVariant b) { return a.compare(b); }; // oops!
  std::ranges::sort(vectorOfVariants, lessThan);

which thankfully doesn't compile as is -- std::optional has
an *explicit* operator bool, and the Compare concept requires an
implicit conversion. However, the error the user is going to face
will be "cannot convert to bool because the operator is explicit",
which is deceiving because the fix is NOT supposed to be:

  auto lessThan = [](QVariant a, QVariant b) { return (bool)a.compare(b); }; // big oops!

Instead: backport to Qt the required subset of C++20's <compare>
API, and use that. This commits just adds the necessary parts
for compare() (i.e. partial ordering), the rest of <compare>
(classes, functions, conversions) can be added to 6.1.

Change-Id: I2b5522da47854da39f79993e1207fad033786f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3e59c97c3453926fc66479d9ceca03901df55f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 11:56:44 +00:00
Friedemann Kleint
5fb3b9e260 Output source in debug operator of QMouseEvent
Task-number: QTBUG-88678
Task-number: QTBUG-46412
Change-Id: If9282f5b845ef16ff7e7ce523f78e3b8adfbef90
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 45c623c42ac26eafff8e401709fa4c97ed9cd585)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 10:53:09 +00:00
Giuseppe D'Angelo
f9ccf9d3f1 QVLA: do not include QtTest
The right include is QTest, QtTest drags in all of QtCore.

Change-Id: Icc2964ccdb85fe1bfc9fe8f43351a4605a34329b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bfe77a21fb0988a52fb77af09fe9675eb151e8b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 05:51:21 +00:00
Volker Hilsheimer
a64953708b Fix link to Qt OpenGL C++ classes
Change-Id: Ia8d71cf48b2d0c3d0f6d3de81335c263eb5466c4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit df1a62fe61334d786cbb085200877cd9e6f5a478)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 05:51:12 +00:00
Volker Hilsheimer
4185e4fa74 Document removal of QEvent copying
Change-Id: Ia4681fe5c5ae0953ba75f4ab24da4eec7461c719
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 60870ca68c2fc2a1bbbb30bb8c3853c87e142373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-25 05:51:04 +00:00
Alexey Edelev
c4888edfb8 CMake: Change generated resources naming
Align generated resources .qrc file naming to qmake naming.
Update tests.

Fixes: QTBUG-88581
Change-Id: Id8a2f91f23c257e5b8bd371748c2151ec54a6418
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2548438e326d20eda2eb4398139164f5400d22ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 23:49:20 +00:00
Andreas Buhr
adf6f02bb0 Fix tst_qfiledialog2 in case directory ~/foo exists
One test in tst_qfiledialog2 only succeeded if the directory "~/foo"
did not exist. This patch changes the path used to "~/Vugiu1co"
which has hopefully a much lower probability of existing.
The string "Vugiu1co" is taken from a call to "pwgen".

Change-Id: Ia82b07902a91eb908a74aa90cdbdf4761d432d9a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
(cherry picked from commit 824de3850e50904720f959d823fc8d962b639522)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 23:49:09 +00:00
Alexey Edelev
e0cb10e4be CMake: Restore QT_STAGING_PREFIX in qt-cmake-standalone-test generation
Restore 'QT_STAGING_PREFIX' logic when generating
'qt-cmake-standalone-test'. Relative paths now calculating depend on
'QT_STAGING_PREFIX'. For prefix builds QT_STAGING_PREFIX should be
prepend to '__qt_cmake_standalone_test_path'

Fixes: QTBUG-88764
Change-Id: I655c60847f2ab872948cfe9aedc27835e5cc4fb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7f1e145f7ee885d8c6b29d02206711040b65f6f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 23:49:00 +00:00
Joerg Bornemann
5e2fd2fcd4 CMake: Rename QtBuildInternalsAndroid.cmake to QtAndroidHelpers.cmake
...and include it in QtBuild.cmake.

Commit e8d8b1a5e4c added two different code paths to include
QtBuildInternalsAndroid.cmake.

This was needed, because:

In a top-level build, we must not include files that are not yet
installed.  We have the source tree available, and
"${QT_SOURCE_TREE}/cmake" is in CMAKE_MODULE_PATH.
We can use the "module syntax" of the include() command.

In a per-repository build, when building against an installed qtbase, we
must not include files of the source tree, because that's not guaranteed
to be available.  However, Qt6BuildInternalsConfig.cmake is installed,
and we can directly include QtBuildInternalsAndroid.cmake, which is
right next to it.

We can circumvent this whole issue by moving the Android-related
functions out of the Qt6BuildInternals package and including it in
QtBuild.cmake.

Task-number: QTBUG-88718
Change-Id: I5192ba19bb77952505c20d053d7285f798d16ac5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0274daf30779ba08fc708247a3e645fd44980280)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 23:48:48 +00:00
Andreas Buhr
be6c48e2da Fix tst_qlibrary after rebuild
tst_qlibrary depends on a library (targets mylib and mylib2) to be
built. They create a library with the same name, in two versions.
This is done in order to test versioned library loading.
However, those two libraries were fighting over the creation of
"libmylib.so". In a fresh build, mylib2 wins, as intended. But after
a rebuild, mylib won, which led to failing unit tests.
This patch changes the situation. With this change, mylib no longer
tries to create "libmylib.so". Thus no fighting and no problem.

Change-Id: Id89baa5503c9f078a8737ff0b8616edf09044f72
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1dff26dd9539feb40767b7761c5339085ad74dbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 23:48:41 +00:00
Alexandru Croitor
d10e7b66c3 Blacklist authenticationCacheAfterCancel on Ubuntu 20.04
It flaky fails integrations.

Amends 2b49b01aa3467173f0be9252cfa50b41a311dd57

Task-number: QTBUG-88417
Change-Id: I6aad6ee7a70e580da64e75f69e8c9cab1cb78cd7
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 143d619ba33c693fbbf9fbc3587921a44ae87435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 20:57:50 +00:00
Alexandru Croitor
8725accf99 CMake: Use lower cased property name for entrypoint library opt-out
We need this to enable headersclean functionality to work with CMake
<=3.18 which is our minimum required CMake version to build
Qt (it's not a problem for 3.19).

Otherwise we hit a configuration error while trying to evaluate
generator expressions for INTERFACE only libraries for which we need
to do the headersclean check (e.g. UiPlugin in qttools).

Sample error message:

 INTERFACE_LIBRARY targets may only have whitelisted properties.  The
  property "QT_NO_ENTRYPOINT" is not allowed.

More info:

 https://gitlab.kitware.com/cmake/cmake/-/issues/21484

Naming it lower case avoids the issue, but is inconsistent with all
our other public property names.

Furthermore if we do this change, it should probably go to 6.0.0 due
to it being a property that a user is meant to set in their project.

Task-number: QTBUG-82615
Change-Id: I1f1439f1e5cbc816010eba7301605a8f60b88fd1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6ca66de9120537134b63d42de6c53c6e5834e8f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 20:57:50 +00:00
Giuseppe D'Angelo
75c54a79f1 Re-fix the definition of primitive types
The conditions are AND, not OR. Technically we don't rely on
not having constructors any more, but we may reserve the right
in the future to have uninitialized resizes.

Change-Id: Icfae61079a544f7ac8e90a32ad605c12cfa8b4aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bcd38a96149f5397375b57e948c05c7a8f172194)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 07:17:39 +00:00
Andreas Buhr
9abc84a131 Fix tst_qlibrary by telling CMake about required libraries
tst_qlibraries needs to test libraries to be built in order to run
successfully. However, these libraries were not mentioned as
dependencies in CMake.
This patch fixes that.

Fixes: QTBUG-88445
Change-Id: Ic335e46664edd98217bd55a9bca5a58a39cffe66
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f9d172f5a191a4e0e13923a6a1d31e86107bc75e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 01:05:37 +00:00
Volker Hilsheimer
c11c9e52b4 Return subclass type from overrides of QEvent::clone
C++ allows overrides to return a covariant type, so if calling code has
already cast the callee down to the right type, don't require it to cast
the returned clone down as well.

Change-Id: I802f00a3c78e03047046986d0ed0a479b47573b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 146b37cdf376fb2fde85fa27326acfbeb2a024e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-24 01:01:22 +00:00
Giuseppe D'Angelo
b963f3aa0f QStackedLayout: fix a memory leak
A layout takes ownership of the QLayoutItem passed to addItem.

Change-Id: Iea3c64453f3cbf4f1b5660e505c1a35dca537833
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1fcc882d7ca564f17e49b8d51adc43eb5b97c57b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 23:40:14 +00:00
Volker Hilsheimer
b05d8749bc Fix compiler warning about discarded return value
Not testing the result of the copying, just verifying that it doesn't
assert.

Change-Id: Ib51129134b74c17eada7e3819ccfff10bb9affbf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e59ab8b5907f87a77cc6924abab5fb1c82483856)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 18:13:37 +00:00
Li Xinwei
5464606e9d CMake: Fix entrypoint output directory when multi-config build
When multi-config build, the output directory of Qt6EntryPoint.lib is
<build_dir>/lib/Release, the output directory of Qt6EntryPointd.lib is
<build_dir>/lib/Debug. This behavior is different from other lib files.
Both release and debug lib files should be outputted to <build_dir>/lib.

Change-Id: I81d284e4630afebb40ba90fe822dd5bda2b2036a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 876b22a425aea45023983aae584eb9996886467f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 16:26:35 +00:00
Allan Sandfeld Jensen
3bfcab1718 Avoid integer overflow and division by zero
Restrain patterns to sensible lengths and values.

[ChangeLog][QCosmeticStroker] Pen patterns are restrained to a
maximum length and values of 1024, fixing oss-fuzz issue 25310.

Change-Id: If062f8336ff5ad113258391b0d70b8ac6f42c4b3
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 1ff25785ff93d0bd3d597e3a65a261bdbfa13c3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 16:23:00 +00:00
Fabian Kosmale
0ef76c77b8 QMetaType: Track whether type is QML list type
This information is required in the QML engine to handle list properties
(instances of QQmlListproperty<T> and list<T> types from QML).

Change-Id: I1e30572f1c91f58b290cb9b4b07433af99a1db6f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 5806ecf5cb24cf39ea2608d42246eafbaa817582)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 12:44:54 +00:00
Kai Koehne
b6dae38c27 Doc: Update CMake functions in Qt Widgets for Qt 6
Change-Id: I4110e8695c75c40cec6f94bb94879b07282b29d3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c082213556991c6619ef2d2c00a7042406f867a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 12:44:49 +00:00
Kai Koehne
5d45a1d83a Doc: Update CMake functions in Qt Core for Qt 6
Change-Id: Ica6141f183c75f60e5b1031c0972f79de7821841
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f74e572cb7aff59d3a64d1761370b0a88d5ec7c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 12:44:44 +00:00
Joerg Bornemann
2f7fcebf3b CMake: Fix Android non-top-level build against qtbase
Commit 9e0fb9c4fbe7a11c09a70d7ea1be97405c6bf0f8 introduced build
failures in non-top-level builds when building Qt modules against
qtbase.

This was observed on in the CI for CentOS.

Partly revert above commit by taking the old code path for non-top-level
builds.

Fixes: QTBUG-88718
Change-Id: I8926e1e4628ec5bdcea99e10497c1f65c10d072d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 510186a218e63c88100efc38cb1611f122f94570)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-23 09:54:43 +00:00
Kai Koehne
7cf781d075 Revert "QChar: assert on illegal construction"
This reverts commit 915be6606ead25f4fbbbcb2687b33cf22a955177.

Reason for revert: This causes issues in other modules,
see QTBUG-88687, QTBUG-88710, QTBUG-88712. We should fix them,
but let's not block 6.0.0 until then.

Task-number: QTBUG-88687
Task-number: QTBUG-88710
Task-number: QTBUG-88712
Change-Id: I89425082c9c55aabb34283dfec5dfd421d91d269
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 64319ae45ebbd1bfb3fb741756c924e445516ac7)
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-11-23 07:40:03 +00:00
Andreas Buhr
33f85891dc Fit tst_qprinterinfo in case there are printers in local network
tst_qprinterinfo compared the output of "lpstat -p" with the
result of a call to "cupsGetDests". "lpstat -p" only returns local
printers, "cupsGetDests" also returns printers on the local network.
This patch fixes the test by using "lpstat -e", which also
shows printers on the local network.

Change-Id: Ia70adad8b8467f4c738f769d34757786fc9645b2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 146a2a21b1fd279e3f26690243db30fba89f9027)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 15:57:21 +00:00
Andreas Buhr
628ce898fa Add unit test for QAnyStringView::compare
Coverage tests revealed that
QAnyStringView::compare(QAnyStringView, QAnyStringView, CaseSensitivity)
was not tested in our unit tests. This patch adds a test for this.

Change-Id: Id8e0d8af87e7e7ab192fb7554a278ddbb890fb14
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ae2c30942086bd0387c6d5297c0cb85b505f29a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 15:57:14 +00:00
Mårten Nordheim
7b2b4bb5d0 QCache: fix accidental pessimization
By unconditionally removing the existing entry we never
hit the if (result.initialized) branch. Change it to
only remove the existing entry if we don't plan on inserting.

Task-number: QTBUG-88183
Change-Id: If4e7ebac23aa63d4b9d4b0a22882dd7d90a58e8b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit f08492c6fd9818c7d80b1725355453e179b4d85b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 15:05:30 +00:00
Shawn Rutledge
9f0491b8c6 QGuiAppPriv: don't clear target and window for TouchCancel
It's nice not to leave garbage in QPointingDevicePrivate::activePoints
between events; on the other hand, this garbage doesn't matter, because
every press event sets the target and window independently, without
caring what was stored there from before.  But it was wrong to clear
it before we've even delivered the TouchCancel event.

Change-Id: I924039a7c7a8ed75f420d1837c63dc19d3cc98b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 45a65cbeb2775da71d4e7b417b45d54341a3ee7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 05:53:34 +00:00
Eskil Abrahamsen Blomfeldt
2acf1122ea Fix weight when reading old serialized QFonts
The QFont::fromString() needs to differ between strings
produced before and after Qt 6.0 when interpreting the
weight value, since in older strings this will be the legacy
scale.

Luckily the number of tokens in the string can be used for this
purpose, since many tokens were added in Qt 6.0.

This broke KDE, where font settings are stored in QSettings
and serialized using QFont::toString() from Qt 5.

Fixes: QTBUG-88589
Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 1d14067680f02f47b2f8ff375c44eb64633eec02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 03:20:56 +00:00
Allan Sandfeld Jensen
c0b0ade622 Fix safe conversion
Ensure the resulting QScFixed values are no larger than can
be safely returned to int after shifting the fixed factor
away.

Fixes: QTBUG-88683
Change-Id: Id0754b021e5fa9a3cf0d15e37ac643cfc1509993
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit a31484302d71c29c0e0e62f9941f9d5f0c87f9aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 03:20:48 +00:00
Alex Trotsenko
28b419c733 QWin32PrintEngine: fix compilation
On MinGW32 it fails with error:

.../src/corelib/global/global.h: 1186:34: error: unused variable 'q'
...qprintengine_win.cpp: 753:5: note: in expansion of macro 'Q_Q'

Change-Id: I8eb0e3c5b72f8542cd3bd11514b12d308481f250
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 27e08b0c40b73edc5354f9ad3cf7e5e660243553)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 03:20:35 +00:00
Volker Hilsheimer
8335305df3 Delete move constructor and move-assignment for QEvent
As of 19f9b0d5f54379151eb71e98555b203ad6756276 we define a protected copy
constructor and assignment operator. Static analyzers warn about missing
move variants, so delete those in addition.

Change-Id: I28c1a2afd4560ce35a258bde507dafd93245b75b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 291e8e729ee7a28e579c3aea22fd4482cd271ed7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-21 02:41:16 +00:00
Joerg Bornemann
4cd9ac52ed CMake: Name QT_NO_MAKE_*/BUILD_* variables consistently
For consistency, apply the following renamings:
QT_NO_MAKE_EXAMPLES -> QT_BUILD_EXAMPLES_BY_DEFAULT
QT_NO_MAKE_TESTS    -> QT_BUILD_TESTS_BY_DEFAULT
QT_NO_MAKE_TOOLS    -> QT_BUILD_TOOLS_BY_DEFAULT
BUILD_EXAMPLES      -> QT_BUILD_EXAMPLES
BUILD_TESTING       -> QT_BUILD_TESTS

This should help to better convey the difference between "BUILD" and
"NO_MAKE".

To configure tests, but not to build them by default, pass the
following to CMake:
-DQT_BUILD_TESTS=ON -DQT_BUILD_TESTS_BY_DEFAULT=OFF

Analoguous for examples:
-DQT_BUILD_EXAMPLES=ON -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF

Tools can be excluded from the default build with:
-DBUILD_TOOLS_BY_DEFAULT=OFF

The variable BUILD_TESTING is still available and initialized with the
value of QT_BUILD_TESTS.

Change-Id: Ie5f29dfbdca8bfa8d687981dfe8c19c0397ca080
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit fb21a5ce1a5831fab2af5e4d301600d6a6211e5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 21:33:20 +00:00
Assam Boudjelthia
c1f9e6ce98 Android: exclude qarraydata::dataPointerAllocate() from CI tests
Task-number: QTBUG-88705
Task-number: QTBUG-87025
Change-Id: If2dc0e650e5104d00a097e6195dd117d6cfd64e6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4713298b98503cc7c4699a6e33e3167622da91d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 21:33:19 +00:00
Sona Kurazyan
334bbfa2d9 Test conversion of ulonglong variant to JSON
Make sure ulonglong variant converts to a double JSON value when the
value is greater than 2^63.

Change-Id: I4d4392b05de29c220624056d5d0d4664fb2c08b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 289f909621a8d83320d33e3ff7d651c164034098)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-20 20:51:47 +00:00
Timur Pocheptsov
6298c26789 QSslCipher - improve its code coverage and auto-tests
tst_qsslcipher was quite useless - now we test that default constructed
QSslCipher reports expected values. Test the non-default from the
different auto-test,  where we are sure we have really useful
ciphersuites (with different parameters obtained from a TLS backend,
where it's possible).

Change-Id: Iff14a0580fed889cf9e0873bee01d968773626db
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 1a2e2921d268f09b6cb5ca91c85614192b8e2e0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:27 +00:00
Cristian Adam
0eac6af035 CMake: Fix build of plugins/styles/mac using PCH
If a target inherits precompile headers from a different target
that has more languages enabled (CXX, OBJCXX), the target will
depend on PCH artifacts for a language that is not actually
present.

Ammends d9d137c8f39b8aa77b28b12fcb6f1642ca650291

Fixes: QTBUG-88609
Change-Id: I9735317e634b62732df0fce84fe7cf229cfdea1b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e395cbb43d246abb18f9df45cd32c9fbea686076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:25 +00:00
Li Xinwei
415a3d44fe CMake: Don't install pri and debug info for bundled harfbuzz and pcre2
For shared build, Qt6BundledHarfbuzz.lib and Qt6BundledPcre2.lib are not
installed. But their pri files(qt_ext_harfbuzz.pri, qt_ext_pcre2.pri)
and debug info files(Qt6BundledHarfbuzz.pdb, Qt6BundledPcre2.pdb) are
still installed. These files should not be installed too.

Change-Id: I3e54bec01d94ee3897b485a982d01b24edc602aa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3ef32ce901490bb40a87bf6de19748045a605c05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:23 +00:00
Mitch Curtis
60ed7fd61e Doc: explain how to create a test touch device for use with touchEvent
Change-Id: Ib60eb0754449da7c50f8632ebd5228ddbe8389f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5861e06568c44c58aecacdf26fd7938240348956)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:20 +00:00
Cristian Adam
0bc41f5601 CMake: Generate less pri files and mark header modules as no_link
Plugins will no longer get .pri files generated in non-static builds.

Header modules are now marked in the .pri files as CONFIG += no_link.

Fixes: QTBUG-88221
Change-Id: I06e31fa970ad021261c43ca3acd88055cc4c9555
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 98e6234bd4a910ab1b3873bafc9da33aab499e2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:16 +00:00
Timur Pocheptsov
ab3f3d5c4d tst_qocsp: improve code coverage
By simply extending the basic test to trigger qHash, isEqual and
a bunch of getters.

Change-Id: Ib1d88fc6d2ad623743cea77ac286ae6ac819dfd1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 1d7189f5b3eb03e7c71fb31e2bd491d0e5a535e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:10 +00:00
Alexey Edelev
72c31006a9 CMake: Fix resource_name variable name in __qt_propagate_generated_resource
__qt_propagate_generated_resource used resourceName variable from
parent scope instead of one passed to function.

Change-Id: I18ce8a9f9c01bcfdbab532def55af4e2780d7753
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit eaedd7efbf5f97be585437ad2d358c43c155204f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:04 +00:00
Andreas Buhr
4cb21ded95 Add unit test for QString::insert(negativeint, QChar)
QString::insert(qsizetype, QChar) can insert at negative positions,
then counting from the end of the string. Coverage analysis revealed we
do not have a unit test for this. This patch adds a unit test.

Change-Id: I8d41b38df964c07fe2d2e7be444f8236c9e19b5d
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit 7b0fd207756d367db768c3cb546fa439c15bbac8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:02 +00:00
Andreas Buhr
7a6f6fb20f Add unit test for YearMonthDate
Coverage analysis showed that QCalendar::YearMonthDate was not
rigorously tested. This patch adds a unit test.

Change-Id: I0af485d13c4883764b61ea1e35455905cc77b966
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
(cherry picked from commit b02147788b4013a698955aeea9fa92bb5613cc4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:05:00 +00:00
Timur Pocheptsov
2eae1ad0ea QDtls - remove redundant RAII struct
As noted by LCOV, the part with q_BIO_free(bio) was never executed
since we were taking the result from QScopedPointer before returning.
While it's a what RAII idiom is for, there is quite a low probability
that SSL_set_bio() one day will start throwing exceptions.

Change-Id: Id24e480dac34166c627b71bb2972de558c644339
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 16f4ce89eda53645a412b73e0c5ea63e638e7268)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:04:53 +00:00
Volker Hilsheimer
a1be4de712 Toplevel builds: Add utility toplevel targets for each module
Add a target for each level-1 subdirectory in a module. Ninja already
generates phony targets such as "qtbase/src/all", but those are not
available in e.g. IDE integrations of CMake. With this addition, targets
like qtbase, qtbase_src, and qtbase_tests are available in IDEs.

Change-Id: If1c3369e9413b3ce127e68c443d4d22949708d5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 08f46bb40075778e89ba9aed3cef53d990852022)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:04:51 +00:00
Joerg Bornemann
cc26c1e025 CMake: Fix Android top-level prefix build
During a top-level prefix build, while configuring qtsvg,
Qt6BuildInternalsConfig tries to include QtBuildInternalsAndroid.cmake
but such files are not copied by qt_copy_or_install() at configure
time.

We need to use the "module" form of include() to take CMAKE_MODULE_PATH
into account. Then QtBuildInternalsAndroid.cmake can be loaded from the
source tree.

The include's current form was introduced in commit
3cb9ee3a5b36e2c10dbaf1564852472e7e02a1ae without further
explanation. Assuming an accidental change.

Task-number: QTBUG-88460
Change-Id: If06ac715fae3c2bebbeffca44b7e07265ffb0f71
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9e0fb9c4fbe7a11c09a70d7ea1be97405c6bf0f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:04:45 +00:00
Alexey Edelev
3965eb2305 CMake: Change way of 'INPUT_' values handling
Move 'INPUT_' variable detection logic out of
'qt_feature_set_cache_value' function. Use 'INPUT_'
variable to enable/disable related 'FEATURE_' in case if
'FEATURE_' is not defined.

Fixes: QTBUG-88501
Change-Id: I1162ac0fb562036898a37b52c3f80229ec8a0970
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 85f0792d2b10994e9e5fa70de50aa0ac39e98e20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 18:04:40 +00:00
Simo Fält
ba59c49eec Add coin instructions to run Android test in emulator
Task-number: QTQAINFRA-3867
Change-Id: Ie6dd9c2dfeeccd526c2133d7ac03efce5b7ed091
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 13c460d0ff1a4eecfb7b1bc43a863783ed59a2bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 17:11:00 +00:00
Assam Boudjelthia
704f95e9b9 CMake: add CMAKE_FIND_ROOT_PATH as extraPrefixDirs for androiddeployqt
androiddeployqt has extraPrefixDirs to provide extra prefix paths in
addition to the main Qt install path, however, for some reason, it was
not being used.

With this, apps for Android using Conan can pass the Conan build prefix
for androiddeployqt to use it as well.

Task-number: QTBUG-88519
Change-Id: Iad73055ac6c03e3ffe86fca271dbda67ac29a275
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 00e726ce12431e8c3db8bc9deb8952f930a5a672)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 15:45:52 +00:00
Kai Koehne
5a233f7556 Revert "Allow QWindowsPipe{Reader,Writer} to work with foreign event loops"
This reverts commit ee122077b09430da54ca09750589b37326a22d85.

Reason for revert: This causes QProcess::readAll() to sometimes
return nothing after the process has ended.

Fixes: QTBUG-88624
Change-Id: I34fa27ae7fb38cc7c3a1e8eb2fdae2a5775584c2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 23100ee61e33680d20f934dcbc96b57e8da29bf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 12:06:43 +00:00
1087 changed files with 155864 additions and 55056 deletions

View File

@ -1,2 +1,16 @@
set(QT_REPO_MODULE_VERSION "6.0.0")
set(QT_MIN_SUPPORTED_CMAKE_VERSION "3.18")
set(QT_REPO_MODULE_VERSION "6.0.4")
# Minimum requirement for building Qt
set(QT_MIN_SUPPORTED_CMAKE_VERSION "3.16")
# Policy settings for commands defined by qtbase. These will also be injected
# into the top level policy scope of each Qt module when building Qt so that
# modules have the same policy settings as qtbase by default. They can be
# overridden by individual Qt modules in their own .cmake.conf files if needed.
#
# NOTE: These two values are also hard-coded in QtBuildInternalsConfig.cmake
# because that file is used in-place by a superbuild, so there is no
# opportunity for substituting the values from here. Keep both locations
# in sync.
set(QT_MIN_NEW_POLICY_CMAKE_VERSION "3.14")
set(QT_MAX_NEW_POLICY_CMAKE_VERSION "3.19")

View File

@ -3,7 +3,7 @@
# The goal of this workflow is to finish as fast as possible. Therefore some
# choices have been made:
# - no optimizations
# - link to system-provided libraries instead of bulding
# - link to system-provided libraries instead of building
# bundled 3rd party libraries
# - ccache
@ -11,6 +11,10 @@ name: Smoke build
on: push
env:
BRANCH: 6.0
BRANCH_REF: refs/heads/6.0
defaults:
run:
shell: bash
@ -22,28 +26,38 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubuntu-18.04
os: ubuntu-18.04
deps: libgl-dev libglu-dev libpcre2-dev libz-dev libfreetype6-dev libpng-dev libjpeg-dev libsqlite3-dev
- name: ubuntu-20.04
os: ubuntu-20.04
# NOTE: system libmd4c is not detected
deps: libgl-dev libglu-dev 'libxcb*-dev' libx11-xcb-dev libxkbcommon-x11-dev libpcre2-dev libz-dev libfreetype6-dev libpng-dev libjpeg-dev libsqlite3-dev libharfbuzz-dev libb2-dev libdouble-conversion-dev libmd4c-dev
tools: ninja-build ccache
install_cmd: sudo apt-get -y install
configure_flags: -system-sqlite -system-pcre -system-zlib -system-freetype -system-libpng -system-libjpeg
configure_flags: -xcb -system-sqlite -system-pcre -system-zlib -system-freetype -system-libpng -system-libjpeg -system-harfbuzz -system-libb2 -system-doubleconversion -system-libmd4c
- name: ubuntu-18.04
os: ubuntu-18.04
# NOTE: system libb2 is not detected because version < 0.98.1 lacks pkg-config module
# NOTE: system libharfbuzz is not detected because system has old version
deps: libgl-dev libglu-dev 'libxcb*-dev' libx11-xcb-dev libxkbcommon-x11-dev libpcre2-dev libz-dev libfreetype6-dev libpng-dev libjpeg-dev libsqlite3-dev libharfbuzz-dev libb2-dev libdouble-conversion-dev
tools: ninja-build ccache
install_cmd: sudo apt-get -y install
configure_flags: -xcb -system-sqlite -system-pcre -system-zlib -system-freetype -system-libpng -system-libjpeg -system-harfbuzz -system-libb2 -system-doubleconversion
- name: macos-10.15
os: macos-10.15
deps: jpeg sqlite
deps: jpeg sqlite libpng pcre2 harfbuzz freetype libb2 double-conversion
tools: ninja ccache pkg-config
install_cmd: brew install
install_cmd: HOMEBREW_NO_INSTALL_CLEANUP=1 brew install
# Specifically on macOS pkg_config has to be manually turned on otherwise libraries under /usr/local are not detected.
configure_flags: -feature-pkg-config -system-sqlite -system-libjpeg
configure_flags: -pkg-config -system-sqlite -system-pcre -system-zlib -system-freetype -system-libpng -system-libjpeg -system-harfbuzz -system-libb2 -system-doubleconversion
- name: windows-2019
os: windows-2019
install_cmd: choco install
install_cmd_postfix: --yes --no-progress
# Chocolatey sqlite package does not come with headers, so we build with bundled sqlite.
#deps: sqlite
tools: ninja ccache
# ccache installed separately later in order to force version
tools: ninja
# We don't want the system headers / libraries from Strawberry Perl while compiling with MinGW 8.1.0
configure_flags: -qt-sqlite -qt-pcre -qt-zlib -qt-freetype -qt-libpng -qt-libjpeg -no-feature-sql-psql -no-feature-sql-mysql -no-feature-sql-odbc
configure_flags: -qt-sqlite -qt-pcre -qt-zlib -qt-freetype -qt-libpng -qt-libjpeg -qt-harfbuzz -no-feature-sql-psql -no-feature-sql-mysql -no-feature-sql-odbc
runs-on: ${{ matrix.os }}
@ -52,19 +66,26 @@ jobs:
- name: prepare Linux
if: runner.os == 'Linux'
run: sudo apt-get update
- name: prepare macOS
if: runner.os == 'macOS'
run: echo noop
- name: prepare Windows
if: runner.os == 'Windows'
# Header pthread.h from postgres is included and creates issues.
# Also library zlib.lib is linked instead of the system one.
run: rm -rf "C:/Program Files/PostgreSQL/"
run: |
rm -rf "C:/Program Files/PostgreSQL/"
choco install ccache --version 3.7.12 --yes --no-progress --not-silent --verbose --debug
- uses: actions/checkout@v2
with:
path: source
- name: restore ccache
id: ccache
uses: actions/cache@v2
with:
path: ~/.ccache
path: ${{ runner.temp }}/ccache
# "github.run_id" is unique, which causes the cache to always get
# saved at the end of a successful run.
key: ccache-${{ matrix.os }}-${{ github.ref }}-${{ github.run_id }}
@ -73,6 +94,7 @@ jobs:
# and restore the most recent cache.
restore-keys: |
ccache-${{ matrix.os }}-${{ github.ref }}-
ccache-${{ matrix.os }}-${{ env.BRANCH_REF }}-
ccache-${{ matrix.os }}-refs/heads/dev-
ccache-${{ matrix.os }}-
@ -81,6 +103,12 @@ jobs:
if: matrix.deps != ''
- name: install compiler tools
run: ${{ matrix.install_cmd }} ${{ matrix.tools }} ${{ matrix.install_cmd_postfix }}
- name: configure ccache
run: |
ccache --set-config sloppiness=file_macro,time_macros
ccache --set-config cache_dir='${{ runner.temp }}'/ccache
ccache --set-config compression=true
ccache --set-config max_size=1G
- name: print versions and environment
run: |
gcc --version | head -1
@ -88,6 +116,7 @@ jobs:
echo Ninja `ninja --version`
{ ninja --help || true ; } 2>&1 | grep "run N jobs in parallel"
ccache --version | head -1
ccache --show-config || echo 'Old ccache version does not support --show-config'
echo Environment:
printenv
@ -95,14 +124,28 @@ jobs:
run: mkdir build
- name: configure
working-directory: build
run: ../configure -cmake -opensource -confirm-license -ccache -no-pch \
\ -debug -nomake tests -nomake examples \
\ -qt-harfbuzz \
\ ${{ matrix.configure_flags }}
run: "../source/configure -cmake -opensource -confirm-license -ccache -no-pch
-debug -nomake tests -nomake examples
-prefix '${{ runner.temp }}'/install_dir
${{ matrix.configure_flags }}"
- name: ninja
working-directory: build
run: ninja
- name: various stats
# Print ccache utilization statistics, then reset them.
run: ccache -s && ccache -z
run: |
ccache -s
ccache -x 2>/dev/null || true
ccache -z
- name: print logfiles and other info in case of failure
if: ${{ failure() }}
run: |
echo ==== CMakeOutput.log ====
cat build/CMakeFiles/CMakeOutput.log
echo
echo ==== CMakeError.log ====
cat build/CMakeFiles/CMakeError.log
echo ==== CMakeCache.txt ====
cat build/CMakeCache.txt

View File

@ -635,6 +635,11 @@ qt_feature("ltcg"
CONDITION __qt_ltcg_detected
)
qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG)
qt_feature("enable_new_dtags"
LABEL "Using new DTAGS"
CONDITION LINUX AND TEST_enable_new_dtags
)
qt_feature_config("enable_new_dtags" QMAKE_PRIVATE_CONFIG)
qt_feature("enable_gdb_index"
LABEL "Generating GDB index"
AUTODETECT QT_FEATURE_developer_build
@ -643,7 +648,7 @@ qt_feature("enable_gdb_index"
qt_feature_config("enable_gdb_index" QMAKE_PRIVATE_CONFIG)
qt_feature("reduce_exports" PRIVATE
LABEL "Reduce amount of exported symbols"
CONDITION NOT WIN32 AND CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY
CONDITION NOT MSVC
)
qt_feature_definition("reduce_exports" "QT_VISIBILITY_AVAILABLE")
qt_feature_config("reduce_exports" QMAKE_PUBLIC_QT_CONFIG)
@ -761,13 +766,13 @@ qt_feature_definition("avx512vbmi" "QT_COMPILER_SUPPORTS_AVX512VBMI" VALUE "1")
qt_feature_config("avx512vbmi" QMAKE_PRIVATE_CONFIG)
qt_feature("aesni"
LABEL "AES"
CONDITION QT_FEATURE_sse2 AND TEST_subarch_aes
CONDITION QT_FEATURE_sse2 AND TEST_subarch_aesni
)
qt_feature_definition("aesni" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
qt_feature_config("aesni" QMAKE_PRIVATE_CONFIG)
qt_feature("rdrnd"
LABEL "RDRAND"
CONDITION TEST_subarch_rdseed
CONDITION TEST_subarch_rdrnd
)
qt_feature_definition("rdrnd" "QT_COMPILER_SUPPORTS_RDRND" VALUE "1")
qt_feature_config("rdrnd" QMAKE_PRIVATE_CONFIG)
@ -779,7 +784,7 @@ qt_feature_definition("rdseed" "QT_COMPILER_SUPPORTS_RDSEED" VALUE "1")
qt_feature_config("rdseed" QMAKE_PRIVATE_CONFIG)
qt_feature("shani"
LABEL "SHA"
CONDITION QT_FEATURE_sse2 AND TEST_subarch_sha
CONDITION QT_FEATURE_sse2 AND TEST_subarch_shani
)
qt_feature_definition("shani" "QT_COMPILER_SUPPORTS_SHA" VALUE "1")
qt_feature_config("shani" QMAKE_PRIVATE_CONFIG)

View File

@ -6,4 +6,4 @@ DEFINES += QT_NO_JAVA_STYLE_ITERATORS
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)
MODULE_VERSION = 6.0.0
MODULE_VERSION = 6.0.4

View File

@ -1,14 +1,16 @@
# special case skip regeneration
# Get the repo version and the minimum CMake version.
include("${CMAKE_CURRENT_SOURCE_DIR}/.cmake.conf")
# Need an explicit call at the top level. This is the absolute minimum version
# needed to configure the project with any combination of enabled features.
# The call to qt_build_repo_begin() will upgrade policies further.
cmake_minimum_required(VERSION 3.16)
if(NOT QT_SUPER_BUILD)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtCMakeVersionHelpers.cmake")
qt_internal_check_for_suitable_cmake_version()
qt_internal_get_computed_minimum_cmake_version(__qt_minimum_cmake_version)
cmake_minimum_required(VERSION ${__qt_minimum_cmake_version})
endif()
# Get the repo version and CMake policy details
include(.cmake.conf)
# Early check to reduce chance of warning being lost in the output
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtCMakeVersionHelpers.cmake")
qt_internal_check_for_suitable_cmake_version()
# Run auto detection routines, but not when doing standalone tests. In that case, the detection
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file. Also, inhibit
@ -96,9 +98,9 @@ if(NOT QT_BUILD_STANDALONE_TESTS)
add_subdirectory(src)
endif()
if(BUILD_TESTING)
if(QT_BUILD_TESTS)
add_subdirectory(tests)
if(QT_NO_MAKE_TESTS)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
@ -129,9 +131,9 @@ endif()
qt_build_repo_end()
if(NOT QT_BUILD_STANDALONE_TESTS AND BUILD_EXAMPLES)
if(NOT QT_BUILD_STANDALONE_TESTS AND QT_BUILD_EXAMPLES)
add_subdirectory(examples)
if(QT_NO_MAKE_EXAMPLES)
if(NOT QT_BUILD_EXAMPLES_BY_DEFAULT)
set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()

0
bin/qt-cmake-standalone-test.in Executable file → Normal file
View File

View File

@ -24,27 +24,26 @@ pkg_check_modules(PC_MySQL QUIET mysqlclient)
find_path(MySQL_INCLUDE_DIRS
NAMES mysql.h
HINTS ${PC_MySQL_INCLUDEDIR}
PATH_SUFFIXES mysql)
PATH_SUFFIXES mysql mariadb)
find_library(MySQL_LIBRARIES
NAMES mysqlclient
HINTS ${PC_MySQL_LIBDIR}
)
NAMES libmysql mysql mysqlclient libmariadb mariadb
HINTS ${PC_MySQL_LIBDIR})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MySQL DEFAULT_MSG MySQL_LIBRARIES MySQL_INCLUDE_DIRS)
if(MySQL_FOUND AND NOT TARGET MySQL::MySQL)
add_library(MySQL::MySQL UNKNOWN IMPORTED)
set_target_properties(MySQL::MySQL PROPERTIES
IMPORTED_LOCATION "${MySQL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${MySQL_INCLUDE_DIRS}")
add_library(MySQL::MySQL UNKNOWN IMPORTED)
set_target_properties(MySQL::MySQL PROPERTIES
IMPORTED_LOCATION "${MySQL_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${MySQL_INCLUDE_DIRS}")
endif()
mark_as_advanced(MySQL_INCLUDE_DIRS MySQL_LIBRARIES)
include(FeatureSummary)
set_package_properties(MySQL PROPERTIES
URL "https://www.mysql.com"
DESCRIPTION "MySQL client library")
URL "https://www.mysql.com"
DESCRIPTION "MySQL client library")

317
cmake/FindPostgreSQL.cmake Normal file
View File

@ -0,0 +1,317 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPostgreSQL
--------------
Find the PostgreSQL installation.
IMPORTED Targets
^^^^^^^^^^^^^^^^
.. versionadded:: 3.14
This module defines :prop_tgt:`IMPORTED` target ``PostgreSQL::PostgreSQL``
if PostgreSQL has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module will set the following variables in your project:
``PostgreSQL_FOUND``
True if PostgreSQL is found.
``PostgreSQL_LIBRARIES``
the PostgreSQL libraries needed for linking
``PostgreSQL_INCLUDE_DIRS``
the directories of the PostgreSQL headers
``PostgreSQL_LIBRARY_DIRS``
the link directories for PostgreSQL libraries
``PostgreSQL_VERSION_STRING``
the version of PostgreSQL found
``PostgreSQL_TYPE_INCLUDE_DIR``
the directories of the PostgreSQL server headers
Components
^^^^^^^^^^
This module contains additional ``Server`` component, that forcibly checks
for the presence of server headers. Note that ``PostgreSQL_TYPE_INCLUDE_DIR``
is set regardless of the presence of the ``Server`` component in find_package call.
#]=======================================================================]
# ----------------------------------------------------------------------------
# History:
# This module is derived from the module originally found in the VTK source tree.
#
# ----------------------------------------------------------------------------
# Note:
# PostgreSQL_ADDITIONAL_VERSIONS is a variable that can be used to set the
# version number of the implementation of PostgreSQL.
# In Windows the default installation of PostgreSQL uses that as part of the path.
# E.g C:\Program Files\PostgreSQL\8.4.
# Currently, the following version numbers are known to this module:
# "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0"
#
# To use this variable just do something like this:
# set(PostgreSQL_ADDITIONAL_VERSIONS "9.2" "8.4.4")
# before calling find_package(PostgreSQL) in your CMakeLists.txt file.
# This will mean that the versions you set here will be found first in the order
# specified before the default ones are searched.
#
# ----------------------------------------------------------------------------
# You may need to manually set:
# PostgreSQL_INCLUDE_DIR - the path to where the PostgreSQL include files are.
# PostgreSQL_LIBRARY_DIR - The path to where the PostgreSQL library files are.
# If FindPostgreSQL.cmake cannot find the include files or the library files.
#
# ----------------------------------------------------------------------------
# The following variables are set if PostgreSQL is found:
# PostgreSQL_FOUND - Set to true when PostgreSQL is found.
# PostgreSQL_INCLUDE_DIRS - Include directories for PostgreSQL
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
#
# The ``PostgreSQL::PostgreSQL`` imported target is also created.
#
# ----------------------------------------------------------------------------
# If you have installed PostgreSQL in a non-standard location.
# (Please note that in the following comments, it is assumed that <Your Path>
# points to the root directory of the include directory of PostgreSQL.)
# Then you have three options.
# 1) After CMake runs, set PostgreSQL_INCLUDE_DIR to <Your Path>/include and
# PostgreSQL_LIBRARY_DIR to wherever the library pq (or libpq in windows) is
# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/PostgreSQL<-version>. This will allow find_path()
# to locate PostgreSQL_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g. In your CMakeLists.txt file
# set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
# 3) Set an environment variable called ${PostgreSQL_ROOT} that points to the root of where you have
# installed PostgreSQL, e.g. <Your Path>.
#
# ----------------------------------------------------------------------------
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
include("${CMAKE_ROOT}/Modules/FindPostgreSQL.cmake")
return()
endif()
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
set(PostgreSQL_INCLUDE_PATH_DESCRIPTION "top-level directory containing the PostgreSQL include directories. E.g /usr/local/include/PostgreSQL/8.4 or C:/Program Files/PostgreSQL/8.4/include")
set(PostgreSQL_INCLUDE_DIR_MESSAGE "Set the PostgreSQL_INCLUDE_DIR cmake cache entry to the ${PostgreSQL_INCLUDE_PATH_DESCRIPTION}")
set(PostgreSQL_LIBRARY_PATH_DESCRIPTION "top-level directory containing the PostgreSQL libraries.")
set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache entry to the ${PostgreSQL_LIBRARY_PATH_DESCRIPTION}")
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
"13" "12" "11" "10" "9.6" "9.5" "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
# Define additional search paths for root directories.
set( PostgreSQL_ROOT_DIRECTORIES
ENV PostgreSQL_ROOT
${PostgreSQL_ROOT}
)
foreach(suffix ${PostgreSQL_KNOWN_VERSIONS})
if(WIN32)
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
"PostgreSQL/${suffix}/lib")
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
"PostgreSQL/${suffix}/include")
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
"PostgreSQL/${suffix}/include/server")
endif()
if(UNIX)
list(APPEND PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}"
"pgsql-${suffix}/lib")
list(APPEND PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}"
"postgresql/${suffix}"
"pgsql-${suffix}/include")
list(APPEND PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES
"postgresql${suffix}/server"
"postgresql/${suffix}/server"
"pgsql-${suffix}/include/server")
endif()
endforeach()
#
# Look for an installation.
#
find_path(PostgreSQL_INCLUDE_DIR
NAMES libpq-fe.h
PATHS
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
pgsql
postgresql
include
${PostgreSQL_INCLUDE_ADDITIONAL_SEARCH_SUFFIXES}
# Help the user find it if we cannot.
DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
)
find_path(PostgreSQL_TYPE_INCLUDE_DIR
NAMES catalog/pg_type.h
PATHS
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
postgresql
pgsql/server
postgresql/server
include/server
${PostgreSQL_TYPE_ADDITIONAL_SEARCH_SUFFIXES}
# Help the user find it if we cannot.
DOC "The ${PostgreSQL_INCLUDE_DIR_MESSAGE}"
)
# The PostgreSQL library.
set (PostgreSQL_LIBRARY_TO_FIND pq)
# Setting some more prefixes for the library
set (PostgreSQL_LIB_PREFIX "")
if ( WIN32 )
set (PostgreSQL_LIB_PREFIX ${PostgreSQL_LIB_PREFIX} "lib")
set (PostgreSQL_LIBRARY_TO_FIND ${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
endif()
function(__postgresql_find_library _name)
find_library(${_name}
NAMES ${ARGN}
PATHS
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
lib
${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES}
# Help the user find it if we cannot.
DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}"
)
endfunction()
# For compatibility with versions prior to this multi-config search, honor
# any PostgreSQL_LIBRARY that is already specified and skip the search.
if(PostgreSQL_LIBRARY)
set(PostgreSQL_LIBRARIES "${PostgreSQL_LIBRARY}")
get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY}" PATH)
else()
__postgresql_find_library(PostgreSQL_LIBRARY_RELEASE ${PostgreSQL_LIBRARY_TO_FIND})
__postgresql_find_library(PostgreSQL_LIBRARY_DEBUG ${PostgreSQL_LIBRARY_TO_FIND}d)
include(SelectLibraryConfigurations)
select_library_configurations(PostgreSQL)
mark_as_advanced(PostgreSQL_LIBRARY_RELEASE PostgreSQL_LIBRARY_DEBUG)
if(PostgreSQL_LIBRARY_RELEASE)
get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_RELEASE}" PATH)
elseif(PostgreSQL_LIBRARY_DEBUG)
get_filename_component(PostgreSQL_LIBRARY_DIR "${PostgreSQL_LIBRARY_DEBUG}" PATH)
else()
set(PostgreSQL_LIBRARY_DIR "")
endif()
endif()
if (PostgreSQL_INCLUDE_DIR)
# Some platforms include multiple pg_config.hs for multi-lib configurations
# This is a temporary workaround. A better solution would be to compile
# a dummy c file and extract the value of the symbol.
file(GLOB _PG_CONFIG_HEADERS "${PostgreSQL_INCLUDE_DIR}/pg_config*.h")
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
if(EXISTS "${_PG_CONFIG_HEADER}")
file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
REGEX "^#define[\t ]+PG_VERSION_NUM[\t ]+.*")
if(pgsql_version_str)
string(REGEX REPLACE "^#define[\t ]+PG_VERSION_NUM[\t ]+([0-9]*).*"
"\\1" _PostgreSQL_VERSION_NUM "${pgsql_version_str}")
break()
endif()
endif()
endforeach()
if (_PostgreSQL_VERSION_NUM)
# 9.x and older encoding
if (_PostgreSQL_VERSION_NUM LESS 100000)
math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000 / 100")
math(EXPR _PostgreSQL_patch_version "${_PostgreSQL_VERSION_NUM} % 100")
set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}.${_PostgreSQL_patch_version}")
unset(_PostgreSQL_major_version)
unset(_PostgreSQL_minor_version)
unset(_PostgreSQL_patch_version)
else ()
math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
unset(_PostgreSQL_major_version)
unset(_PostgreSQL_minor_version)
endif ()
else ()
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
if(EXISTS "${_PG_CONFIG_HEADER}")
file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
if(pgsql_version_str)
string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
"\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
break()
endif()
endif()
endforeach()
endif ()
unset(_PostgreSQL_VERSION_NUM)
unset(pgsql_version_str)
endif()
if("Server" IN_LIST PostgreSQL_FIND_COMPONENTS)
set(PostgreSQL_Server_FOUND TRUE)
if(NOT PostgreSQL_TYPE_INCLUDE_DIR)
set(PostgreSQL_Server_FOUND FALSE)
endif()
endif()
# Did we find anything?
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PostgreSQL
REQUIRED_VARS PostgreSQL_LIBRARY PostgreSQL_INCLUDE_DIR
HANDLE_COMPONENTS
VERSION_VAR PostgreSQL_VERSION_STRING)
set(PostgreSQL_FOUND ${POSTGRESQL_FOUND})
function(__postgresql_import_library _target _var _config)
if(_config)
set(_config_suffix "_${_config}")
else()
set(_config_suffix "")
endif()
set(_lib "${${_var}${_config_suffix}}")
if(EXISTS "${_lib}")
if(_config)
set_property(TARGET ${_target} APPEND PROPERTY
IMPORTED_CONFIGURATIONS ${_config})
endif()
set_target_properties(${_target} PROPERTIES
IMPORTED_LOCATION${_config_suffix} "${_lib}")
endif()
endfunction()
# Now try to get the include and library path.
if(PostgreSQL_FOUND)
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR})
if(PostgreSQL_TYPE_INCLUDE_DIR)
list(APPEND PostgreSQL_INCLUDE_DIRS ${PostgreSQL_TYPE_INCLUDE_DIR})
endif()
set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR})
if (NOT TARGET PostgreSQL::PostgreSQL)
add_library(PostgreSQL::PostgreSQL UNKNOWN IMPORTED)
set_target_properties(PostgreSQL::PostgreSQL PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIRS}")
__postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "")
__postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "RELEASE")
__postgresql_import_library(PostgreSQL::PostgreSQL PostgreSQL_LIBRARY "DEBUG")
endif ()
endif()
mark_as_advanced(PostgreSQL_INCLUDE_DIR PostgreSQL_TYPE_INCLUDE_DIR)
cmake_policy(POP)

View File

@ -11,6 +11,18 @@ set(WrapOpenSSL_FOUND OFF)
find_package(WrapOpenSSLHeaders ${WrapOpenSSL_FIND_VERSION})
if(OpenSSL_FOUND)
if(WIN32)
get_target_property(libType OpenSSL::Crypto TYPE)
if(libType STREQUAL "ALIAS")
get_target_property(writableLib OpenSSL::Crypto ALIASED_TARGET)
else()
set(writableLib OpenSSL::Crypto)
endif()
set_property(TARGET ${writableLib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES Ws2_32 Crypt32)
unset(libType)
unset(writableLib)
endif()
set(WrapOpenSSL_FOUND ON)
add_library(WrapOpenSSL::WrapOpenSSL INTERFACE IMPORTED)

View File

@ -1,5 +1,7 @@
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
include(CMakeFindDependencyMacro)
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)

View File

@ -9,11 +9,14 @@ function(qt_internal_add_cmake_library target)
${ARGN}
)
set(is_static_lib 0)
### Define Targets:
if(${arg_INTERFACE})
add_library("${target}" INTERFACE)
elseif(${arg_STATIC} OR (${arg_MODULE} AND NOT BUILD_SHARED_LIBS))
add_library("${target}" STATIC)
set(is_static_lib 1)
elseif(${arg_SHARED})
add_library("${target}" SHARED)
qt_internal_apply_win_prefix_and_suffix("${target}")
@ -32,6 +35,9 @@ function(qt_internal_add_cmake_library target)
qt_internal_apply_win_prefix_and_suffix("${target}")
else()
add_library("${target}")
if(NOT BUILD_SHARED_LIBS)
set(is_static_lib 1)
endif()
endif()
if (NOT arg_ARCHIVE_INSTALL_DIRECTORY AND arg_INSTALL_DIRECTORY)
@ -43,6 +49,11 @@ function(qt_internal_add_cmake_library target)
endif()
qt_skip_warnings_are_errors_when_repo_unclean("${target}")
# No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.
if(is_static_lib)
_qt_internal_disable_static_default_plugins("${target}")
endif()
if (arg_INSTALL_DIRECTORY)
set(install_arguments
ARCHIVE_INSTALL_DIRECTORY ${arg_ARCHIVE_INSTALL_DIRECTORY}
@ -93,11 +104,14 @@ function(qt_internal_add_3rdparty_library target)
${ARGN}
)
set(is_static_lib 0)
### Define Targets:
if(${arg_INTERFACE})
add_library("${target}" INTERFACE)
elseif(${arg_STATIC} OR (${arg_MODULE} AND NOT BUILD_SHARED_LIBS))
add_library("${target}" STATIC)
set(is_static_lib 1)
elseif(${arg_SHARED})
add_library("${target}" SHARED)
elseif(${arg_MODULE})
@ -114,6 +128,9 @@ function(qt_internal_add_3rdparty_library target)
endif()
else()
add_library("${target}")
if(NOT BUILD_SHARED_LIBS)
set(is_static_lib 1)
endif()
endif()
if(NOT arg_INTERFACE)
@ -128,6 +145,11 @@ function(qt_internal_add_3rdparty_library target)
qt_internal_add_target_aliases(${target})
_qt_internal_apply_strict_cpp(${target})
# No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.
if(is_static_lib)
_qt_internal_disable_static_default_plugins("${target}")
endif()
if (ANDROID)
qt_android_apply_arch_suffix("${target}")
endif()
@ -168,11 +190,6 @@ function(qt_internal_add_3rdparty_library target)
qt_internal_set_no_exceptions_flags("${target}")
endif()
qt_generate_3rdparty_lib_pri_file("${target}" "${arg_QMAKE_LIB_NAME}" pri_file)
if(pri_file)
qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
endif()
qt_internal_extend_target("${target}"
SOURCES ${arg_SOURCES}
INCLUDE_DIRECTORIES
@ -196,11 +213,18 @@ function(qt_internal_add_3rdparty_library target)
)
if(NOT BUILD_SHARED_LIBS OR arg_INSTALL)
qt_generate_3rdparty_lib_pri_file("${target}" "${arg_QMAKE_LIB_NAME}" pri_file)
if(pri_file)
qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
endif()
set(path_suffix "${INSTALL_CMAKE_NAMESPACE}${target}")
qt_path_join(config_build_dir ${QT_CONFIG_BUILD_DIR} ${path_suffix})
qt_path_join(config_install_dir ${QT_CONFIG_INSTALL_DIR} ${path_suffix})
set(export_name "${INSTALL_CMAKE_NAMESPACE}${target}Targets")
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(
"${QT_CMAKE_DIR}/Qt3rdPartyLibraryConfig.cmake.in"
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
@ -243,14 +267,14 @@ function(qt_internal_add_3rdparty_library target)
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target}
CONFIG_INSTALL_DIR "${config_install_dir}"
)
endif()
set(debug_install_dir "${INSTALL_LIBDIR}")
if (MINGW)
set(debug_install_dir "${INSTALL_BINDIR}")
set(debug_install_dir "${INSTALL_LIBDIR}")
if (MINGW)
set(debug_install_dir "${INSTALL_BINDIR}")
endif()
qt_enable_separate_debug_info(${target} "${debug_install_dir}")
qt_internal_install_pdb_files(${target} "${INSTALL_LIBDIR}")
endif()
qt_enable_separate_debug_info(${target} "${debug_install_dir}")
qt_internal_install_pdb_files("${target}" "${INSTALL_LIBDIR}")
endfunction()
function(qt_install_3rdparty_library_wrap_config_extra_file target)

View File

@ -8,7 +8,7 @@ define_property(TARGET
BRIEF_DOCS
"Recorded install location for a Qt Module."
FULL_DOCS
"Recorded install location for a Qt Module. Used by qt_android_dependencies()."
"Recorded install location for a Qt Module. Used by qt_internal_android_dependencies()."
)
@ -65,42 +65,36 @@ define_property(TARGET
FULL_DOCS
"Qt Module android permission list."
)
# Generate Qt Module -android-dependencies.xml required by the
# androiddeploytoolqt to successfully copy all the plugins and other dependent
# items into tha APK
function(qt_android_dependencies target)
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
return()
endif()
define_property(TARGET
PROPERTY
QT_ANDROID_FEATURES
BRIEF_DOCS
"Qt Module android feature list."
FULL_DOCS
"Qt Module android feature list."
)
function(qt_internal_android_dependencies_content target file_content_out)
get_target_property(arg_JAR_DEPENDENCIES ${target} QT_ANDROID_JAR_DEPENDENCIES)
get_target_property(arg_BUNDLED_JAR_DEPENDENCIES ${target} QT_ANDROID_BUNDLED_JAR_DEPENDENCIES)
get_target_property(arg_LIB_DEPENDENCIES ${target} QT_ANDROID_LIB_DEPENDENCIES)
get_target_property(arg_LIB_DEPENDENCY_REPLACEMENTS ${target} QT_ANDROID_LIB_DEPENDENCY_REPLACEMENTS)
get_target_property(arg_BUNDLED_FILES ${target} QT_ANDROID_BUNDLED_FILES)
get_target_property(arg_PERMISSIONS ${target} QT_ANDROID_PERMISSIONS)
get_target_property(module_plugins ${target} MODULE_PLUGIN_TYPES)
get_target_property(arg_FEATURES ${target} QT_ANDROID_FEATURES)
if ((NOT module_plugins)
AND (NOT arg_JAR_DEPENDENCIES)
AND (NOT arg_LIB_DEPENDENCY_REPLACEMENTS)
AND (NOT arg_LIB_DEPENDENCIES)
if ((NOT arg_JAR_DEPENDENCIES)
AND (NOT arg_BUNDLED_JAR_DEPENDENCIES)
AND (NOT arg_LIB_DEPENDENCIES)
AND (NOT arg_LIB_DEPENDENCY_REPLACEMENTS)
AND (NOT arg_BUNDLED_FILES)
AND (NOT arg_PERMISSIONS)
AND (NOT arg_BUNDLED_FILES))
AND (NOT arg_FEATURES))
# None of the values were set, so there's nothing to do
return()
endif()
get_target_property(target_output_name ${target} OUTPUT_NAME)
if (NOT target_output_name)
set(target_name ${target})
else()
set(target_name ${target_output_name})
endif()
# mimic qmake's section and string splitting from
# mkspecs/feature/qt_android_deps.prf
macro(section string delimiter first second)
@ -115,10 +109,7 @@ function(qt_android_dependencies target)
endif()
endmacro()
set(dependency_file "${QT_BUILD_DIR}/${INSTALL_LIBDIR}/${target_name}_${CMAKE_ANDROID_ARCH_ABI}-android-dependencies.xml")
set(file_contents "<rules><dependencies>\n")
string(APPEND file_contents "<lib name=\"${target_name}_${CMAKE_ANDROID_ARCH_ABI}\"><depends>\n")
set(file_contents "")
# Jar Dependencies
if(arg_JAR_DEPENDENCIES)
@ -135,11 +126,11 @@ function(qt_android_dependencies target)
# Bundled Jar Dependencies
if(arg_BUNDLED_JAR_DEPENDENCIES)
foreach(jar_bundle IN LISTS arg_BUNDLED_JAR_DEPENDENCIES)
section(${jar_bundle} ":" bundle_file init_calss)
section(${jar_bundle} ":" bundle_file init_class)
if (init_class)
set(init_class "initClass=\"${init_class}\"")
endif()
file(TO_NATIVE_PATH ${jar_bundle} jar_bundle_native)
file(TO_NATIVE_PATH ${bundle_file} jar_bundle_native)
string(APPEND file_contents "<jar bundling=\"1\" file=\"${jar_bundle_native}\" ${init_class} />\n")
endforeach()
endif()
@ -171,7 +162,6 @@ function(qt_android_dependencies target)
endforeach()
endif()
# Bundled files
if(arg_BUNDLED_FILES)
foreach(bundled_file IN LISTS arg_BUNDLED_FILES)
@ -180,13 +170,6 @@ function(qt_android_dependencies target)
endforeach()
endif()
# Module plugins
if(module_plugins)
foreach(plugin IN LISTS module_plugins)
string(APPEND file_contents "<bundled file=\"plugins/${plugin}\" />\n")
endforeach()
endif()
# Android Permissions
if(arg_PERMISSIONS)
foreach(permission IN LISTS arg_PERMISSIONS)
@ -194,13 +177,74 @@ function(qt_android_dependencies target)
endforeach()
endif()
string(APPEND file_contents "</depends></lib>")
string(APPEND file_contents "</dependencies></rules>\n")
# Android Features
if(arg_FEATURES)
foreach(feature IN LISTS arg_FEATURES)
string(APPEND file_contents "<feature name=\"${feature}\" />\n")
endforeach()
endif()
set(${file_content_out} ${file_contents} PARENT_SCOPE)
endfunction()
# Generate Qt Module -android-dependencies.xml required by the
# androiddeploytoolqt to successfully copy all the plugins and other dependent
# items into the APK
function(qt_internal_android_dependencies target)
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
return()
endif()
# Get plugins for the current module
get_target_property(module_plugin_types ${target} MODULE_PLUGIN_TYPES)
# Get depends for the current module
qt_internal_android_dependencies_content(${target} file_contents)
# Get plugins from the module's plugin types and get their dependencies
foreach(plugin ${QT_KNOWN_PLUGINS})
get_target_property(iter_known_plugin_type ${plugin} QT_PLUGIN_TYPE)
foreach(plugin_type ${module_plugin_types})
if (plugin_type STREQUAL iter_known_plugin_type)
qt_internal_android_dependencies_content(${plugin} plugin_file_contents)
string(APPEND file_contents ${plugin_file_contents})
endif()
endforeach()
endforeach()
if ((NOT module_plugin_types)
AND (NOT file_contents))
# None of the values were set, so there's nothing to do
return()
endif()
get_target_property(target_output_name ${target} OUTPUT_NAME)
if (NOT target_output_name)
set(target_name ${target})
else()
set(target_name ${target_output_name})
endif()
string(PREPEND file_contents "<lib name=\"${target_name}_${CMAKE_ANDROID_ARCH_ABI}\"><depends>\n")
string(PREPEND file_contents "<rules><dependencies>\n")
# Module plugins
if(module_plugin_types)
foreach(plugin IN LISTS module_plugin_types)
string(APPEND file_contents "<bundled file=\"plugins/${plugin}\" />\n")
endforeach()
endif()
string(APPEND file_contents "</depends></lib>\n")
string(APPEND file_contents "</dependencies></rules>")
qt_path_join(dependency_file "${QT_BUILD_DIR}" "${INSTALL_LIBDIR}" "${target_name}_${CMAKE_ANDROID_ARCH_ABI}-android-dependencies.xml")
file(WRITE ${dependency_file} ${file_contents})
get_target_property(target_install_dir ${target} QT_ANDROID_MODULE_INSTALL_DIR)
if (NOT target_install_dir)
message(SEND_ERROR "qt_android_dependencies: Target ${target} is either not a Qt Module or has no recorded install location")
message(SEND_ERROR "qt_internal_android_dependencies: Target ${target} is either not a Qt Module or has no recorded install location")
return()
endif()
@ -212,5 +256,3 @@ function(qt_android_dependencies target)
COMPONENT
Devel)
endfunction()

View File

@ -39,7 +39,7 @@ function(qt_auto_detect_android)
if(DEFINED CMAKE_TOOLCHAIN_FILE AND NOT DEFINED QT_AUTODETECT_ANDROID)
file(READ ${CMAKE_TOOLCHAIN_FILE} toolchain_file_content OFFSET 0 LIMIT 80)
string(FIND ${toolchain_file_content} "The Android Open Source Project" find_result REVERSE)
string(FIND "${toolchain_file_content}" "The Android Open Source Project" find_result REVERSE)
if (NOT ${find_result} EQUAL -1)
set(android_detected TRUE)
else()
@ -268,11 +268,11 @@ function(qt_auto_detect_darwin)
# macOS
set(version "10.14")
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
set(version "12.0")
set(version "13.0")
elseif(CMAKE_SYSTEM_NAME STREQUAL watchOS)
set(version "5.0")
set(version "6.0")
elseif(CMAKE_SYSTEM_NAME STREQUAL tvOS)
set(version "12.0")
set(version "13.0")
endif()
if(version)
set(CMAKE_OSX_DEPLOYMENT_TARGET "${version}" CACHE STRING "${description}")

View File

@ -42,7 +42,8 @@ function(qt_run_config_test_architecture)
endif()
message(STATUS "Extracting architecture info from ${_arch_file}.")
file(STRINGS "${_arch_file}" _arch_lines LENGTH_MINIMUM 16 LENGTH_MAXIMUM 1024 ENCODING UTF-8)
file(STRINGS "${_arch_file}" _arch_lines LENGTH_MINIMUM 16 LENGTH_MAXIMUM 1024 ENCODING UTF-8
REGEX "==Qt=magic=Qt==")
foreach (_line ${_arch_lines})
string(LENGTH "${_line}" lineLength)

View File

@ -19,6 +19,8 @@ file(RELATIVE_PATH
${__qt_bin_dir_absolute} ${__GlobalConfig_install_dir_absolute})
# Generate and install Qt6 config file.
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in"
"${__GlobalConfig_build_dir}/${INSTALL_CMAKE_NAMESPACE}Config.cmake"
@ -57,10 +59,6 @@ qt_install(FILES
DESTINATION "${__build_internals_install_dir}"
COMPONENT Devel
)
qt_copy_or_install(
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/QtBuildInternalsAndroid.cmake"
DESTINATION "${__build_internals_install_dir}")
qt_copy_or_install(
DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QtBuildInternals/${__build_internals_standalone_test_template_dir}"
@ -149,6 +147,7 @@ qt_copy_or_install(FILES
cmake/ModuleDescription.json.in
cmake/Qt3rdPartyLibraryConfig.cmake.in
cmake/Qt3rdPartyLibraryHelpers.cmake
cmake/QtAndroidHelpers.cmake
cmake/QtAppHelpers.cmake
cmake/QtAutogenHelpers.cmake
cmake/QtBuild.cmake
@ -240,3 +239,8 @@ if(MACOS)
DESTINATION "${__GlobalConfig_install_dir}/macos"
)
endif()
# Install CI support files to libexec.
qt_path_join(__qt_libexec_install_dir "${QT_INSTALL_DIR}" "${INSTALL_LIBEXECDIR}")
qt_copy_or_install(FILES coin/instructions/qmake/ensure_pro_file.cmake
DESTINATION "${__qt_libexec_install_dir}")

View File

@ -490,5 +490,12 @@ include(QtToolHelpers)
include(QtHeadersClean)
include(QtJavaHelpers)
# This sets up the scope finalizer mechanism.
variable_watch(CMAKE_CURRENT_LIST_DIR qt_watch_current_list_dir)
if(ANDROID)
include(QtAndroidHelpers)
endif()
# This sets up the poor man's scope finalizer mechanism.
# For newer CMake versions, we use cmake_language(DEFER CALL) instead.
if(CMAKE_VERSION VERSION_LESS "3.19.0")
variable_watch(CMAKE_CURRENT_LIST_DIR qt_watch_current_list_dir)
endif()

View File

@ -48,23 +48,30 @@ function(qt_configure_print_summary)
# Evaluate all recorded commands.
qt_configure_eval_commands()
set(summary_file "${CMAKE_BINARY_DIR}/config.summary")
file(WRITE "${summary_file}" "")
# Show Qt-specific configure summary and any notes, wranings, etc.
if(__qt_configure_reports)
message("Configure summary:\n${__qt_configure_reports}")
file(APPEND "${summary_file}" "${__qt_configure_reports}")
endif()
if(__qt_configure_notes)
message("${__qt_configure_notes}")
file(APPEND "${summary_file}" "${__qt_configure_notes}")
endif()
if(__qt_configure_warnings)
message("${__qt_configure_warnings}")
file(APPEND "${summary_file}" "${__qt_configure_warnings}")
endif()
if(__qt_configure_errors)
message("${__qt_configure_errors}")
file(APPEND "${summary_file}" "${__qt_configure_errors}")
endif()
message("")
if(__qt_configure_an_error_occurred)
message(FATAL_ERROR "Check the configuration messages for an error that has occurred.")
endif()
file(APPEND "${summary_file}" "\n")
endfunction()
# Takes a list of arguments, and saves them to be evaluated at the end of the configuration
@ -79,11 +86,11 @@ function(qt_configure_record_command)
if(NOT DEFINED command_count)
set(command_count 0)
else()
math(EXPR command_count "${command_count}+1")
endif()
set_property(GLOBAL PROPERTY qt_configure_command_${command_count} "${ARGV}")
math(EXPR command_count "${command_count}+1")
set_property(GLOBAL PROPERTY qt_configure_command_count "${command_count}")
endfunction()

View File

@ -1,6 +1,5 @@
if (CMAKE_VERSION VERSION_LESS 3.1.0)
message(FATAL_ERROR "Qt requires at least CMake version 3.1.0")
endif()
# These values should be kept in sync with those in qtbase/.cmake.conf
cmake_minimum_required(VERSION 3.14...3.19)
######################################
#
@ -168,6 +167,7 @@ macro(qt_build_internals_set_up_private_api)
# Check for the minimum CMake version.
include(QtCMakeVersionHelpers)
qt_internal_require_suitable_cmake_version()
qt_internal_upgrade_cmake_policies()
# Qt specific setup common for all modules:
include(QtSetup)
@ -184,6 +184,51 @@ macro(qt_build_internals_set_up_private_api)
qt_check_if_tools_will_be_built()
endmacro()
# find all targets defined in $subdir by recursing through all added subdirectories
# populates $qt_repo_targets with a ;-list of non-UTILITY targets
macro(qt_build_internals_get_repo_targets subdir)
get_directory_property(_targets DIRECTORY "${subdir}" BUILDSYSTEM_TARGETS)
if(_targets)
foreach(_target IN LISTS _targets)
get_target_property(_type ${_target} TYPE)
if(NOT (${_type} STREQUAL "UTILITY" OR ${_type} STREQUAL "INTERFACE"))
list(APPEND qt_repo_targets "${_target}")
endif()
endforeach()
endif()
get_directory_property(_directories DIRECTORY "${subdir}" SUBDIRECTORIES)
if (_directories)
foreach(_directory IN LISTS _directories)
qt_build_internals_get_repo_targets("${_directory}")
endforeach()
endif()
endmacro()
# add toplevel targets for each subdirectory, e.g. qtbase_src
function(qt_build_internals_add_toplevel_targets)
set(qt_repo_target_all "")
get_directory_property(directories DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" SUBDIRECTORIES)
foreach(directory IN LISTS directories)
set(qt_repo_targets "")
get_filename_component(qt_repo_target_basename ${directory} NAME)
qt_build_internals_get_repo_targets("${directory}")
if (qt_repo_targets)
set(qt_repo_target_name "${qt_repo_targets_name}_${qt_repo_target_basename}")
message(DEBUG "${qt_repo_target_name} depends on ${qt_repo_targets}")
add_custom_target("${qt_repo_target_name}"
DEPENDS ${qt_repo_targets}
COMMENT "Building everything in ${qt_repo_targets_name}/${qt_repo_target_basename}")
list(APPEND qt_repo_target_all "${qt_repo_target_name}")
endif()
endforeach()
if (qt_repo_target_all)
add_custom_target("${qt_repo_targets_name}"
DEPENDS ${qt_repo_target_all}
COMMENT "Building everything in ${qt_repo_targets_name}")
endif()
endfunction()
macro(qt_enable_cmake_languages)
include(CheckLanguage)
set(__qt_required_language_list C CXX)
@ -254,6 +299,7 @@ macro(qt_build_repo_begin)
string(TOLOWER ${PROJECT_NAME} project_name_lower)
set(qt_repo_targets_name ${project_name_lower})
set(qt_docs_target_name docs_${project_name_lower})
set(qt_docs_prepare_target_name prepare_docs_${project_name_lower})
set(qt_docs_generate_target_name generate_docs_${project_name_lower})
@ -290,6 +336,12 @@ macro(qt_build_repo_begin)
add_custom_target(host_tools)
add_custom_target(bootstrap_tools)
endif()
# Add benchmark meta target. It's collection of all benchmarks added/registered by
# 'qt_internal_add_benchmark' helper.
if(NOT TARGET benchmark)
add_custom_target(benchmark)
endif()
endmacro()
macro(qt_build_repo_end)
@ -316,6 +368,8 @@ macro(qt_build_repo_end)
if(NOT QT_SUPERBUILD)
qt_print_build_instructions()
else()
qt_build_internals_add_toplevel_targets()
endif()
endmacro()
@ -325,7 +379,7 @@ macro(qt_build_repo)
# If testing is enabled, try to find the qtbase Test package.
# Do this before adding src, because there might be test related conditions
# in source.
if (BUILD_TESTING AND NOT QT_BUILD_STANDALONE_TESTS)
if (QT_BUILD_TESTS AND NOT QT_BUILD_STANDALONE_TESTS)
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Test)
endif()
@ -339,20 +393,20 @@ macro(qt_build_repo)
endif()
endif()
if (BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
if (QT_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
add_subdirectory(tests)
if(QT_NO_MAKE_TESTS)
if(NOT QT_BUILD_TESTS_BY_DEFAULT)
set_property(DIRECTORY tests PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
qt_build_repo_end()
if (BUILD_EXAMPLES AND BUILD_SHARED_LIBS
if(QT_BUILD_EXAMPLES AND BUILD_SHARED_LIBS
AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt"
AND NOT QT_BUILD_STANDALONE_TESTS)
add_subdirectory(examples)
if(QT_NO_MAKE_EXAMPLES)
if(NOT QT_BUILD_EXAMPLES_BY_DEFAULT)
set_property(DIRECTORY examples PROPERTY EXCLUDE_FROM_ALL TRUE)
endif()
endif()
@ -368,7 +422,11 @@ function(qt_get_standalone_tests_confg_files_path out_var)
# QT_CONFIG_INSTALL_DIR is relative in prefix builds.
if(QT_WILL_INSTALL)
qt_path_join(path "${CMAKE_INSTALL_PREFIX}" "${path}")
if(DEFINED CMAKE_STAGING_PREFIX)
qt_path_join(path "${CMAKE_STAGING_PREFIX}" "${path}")
else()
qt_path_join(path "${CMAKE_INSTALL_PREFIX}" "${path}")
endif()
endif()
set("${out_var}" "${path}" PARENT_SCOPE)
@ -402,8 +460,8 @@ macro(qt_build_tests)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/CMakeLists.txt" AND QT_BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/manual/CMakeLists.txt")
# add_subdirectory(manual) don't build manual tests for now, because qmake doesn't.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/manual/CMakeLists.txt" AND QT_BUILD_MANUAL_TESTS)
add_subdirectory(manual)
endif()
endmacro()
@ -521,7 +579,3 @@ macro(qt_examples_build_end)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ${BACKUP_CMAKE_FIND_ROOT_PATH_MODE_PACKAGE})
endmacro()
if (ANDROID)
include(${CMAKE_CURRENT_LIST_DIR}/QtBuildInternalsAndroid.cmake)
endif()

View File

@ -39,11 +39,11 @@ set(QT_SOURCE_TREE "@QT_SOURCE_TREE@" CACHE PATH
"A path to the source tree of the previously configured QtBase project." FORCE)
# Propagate decision of building tests and examples to other repositories.
set(BUILD_TESTING @BUILD_TESTING@ CACHE BOOL "Build the testing tree.")
set(BUILD_EXAMPLES @BUILD_EXAMPLES@ CACHE BOOL "Build Qt examples")
set(QT_NO_MAKE_TESTS @QT_NO_MAKE_TESTS@ CACHE BOOL
set(QT_BUILD_TESTS @QT_BUILD_TESTS@ CACHE BOOL "Build the testing tree.")
set(QT_BUILD_EXAMPLES @QT_BUILD_EXAMPLES@ CACHE BOOL "Build Qt examples")
set(QT_BUILD_TESTS_BY_DEFAULT @QT_BUILD_TESTS_BY_DEFAULT@ CACHE BOOL
"Should tests be built as part of the default 'all' target.")
set(QT_NO_MAKE_EXAMPLES @QT_NO_MAKE_EXAMPLES@ CACHE BOOL
set(QT_BUILD_EXAMPLES_BY_DEFAULT @QT_BUILD_EXAMPLES_BY_DEFAULT@ CACHE BOOL
"Should examples be built as part of the default 'all' target.")
# Propagate usage of ccache.

View File

@ -27,11 +27,36 @@ function(qt_internal_get_computed_minimum_cmake_version out_var)
set(${out_var} "${computed_min_version}" PARENT_SCOPE)
endfunction()
# Returns the oldest CMake version for which NEW policies should be enabled.
# It can be older than the minimum supported or computed CMake version, as it
# is only used for policy settings. The currently running CMake must not be
# older than this version though (doing so will result in an error).
function(qt_internal_get_min_new_policy_cmake_version out_var)
# QT_MIN_NEW_POLICY_CMAKE_VERSION is set either in .cmake.conf or in
# QtBuildInternalsExtras.cmake when building a child repo.
set(lower_version "${QT_MIN_NEW_POLICY_CMAKE_VERSION}")
set(${out_var} "${lower_version}" PARENT_SCOPE)
endfunction()
# Returns the latest CMake version for which NEW policies should be enabled.
# This cannot be less than the minimum CMake policy version or we will end up
# specifying a version range with the max less than the min.
function(qt_internal_get_max_new_policy_cmake_version out_var)
# QT_MAX_NEW_POLICY_CMAKE_VERSION is set either in .cmake.conf or in
# QtBuildInternalsExtras.cmake when building a child repo.
set(upper_version "${QT_MAX_NEW_POLICY_CMAKE_VERSION}")
qt_internal_get_min_new_policy_cmake_version(lower_version)
if(upper_version VERSION_LESS lower_version)
set(upper_version ${lower_version})
endif()
set(${out_var} "${upper_version}" PARENT_SCOPE)
endfunction()
function(qt_internal_check_for_suitable_cmake_version)
# Implementation note.
# The very first cmake_required_version() call can't be placed in an include()d file.
# The very first cmake_minimum_required() call can't be placed in an include()d file.
# It causes CMake to fail to configure with 'No cmake_minimum_required command is present.'
# The first cmake_required_version() must be called directly in the top-level CMakeLists.txt
# The first cmake_minimum_required() must be called directly in the top-level CMakeLists.txt
# file.
# That's why this function only handles output of warnings, and doesn't try to set the required
# version.
@ -41,7 +66,7 @@ endfunction()
# Function to be used in child repos like qtsvg to require a minimum CMake version.
#
# Such repos don't have the required version information at cmake_required_version() time, that's
# Such repos don't have the required version information at cmake_minimum_required() time, that's
# why we provide this function to be called at a time when the info is available.
function(qt_internal_require_suitable_cmake_version)
qt_internal_check_for_suitable_cmake_version()
@ -91,6 +116,17 @@ function(qt_internal_warn_about_unsuitable_cmake_versions)
# https://gitlab.kitware.com/cmake/cmake/-/issues/21163
list(APPEND unsuitable_versions "3.18.2")
# Cyclic dependencies are created when mixing AUTOMOC/AUTOUIC with sources
# that have their SKIP_MOC or SKIP_UIC source file properties set to true.
# https://gitlab.kitware.com/cmake/cmake/-/issues/21977
list(APPEND unsuitable_versions "3.20.0")
# AUTOMOC can crash or hang when using a Qt that supports moc depfiles.
# Issues reported on Windows with Ninja and Makefiles, but it could be happening
# on other platforms too.
# https://gitlab.kitware.com/cmake/cmake/-/issues/22014
list(APPEND unsuitable_versions "3.20.1")
foreach(unsuitable_version ${unsuitable_versions})
if(CMAKE_VERSION VERSION_EQUAL unsuitable_version)
message(WARNING
@ -99,4 +135,25 @@ function(qt_internal_warn_about_unsuitable_cmake_versions)
"CMake version used: '${unsuitable_version}'")
endif()
endforeach()
# Ninja Multi-Config was introduced in 3.17, but we recommend 3.18.
set(min_nmc_cmake_version "3.18.3")
if(CMAKE_GENERATOR STREQUAL "Ninja Multi-Config"
AND CMAKE_VERSION VERSION_LESS ${min_nmc_cmake_version})
message(WARNING
"You are using CMake ${CMAKE_VERSION} with the Ninja Multi-Config generator. "
"This combination is unsupported. "
"Please upgrade to at least CMake ${min_nmc_cmake_version}. ")
endif()
endfunction()
# Functions don't have their own policy scope, so the policy settings modified
# here will be those of the caller's policy scope. Note that these settings
# will only apply to functions and macros defined after this function is called,
# but not to any that are already defined. Ordinary CMake code not inside a
# function or macro will be affected by these policy settings too.
function(qt_internal_upgrade_cmake_policies)
qt_internal_get_computed_minimum_cmake_version(lower_version)
qt_internal_get_max_new_policy_cmake_version(upper_version)
cmake_minimum_required(VERSION ${lower_version}...${upper_version})
endfunction()

View File

@ -1,9 +1,6 @@
@PACKAGE_INIT@
# Slightly amended version of ./src/corelib/Qt6Config.cmake.in
if (CMAKE_VERSION VERSION_LESS 3.14)
message(FATAL_ERROR "Qt requires at least CMake version 3.14")
endif()
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
get_filename_component(_qt_cmake_dir "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
set(_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir "${CMAKE_CURRENT_LIST_DIR}")
@ -22,6 +19,16 @@ else()
QT_VERSION_PATCH @PROJECT_VERSION_PATCH@)
endif()
if(NOT "${QT_HOST_PATH}" STREQUAL "")
find_package(Qt@PROJECT_VERSION_MAJOR@HostInfo
CONFIG
REQUIRED
PATHS "${QT_HOST_PATH}"
"${QT_HOST_PATH_CMAKE_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
endif()
# if (NOT @INSTALL_CMAKE_NAMESPACE@_FIND_COMPONENTS)
# set(@INSTALL_CMAKE_NAMESPACE@_NOT_FOUND_MESSAGE "The Qt package requires at least one component")
# set(@INSTALL_CMAKE_NAMESPACE@_FOUND False)

View File

@ -54,11 +54,18 @@ function(qt_internal_add_docs)
# Generate include dir list
set(target_include_dirs_file "${doc_output_dir}/$<CONFIG>/includes.txt")
set(include_paths_property "$<TARGET_PROPERTY:${target},INCLUDE_DIRECTORIES>")
if (NOT target_type STREQUAL "INTERFACE_LIBRARY" AND NOT target_type STREQUAL "UTILITY")
set(prop_prefix "")
if(target_type STREQUAL "INTERFACE_LIBRARY")
set(prop_prefix "INTERFACE_")
endif()
set(include_path_prop "${prop_prefix}INCLUDE_DIRECTORIES")
set(include_paths_property "$<TARGET_PROPERTY:${target},${include_path_prop}>")
if (NOT target_type STREQUAL "UTILITY")
file(GENERATE
OUTPUT ${target_include_dirs_file}
CONTENT "-I$<JOIN:${include_paths_property},\n-I>"
CONTENT "$<$<BOOL:${include_paths_property}>:-I$<JOIN:${include_paths_property},\n-I>>"
)
set(include_path_args "@${target_include_dirs_file}")
else()
@ -68,9 +75,11 @@ function(qt_internal_add_docs)
get_filename_component(doc_target "${doc_project}" NAME_WLE)
if (QT_WILL_INSTALL)
set(qdoc_output_dir "${CMAKE_BINARY_DIR}/${INSTALL_DOCDIR}/${doc_target}")
set(qdoc_qch_output_dir "${CMAKE_BINARY_DIR}/${INSTALL_DOCDIR}")
set(index_dir "${CMAKE_BINARY_DIR}/${INSTALL_DOCDIR}")
else()
set(qdoc_output_dir "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}/${doc_target}")
set(qdoc_qch_output_dir "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}")
set(index_dir "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_DOCDIR}")
endif()
@ -146,7 +155,7 @@ function(qt_internal_add_docs)
# generate .qch
set(qch_file_name ${doc_target}.qch)
set(qch_file_path ${qdoc_output_dir}/${qch_file_name})
set(qch_file_path ${qdoc_qch_output_dir}/${qch_file_name})
foreach(target_prefix qch_top_level_docs qch_repo_docs qch_docs)
add_custom_target(${target_prefix}_${target}
@ -176,7 +185,7 @@ function(qt_internal_add_docs)
)
install(FILES "${qch_file_path}"
DESTINATION "${INSTALL_DOCDIR}/${qch_file_name}"
DESTINATION "${INSTALL_DOCDIR}"
COMPONENT _install_qch_docs_${target}
EXCLUDE_FROM_ALL
)

View File

@ -170,14 +170,64 @@ function(qt_evaluate_config_expression resultVar)
set(${resultVar} ${result} PARENT_SCOPE)
endfunction()
function(qt_feature_set_cache_value resultVar feature emit_if calculated label)
# Enable FEATURE_ variable if INPUT_ is true-like. FEATURE_ value has higher priority.
string(TOUPPER "${INPUT_${feature}}" input_value)
set(booly_values ON YES TRUE Y 1)
if ((NOT DEFINED "FEATURE_${feature}") AND (input_value IN_LIST booly_values))
set(FEATURE_${feature} ON)
function(_qt_internal_dump_expression_values expression_dump expression)
set(dump "")
set(skipNext FALSE)
set(isTargetExpression FALSE)
set(keywords "EQUAL" "LESS" "LESS_EQUAL" "GREATER" "GREATER_EQUAL" "STREQUAL" "STRLESS"
"STRLESS_EQUAL" "STRGREATER" "STRGREATER_EQUAL" "VERSION_EQUAL" "VERSION_LESS"
"VERSION_LESS_EQUAL" "VERSION_GREATER" "VERSION_GREATER_EQUAL" "MATCHES"
"EXISTS" "COMMAND" "DEFINED" "NOT" "AND" "OR" "TARGET" "EXISTS" "IN_LIST" "(" ")")
list(LENGTH expression length)
math(EXPR length "${length}-1")
if(${length} LESS 0)
return()
endif()
foreach(memberIdx RANGE ${length})
if(${skipNext})
set(skipNext FALSE)
continue()
endif()
list(GET expression ${memberIdx} member)
if(NOT "${member}" IN_LIST keywords)
string(FIND "${member}" "QT_FEATURE_" idx)
if(idx EQUAL 0)
if(NOT DEFINED ${member})
list(APPEND dump "${member} not evaluated")
else()
list(APPEND dump "${member} = \"${${member}}\"")
endif()
elseif(isTargetExpression)
set(targetExpression "TARGET;${member}")
if(${targetExpression})
list(APPEND dump "TARGET ${member} found")
else()
list(APPEND dump "TARGET ${member} not found")
endif()
else()
list(APPEND dump "${member} = \"${${member}}\"")
endif()
set(isTargetExpression FALSE)
set(skipNext FALSE)
elseif("${member}" STREQUAL "TARGET")
set(isTargetExpression TRUE)
elseif("${member}" STREQUAL "STREQUAL")
set(skipNext TRUE)
else()
set(skipNext FALSE)
set(isTargetExpression FALSE)
endif()
endforeach()
string(JOIN "\n " ${expression_dump} ${dump})
set(${expression_dump} "${${expression_dump}}" PARENT_SCOPE)
endfunction()
function(qt_feature_set_cache_value resultVar feature emit_if condition calculated label)
if (DEFINED "FEATURE_${feature}")
# Must set up the cache
if (NOT (emit_if))
@ -186,14 +236,25 @@ function(qt_feature_set_cache_value resultVar feature emit_if calculated label)
# Revisit value:
set(cache "${FEATURE_${feature}}")
# If the build is marked as dirty and the cache value doesn't meet the new condition,
# reset it to the calculated one.
get_property(dirty_build GLOBAL PROPERTY _qt_dirty_build)
if(NOT condition AND cache AND dirty_build)
set(cache "${calculated}")
message(WARNING "Reset FEATURE_${feature} value to ${calculated}, because it doesn't \
meet its condition after reconfiguration.")
endif()
set(bool_values OFF NO FALSE N ON YES TRUE Y)
if ((cache IN_LIST bool_values) OR (cache GREATER_EQUAL 0))
set(result "${cache}")
else()
message(FATAL_ERROR "Sanity check failed: FEATURE_${feature} has invalid value \"${cache}\"!")
endif()
# Fix-up user-provided values
set("FEATURE_${feature}" "${cache}" CACHE BOOL "${label}")
set("FEATURE_${feature}" "${cache}" CACHE BOOL "${label}" FORCE)
else()
# Initial setup:
if (emit_if)
@ -207,22 +268,28 @@ function(qt_feature_set_cache_value resultVar feature emit_if calculated label)
set("${resultVar}" "${result}" PARENT_SCOPE)
endfunction()
macro(qt_feature_set_value feature cache emit_if condition label)
macro(qt_feature_set_value feature cache condition label conditionExpression)
set(result "${cache}")
if (NOT (condition) AND (cache))
message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition.")
_qt_internal_dump_expression_values(conditionDump "${conditionExpression}")
string(JOIN " " conditionString ${conditionExpression})
message(SEND_ERROR "Feature \"${feature}\": Forcing to \"${cache}\" breaks its condition:\
\n ${conditionString}\nCondition values dump:\n ${conditionDump}\n")
endif()
if (DEFINED "QT_FEATURE_${feature}")
message(FATAL_ERROR "Feature ${feature} is already defined when evaluating configure.cmake features for ${target}.")
endif()
set(QT_FEATURE_${feature} "${result}" CACHE INTERNAL "Qt feature: ${feature}")
# Add feature to build feature collection
list(APPEND QT_KNOWN_FEATURES "${feature}")
set(QT_KNOWN_FEATURES "${QT_KNOWN_FEATURES}" CACHE INTERNAL "" FORCE)
endmacro()
function(qt_evaluate_feature feature)
# If the feature was set explicitly by the user to be on or off, in the cache, then
# there's nothing for us to do.
# If the feature was already evaluated as dependency nothing to do here.
if(DEFINED "QT_FEATURE_${feature}")
return()
endif()
@ -236,10 +303,6 @@ function(qt_evaluate_feature feature)
"PRIVATE;PUBLIC"
"LABEL;PURPOSE;SECTION;" "AUTODETECT;CONDITION;ENABLE;DISABLE;EMIT_IF" ${_QT_FEATURE_DEFINITION_${feature}})
if(DEFINED QT_FEATURE_${feature})
return()
endif()
if("${arg_ENABLE}" STREQUAL "")
set(arg_ENABLE OFF)
endif()
@ -276,12 +339,21 @@ function(qt_evaluate_feature feature)
qt_evaluate_config_expression(emit_if ${arg_EMIT_IF})
endif()
if (NOT (condition) AND (calculated))
message(FATAL_ERROR "Sanity check failed: Feature ${feature} is enabled but condition does not hold true.")
# If FEATURE_ is not defined trying to use INPUT_ variable to enable/disable feature.
if ((NOT DEFINED "FEATURE_${feature}") AND (DEFINED "INPUT_${feature}")
AND (NOT "${INPUT_${feature}}" STREQUAL "undefined")
AND (NOT "${INPUT_${feature}}" STREQUAL ""))
if(INPUT_${feature})
set(FEATURE_${feature} ON)
else()
set(FEATURE_${feature} OFF)
endif()
endif()
qt_feature_set_cache_value(cache "${feature}" "${emit_if}" "${result}" "${arg_LABEL}")
qt_feature_set_value("${feature}" "${cache}" "${emit_if}" "${condition}" "${arg_LABEL}")
qt_feature_set_cache_value(cache "${feature}" "${emit_if}" "${condition}" "${result}"
"${arg_LABEL}")
qt_feature_set_value("${feature}" "${cache}" "${condition}" "${arg_LABEL}"
"${arg_CONDITION}")
# Store each feature's label for summary info.
set(QT_FEATURE_LABEL_${feature} "${arg_LABEL}" CACHE INTERNAL "")

View File

@ -166,11 +166,19 @@ macro(qt_find_package)
AND (NOT arg_QMAKE_LIB IN_LIST QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}))
set(QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}
${QT_QMAKE_LIBS_FOR_${arg_MODULE_NAME}};${arg_QMAKE_LIB} CACHE INTERNAL "")
set(QT_QMAKE_LIB_TARGETS_${arg_QMAKE_LIB} ${arg_PROVIDED_TARGETS} CACHE INTERNAL "")
set(QT_TARGETS_OF_QMAKE_LIB_${arg_QMAKE_LIB} ${arg_PROVIDED_TARGETS} CACHE INTERNAL "")
foreach(provided_target ${arg_PROVIDED_TARGETS})
set(QT_QMAKE_LIB_OF_TARGET_${provided_target} ${arg_QMAKE_LIB} CACHE INTERNAL "")
endforeach()
endif()
endif()
endmacro()
# Return qmake library name for the given target, e.g. return "vulkan" for "Vulkan::Vulkan".
function(qt_internal_map_target_to_qmake_lib target out_var)
set(${out_var} "${QT_QMAKE_LIB_OF_TARGET_${target}}" PARENT_SCOPE)
endfunction()
# This function records a dependency between ${main_target_name} and ${dep_package_name}.
# at the CMake package level.
# E.g. The Tools package that provides the qtwaylandscanner target

View File

@ -62,11 +62,10 @@ foreach(lib ${known_libs})
qt_transform_absolute_library_paths_to_link_flags(value_release "${value_release}")
if(value_debug STREQUAL value_release)
if(value_debug)
qmake_list(value_debug ${value_debug})
string(APPEND content "QMAKE_LIBS_${lib} = ${value_debug}\n")
endif()
qmake_list(value_debug ${value_debug})
string(APPEND content "QMAKE_LIBS_${lib} = ${value_debug}\n")
else()
string(APPEND content "QMAKE_LIBS_${lib} =\n")
if(value_debug)
qmake_list(value_debug ${value_debug})
string(APPEND content "QMAKE_LIBS_${lib}_DEBUG = ${value_debug}\n")
@ -88,11 +87,13 @@ foreach(lib ${known_libs})
set(value ${QMAKE_${infix}_${lib}_${cfg}})
if(infix STREQUAL "LIBS")
qt_transform_absolute_library_paths_to_link_flags(value "${value}")
elseif("${value}" STREQUAL "")
# Do not write empty entries, but ensure to write at least
# the QMAKE_LIBS_FOO entry to make the lib 'foo' known.
continue()
endif()
if(value)
qmake_list(value ${value})
string(APPEND content "QMAKE_${infix}_${lib} = ${value}\n")
endif()
qmake_list(value ${value})
string(APPEND content "QMAKE_${infix}_${lib} = ${value}\n")
endforeach()
endforeach()
file(WRITE "${OUT_FILE}" "${content}")

View File

@ -37,15 +37,36 @@ function(qt_internal_add_headers_clean_target
list(PREPEND compiler_to_run "${CMAKE_CXX_COMPILER_LAUNCHER}")
endif()
set(target_includes_genex "$<TARGET_PROPERTY:${module_target},INCLUDE_DIRECTORIES>")
set(prop_prefix "")
get_target_property(target_type "${target}" TYPE)
if(target_type STREQUAL "INTERFACE_LIBRARY")
set(prop_prefix "INTERFACE_")
endif()
set(target_includes_genex
"$<TARGET_PROPERTY:${module_target},${prop_prefix}INCLUDE_DIRECTORIES>")
set(includes_exist_genex "$<BOOL:${target_includes_genex}>")
set(target_includes_joined_genex
"$<${includes_exist_genex}:-I$<JOIN:${target_includes_genex},;-I>>")
set(target_defines_genex "$<TARGET_PROPERTY:${module_target},COMPILE_DEFINITIONS>")
set(defines_exist_genex "$<BOOL:${target_defines_genex}>")
set(target_defines_joined_genex
"$<${defines_exist_genex}:-D$<JOIN:${target_defines_genex},;-D>>")
# qmake doesn't seem to add the defines that are set by the header_only_module when checking the
# the cleanliness of the module's header files.
# This allows us to bypass an error with CMake 3.18 and lower when trying to evaluate
# genex-enhanced compile definitions. An example of that is in
# qttools/src/designer/src/uiplugin/CMakeLists.txt which ends up causing the following error
# message:
# CMake Error at qtbase/cmake/QtModuleHelpers.cmake:35 (add_library):
# INTERFACE_LIBRARY targets may only have whitelisted properties. The
# property "QT_PLUGIN_CLASS_NAME" is not allowed.
# Call Stack (most recent call first):
# src/designer/src/uiplugin/CMakeLists.txt:7 (qt_internal_add_module)
if(NOT target_type STREQUAL "INTERFACE_LIBRARY")
set(target_defines_genex
"$<TARGET_PROPERTY:${module_target},${prop_prefix}COMPILE_DEFINITIONS>")
set(defines_exist_genex "$<BOOL:${target_defines_genex}>")
set(target_defines_joined_genex
"$<${defines_exist_genex}:-D$<JOIN:${target_defines_genex},;-D>>")
endif()
# TODO: FIXME
# Passing COMPILE_OPTIONS can break add_custom_command() if the values contain genexes
@ -69,7 +90,8 @@ function(qt_internal_add_headers_clean_target
#set(target_compile_options_joined_genex
# "$<${compile_options_exist_genex}:$<JOIN:${target_compile_options_genex},;>>")
set(target_compile_flags_genex "$<TARGET_PROPERTY:${module_target},COMPILE_FLAGS>")
set(target_compile_flags_genex
"$<TARGET_PROPERTY:${module_target},${prop_prefix}COMPILE_FLAGS>")
set(compile_flags_exist_genex "$<BOOL:${target_compile_flags_genex}>")
set(target_compile_flags_joined_genex
"$<${compile_flags_exist_genex}:$<JOIN:${target_compile_flags_genex},;>>")
@ -131,25 +153,24 @@ function(qt_internal_add_headers_clean_target
list(APPEND cxx_flags "${CMAKE_CXX_SYSROOT_FLAG}" "${CMAKE_OSX_SYSROOT}")
endif()
if(APPLE)
if(APPLE AND QT_FEATURE_framework)
# For some reason CMake doesn't generate -iframework flags from the INCLUDE_DIRECTORIES
# generator expression we provide, so pass it explicitly and hope for the best.
get_target_property(is_framework "${target}" FRAMEWORK)
if(is_framework)
list(APPEND framework_includes
"-iframework" "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBDIR}")
endif()
list(APPEND framework_includes
"-iframework" "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}/${INSTALL_LIBDIR}")
endif()
foreach(header ${hclean_headers})
get_filename_component(input_path "${header}" ABSOLUTE)
set(artifact_path "header_${header}.o")
set(artifact_path "header_check/${header}.o")
get_filename_component(artifact_directory "${artifact_path}" DIRECTORY)
set(comment_header_path "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
file(RELATIVE_PATH comment_header_path "${PROJECT_SOURCE_DIR}" "${comment_header_path}")
add_custom_command(
OUTPUT "${artifact_path}"
COMMENT "headersclean: Checking header ${comment_header_path}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${artifact_directory}"
COMMAND
${compiler_to_run} -c ${cxx_flags}
"${target_compile_flags_joined_genex}"

View File

@ -237,6 +237,10 @@ if(QT_FEATURE_enable_gdb_index)
target_link_options(PlatformCommonInternal INTERFACE "-Wl,--gdb-index")
endif()
if(QT_FEATURE_enable_new_dtags)
target_link_options(PlatformCommonInternal INTERFACE "-Wl,--enable-new-dtags")
endif()
function(qt_get_implicit_sse2_genex_condition out_var)
set(is_shared_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>")
set(is_static_lib "$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>")

View File

@ -1,5 +1,7 @@
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
include(CMakeFindDependencyMacro)
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
@ -84,32 +86,36 @@ if (NOT QT_NO_CREATE_TARGETS)
list(REMOVE_DUPLICATES @QT_CMAKE_EXPORT_NAMESPACE@@target@_COMPILE_DEFINITIONS)
endif()
foreach(extra_cmake_include @extra_cmake_includes@)
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}")
endforeach()
if (TARGET @QT_CMAKE_EXPORT_NAMESPACE@::@target@)
foreach(extra_cmake_include @extra_cmake_includes@)
include("${CMAKE_CURRENT_LIST_DIR}/${extra_cmake_include}")
endforeach()
include(${_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir}/QtFeature.cmake)
include(${_qt_@PROJECT_VERSION_MAJOR@_config_cmake_dir}/QtFeature.cmake)
qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@)
qt_make_features_available(@QT_CMAKE_EXPORT_NAMESPACE@::@target@)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
endif()
list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@")
get_target_property(_qt_module_target_type "@INSTALL_CMAKE_NAMESPACE@::@target@" TYPE)
if(NOT _qt_module_target_type STREQUAL "INTERFACE_LIBRARY")
get_target_property(_qt_module_plugin_types
@INSTALL_CMAKE_NAMESPACE@::@target@ MODULE_PLUGIN_TYPES)
if(_qt_module_plugin_types)
list(APPEND QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE "${_qt_module_plugin_types}")
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@Plugins.cmake")
endif()
list(APPEND QT_ALL_MODULES_FOUND_VIA_FIND_PACKAGE "@target@")
get_target_property(_qt_module_target_type "@INSTALL_CMAKE_NAMESPACE@::@target@" TYPE)
if(NOT _qt_module_target_type STREQUAL "INTERFACE_LIBRARY")
get_target_property(_qt_module_plugin_types
@INSTALL_CMAKE_NAMESPACE@::@target@ MODULE_PLUGIN_TYPES)
if(_qt_module_plugin_types)
list(APPEND QT_ALL_PLUGIN_TYPES_FOUND_VIA_FIND_PACKAGE "${_qt_module_plugin_types}")
endif()
endif()
endif()
# Load Module's BuildIntenals should any exist
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND
# Load Module's BuildInternals should any exist
if (@INSTALL_CMAKE_NAMESPACE@BuildInternals_DIR AND
EXISTS "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@@target@BuildInternals.cmake")
endif()
else()
set("@INSTALL_CMAKE_NAMESPACE@@target@_FOUND" FALSE)
endif()

View File

@ -43,7 +43,7 @@ endforeach()
# Find Qt tool package.
set(_tool_deps "@main_module_tool_deps@")
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
# Make sure that the tools find the host tools first
set(BACKUP_@target@_CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH})
set(BACKUP_@target@_CMAKE_FIND_ROOT_PATH ${CMAKE_FIND_ROOT_PATH})
@ -64,14 +64,14 @@ foreach(_target_dep ${_tool_deps})
endif()
find_package(${pkg} ${version} ${find_package_args})
if (NOT ${pkg}_FOUND)
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
endif()
return()
endif()
endforeach()
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
set(CMAKE_PREFIX_PATH ${BACKUP_@target@_CMAKE_PREFIX_PATH})
set(CMAKE_FIND_ROOT_PATH ${BACKUP_@target@_CMAKE_FIND_ROOT_PATH})
endif()

View File

@ -8,12 +8,18 @@
# this module are imported into the scope of the calling feature.
#
# Target is without leading "Qt". So e.g. the "QtCore" module has the target "Core".
#
# Options:
# NO_ADDITIONAL_TARGET_INFO
# Don't generate a Qt6*AdditionalTargetInfo.cmake file.
# The caller is responsible for creating one.
#
function(qt_internal_add_module target)
qt_internal_module_info(module "${target}")
# Process arguments:
qt_parse_all_arguments(arg "qt_add_module"
"NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE;NO_SYNC_QT;NO_PRIVATE_MODULE;HEADER_MODULE;GENERATE_METATYPES;NO_CONFIG_HEADER_FILE;SKIP_DEPENDS_INCLUDE"
"NO_MODULE_HEADERS;STATIC;DISABLE_TOOLS_EXPORT;EXCEPTIONS;INTERNAL_MODULE;NO_SYNC_QT;NO_PRIVATE_MODULE;HEADER_MODULE;GENERATE_METATYPES;NO_CONFIG_HEADER_FILE;SKIP_DEPENDS_INCLUDE;NO_ADDITIONAL_TARGET_INFO"
"MODULE_INCLUDE_NAME;CONFIG_MODULE_NAME;PRECOMPILED_HEADER;CONFIGURE_FILE_PATH;${__default_target_info_args}"
"${__default_private_args};${__default_public_args};${__default_private_module_args};QMAKE_MODULE_CONFIG;EXTRA_CMAKE_FILES;EXTRA_CMAKE_INCLUDES;NO_PCH_SOURCES" ${ARGN})
@ -31,16 +37,19 @@ function(qt_internal_add_module target)
### Define Targets:
set(is_interface_lib 0)
set(is_shared_lib 0)
set(is_static_lib 0)
if(${arg_HEADER_MODULE})
add_library("${target}" INTERFACE)
set(is_interface_lib 1)
elseif(${arg_STATIC})
add_library("${target}" STATIC)
set(is_static_lib 1)
elseif(${QT_BUILD_SHARED_LIBS})
add_library("${target}" SHARED)
set(is_shared_lib 1)
else()
add_library("${target}" STATIC)
set(is_static_lib 1)
endif()
set(property_prefix "INTERFACE_")
@ -79,6 +88,14 @@ function(qt_internal_add_module target)
endif()
endif()
if(FEATURE_ltcg AND GCC AND is_static_lib)
# CMake <= 3.19 appends -fno-fat-lto-objects for all library types if
# CMAKE_INTERPROCEDURAL_OPTIMIZATION is enabled. Static libraries need
# the opposite compiler option.
# (https://gitlab.kitware.com/cmake/cmake/-/issues/21696)
target_compile_options(${target} PRIVATE -ffat-lto-objects)
endif()
if (ANDROID)
qt_android_apply_arch_suffix("${target}")
endif()
@ -86,6 +103,11 @@ function(qt_internal_add_module target)
qt_skip_warnings_are_errors_when_repo_unclean("${target}")
_qt_internal_apply_strict_cpp("${target}")
# No need to compile Q_IMPORT_PLUGIN-containing files for non-executables.
if(is_static_lib)
_qt_internal_disable_static_default_plugins("${target}")
endif()
# Add _private target to link against the private headers:
if(NOT ${arg_NO_PRIVATE_MODULE})
set(target_private "${target}Private")
@ -341,6 +363,10 @@ function(qt_internal_add_module target)
)
endif()
if(MSVC)
list(APPEND defines_for_extend_target _CRT_SECURE_NO_WARNINGS)
endif()
qt_internal_extend_target("${target}"
${header_module}
SOURCES ${arg_SOURCES}
@ -488,6 +514,8 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
endif()
qt6_extract_metatypes(${target} ${args})
endif()
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(
"${QT_CMAKE_DIR}/QtModuleConfig.cmake.in"
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
@ -534,7 +562,7 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
if (ANDROID AND NOT arg_HEADER_MODULE)
# Record install library location so it can be accessed by
# qt_android_dependencies without having to specify it again.
# qt_internal_android_dependencies without having to specify it again.
set_target_properties(${target} PROPERTIES
QT_ANDROID_MODULE_INSTALL_DIR ${INSTALL_LIBDIR})
endif()
@ -543,10 +571,12 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE}::
DESTINATION ${config_install_dir})
qt_internal_export_additional_targets_file(
TARGETS ${exported_targets}
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target}
CONFIG_INSTALL_DIR "${config_install_dir}")
if(NOT arg_NO_ADDITIONAL_TARGET_INFO)
qt_internal_export_additional_targets_file(
TARGETS ${exported_targets}
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target}
CONFIG_INSTALL_DIR "${config_install_dir}")
endif()
qt_internal_export_modern_cmake_config_targets_file(
TARGETS ${exported_targets}

View File

@ -1,5 +1,7 @@
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
include(CMakeFindDependencyMacro)
if (NOT QT_NO_CREATE_TARGETS)

View File

@ -33,7 +33,7 @@ function(qt_get_android_sdk_jar_for_api api out_jar_location)
endfunction()
# Minimum recommend android SDK api version
set(QT_ANDROID_API_VERSION "android-28")
set(QT_ANDROID_API_VERSION "android-29")
# Locate android.jar
set(QT_ANDROID_JAR "${ANDROID_SDK_ROOT}/platforms/${QT_ANDROID_API_VERSION}/android.jar")
@ -125,10 +125,10 @@ define_property(TARGET
"This variable points to the path of the deployment settings JSON file, which holds properties required by androiddeployqt to package the Android app."
)
# Add a test for Android which will be run by the android test runner tool
function(qt_internal_android_add_test target)
set(deployment_tool "${QT_HOST_PATH}/bin/androiddeployqt")
set(test_runner "${QT_HOST_PATH}/bin/androidtestrunner")
# Returns test execution arguments for Android targets
function(qt_internal_android_test_arguments target out_test_runner out_test_arguments)
set(${out_test_runner} "${QT_HOST_PATH}/${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_BINDIR}/androidtestrunner" PARENT_SCOPE)
set(deployment_tool "${QT_HOST_PATH}/${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_BINDIR}/androiddeployqt")
get_target_property(deployment_file ${target} QT_ANDROID_DEPLOYMENT_SETTINGS_FILE)
if (NOT deployment_file)
@ -138,13 +138,13 @@ function(qt_internal_android_add_test target)
set(target_binary_dir "$<TARGET_PROPERTY:${target},BINARY_DIR>")
set(apk_dir "${target_binary_dir}/android-build")
add_test(NAME "${target}"
COMMAND "${test_runner}"
--path "${apk_dir}"
--adb "${ANDROID_SDK_ROOT}/platform-tools/adb"
--skip-install-root
--make "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk"
--apk "${apk_dir}/${target}.apk"
--verbose
set(${out_test_arguments}
"--path" "${apk_dir}"
"--adb" "${ANDROID_SDK_ROOT}/platform-tools/adb"
"--skip-install-root"
"--make" "${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target ${target}_make_apk"
"--apk" "${apk_dir}/${target}.apk"
"--verbose"
PARENT_SCOPE
)
endfunction()

View File

@ -2,6 +2,8 @@ include_guard(DIRECTORY)
@PACKAGE_INIT@
cmake_minimum_required(VERSION @min_new_policy_version@...@max_new_policy_version@)
include(CMakeFindDependencyMacro)
get_filename_component(_import_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)

View File

@ -88,7 +88,7 @@ function(qt_internal_add_plugin target)
# Disable linking of plugins against other plugins during static regular and
# super builds. The latter causes cyclic dependencies otherwise.
set_target_properties(${target} PROPERTIES QT_DEFAULT_PLUGINS 0)
_qt_internal_disable_static_default_plugins("${target}")
set_target_properties("${target}" PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${output_directory}"
@ -150,11 +150,15 @@ function(qt_internal_add_plugin target)
endif()
endif()
add_dependencies(qt_plugins "${target}")
if(TARGET qt_plugins)
add_dependencies(qt_plugins "${target}")
endif()
if(arg_TYPE STREQUAL "platforms")
add_dependencies(qpa_plugins "${target}")
if(TARGET qpa_plugins)
add_dependencies(qpa_plugins "${target}")
endif()
if(_default_plugin)
if(_default_plugin AND TARGET qpa_default_plugins)
add_dependencies(qpa_default_plugins "${target}")
endif()
endif()
@ -218,7 +222,9 @@ function(qt_internal_add_plugin target)
endforeach()
qt_register_target_dependencies("${target}" "${arg_PUBLIC_LIBRARIES}" "${qt_libs_private}")
qt_generate_plugin_pri_file("${target}" pri_file)
if (NOT BUILD_SHARED_LIBS)
qt_generate_plugin_pri_file("${target}" pri_file)
endif()
if (NOT arg_SKIP_INSTALL)
# Handle creation of cmake files for consumers of find_package().
@ -239,6 +245,9 @@ function(qt_internal_add_plugin target)
TARGETS ${target}
EXPORT_NAME_PREFIX ${INSTALL_CMAKE_NAMESPACE}${target}
CONFIG_INSTALL_DIR "${config_install_dir}")
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(
"${QT_CMAKE_DIR}/QtPluginConfig.cmake.in"
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
@ -256,10 +265,9 @@ function(qt_internal_add_plugin target)
DESTINATION "${config_install_dir}"
COMPONENT Devel
)
qt_install(FILES
"${pri_file}"
DESTINATION "${INSTALL_MKSPECSDIR}/modules"
)
if(pri_file)
qt_install(FILES "${pri_file}" DESTINATION "${INSTALL_MKSPECSDIR}/modules")
endif()
# Make the export name of plugins be consistent with modules, so that
# qt_add_resource adds its additional targets to the same export set in a static Qt build.
@ -284,20 +292,29 @@ function(qt_internal_add_plugin target)
endif()
qt_internal_add_linker_version_script(${target})
qt_add_list_file_finalizer(qt_finalize_plugin ${target} "${install_directory}")
set(finalizer_extra_args "")
if(NOT arg_SKIP_INSTALL)
list(APPEND finalizer_extra_args INSTALL_PATH "${install_directory}")
endif()
qt_add_list_file_finalizer(qt_finalize_plugin ${target} ${finalizer_extra_args})
qt_enable_separate_debug_info(${target} "${install_directory}")
qt_internal_install_pdb_files(${target} "${install_directory}")
if(NOT arg_SKIP_INSTALL)
qt_enable_separate_debug_info(${target} "${install_directory}")
qt_internal_install_pdb_files(${target} "${install_directory}")
endif()
endfunction()
function(qt_finalize_plugin target install_directory)
function(qt_finalize_plugin target)
cmake_parse_arguments(arg "" "INSTALL_PATH" "" ${ARGN})
if(WIN32 AND BUILD_SHARED_LIBS)
_qt_internal_generate_win32_rc_file("${target}")
endif()
# Generate .prl files for plugins of static Qt builds.
if(NOT BUILD_SHARED_LIBS)
qt_generate_prl_file(${target} "${install_directory}")
if(arg_INSTALL_PATH)
qt_generate_prl_file(${target} "${arg_INSTALL_PATH}")
endif()
endif()
endfunction()

View File

@ -13,9 +13,6 @@ if(NOT @BUILD_SHARED_LIBS@)
unset(_aliased_target)
set(_default_plugins_are_enabled "$<NOT:$<STREQUAL:$<GENEX_EVAL:$<TARGET_PROPERTY:QT_DEFAULT_PLUGINS>>,0>>")
# Make sure to boolify the result of the expression, in case if the returned property value
# is empty.
set(_default_plugins_are_enabled_wrapped "$<BOOL:${_default_plugins_are_enabled}>")
set(_manual_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>")
set(_no_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>")
@ -105,7 +102,7 @@ if(NOT @BUILD_SHARED_LIBS@)
"${_plugin_is_in_type_whitelist},"
"${_plugin_versionless_is_in_type_whitelist},"
"$<AND:"
"${_default_plugins_are_enabled_wrapped},"
"${_default_plugins_are_enabled},"
"${_plugin_is_default},"
"${_plugin_is_not_blacklisted}"
">"
@ -119,15 +116,23 @@ if(NOT @BUILD_SHARED_LIBS@)
set(_generated_qt_plugin_file_name
"${CMAKE_CURRENT_BINARY_DIR}/qt_@QT_MODULE@_${target}.cpp")
set(_generated_qt_plugin_file_name_template "${_generated_qt_plugin_file_name}.in")
set(_generated_qt_plugin_file_content "#include <QtPlugin>\nQ_IMPORT_PLUGIN(${_classname})")
# Generate a source file to import that plug-in. Has to be done with configure_file,
# because file(GENERATE) and target_sources has issues with scopes.
file(WRITE "${_generated_qt_plugin_file_name_template}"
"${_generated_qt_plugin_file_content}")
configure_file("${_generated_qt_plugin_file_name_template}"
"${_generated_qt_plugin_file_name}")
# Generate a source file to import that plug-in. Be careful not to
# update the timestamp of the generated file if we are not going to
# change anything. Otherwise we will trigger CMake's autogen to re-run
# and executables will then need to at least relink.
set(need_write TRUE)
if(EXISTS ${_generated_qt_plugin_file_name})
file(READ ${_generated_qt_plugin_file_name} old_contents)
if(old_contents STREQUAL "${_generated_qt_plugin_file_content}")
set(need_write FALSE)
endif()
endif()
if(need_write)
file(WRITE "${_generated_qt_plugin_file_name}"
"${_generated_qt_plugin_file_content}")
endif()
target_sources(${_module_target} INTERFACE
"$<${_plugin_condition}:${_generated_qt_plugin_file_name}>")

View File

@ -549,14 +549,19 @@ endif()\n")
"set(QT_QPA_DEFAULT_PLATFORM \"${QT_QPA_DEFAULT_PLATFORM}\" CACHE STRING \"\")\n")
endif()
# Save the supported and computed minimum CMake versions to ensure the same minimum is
# checked for when building other child repos (qtsvg, etc).
# Save minimum and policy-related CMake versions to ensure the same minimum is
# checked for when building other child repos (qtsvg, etc) and the policy settings
# will be consistent unless the child repos explicitly override them.
qt_internal_get_qt_supported_minimum_cmake_version(min_supported_version)
qt_internal_get_computed_minimum_cmake_version(computed_min_version)
qt_internal_get_min_new_policy_cmake_version(lower_policy_version)
qt_internal_get_max_new_policy_cmake_version(upper_policy_version)
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"set(QT_MIN_SUPPORTED_CMAKE_VERSION \"${min_supported_version}\" CACHE STRING \"Minimum supported CMake version required to build Qt\")\n")
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
"set(QT_COMPUTED_MIN_CMAKE_VERSION \"${computed_min_version}\" CACHE STRING \"Computed minimum CMake version required to build Qt\")\n")
"set(QT_MIN_SUPPORTED_CMAKE_VERSION \"${min_supported_version}\" CACHE STRING \"Minimum supported CMake version required to build Qt\")\n"
"set(QT_COMPUTED_MIN_CMAKE_VERSION \"${computed_min_version}\" CACHE STRING \"Computed minimum CMake version required to build Qt\")\n"
"set(QT_MIN_NEW_POLICY_CMAKE_VERSION \"${lower_policy_version}\" CACHE STRING \"Oldest CMake version for which NEW policies should be enabled\")\n"
"set(QT_MAX_NEW_POLICY_CMAKE_VERSION \"${upper_policy_version}\" CACHE STRING \"Latest CMake version for which NEW policies should be enabled\")\n"
)
# Rpath related things that need to be re-used when building other repos.
string(APPEND QT_EXTRA_BUILD_INTERNALS_VARS
@ -634,7 +639,7 @@ endfunction()
function(qt_modules_process_android_dependencies)
qt_internal_get_qt_repo_known_modules(repo_known_modules)
foreach (target ${repo_known_modules})
qt_android_dependencies(${target})
qt_internal_android_dependencies(${target})
endforeach()
endfunction()
@ -699,10 +704,15 @@ function(qt_internal_create_config_file_for_standalone_tests)
endfunction()
function(qt_internal_install_prl_files)
# Install prl files
# Get locations relative to QT_BUILD_DIR from which prl files should be installed.
get_property(prl_install_dirs GLOBAL PROPERTY QT_PRL_INSTALL_DIRS)
# Clear the list of install dirs so the previous values don't pollute the list of install dirs
# for the next repository in a top-level build.
set_property(GLOBAL PROPERTY QT_PRL_INSTALL_DIRS "")
foreach(prl_install_dir ${prl_install_dirs})
qt_install(DIRECTORY "${PROJECT_BINARY_DIR}/${prl_install_dir}/"
qt_install(DIRECTORY "${QT_BUILD_DIR}/${prl_install_dir}/"
DESTINATION ${prl_install_dir}
FILES_MATCHING PATTERN "*.prl"
)

View File

@ -16,8 +16,9 @@ function(qt_generate_qmake_libraries_pri_content module_name output_root_dir out
list(JOIN implicit_include_dirs_regex "|" implicit_include_dirs_regex)
foreach(lib ${QT_QMAKE_LIBS_FOR_${module_name}})
set(lib_targets ${QT_QMAKE_LIB_TARGETS_${lib}})
set(lib_targets ${QT_TARGETS_OF_QMAKE_LIB_${lib}})
string(TOUPPER ${lib} uclib)
string(REPLACE "-" "_" uclib "${uclib}")
set(lib_defines "")
set(lib_incdir "")
set(lib_libdir "")
@ -116,6 +117,23 @@ function(qt_get_direct_module_dependencies target out_var)
set(${out_var} ${dependencies} PARENT_SCOPE)
endfunction()
# Return a list of qmake library names for a given list of targets.
# For example, Vulkan::Vulkan_nolink is mapped to vulkan/nolink.
function(qt_internal_map_targets_to_qmake_libs out_var)
set(result "")
foreach(target ${ARGN})
string(REGEX REPLACE "_nolink$" "" stripped_target "${target}")
qt_internal_map_target_to_qmake_lib(${stripped_target} qmake_lib)
if(NOT "${qmake_lib}" STREQUAL "")
if(NOT target STREQUAL stripped_target)
string(APPEND qmake_lib "/nolink")
endif()
list(APPEND result "${qmake_lib}")
endif()
endforeach()
set(${out_var} "${result}" PARENT_SCOPE)
endfunction()
# Generates module .pri files for consumption by qmake
function(qt_generate_module_pri_file target)
set(flags INTERNAL_MODULE HEADER_MODULE NO_PRIVATE_MODULE)
@ -146,8 +164,6 @@ function(qt_generate_module_pri_file target)
get_target_property(module_internal_config "${target}"
"${property_prefix}QT_MODULE_INTERNAL_CONFIG")
get_target_property(module_uses "${target}"
"${property_prefix}QT_MODULE_USES")
get_target_property(module_pri_extra_content "${target}"
"${property_prefix}QT_MODULE_PRI_EXTRA_CONTENT")
get_target_property(module_ldflags "${target}"
@ -156,7 +172,7 @@ function(qt_generate_module_pri_file target)
"${property_prefix}QT_MODULE_DEPENDS")
foreach(var enabled_features disabled_features enabled_private_features disabled_private_features
module_internal_config module_uses module_pri_extra_content module_ldflags module_depends)
module_internal_config module_pri_extra_content module_ldflags module_depends)
if(${var} STREQUAL "${var}-NOTFOUND")
set(${var} "")
else()
@ -186,6 +202,9 @@ function(qt_generate_module_pri_file target)
get_target_property(config_module_name ${target} _qt_config_module_name)
get_target_property(qmake_module_config ${target} ${property_prefix}QT_QMAKE_MODULE_CONFIG)
if (arg_HEADER_MODULE)
list(APPEND qmake_module_config "no_link")
endif()
if(qmake_module_config)
string(REPLACE ";" " " module_build_config "${qmake_module_config}")
set(module_build_config "\nQT.${config_module_name}.CONFIG = ${module_build_config}")
@ -269,6 +288,11 @@ function(qt_generate_module_pri_file target)
set(extra_assignments "\nQT_DEFAULT_QPA_PLUGIN = q${QT_QPA_DEFAULT_PLATFORM}")
endif()
# Map the public dependencies of the target to qmake library names.
get_target_property(dep_targets ${target} INTERFACE_LINK_LIBRARIES)
qt_internal_map_targets_to_qmake_libs(module_uses ${dep_targets})
list(JOIN module_uses " " joined_module_uses)
file(GENERATE
OUTPUT "${pri_file_name}"
CONTENT
@ -281,7 +305,7 @@ QT.${config_module_name}.includes = ${public_module_includes}
QT.${config_module_name}.frameworks = ${public_module_frameworks}
QT.${config_module_name}.bins = $$QT_MODULE_BIN_BASE${module_plugin_types_assignment}
QT.${config_module_name}.depends = ${public_module_dependencies}
QT.${config_module_name}.uses = ${module_uses}
QT.${config_module_name}.uses = ${joined_module_uses}
QT.${config_module_name}.module_config = ${joined_module_internal_config}${module_build_config}
QT.${config_module_name}.DEFINES = ${joined_target_defines}
QT.${config_module_name}.enabled_features = ${enabled_features}
@ -309,6 +333,11 @@ ${module_pri_extra_content}
list(APPEND module_internal_config internal_module)
list(JOIN module_internal_config " " joined_module_internal_config)
# Map the public dependencies of the private module to qmake library names.
get_target_property(dep_targets ${target}Private INTERFACE_LINK_LIBRARIES)
qt_internal_map_targets_to_qmake_libs(private_module_uses ${dep_targets})
list(JOIN private_module_uses " " joined_private_module_uses)
# Generate a preliminary qt_lib_XXX_private.pri file
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${private_pri_file_name}"
@ -320,7 +349,7 @@ QT.${config_module_name}_private.libs = $$QT_MODULE_LIB_BASE
QT.${config_module_name}_private.includes = ${private_module_includes}
QT.${config_module_name}_private.frameworks = ${private_module_frameworks}
QT.${config_module_name}_private.depends = ${private_module_dependencies}
QT.${config_module_name}_private.uses =
QT.${config_module_name}_private.uses = ${joined_private_module_uses}
QT.${config_module_name}_private.module_config = ${joined_module_internal_config}
QT.${config_module_name}_private.enabled_features = ${enabled_private_features}
QT.${config_module_name}_private.disabled_features = ${disabled_private_features}"
@ -639,11 +668,11 @@ endfunction()
function(qt_get_build_parts out_var)
set(parts "libs")
if(BUILD_EXAMPLES AND NOT QT_NO_MAKE_EXAMPLES)
if(QT_BUILD_EXAMPLES AND QT_BUILD_EXAMPLES_BY_DEFAULT)
list(APPEND parts "examples")
endif()
if(BUILD_TESTING AND NOT QT_NO_MAKE_TESTS)
if(QT_BUILD_TESTS AND QT_BUILD_TESTS_BY_DEFAULT)
list(APPEND parts "tests")
endif()

View File

@ -188,7 +188,7 @@ function(qt_internal_walk_libs
qt_merge_libs(rcc_objects ${lib_rcc_objects_${target}})
endif()
else()
qt_merge_libs(libs "$<TARGET_FILE:${lib_target}>")
qt_merge_libs(libs "$<TARGET_LINKER_FILE:${lib_target}>")
get_target_property(target_rcc_objects "${lib_target}" _qt_rcc_objects)
if(target_rcc_objects)
@ -283,7 +283,7 @@ function(qt_generate_prl_file target install_dir)
endif()
if(rcc_objects AND QT_WILL_INSTALL)
list(TRANSFORM rcc_objects PREPEND "$$[QT_INSTALL_LIBS]/")
list(TRANSFORM rcc_objects PREPEND "$$[QT_INSTALL_PREFIX]/")
endif()
# Generate a preliminary .prl file that contains absolute paths to all libraries
@ -334,7 +334,7 @@ function(qt_generate_prl_file target install_dir)
set(prl_step1_content
"RCC_OBJECTS = ${rcc_objects}
QMAKE_PRL_BUILD_DIR = ${CMAKE_CURRENT_BINARY_DIR}
QMAKE_PRL_TARGET = $<TARGET_FILE_NAME:${target}>
QMAKE_PRL_TARGET = $<TARGET_LINKER_FILE_NAME:${target}>
QMAKE_PRL_CONFIG = ${prl_config}
QMAKE_PRL_VERSION = ${PROJECT_VERSION}
${prl_step1_content_libs}

View File

@ -603,6 +603,30 @@ function(guess_compiler_from_mkspec)
set(cmake_args "${cmake_args}" PARENT_SCOPE)
endfunction()
function(check_qt_build_parts type)
set(input "INPUT_${type}")
set(buildFlag "TRUE")
if("${type}" STREQUAL "nomake")
set(buildFlag "FALSE")
endif()
list(APPEND knownParts "tests" "examples" "benchmarks")
foreach(part ${${input}})
if(part IN_LIST knownParts)
qt_feature_normalize_name("${part}" partUpperCase)
string(TOUPPER "${partUpperCase}" partUpperCase)
push("-DQT_BUILD_${partUpperCase}=${buildFlag}")
continue()
elseif("${part}" STREQUAL "tools" AND "${type}" STREQUAL "make")
# default true ignored
continue()
endif()
qtConfAddWarning("'-${type} ${part}' is not implemented yet.")
endforeach()
set(cmake_args "${cmake_args}" PARENT_SCOPE)
endfunction()
drop_input(commercial)
drop_input(confirm-license)
translate_boolean_input(precompile_header BUILD_WITH_PCH)
@ -614,12 +638,13 @@ translate_string_input(qt_libinfix QT_LIBINFIX)
translate_string_input(qreal QT_COORD_TYPE)
translate_path_input(prefix CMAKE_INSTALL_PREFIX)
translate_path_input(extprefix CMAKE_STAGING_PREFIX)
foreach(kind bin lib archdata libexec qml data doc translation sysconf examples tests)
foreach(kind bin lib archdata libexec qml data doc sysconf examples tests)
string(TOUPPER ${kind} uc_kind)
translate_path_input(${kind}dir INSTALL_${uc_kind}DIR)
endforeach()
translate_path_input(headerdir INSTALL_INCLUDEDIR)
translate_path_input(plugindir INSTALL_PLUGINSDIR)
translate_path_input(translationdir INSTALL_TRANSLATIONSDIR)
if(NOT "${INPUT_device}" STREQUAL "")
push("-DQT_QMAKE_TARGET_MKSPEC=devices/${INPUT_device}")
@ -662,33 +687,8 @@ endif()
drop_input(make)
drop_input(nomake)
foreach(part ${INPUT_nomake})
if("${part}" STREQUAL "tests")
push("-DBUILD_TESTING=OFF")
continue()
endif()
if("${part}" STREQUAL "examples")
push("-DBUILD_EXAMPLES=OFF")
continue()
endif()
qtConfAddWarning("'-nomake ${part}' is not implemented yet.")
endforeach()
foreach(part ${INPUT_make})
if("${part}" STREQUAL "tests")
push("-DBUILD_TESTING=ON")
continue()
endif()
if("${part}" STREQUAL "examples")
push("-DBUILD_EXAMPLES=ON")
continue()
endif()
if("${part}" STREQUAL "tools")
# default
continue()
endif()
qtConfAddWarning("'-make ${part}' is not implemented yet.")
endforeach()
check_qt_build_parts(nomake)
check_qt_build_parts(make)
drop_input(debug)
drop_input(release)
@ -727,11 +727,6 @@ if("${INPUT_ltcg}" STREQUAL "yes")
endforeach()
endif()
if(NOT "${INPUT_opengl}" STREQUAL "")
drop_input(opengl)
push("-DINPUT_opengl=${INPUT_opengl}")
endif()
translate_list_input(device-option QT_QMAKE_DEVICE_OPTIONS)
translate_list_input(defines QT_EXTRA_DEFINES)
translate_list_input(fpaths QT_EXTRA_FRAMEWORKPATHS)
@ -739,13 +734,6 @@ translate_list_input(includes QT_EXTRA_INCLUDEPATHS)
translate_list_input(lpaths QT_EXTRA_LIBDIRS)
translate_list_input(rpaths QT_EXTRA_RPATHS)
foreach(feature ${commandline_known_features})
qt_feature_normalize_name("${feature}" cmake_feature)
if(${feature} IN_LIST config_inputs)
translate_boolean_input(${feature} INPUT_${cmake_feature})
endif()
endforeach()
foreach(input ${config_inputs})
qt_feature_normalize_name("${input}" cmake_input)
push("-DINPUT_${cmake_input}=${INPUT_${input}}")
@ -775,6 +763,16 @@ if(NOT generator AND auto_detect_generator)
endif()
endif()
endif()
if(multi_config
AND NOT "${generator}" STREQUAL "Xcode"
AND NOT "${generator}" STREQUAL "Ninja Multi-Config"
AND NOT "${generator}" MATCHES "^Visual Studio")
message(FATAL_ERROR "Multi-config build is only supported by Xcode, Ninja Multi-Config and \
Visual Studio generators. Current generator is \"${generator}\".
Note: Use '-cmake-generator <generator name>' option to specify the generator manually.")
endif()
if(generator)
push(-G "${generator}")
endif()

View File

@ -141,23 +141,6 @@ Prefix=${prefix}
")
endif()
if(NOT QT_WILL_INSTALL)
# The shadow build directory of a non-prefix build does not contain a copy of the mkspecs
# directory. Let $$[QT_HOST_DATA/src] point to the qtbase source directory.
string(APPEND content "[EffectiveSourcePaths]
HostData=${CMAKE_CURRENT_SOURCE_DIR}
")
# Set $$[QT_HOST_DATA/get] to avoid falling back to the source dir where it isn't explicitly
# requested.
# Also make sure to specify the Prefix as well, because it doesn't get inherited from the
# [Paths] section.
string(APPEND content "[EffectivePaths]
HostData=${ext_prefix}
Prefix=${ext_prefix_relative_to_conf_file}
")
endif()
string(APPEND content
"[Paths]
Prefix=${ext_prefix_relative_to_conf_file}

View File

@ -19,26 +19,64 @@ function(qt_internal_add_resource target resourceName)
if (out_targets)
qt_install(TARGETS ${out_targets}
EXPORT "${INSTALL_CMAKE_NAMESPACE}${target}Targets"
DESTINATION ${INSTALL_LIBDIR}
DESTINATION "${INSTALL_LIBDIR}"
)
qt_internal_record_rcc_object_files("${target}" "${out_targets}")
qt_internal_record_rcc_object_files("${target}" "${out_targets}"
INSTALL_LOCATION "${INSTALL_LIBDIR}")
endif()
endfunction()
function(qt_internal_record_rcc_object_files target resource_targets)
set(args_optional "")
set(args_single INSTALL_LOCATION)
set(args_multi "")
cmake_parse_arguments(arg
"${args_optional}"
"${args_single}"
"${args_multi}"
${ARGN}
)
foreach(out_target ${resource_targets})
get_target_property(resource_name ${out_target} _qt_resource_name)
if(NOT resource_name)
continue()
endif()
if(QT_WILL_INSTALL)
# Compute the install location of the rcc object file.
# This is the relative path below the install destination (install_prefix/lib).
# See CMake's computeInstallObjectDir function.
set(object_file_name "qrc_${resource_name}.cpp${CMAKE_CXX_OUTPUT_EXTENSION}")
# Compute the install location of a resource object file in a prefix build.
# It's comprised of thee following path parts:
#
# part (1) INSTALL_LOCATION.
# A usual value is '${INSTALL_LIBDIR}/' for libraries
# and '${INSTALL_QMLDIR}/foo/bar/' for qml plugin resources.
#
# part (2) the value computed by CMake's computeInstallObjectDir comprised of an
# objects-<CONFIG> dir and the target name of the object library.
# Example: objects-$<CONFIG>/Gui_resources_qpdf
#
# part (3) path to the object file, relative to it's build directory.
# Example: .rcc/qrc_qpdf.cpp.o
#
# The final path is relative to CMAKE_INSTALL_PREFIX aka $qt_install_prefix.
#
# The relative path will be transformed into an absolute path when generating .prl
# files, by prepending $$[QT_INSTALL_PREFIX]/.
get_target_property(generated_cpp_file_relative_path
${out_target}
_qt_resource_generated_cpp_relative_path)
set(object_file_name "${generated_cpp_file_relative_path}${CMAKE_CXX_OUTPUT_EXTENSION}")
qt_path_join(rcc_object_file_path
"objects-$<CONFIG>" ${out_target} .rcc "${object_file_name}")
"objects-$<CONFIG>" ${out_target} "${object_file_name}")
if(arg_INSTALL_LOCATION)
qt_path_join(rcc_object_file_path
"${arg_INSTALL_LOCATION}" "${rcc_object_file_path}")
else()
message(FATAL_ERROR "No install location given for object files to be installed"
" for the following resource target: '${out_target}'")
endif()
else()
# In a non-prefix build we use the object file paths right away.
set(rcc_object_file_path $<TARGET_OBJECTS:$<TARGET_NAME:${out_target}>>)
@ -48,5 +86,7 @@ function(qt_internal_record_rcc_object_files target resource_targets)
# Make sure that the target cpp files are compiled with the regular Qt internal compile
# flags, needed for building iOS apps with qmake where bitcode is involved.
target_link_libraries("${out_target}" PRIVATE Qt::PlatformModuleInternal)
qt_set_common_target_properties(${out_target})
endforeach()
endfunction()

View File

@ -1,24 +1,38 @@
# Add a finalizer function for the current CMake list file.
# It will be processed just before leaving the current source directory scope.
#
# When using CMake 3.18 or lower:
# You may add up to nine arguments that are passed to the finalizer.
# A finalizer that is registered with qt_add_list_file_finalizer(foo bar baz)
# will be called with nine arguments: foo(bar baz IGNORE IGNORE IGNORE...),
# because CMake's handling of empty list elements is a cruel joke.
#
# For CMake < 3.18 the function qt_watch_current_list_dir must know about the finalizer.
#
# When using CMake 3.19 or higher, no more INGORE parameters are passed. Instead we
# use cmake_language(DEFER CALL) and pass arguments as usual.
# qt_watch_current_list_dir also doesn't need to know about the finalizer
function(qt_add_list_file_finalizer func)
set_property(GLOBAL APPEND
PROPERTY QT_LIST_FILE_FINALIZER_FILES "${CMAKE_CURRENT_LIST_FILE}")
set_property(GLOBAL APPEND
PROPERTY QT_LIST_FILE_FINALIZER_FUNCS ${func})
foreach(i RANGE 1 9)
set(arg "${ARGV${i}}")
if(i GREATER_EQUAL ARGC OR "${arg}" STREQUAL "")
set(arg "IGNORE")
endif()
set(use_cmake_defer_call TRUE)
if(CMAKE_VERSION VERSION_LESS "3.19.0")
set(use_cmake_defer_call FALSE)
endif()
if(use_cmake_defer_call)
cmake_language(EVAL CODE "cmake_language(DEFER CALL \"${func}\" ${ARGN}) ")
else()
set_property(GLOBAL APPEND
PROPERTY QT_LIST_FILE_FINALIZER_ARGV${i} "${arg}")
endforeach()
PROPERTY QT_LIST_FILE_FINALIZER_FILES "${CMAKE_CURRENT_LIST_FILE}")
set_property(GLOBAL APPEND
PROPERTY QT_LIST_FILE_FINALIZER_FUNCS ${func})
foreach(i RANGE 1 9)
set(arg "${ARGV${i}}")
if(i GREATER_EQUAL ARGC OR "${arg}" STREQUAL "")
set(arg "IGNORE")
endif()
set_property(GLOBAL APPEND
PROPERTY QT_LIST_FILE_FINALIZER_ARGV${i} "${arg}")
endforeach()
endif()
endfunction()
# Watcher function for the variable CMAKE_CURRENT_LIST_DIR.

View File

@ -5,8 +5,14 @@
set(QT_BUILDING_QT TRUE CACHE
TYPE STRING "When this is present and set to true, it signals that we are building Qt from source.")
# Pre-calculate the developer_build feature if it's set by the user via INPUT_developer_build
if(NOT FEATURE_developer_build AND INPUT_developer_build
AND NOT "${INPUT_developer_build}" STREQUAL "undefined")
set(FEATURE_developer_build ON)
endif()
set(_default_build_type "Release")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
if(FEATURE_developer_build)
set(_default_build_type "Debug")
endif()
@ -54,12 +60,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Do not relink dependent libraries when no header has changed:
set(CMAKE_LINK_DEPENDS_NO_SHARED ON)
# Pre-calculate the developer_build feature if it's set by the user via INPUT_developer_build
if(NOT FEATURE_developer_build AND INPUT_developer_build
AND NOT "${INPUT_developer_build}" STREQUAL "undefined")
set(FEATURE_developer_build ON)
endif()
# Detect non-prefix builds: either when the qtbase install prefix is set to the binary dir
# or when a developer build is explicitly enabled and no install prefix is specified.
# This detection only happens when building qtbase, and later is propagated via the generated
@ -106,13 +106,13 @@ if(FEATURE_developer_build)
else()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
set(QT_BUILD_TESTING ON)
set(_qt_build_tests_default ON)
set(__build_benchmarks ON)
# Tests are not built by default with qmake for iOS and friends, and thus the overall build
# tends to fail. Disable them by default when targeting uikit.
if(UIKIT OR ANDROID)
set(QT_BUILD_TESTING OFF)
set(_qt_build_tests_default OFF)
endif()
# Disable benchmarks for single configuration generators which do not build
@ -121,44 +121,49 @@ if(FEATURE_developer_build)
set(__build_benchmarks OFF)
endif()
else()
set(QT_BUILD_TESTING OFF)
set(_qt_build_tests_default OFF)
set(__build_benchmarks OFF)
endif()
## Set up testing
option(BUILD_TESTING "Build the testing tree." ${QT_BUILD_TESTING})
if(QT_BUILD_STANDALONE_TESTS)
set(QT_BUILD_TESTING ON)
# Build Benchmarks
option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks})
if(QT_BUILD_BENCHMARKS)
set(_qt_build_tests_default ON)
endif()
## Set up testing
option(QT_BUILD_TESTS "Build the testing tree." ${_qt_build_tests_default})
unset(_qt_build_tests_default)
option(QT_BUILD_TESTS_BY_DEFAULT "Should tests be built as part of the default 'all' target." ON)
if(QT_BUILD_STANDALONE_TESTS)
# BuildInternals might have set it to OFF on initial configuration. So force it to ON when
# building standalone tests.
set(BUILD_TESTING ON CACHE BOOL "Build the testing tree." FORCE)
set(QT_BUILD_TESTS ON CACHE BOOL "Build the testing tree." FORCE)
# Also force the tests to be built as part of the default build target.
set(QT_NO_MAKE_TESTS OFF CACHE BOOL
"Should examples be built as part of the default 'all' target." FORCE)
set(QT_BUILD_TESTS_BY_DEFAULT ON CACHE BOOL
"Should tests be built as part of the default 'all' target." FORCE)
endif()
option(QT_NO_MAKE_TESTS "Should tests be built as part of the default 'all' target." OFF)
set(BUILD_TESTING ${QT_BUILD_TESTS} CACHE INTERNAL "")
# When cross-building, we don't build tools by default. Sometimes this also covers Qt apps as well.
# Like in qttools/assistant/assistant.pro, load(qt_app), which is guarded by a qtNomakeTools() call.
set(qt_no_make_tools_default OFF)
set(_qt_build_tools_by_default_default ON)
if(CMAKE_CROSSCOMPILING AND NOT QT_BUILD_TOOLS_WHEN_CROSSCOMPILING)
set(qt_no_make_tools_default ON)
set(_qt_build_tools_by_default_default OFF)
endif()
option(QT_NO_MAKE_TOOLS "Should tools be built as part of the default 'all' target."
"${qt_no_make_tools_default}")
unset(qt_no_make_tools_default)
option(QT_BUILD_TOOLS_BY_DEFAULT "Should tools be built as part of the default 'all' target."
"${_qt_build_tools_by_default_default}")
unset(_qt_build_tools_by_default_default)
include(CTest)
enable_testing()
option(BUILD_EXAMPLES "Build Qt examples" OFF)
option(QT_NO_MAKE_EXAMPLES "Should examples be built as part of the default 'all' target." OFF)
option(QT_BUILD_EXAMPLES "Build Qt examples" OFF)
option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON)
# Build Benchmarks
option(QT_BUILD_BENCHMARKS "Build Qt Benchmarks" ${__build_benchmarks})
option(QT_BUILD_MANUAL_TESTS "Build Qt manual tests" OFF)
## Find host tools (if non native):
set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.")
@ -169,11 +174,12 @@ if (CMAKE_CROSSCOMPILING)
endif()
endif()
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
find_package(Qt${PROJECT_VERSION_MAJOR}HostInfo
CONFIG
REQUIRED
PATHS "${QT_HOST_PATH}" "${QT_HOST_PATH}/lib/cmake"
PATHS "${QT_HOST_PATH}"
"${QT_HOST_PATH_CMAKE_DIR}"
NO_CMAKE_FIND_ROOT_PATH
NO_DEFAULT_PATH)
endif()
@ -217,3 +223,27 @@ if(QT_USE_CCACHE)
message(WARNING "Ccache use was requested, but the program was not found.")
endif()
endif()
# We need to clean up QT_FEATURE_*, but only once per configuration cycle
get_property(qt_feature_clean GLOBAL PROPERTY _qt_feature_clean)
if(NOT qt_feature_clean)
message(STATUS "Check for feature set changes")
set_property(GLOBAL PROPERTY _qt_feature_clean TRUE)
foreach(feature ${QT_KNOWN_FEATURES})
if(DEFINED "FEATURE_${feature}" AND
NOT "${QT_FEATURE_${feature}}" STREQUAL "${FEATURE_${feature}}")
message(" '${feature}' is changed from ${QT_FEATURE_${feature}} \
to ${FEATURE_${feature}}")
set(dirty_build TRUE)
endif()
unset("QT_FEATURE_${feature}" CACHE)
endforeach()
set(QT_KNOWN_FEATURES "" CACHE INTERNAL "" FORCE)
if(dirty_build)
set_property(GLOBAL PROPERTY _qt_dirty_build TRUE)
message(WARNING "Re-configuring in existing build folder. \
Some features will be re-evaluated automatically.")
endif()
endif()

View File

@ -27,7 +27,7 @@ function(qt_ensure_sync_qt)
qt_path_join(syncqt_install_dir ${QT_INSTALL_DIR} ${INSTALL_BINDIR})
qt_copy_or_install(PROGRAMS "${SYNCQT_FROM_SOURCE}"
DESTINATION "${syncqt_install_dir}")
elseif(QT_HOST_PATH)
elseif(NOT "${QT_HOST_PATH}" STREQUAL "")
get_filename_component(syncqt_absolute_path
"${QT_HOST_PATH}/${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_LIBEXECDIR}/syncqt.pl"
ABSOLUTE)

View File

@ -188,15 +188,15 @@ function(qt_set_common_target_properties target)
OBJCXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN 1)
endif()
if(FEATURE_static_runtime)
if(MSVC)
set_property(TARGET ${target} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
elseif(MINGW)
target_link_options(${target} INTERFACE "LINKER:-static")
endif()
endif()
qt_internal_set_compile_pdb_names("${target}")
if(QT_FEATURE_static_runtime)
if(MSVC)
set_property(TARGET ${target} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
elseif(MINGW)
target_link_options(${target} INTERFACE "LINKER:-static")
endif()
endif()
qt_internal_set_compile_pdb_names("${target}")
endfunction()
# Set common, informational target properties.
@ -501,7 +501,7 @@ function(qt_internal_create_tracepoints name tracepoints_file)
set(tracegen_arg "etw")
endif()
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
qt_path_join(tracegen
"${QT_HOST_PATH}"
"${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_BINDIR}"

View File

@ -33,6 +33,28 @@ function(qt_internal_add_benchmark target)
${exec_args}
)
qt_internal_collect_command_environment(benchmark_env_path benchmark_env_plugin_path)
# Add a ${target}_benchmark generator target, to run single benchmark more easily.
set(benchmark_wrapper_file "${arg_OUTPUT_DIRECTORY}/${target}Wrapper$<CONFIG>.cmake")
qt_internal_create_command_script(COMMAND "$<TARGET_FILE:${target}>"
OUTPUT_FILE "${benchmark_wrapper_file}"
ENVIRONMENT "PATH" "${benchmark_env_path}"
"QT_PLUGIN_PATH" "${benchmark_env_plugin_path}"
)
add_custom_target("${target}_benchmark"
VERBATIM
COMMENT "Running benchmark ${target}"
COMMAND "${CMAKE_COMMAND}" "-P" "${benchmark_wrapper_file}"
)
add_dependencies("${target}_benchmark" "${target}")
# Add benchmark to meta target if it exists.
if (TARGET benchmark)
add_dependencies("benchmark" "${target}_benchmark")
endif()
endfunction()
# Simple wrapper around qt_internal_add_executable for manual tests which insure that
@ -141,10 +163,18 @@ function(qt_internal_setup_docker_test_fixture name)
endfunction()
# This function creates a CMake test target with the specified name for use with CTest.
#
# All tests are wrapped with cmake script that supports TESTARGS and TESTRUNNER environment
# variables handling. Endpoint wrapper may be used standalone as cmake script to run tests e.g.:
# TESTARGS="-o result.xml,xunitxml" TESTRUNNER="testrunner --arg" ./tst_simpleTestWrapper.cmake
# On non-UNIX machine you may need to use 'cmake -P' explicitly to execute wrapper.
# You may avoid test wrapping by either passing NO_WRAPPER option or switching QT_NO_TEST_WRAPPERS
# to ON. This is helpful if you want to use internal CMake tools within tests, like memory or
# sanitizer checks. See https://cmake.org/cmake/help/v3.19/manual/ctest.1.html#ctest-memcheck-step
function(qt_internal_add_test name)
# EXCEPTIONS is a noop as they are enabled by default.
qt_parse_all_arguments(arg "qt_add_test"
"RUN_SERIAL;EXCEPTIONS;NO_EXCEPTIONS;GUI;QMLTEST;CATCH;LOWDPI"
"RUN_SERIAL;EXCEPTIONS;NO_EXCEPTIONS;GUI;QMLTEST;CATCH;LOWDPI;NO_WRAPPER"
"OUTPUT_DIRECTORY;WORKING_DIRECTORY;TIMEOUT;VERSION"
"QML_IMPORTPATH;TESTDATA;QT_TEST_SERVER_LIST;${__default_private_args};${__default_public_args}" ${ARGN}
)
@ -208,7 +238,6 @@ function(qt_internal_add_test name)
set_property(TARGET "${name}" PROPERTY WIN32_EXECUTABLE FALSE)
# QMLTest specifics
qt_internal_extend_target("${name}" CONDITION arg_QMLTEST
PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::QuickTest
)
@ -222,6 +251,11 @@ function(qt_internal_add_test name)
DEFINES
QUICK_TEST_SOURCE_DIR=":/"
)
# Android requires Qt::Gui so add it by default for tests
qt_internal_extend_target("${name}" CONDITION ANDROID
PUBLIC_LIBRARIES ${QT_CMAKE_EXPORT_NAMESPACE}::Gui
)
endif()
foreach(path IN LISTS arg_QML_IMPORTPATH)
@ -241,7 +275,8 @@ function(qt_internal_add_test name)
endif()
if (ANDROID)
qt_internal_android_add_test("${name}")
qt_internal_android_test_arguments("${name}" test_executable extra_test_args)
set(test_working_dir "${CMAKE_CURRENT_BINARY_DIR}")
else()
if(arg_QMLTEST AND NOT arg_SOURCES)
set(test_working_dir "${CMAKE_CURRENT_SOURCE_DIR}")
@ -258,67 +293,53 @@ function(qt_internal_add_test name)
endif()
if (NOT arg_CATCH)
list(APPEND test_outputs "-o" "${name}.xml,xml" "-o" "-,txt")
endif()
add_test(NAME "${name}" COMMAND ${test_executable} ${extra_test_args} ${test_outputs} WORKING_DIRECTORY "${test_working_dir}")
if (arg_QT_TEST_SERVER_LIST)
qt_internal_setup_docker_test_fixture(${name} ${arg_QT_TEST_SERVER_LIST})
#TODO: Should we replace this by TESTARGS environment variable?
list(APPEND extra_test_args "-o" "${name}.xml,xml" "-o" "-,txt")
endif()
endif()
qt_internal_collect_command_environment(test_env_path test_env_plugin_path)
if(arg_NO_WRAPPER OR QT_NO_TEST_WRAPPERS)
add_test(NAME "${name}" COMMAND ${test_executable} ${extra_test_args}
WORKING_DIRECTORY "${test_working_dir}")
set_property(TEST "${name}" APPEND PROPERTY
ENVIRONMENT "PATH=${test_env_path}"
"QT_TEST_RUNNING_IN_CTEST=1"
"QT_PLUGIN_PATH=${test_env_plugin_path}"
)
else()
set(test_wrapper_file "${CMAKE_CURRENT_BINARY_DIR}/${name}Wrapper$<CONFIG>.cmake")
qt_internal_create_test_script(NAME "${name}"
COMMAND "${test_executable}"
ARGS "${extra_test_args}"
WORKING_DIRECTORY "${test_working_dir}"
OUTPUT_FILE "${test_wrapper_file}"
ENVIRONMENT "QT_TEST_RUNNING_IN_CTEST" 1
"PATH" "${test_env_path}"
"QT_PLUGIN_PATH" "${test_env_plugin_path}"
)
endif()
if(arg_QT_TEST_SERVER_LIST AND NOT ANDROID)
qt_internal_setup_docker_test_fixture(${name} ${arg_QT_TEST_SERVER_LIST})
endif()
set_tests_properties("${name}" PROPERTIES RUN_SERIAL "${arg_RUN_SERIAL}" LABELS "${label}")
if (arg_TIMEOUT)
set_tests_properties(${name} PROPERTIES TIMEOUT ${arg_TIMEOUT})
endif()
# Add a ${target}/check makefile target, to more easily test one test.
if(TEST "${name}")
add_custom_target("${name}_check"
VERBATIM
COMMENT "Running ${CMAKE_CTEST_COMMAND} -V -R \"^${name}$\""
COMMAND "${CMAKE_CTEST_COMMAND}" -V -R "^${name}$"
)
if(TARGET "${name}")
add_dependencies("${name}_check" "${name}")
endif()
add_custom_target("${name}_check"
VERBATIM
COMMENT "Running ${CMAKE_CTEST_COMMAND} -V -R \"^${name}$\""
COMMAND "${CMAKE_CTEST_COMMAND}" -V -R "^${name}$"
)
if(TARGET "${name}")
add_dependencies("${name}_check" "${name}")
endif()
# Get path to <qt_relocatable_install_prefix>/bin, as well as CMAKE_INSTALL_PREFIX/bin, then
# prepend them to the PATH environment variable.
# It's needed on Windows to find the shared libraries and plugins.
# qt_relocatable_install_prefix is dynamically computed from the location of where the Qt CMake
# package is found.
# The regular CMAKE_INSTALL_PREFIX can be different for example when building standalone tests.
# Any given CMAKE_INSTALL_PREFIX takes priority over qt_relocatable_install_prefix for the
# PATH environment variable.
set(install_prefixes "${CMAKE_INSTALL_PREFIX}")
if(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX)
list(APPEND install_prefixes "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
endif()
set(test_env_path "PATH=${CMAKE_CURRENT_BINARY_DIR}")
foreach(install_prefix ${install_prefixes})
set(test_env_path "${test_env_path}${QT_PATH_SEPARATOR}${install_prefix}/${INSTALL_BINDIR}")
endforeach()
set(test_env_path "${test_env_path}${QT_PATH_SEPARATOR}$ENV{PATH}")
string(REPLACE ";" "\;" test_env_path "${test_env_path}")
set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "${test_env_path}")
set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_TEST_RUNNING_IN_CTEST=1")
# Add the install prefix to list of plugin paths when doing a prefix build
if(NOT QT_INSTALL_DIR)
foreach(install_prefix ${install_prefixes})
list(APPEND plugin_paths "${install_prefix}/${INSTALL_PLUGINSDIR}")
endforeach()
endif()
#TODO: Collect all paths from known repositories when performing a super
# build.
list(APPEND plugin_paths "${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}")
list(JOIN plugin_paths "${QT_PATH_SEPARATOR}" plugin_paths_joined)
set_property(TEST "${name}" APPEND PROPERTY ENVIRONMENT "QT_PLUGIN_PATH=${plugin_paths_joined}")
if(ANDROID OR IOS OR WINRT)
set(builtin_testdata TRUE)
endif()
@ -376,6 +397,179 @@ function(qt_internal_add_test name)
endfunction()
# This function adds test with specified NAME and wraps given test COMMAND with standalone cmake
# script.
#
# NAME must be compatible with add_test function, since it's propagated as is.
# COMMAND might be either target or path to executable. When test is called either by ctest or
# directly by 'cmake -P path/to/scriptWrapper.cmake', COMMAND will be executed in specified
# WORKING_DIRECTORY with arguments specified in ARGS.
#
# See also qt_internal_create_command_script for details.
function(qt_internal_create_test_script)
#This style of parsing keeps ';' in ENVIRONMENT variables
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"NAME;COMMAND;OUTPUT_FILE;WORKING_DIRECTORY"
"ARGS;ENVIRONMENT;PRE_RUN;POST_RUN"
)
if(NOT arg_COMMAND)
message(FATAL_ERROR "qt_internal_create_test_script: Test COMMAND is not specified")
endif()
if(NOT arg_NAME)
message(FATAL_ERROR "qt_internal_create_test_script: Test NAME is not specified")
endif()
if(NOT arg_OUTPUT_FILE)
message(FATAL_ERROR "qt_internal_create_test_script: Test Wrapper OUTPUT_FILE\
is not specified")
endif()
if(arg_PRE_RUN)
message(WARNING "qt_internal_create_test_script: PRE_RUN is not acceptable argument\
for this function. Will be ignored")
endif()
if(arg_POST_RUN)
message(WARNING "qt_internal_create_test_script: POST_RUN is not acceptable argument\
for this function. Will be ignored")
endif()
if(arg_ARGS)
set(command_args ${arg_ARGS})# Avoid "${arg_ARGS}" usage and let cmake expand string to
# semicolon-separated list
qt_internal_wrap_command_arguments(command_args)
endif()
if(TARGET ${arg_COMMAND})
set(executable_file "$<TARGET_FILE:${arg_COMMAND}>")
else()
set(executable_file "${arg_COMMAND}")
endif()
add_test(NAME "${arg_NAME}" COMMAND "${CMAKE_COMMAND}" "-P" "${arg_OUTPUT_FILE}"
WORKING_DIRECTORY "${arg_WORKING_DIRECTORY}")
# If crosscompiling is enabled, we should avoid run cmake in emulator environment.
# Prepend emulator to test command in generated cmake script instead. Keep in mind that
# CROSSCOMPILING_EMULATOR don't check if actual cross compilation is configured,
# emulator is prepended independently.
if(CMAKE_CROSSCOMPILING)
get_test_property(${arg_NAME} CROSSCOMPILING_EMULATOR crosscompiling_emulator)
if(NOT crosscompiling_emulator)
set(crosscompiling_emulator "")
else()
qt_internal_wrap_command_arguments(crosscompiling_emulator)
endif()
endif()
qt_internal_create_command_script(COMMAND "${crosscompiling_emulator} \${env_test_runner} \
\"${executable_file}\" \${env_test_args} ${command_args}"
OUTPUT_FILE "${arg_OUTPUT_FILE}"
WORKING_DIRECTORY "${arg_WORKING_DIRECTORY}"
ENVIRONMENT ${arg_ENVIRONMENT}
PRE_RUN "separate_arguments(env_test_args NATIVE_COMMAND \
\"\$ENV{TESTARGS}\")"
"separate_arguments(env_test_runner NATIVE_COMMAND \
\"\$ENV{TESTRUNNER}\")"
)
endfunction()
# This function wraps COMMAND with cmake script, that makes possible standalone run with external
# arguments.
#
# Generated wrapper will be written to OUTPUT_FILE.
# If WORKING_DIRECTORY is not set COMMAND will be executed in CMAKE_CURRENT_BINARY_DIR.
# Variables from ENVIRONMENT will be set before COMMAND execution.
# PRE_RUN and POST_RUN arguments may contain extra cmake code that supposed to be executed before
# and after COMMAND, respectively. Both arguments accept a list of cmake script language
# constructions. Each item of the list will be concantinated into single string with '\n' sepatator.
function(qt_internal_create_command_script)
#This style of parsing keeps ';' in ENVIRONMENT variables
cmake_parse_arguments(PARSE_ARGV 0 arg
""
"OUTPUT_FILE;WORKING_DIRECTORY"
"COMMAND;ENVIRONMENT;PRE_RUN;POST_RUN"
)
if(NOT arg_COMMAND)
message(FATAL_ERROR "qt_internal_create_command_script: COMMAND is not specified")
endif()
if(NOT arg_OUTPUT_FILE)
message(FATAL_ERROR "qt_internal_create_command_script: Wrapper OUTPUT_FILE\
is not specified")
endif()
if(NOT arg_WORKING_DIRECTORY)
set(arg_WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endif()
set(environment_extras)
set(skipNext false)
if(arg_ENVIRONMENT)
list(LENGTH arg_ENVIRONMENT length)
math(EXPR length "${length} - 1")
foreach(envIdx RANGE ${length})
if(skipNext)
set(skipNext FALSE)
continue()
endif()
set(envVariable "")
set(envValue "")
list(GET arg_ENVIRONMENT ${envIdx} envVariable)
math(EXPR envIdx "${envIdx} + 1")
if (envIdx LESS_EQUAL ${length})
list(GET arg_ENVIRONMENT ${envIdx} envValue)
endif()
if(NOT "${envVariable}" STREQUAL "")
set(environment_extras "${environment_extras}\nset(ENV{${envVariable}} \
\"${envValue}\")")
endif()
set(skipNext TRUE)
endforeach()
endif()
#Escaping environment variables before expand them by file GENERATE
string(REPLACE "\\" "\\\\" environment_extras "${environment_extras}")
if(WIN32)
# It's necessary to call actual test inside 'cmd.exe', because 'execute_process' uses
# SW_HIDE to avoid showing a console window, it affects other GUI as well.
# See https://gitlab.kitware.com/cmake/cmake/-/issues/17690 for details.
set(extra_runner "cmd /c")
endif()
if(arg_PRE_RUN)
string(JOIN "\n" pre_run ${arg_PRE_RUN})
endif()
if(arg_POST_RUN)
string(JOIN "\n" post_run ${arg_POST_RUN})
endif()
file(GENERATE OUTPUT "${arg_OUTPUT_FILE}" CONTENT
"#!${CMAKE_COMMAND} -P
# Qt generated command wrapper
${environment_extras}
${pre_run}
execute_process(COMMAND ${extra_runner} ${arg_COMMAND}
WORKING_DIRECTORY \"${arg_WORKING_DIRECTORY}\"
RESULT_VARIABLE result
)
${post_run}
if(NOT result EQUAL 0)
string(JOIN \" \" full_command ${arg_COMMAND})
message(FATAL_ERROR \"\${full_command} execution failed.\")
endif()"
)
endfunction()
# This function creates an executable for use as a helper program with tests. Some
# tests launch separate programs to test certain input/output behavior.
@ -413,3 +607,49 @@ function(qt_internal_add_test_helper name)
qt_internal_add_executable("${name}" NO_INSTALL ${extra_args_to_pass} ${forward_args})
endfunction()
function(qt_internal_wrap_command_arguments argument_list)
list(TRANSFORM ${argument_list} REPLACE "^(.+)$" "[=[\\1]=]")
list(JOIN ${argument_list} " " ${argument_list})
set(${argument_list} "${${argument_list}}" PARENT_SCOPE)
endfunction()
function(qt_internal_collect_command_environment out_path out_plugin_path)
# Get path to <qt_relocatable_install_prefix>/bin, as well as CMAKE_INSTALL_PREFIX/bin, and
# combine them with the PATH environment variable.
# It's needed on Windows to find the shared libraries and plugins.
# qt_relocatable_install_prefix is dynamically computed from the location of where the Qt CMake
# package is found.
# The regular CMAKE_INSTALL_PREFIX can be different for example when building standalone tests.
# Any given CMAKE_INSTALL_PREFIX takes priority over qt_relocatable_install_prefix for the
# PATH environment variable.
set(install_prefixes "${CMAKE_INSTALL_PREFIX}")
if(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX)
list(APPEND install_prefixes "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}")
endif()
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" test_env_path)
foreach(install_prefix ${install_prefixes})
file(TO_NATIVE_PATH "${install_prefix}/${INSTALL_BINDIR}" install_prefix)
set(test_env_path "${test_env_path}${QT_PATH_SEPARATOR}${install_prefix}")
endforeach()
set(test_env_path "${test_env_path}${QT_PATH_SEPARATOR}$ENV{PATH}")
string(REPLACE ";" "\;" test_env_path "${test_env_path}")
set(${out_path} "${test_env_path}" PARENT_SCOPE)
# Add the install prefix to list of plugin paths when doing a prefix build
if(NOT QT_INSTALL_DIR)
foreach(install_prefix ${install_prefixes})
file(TO_NATIVE_PATH "${install_prefix}/${INSTALL_BINDIR}" install_prefix)
list(APPEND plugin_paths "${install_prefix}")
endforeach()
endif()
#TODO: Collect all paths from known repositories when performing a super
# build.
file(TO_NATIVE_PATH "${PROJECT_BINARY_DIR}/${INSTALL_PLUGINSDIR}" install_pluginsdir)
list(APPEND plugin_paths "${install_pluginsdir}")
list(JOIN plugin_paths "${QT_PATH_SEPARATOR}" plugin_paths_joined)
string(REPLACE ";" "\;" plugin_paths_joined "${plugin_paths_joined}")
set(${out_plugin_path} "${plugin_paths_joined}" PARENT_SCOPE)
endfunction()

View File

@ -324,6 +324,8 @@ endif()
endif()
# Configure and install the ${module_name}Tools package Config file.
qt_internal_get_min_new_policy_cmake_version(min_new_policy_version)
qt_internal_get_max_new_policy_cmake_version(max_new_policy_version)
configure_package_config_file(
"${QT_CMAKE_DIR}/QtModuleToolsConfig.cmake.in"
"${config_build_dir}/${INSTALL_CMAKE_NAMESPACE}${target}Config.cmake"
@ -417,11 +419,11 @@ function(qt_check_if_tools_will_be_built)
endfunction()
# Equivalent of qmake's qtNomakeTools(directory1 directory2).
# If QT_NO_MAKE_TOOLS is true, then targets within the given directories will be excluded from the
# default 'all' target, as well as from install phase.
# The private variable is checked by qt_internal_add_executable.
# If QT_BUILD_TOOLS_BY_DEFAULT is true, then targets within the given directories will be excluded
# from the default 'all' target, as well as from install phase. The private variable is checked by
# qt_internal_add_executable.
function(qt_exclude_tool_directories_from_default_target)
if(QT_NO_MAKE_TOOLS)
if(NOT QT_BUILD_TOOLS_BY_DEFAULT)
set(absolute_path_directories "")
foreach(directory ${ARGV})
list(APPEND absolute_path_directories "${CMAKE_CURRENT_SOURCE_DIR}/${directory}")

View File

@ -2,7 +2,7 @@
# as well as CMake application projects.
# Expects various global variables to be set.
function(qt_internal_create_toolchain_file)
if(QT_HOST_PATH)
if(NOT "${QT_HOST_PATH}" STREQUAL "")
# TODO: Figure out how to make these relocatable.
get_filename_component(__qt_host_path_absolute "${QT_HOST_PATH}" ABSOLUTE)
@ -22,10 +22,10 @@ function(qt_internal_create_toolchain_file)
endif()")
set(init_qt_host_path_checks "
if(NOT QT_HOST_PATH OR NOT EXISTS \"\${QT_HOST_PATH}\")
if(\"\${QT_HOST_PATH}\" STREQUAL \"\" OR NOT EXISTS \"\${QT_HOST_PATH}\")
message(FATAL_ERROR \"To use a cross-compiled Qt, please specify a path to a host Qt installation by setting the QT_HOST_PATH cache variable.\")
endif()
if(NOT QT_HOST_PATH_CMAKE_DIR OR NOT EXISTS \"\${QT_HOST_PATH_CMAKE_DIR}\")
if(\"\${QT_HOST_PATH_CMAKE_DIR}\" STREQUAL \"\" OR NOT EXISTS \"\${QT_HOST_PATH_CMAKE_DIR}\")
message(FATAL_ERROR \"To use a cross-compiled Qt, please specify a path to a host Qt installation CMake directory by setting the QT_HOST_PATH_CMAKE_DIR cache variable.\")
endif()")
endif()

View File

@ -70,17 +70,26 @@ function(qt_internal_create_wrapper_scripts)
set(__qt_cmake_standalone_test_bin_name "qt-cmake-standalone-test")
set(__qt_cmake_standalone_test_bin_path
"${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}")
set(__qt_cmake_private_path
"${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private")
set(__qt_cmake_standalone_test_path
"${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}")
get_filename_component(rel_base_path
"${CMAKE_INSTALL_PREFIX}/${__qt_cmake_standalone_test_bin_path}"
"${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_bin_path}"
DIRECTORY)
if(QT_WILL_INSTALL)
# Need to prepend the staging prefix when doing prefix builds, because the build internals
# install dir is relative in that case..
qt_path_join(__qt_cmake_standalone_test_path
"${QT_STAGING_PREFIX}"
"${__qt_cmake_standalone_test_path}")
endif()
file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
"${CMAKE_INSTALL_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private")
"${__qt_cmake_private_path}")
file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
"${CMAKE_INSTALL_PREFIX}/${__qt_cmake_standalone_test_path}")
"${__qt_cmake_standalone_test_path}")
if(CMAKE_HOST_UNIX)
set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
@ -112,10 +121,11 @@ function(qt_internal_create_wrapper_scripts)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/${__qt_cmake_install_script_name}.in"
"${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}" @ONLY)
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}"
qt_install(FILES "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${__qt_cmake_install_script_name}"
DESTINATION "${INSTALL_BINDIR}")
qt_internal_create_qt_configure_tests_wrapper_script()
qt_internal_install_android_helper_scripts()
endfunction()
function(qt_internal_create_qt_configure_tests_wrapper_script)
@ -147,3 +157,9 @@ function(qt_internal_create_qt_configure_tests_wrapper_script)
qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_BINDIR}/${script_name}"
DESTINATION "${INSTALL_BINDIR}")
endfunction()
function(qt_internal_install_android_helper_scripts)
qt_path_join(destination "${QT_INSTALL_DIR}" "${INSTALL_LIBEXECDIR}")
qt_copy_or_install(PROGRAMS "${CMAKE_CURRENT_SOURCE_DIR}/util/android/android_emulator_launcher.sh"
DESTINATION "${destination}")
endfunction()

View File

@ -1,20 +1,24 @@
# Status
# Overview
Port is still on-going.
This document gives an overview of the Qt 6 build system. For a hands-on guide on how
to build Qt 6, see https://doc.qt.io/qt-6/build-sources.html and
https://wiki.qt.io/Building_Qt_6_from_Git
Note:
You need CMake 3.16.0 or later for most platforms (due to new AUTOMOC json feature).
You need CMake 3.17.0 to build Qt for iOS with the simulator_and_device feature.
You need CMake 3.17.0 + Ninja to build Qt in debug_and_release mode on Windows / Linux.
You need CMake 3.18.0 + Ninja to build Qt on macOS in debug_and_release mode when using frameworks.
# CMake Versions
# Intro
* You need CMake 3.16.0 or later for most platforms (due to new AUTOMOC json feature).
* You need CMake 3.17.0 to build Qt for iOS with the simulator_and_device feature.
* You need CMake 3.17.0 + Ninja to build Qt in debug_and_release mode on Windows / Linux.
* You need CMake 3.18.0 + Ninja to build Qt on macOS in debug_and_release mode when using frameworks.
The CMake update offers an opportunity to revisit some topics that came up during the last few
years.
# Changes to Qt 5
* The Qt build system does not support building host tools during a cross-compilation run. You need
to build a Qt for your host machine first and then use the platform tools from that version. The
The build system of Qt 5 was done on top of qmake. Qt 6 is built with CMake.
This offered an opportunity to revisit other areas of the build system, too:
* The Qt 5 build system allowed to build host tools during a cross-compilation run. Qt 6 requires
you to build a Qt for your host machine first and then use the platform tools from that version. The
decision to do this was reached independent of cmake: This does save resources on build machines
as the host tools will only get built once.
@ -24,14 +28,10 @@ years.
* There is less need for bootstrapping. Only moc and rcc (plus the lesser known tracegen and
qfloat16-tables) are linking against the bootstrap Qt library. Everything else can link against
the full QtCore. This will include qmake.
Qmake is supported as a build system for applications *using* Qt going forward and will
the full QtCore. This does include qmake.
qmake is supported as a build system for applications *using* Qt going forward and will
not go away anytime soon.
* We keep the qmake-based Qt build system working so that we do not interfere too much with ongoing
development.
# Building against homebrew on macOS
You may use brew to install dependencies needed to build QtBase.
@ -128,7 +128,7 @@ machine you're building on, regardless of the architecure you are targeting.
Build Qt regularly for your host system and install it into a directory of your choice using the
``CMAKE_INSTALL_PREFIX`` variable. You are free to disable the build of tests and examples by
passing ``-DBUILD_EXAMPLES=OFF`` and ``-DBUILD_TESTING=OFF``.
passing ``-DQT_BUILD_EXAMPLES=OFF`` and ``-DQT_BUILD_TESTS=OFF``.
With this installation of Qt in place, which contains all tools needed, we can proceed to create a
new build of Qt that is cross-compiled to the target architecture of choice. You may proceed by

View File

@ -7,7 +7,7 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
| -prefix /opt/qt6 | -DCMAKE_INSTALL_PREFIX=/opt/qta6 | |
| -extprefix /opt/qt6 | -DCMAKE_STAGING_PREFIX=/opt/qt6 | |
| -hostprefix /where/ever | n/a | When cross-building Qt, we do not build for host system anymore |
| -external-hostbindir /path/to/host/qt | -DQT_HOST_PATH=/path/to/host/qt | |
| -external-hostbindir /path/to/host/qt | -DQT_HOST_PATH=/path/to/host/qt | Can be set with configure -qt-host-path /path/to/host/qt. |
| -bindir <dir> | -DINSTALL_BINDIR=<dir> | similar for -headerdir -libdir and so on |
| -hostdatadir <dir> | -DINSTALL_MKSPECSDIR=<dir> | |
| -host*dir <dir> | n/a | |
@ -102,11 +102,16 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
| -android-javac-source | -DQT_ANDROID_JAVAC_SOURCE=7 | Set the javac build source version. |
| -android-javac-target | -DQT_ANDROID_JAVAC_TARGET=7 | Set the javac build target version. |
| -skip <repo> | -DBUILD_<repo>=OFF | |
| -make <part> | -DBUILD_TESTING=ON | A way to turn on tools explicitly is missing. |
| | -DBUILD_EXAMPLES=ON | |
| -nomake <part> | -DBUILD_TESTING=OFF | A way to turn off tools explicitly is missing. |
| | -DBUILD_EXAMPLES=OFF | |
| -no-gui | | |
| -make <part> | -DQT_BUILD_TESTS=ON | A way to turn on tools explicitly is missing. If tests/examples |
| | -DQT_BUILD_EXAMPLES=ON | are enabled, you can disable their building as part of the |
| | | 'all' target by also passing -DQT_BUILD_TESTS_BY_DEFAULT=OFF or |
| | | -DQT_BUILD_EXAMPLES_BY_DEFAULT=OFF. Note that if you entirely |
| | | disable tests/examples at configure time (by using |
| | | -DQT_BUILD_TESTS=OFF or -DQT_BUILD_EXAMPLES=OFF) you can't then |
| | | build them separately, after configuration. |
| -nomake <part> | -DQT_BUILD_TESTS=OFF | A way to turn off tools explicitly is missing. |
| | -DQT_BUILD_EXAMPLES=OFF | |
| -no-gui | -DFEATURE_gui=OFF | |
| -no-widgets | -DFEATURE_widgets=OFF | |
| -no-dbus | -DFEATURE_dbus=OFF | |
| -dbus [linked/runtime] | -DINPUT_dbus=[linked/runtime] | |
@ -140,10 +145,10 @@ The effort of this is tracked in QTBUG-85373 and QTBUG-85349.
| | -DFEATURE_system_harfbuzz=ON/OFF | |
| -gtk | -DFEATURE_gtk3=ON | |
| -lgmon | n/a | QNX-specific |
| -no-opengl | | |
| -opengl <api> | | |
| -opengles3 | | |
| -egl | | |
| -no-opengl | -DINPUT_opengl=no | |
| -opengl <api> | -DINPUT_opengl=<api> | |
| -opengles3 | -DFEATURE_opengles3=ON | |
| -egl | -DFEATURE_egl=ON | |
| -qpa <name> | -DQT_QPA_DEFAULT_PLATFORM=<name> | |
| -xcb-xlib | -DFEATURE_xcb_xlib=ON | |
| -direct2d | -DFEATURE_direct2d=ON | |

View File

@ -1,5 +1,7 @@
type: Group
instructions:
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.TESTS_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_CMAKE_TESTS}}\\bin\\qt-internal-configure-tests {{.Env.COIN_CMAKE_ARGS}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution

View File

@ -19,7 +19,7 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
# The lack of space between the non qtbase configure args and the rest of the args is important!
variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DBUILD_TESTING=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
- !include "{{qt/qtbase}}/call_host_cmake.yaml"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v"
@ -49,7 +49,7 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
# The lack of space between the non qtbase configure args and the rest of the args is important!
variableValue: "{{.Env.NON_QTBASE_TARGET_CONFIGURE_ARGS}} -DBUILD_TESTING=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
variableValue: "{{.Env.NON_QTBASE_TARGET_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
- !include "{{qt/qtbase}}/call_target_cmake.yaml"
- type: ExecuteCommand
command: "{{.Env.TARGET_ENV_PREFIX}} cmake --build . --parallel -v"
@ -73,3 +73,8 @@ instructions:
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Target"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -17,7 +17,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/host -DBUILD_TESTING=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/host -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
@ -63,7 +63,7 @@ instructions:
property: platformDependency
equals_value: null
- type: ExecuteCommand
command: "{{.Env.TARGET_ENV_PREFIX}} cmake {{.Env.TARGET_CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/target -DBUILD_TESTING=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
command: "{{.Env.TARGET_ENV_PREFIX}} cmake {{.Env.TARGET_CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/target -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
@ -91,3 +91,8 @@ instructions:
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Target"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -0,0 +1,41 @@
type: Group
instructions:
- type: MakeDirectory
directory: "{{.SourceDir}}_doc_build"
- type: SetBuildDirectory
directory: "{{.SourceDir}}_doc_build"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "rm {{.SourceDir}}/CMakeCache.txt" # CMake configure does not apply if not removed.
maxTimeInSeconds: 300
maxTimeBetweenOutput: 300
userMessageOnFailure: Failed to remove CMake cache.
- type: CreateFileListFromDirectory
directory: "{{.BuildDir}}/doc"
filterListFileName: "doc_build_filter"
userMessageOnFailure: "Failed to create filter list for docs"
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: "-DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} {{.SourceDir}}"
- !include "{{qt/qtbase}}/call_cmake.yaml"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --build . --target generate_docs -v"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: Failed to generate documentation.
- type: UploadArtifact
archiveDirectory: "{{.BuildDir}}/doc"
transferType: UploadModuleDocumentation
filterListFileName: "doc_build_filter"
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
enable_if:
condition: and
conditions:
- condition: property
property: features
contains_value: Documentation
- condition: runtime
env_var: BUILD_DOCUMENTATION
not_equals_value: null

View File

@ -9,7 +9,7 @@ instructions:
- type: EnvironmentVariable
variableName: COIN_CMAKE_ARGS
# The lack of space between the non qtbase configure args and the rest of the args is important!
variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DBUILD_TESTING=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}"
- !include "{{qt/qtbase}}/call_cmake.yaml"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v"
@ -38,3 +38,8 @@ instructions:
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Host"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -7,7 +7,7 @@ instructions:
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}"
command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DQT_BUILD_TESTS=OFF {{.SourceDir}}"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
@ -40,3 +40,8 @@ instructions:
transferType: UploadModuleBuildArtifact
maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200
- type: EnvironmentVariable
variableName: COIN_CONFIG_TYPE
variableValue: "Host"
- !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml"
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml"

View File

@ -5,6 +5,7 @@ instructions:
instructions:
- !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml"
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_host.yaml"
- !include "{{qt/qtbase}}/cmake_documentation_build.yaml"
enable_if:
condition: and
conditions:

View File

@ -0,0 +1,13 @@
type: Group
instructions:
- type: Group
instructions:
- type: ExecuteCommand
command: "{{.InstallDir}}/libexec/android_emulator_launcher.sh"
maxTimeInSeconds: 300
maxTimeBetweenOutput: 300
userMessageOnFailure: "Failed to start emulator, check logs."
enable_if:
condition: property
property: features
contains_value: AndroidTestRun

View File

@ -2,6 +2,7 @@ type: Group
instructions:
# The build env is needed on MSVC so that tst_qmake can properly build apps / libraries.
- !include "{{qt/qtbase}}/prepare_building_env.yaml"
- !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml"
# The test env vars are needed to pick the proper prefix.bat file.
- !include "{{qt/qtbase}}/cmake_setup_running_tests_env_vars.yaml"
- !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml"

View File

@ -15,6 +15,9 @@ instructions:
- condition: property
property: target.osVersion
equals_value: QEMU
- condition: property
property: features
contains_value: AndroidTestRun
disable_if:
condition: property
property: features

View File

@ -21,20 +21,10 @@ instructions:
instructions:
- !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml"
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_property: target.os
- condition: property
condition: property
property: target.osVersion
equals_value: QEMU
disable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_property: target.os
- condition: property
in_values: [Android_ANY, QEMU]
enable_if:
condition: property
property: target.osVersion
not_equals_value: QEMU
in_values: [IOS_ANY, Android_ANY, QEMU]

View File

@ -0,0 +1,55 @@
type: Group
instructions:
# Call jom when host os is Windows + MSVC
- type: Group
instructions:
# Clear the automatically set MAKEFLAGS variable
- type: EnvironmentVariable
variableName: MAKEFLAGS
variableValue: ""
# Call jom
- type: ExecuteCommand
command: "{{.Env.ENV_PREFIX}} {{.Env.CI_JOM_PATH}}\\jom.exe"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call jom.
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: property
property: host.compiler
not_contains_value: "Mingw"
# Call make when host os is not Windows (Linux, macOS)
- type: ExecuteCommand
command: "{{.Env.CALL_MAKE_ENV_PREFIX}} make"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call make.
enable_if:
condition: property
property: target.os
not_equals_value: Windows
# Call mingw32-make when host os is Windows + MinGW (this includes building for Android)
- type: ExecuteCommand
command: "{{.Env.CALL_MAKE_ENV_PREFIX}} mingw32-make"
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to call mingw32-make.
enable_if:
condition: and
conditions:
- condition: property
property: host.os
equals_value: Windows
- condition: property
property: host.compiler
contains_value: "Mingw"

View File

@ -0,0 +1,16 @@
# CMake script to ensure that a qmake project file exists.
#
# Usage: cmake -DPRO_FILE=.../project.pro -P .../ensure_pro_file.cmake
#
# This script checks for existence of ${PRO_FILE} and creates a fake one, if needed.
#
if(NOT EXISTS "${PRO_FILE}")
get_filename_component(dir "${PRO_FILE}" DIRECTORY)
if(NOT IS_DIRECTORY "${dir}")
file(MAKE_DIRECTORY "${dir}")
endif()
file(WRITE "${PRO_FILE}" "TEMPLATE = aux
")
endif()

View File

@ -0,0 +1,16 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: COIN_QMAKE_LOCATION
variableValue: "{{.InstallDir}}\\bin\\qmake"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: COIN_QMAKE_LOCATION
variableValue: "{{.InstallDir}}/bin/qmake"
disable_if:
condition: property
property: host.os
equals_value: Windows

View File

@ -0,0 +1,29 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: COIN_QMAKE_LOCATION
variableValue: "{{.InstallDir}}\\target\\bin\\qmake.bat"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: Group
disable_if:
condition: property
property: host.os
equals_value: Windows
instructions:
- type: EnvironmentVariable
variableName: COIN_QMAKE_LOCATION
variableValue: "{{.InstallDir}}/target/bin/qmake"
disable_if:
condition: property
property: target.osVersion
equals_value: QEMU
- type: EnvironmentVariable
variableName: COIN_QMAKE_LOCATION
variableValue: "{{.InstallDir}}/target/bin/host-qmake"
enable_if:
condition: property
property: target.osVersion
equals_value: QEMU

View File

@ -0,0 +1,71 @@
type: Group
instructions:
- type: Group
instructions:
# Prepare directories to build examples with qmake.
- type: ChangeDirectory
directory: "{{.SourceDir}}"
- type: MakeDirectory
directory: "{{.SourceDir}}_qmake/examples"
- type: SetBuildDirectory
directory: "{{.SourceDir}}_qmake/examples"
- type: ChangeDirectory
directory: "{{.BuildDir}}"
- !include "{{qt/qtbase}}/qmake_examples/get_examples_source_location.yaml"
# Setup qemu cross-compiled qmake to work.
- !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml"
# Set either host or target env prefix for qmake and make depending on
# tested configuration.
- type: Group
instructions:
- type: EnvironmentVariable
variableName: CALL_MAKE_ENV_PREFIX
variableValue: "{{.Env.ENV_PREFIX}}"
enable_if:
condition: runtime
env_var: COIN_CONFIG_TYPE
equals_value: "Host"
- type: EnvironmentVariable
variableName: CALL_MAKE_ENV_PREFIX
variableValue: "{{.Env.TARGET_ENV_PREFIX}}"
enable_if:
condition: runtime
env_var: COIN_CONFIG_TYPE
equals_value: "Target"
# Ensure that we have an examples/examples.pro file.
# If it doesn't exist, write a dummy project file.
# The CMake that does this is installed to INSTALL_LIBEXEC, which defaults to "bin" on Windows.
- type: ExecuteCommand
enable_if:
condition: property
property: host.os
equals_value: Windows
command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}\\examples\\examples.pro -P {{.InstallDir}}\\bin\\ensure_pro_file.cmake"
maxTimeInSeconds: 20
maxTimeBetweenOutput: 20
userMessageOnFailure: >
Failed to run cmake -P ensure_pro_file.cmake
- type: ExecuteCommand
disable_if:
condition: property
property: host.os
equals_value: Windows
command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}/examples/examples.pro -P {{.InstallDir}}/libexec/ensure_pro_file.cmake"
maxTimeInSeconds: 20
maxTimeBetweenOutput: 20
userMessageOnFailure: >
Failed to run cmake -P ensure_pro_file.cmake
# Run qmake to configure the examples. The env prefix is important for qemu.
- type: ExecuteCommand
command: "{{.Env.CALL_MAKE_ENV_PREFIX}} {{.Env.COIN_QMAKE_LOCATION}} {{.Env.COIN_EXAMPLES_SOURCE_LOCATION}}"
maxTimeInSeconds: 6000
maxTimeBetweenOutput: 1200
userMessageOnFailure: >
Failed to run qmake to build examples.
# Run make to build the examples.
- !include "{{qt/qtbase}}/qmake/call_make.yaml"

View File

@ -0,0 +1,23 @@
type: Group
instructions:
# Only enable building examples if -DQT_BUILD_EXAMPLES=ON was passed to the CMake config in some
# form. The variable to check unfortunately depends on host vs target, and qtbase vs non-qtbase.
- type: Group
instructions:
- !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_inner_instructions.yaml"
enable_if:
condition: or
conditions:
# qtbase host case
- condition: runtime
env_var: CONFIGURE_ARGS
contains_value: "QT_BUILD_EXAMPLES=ON"
# qtbase target case
- condition: runtime
env_var: TARGET_CONFIGURE_ARGS
contains_value: "QT_BUILD_EXAMPLES=ON"
# non-qtbase host case
# non-qtbase target case
- condition: runtime
env_var: COIN_CMAKE_ARGS
contains_value: "QT_BUILD_EXAMPLES=ON"

View File

@ -0,0 +1,16 @@
type: Group
instructions:
- type: EnvironmentVariable
variableName: COIN_EXAMPLES_SOURCE_LOCATION
variableValue: "{{.SourceDir}}\\examples"
enable_if:
condition: property
property: host.os
equals_value: Windows
- type: EnvironmentVariable
variableName: COIN_EXAMPLES_SOURCE_LOCATION
variableValue: "{{.SourceDir}}/examples"
disable_if:
condition: property
property: host.os
equals_value: Windows

View File

@ -89,6 +89,7 @@ Build options:
through an app store by default, in particular Android,
iOS, tvOS, and watchOS. [auto]
-qt-host-path <path> . Specify path to a Qt host build for cross-compiling.
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
-qtlibinfix <infix> .. Rename all libQt6*.so to libQt6*<infix>.so.

View File

@ -648,6 +648,11 @@ qt_feature("ltcg"
CONDITION __qt_ltcg_detected
)
qt_feature_config("ltcg" QMAKE_PRIVATE_CONFIG)
qt_feature("enable_new_dtags"
LABEL "Using new DTAGS"
CONDITION LINUX AND TEST_enable_new_dtags
)
qt_feature_config("enable_new_dtags" QMAKE_PRIVATE_CONFIG)
qt_feature("enable_gdb_index"
LABEL "Generating GDB index"
AUTODETECT QT_FEATURE_developer_build
@ -774,13 +779,13 @@ qt_feature_definition("avx512vbmi" "QT_COMPILER_SUPPORTS_AVX512VBMI" VALUE "1")
qt_feature_config("avx512vbmi" QMAKE_PRIVATE_CONFIG)
qt_feature("aesni"
LABEL "AES"
CONDITION QT_FEATURE_sse2 AND TEST_subarch_aes
CONDITION QT_FEATURE_sse2 AND TEST_subarch_aesni
)
qt_feature_definition("aesni" "QT_COMPILER_SUPPORTS_AES" VALUE "1")
qt_feature_config("aesni" QMAKE_PRIVATE_CONFIG)
qt_feature("rdrnd"
LABEL "RDRAND"
CONDITION TEST_subarch_rdseed
CONDITION TEST_subarch_rdrnd
)
qt_feature_definition("rdrnd" "QT_COMPILER_SUPPORTS_RDRND" VALUE "1")
qt_feature_config("rdrnd" QMAKE_PRIVATE_CONFIG)
@ -792,7 +797,7 @@ qt_feature_definition("rdseed" "QT_COMPILER_SUPPORTS_RDSEED" VALUE "1")
qt_feature_config("rdseed" QMAKE_PRIVATE_CONFIG)
qt_feature("shani"
LABEL "SHA"
CONDITION QT_FEATURE_sse2 AND TEST_subarch_sha
CONDITION QT_FEATURE_sse2 AND TEST_subarch_shani
)
qt_feature_definition("shani" "QT_COMPILER_SUPPORTS_SHA" VALUE "1")
qt_feature_config("shani" QMAKE_PRIVATE_CONFIG)

View File

@ -241,11 +241,18 @@
"testTypeDependencies": {
"linkerSupportsFlag": [ "use_bfd_linker", "use_gold_linker", "use_lld_linker" ],
"verifySpec": [ "shared", "use_bfd_linker", "use_gold_linker", "use_lld_linker", "compiler-flags", "qmakeargs", "commit" ],
"verifySpec": [
"shared",
"use_bfd_linker", "use_gold_linker", "use_lld_linker",
"compiler-flags", "qmakeargs",
"simulator_and_device",
"thread",
"commit" ],
"compile": [ "verifyspec" ],
"detectPkgConfig": [ "cross_compile", "machineTuple" ],
"library": [ "pkg-config", "compiler-flags" ],
"getPkgConfigVariable": [ "pkg-config" ]
"getPkgConfigVariable": [ "pkg-config" ],
"architecture" : [ "verifyspec" ]
},
"testTypeAliases": {
@ -749,7 +756,7 @@
},
"architecture": {
"label": "Architecture",
"output": [ "architecture" ]
"output": [ "architecture", "commitConfig" ]
},
"pkg-config": {
"label": "Using pkg-config",

View File

@ -660,6 +660,13 @@ defineTest(qtConfOutput_commitOptions) {
write_file($$QT_BUILD_TREE/mkspecs/qdevice.pri, $${currentConfig}.output.devicePro)|error()
}
# Output is written after configuring each Qt module,
# but some tests within a module might depend on the
# configuration output of previous tests.
defineTest(qtConfOutput_commitConfig) {
qtConfProcessOutput()
}
# type (empty or 'host'), option name, default value
defineTest(processQtPath) {
out_var = config.rel_input.$${2}

View File

@ -527,3 +527,8 @@
\externalpage https://login.qt.io/
\title Qt Account Sign-up
*/
/*!
\externalpage http://facebook.github.io/zstd/
\title Zstandard Site
*/

View File

@ -0,0 +1,4 @@
macro.youtube.HTML = "<div class=\"video\">\n<span class=\"vspan\"></span>\n" \
"<iframe src=\"https://www.youtube.com/embed/\1\"" \
"frameborder=\"0\" allowfullscreen>\n" \
"</iframe></div>\n"

View File

@ -57,12 +57,17 @@ macro.QtMinorVersion.match = "\\d+\\.(\\d+)"
# qhp.ProjectName.extraFiles += images/dQw4w9WgXcQ.jpg
#
macro.youtube.HTML = "<div class=\"video\">\n<span class=\"vspan\"></span>\n" \
"<iframe src=\"https://www.youtube.com/embed/\1\"" \
"frameborder=\"0\" allowfullscreen>\n" \
"<a href=\"https://www.youtube.com/watch/?v=\1\">\n"\
"<img src=\"images/\1.jpg\"" \
"title=\"Click to play in a browser\" /></a>\n" \
"</iframe></div>\n"
"</div>\n"
macro.excludefromcreator = "\\meta tag broken"
macro.preliminarycmakecommand = "\\note This command is in technology preview and may change in future releases."
macro.preliminarycmakevariable = "\\note This variable is in technology preview and may change in future releases."
macro.preliminarycmakeproperty = "\\note This property is in technology preview and may change in future releases."
macro.cmakecommandandroidonly = "\\note This command should only be called if targeting the Android platform."
macro.cmakepropertyandroidonly = "\\note This property is used only if targeting the Android platform."
macro.cmakevariableandroidonly = "\\note This variable is used only if targeting the Android platform."

View File

@ -240,6 +240,7 @@ manifestmeta.thumbnail.names = "QtCore/Contiguous Cache Example" \
"QtNetwork/Network Download*" \
"QtWidgets/Dynamic Layouts Example" \
"QtWidgets/Validators Example" \
"QtWidgets/Widgets Gallery Example" \
"QtDbus/*" \
"QtHelp/*" \
"QtMultimedia/AudioEngine Example" \

View File

@ -23,6 +23,9 @@ include(manifest-meta.qdocconf)
include(fileextensions.qdocconf)
include(qt-html-templates-online.qdocconf)
#override macros for online use
include(macros-online.qdocconf)
#extra configuration data DITA information
include(config.qdocconf)

View File

@ -8,10 +8,6 @@ pre, .LegaleseLeft {
overflow-x:auto;
}
pre a[href] {
color: #5caa15;
}
p {
width: 70%;
margin: 15px 0px 10px 15px;
@ -22,16 +18,6 @@ table p {
padding: 0px;
}
a[href] {
color: #007330;
text-decoration: none;
}
/* Different color for ext. links */
a[href|="http://"], a[href|="https://"] {
color: #6bb8db;
}
h1.title {
margin-top: 30px;
margin-left: 6px;

View File

@ -89,13 +89,11 @@ offline viewing: HTML links display an icon
-----------
*/
a[href*="http://"], a[href*="ftp://"], a[href*="https://"] {
text-decoration: none;
background-image: url(../images/ico_out.png);
background-repeat: no-repeat;
background-position: left;
padding-left: 20px;
text-align: left;
a[href*="http://"]::before,
a[href*="ftp://"]::before,
a[href*="https://"]::before {
content: url(../images/ico_out.png);
padding-right: 5px;
}
.flags {
@ -547,11 +545,27 @@ ol.a > li{
list-style-type: lower-alpha;
}
ol > li {
ol > li {
margin-left: 30px;
padding-left: 8px;
list-style: decimal;
}
list-style-type: decimal;
}
ol.A > li {
list-style-type: upper-alpha;
}
ol.a > li {
list-style-type: lower-alpha;
}
ol.i > li {
list-style-type: lower-roman;
}
ol.I > li {
list-style-type: upper-roman;
}
.centerAlign {
text-align: left

View File

@ -48,17 +48,18 @@
**
****************************************************************************/
#include <stdio.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QDebug>
#include <QtCore/QProcess>
#include <QtDBus/QtDBus>
#include "ping-common.h"
#include "complexping.h"
#include <QCoreApplication>
#include <QDBusReply>
#include <QDBusServiceWatcher>
#include <QFile>
#include <QDebug>
#include <QProcess>
#include <stdio.h>
void Ping::start(const QString &name)
{
if (name != SERVICE_NAME)

View File

@ -48,16 +48,17 @@
**
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtDBus/QtDBus>
#include "ping-common.h"
#include "complexpong.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
#include <QTimer>
#include <stdio.h>
#include <stdlib.h>
// the property
QString Pong::value() const
{

View File

@ -48,10 +48,13 @@
**
****************************************************************************/
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QStringList>
#include <QtDBus/QtDBus>
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
#include <QDBusInterface>
#include <QDBusReply>
#include <QDebug>
#include <QStringList>
void method1()
{

View File

@ -48,13 +48,15 @@
**
****************************************************************************/
#include <stdio.h>
#include <QtCore/QCoreApplication>
#include <QtDBus/QtDBus>
#include "ping-common.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDBusReply>
#include <stdio.h>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);

View File

@ -48,16 +48,17 @@
**
****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QTimer>
#include <QtDBus/QtDBus>
#include "ping-common.h"
#include "pong.h"
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusError>
#include <QTimer>
#include <stdio.h>
#include <stdlib.h>
QString Pong::ping(const QString &arg)
{
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit");

View File

@ -5,6 +5,9 @@ FORMS += controller.ui
HEADERS += controller.h
SOURCES += main.cpp controller.cpp
# Work-around CI issue. Not needed in user code.
CONFIG += no_batch
# install
target.path = $$[QT_INSTALL_EXAMPLES]/dbus/remotecontrolledcar/controller
INSTALLS += target

View File

@ -49,7 +49,7 @@
****************************************************************************/
#include <QtWidgets>
#include <QtDBus>
#include "controller.h"

View File

@ -196,7 +196,7 @@ void Flickable::handleMouseRelease(QMouseEvent *event)
QMouseEvent *event1 = new QMouseEvent(QEvent::MouseButtonPress,
d->pressPos, Qt::LeftButton,
Qt::LeftButton, Qt::NoModifier);
QMouseEvent *event2 = new QMouseEvent(*event);
QMouseEvent *event2 = event->clone();
d->ignoreList << event1;
d->ignoreList << event2;
QApplication::postEvent(d->target, event1);

View File

@ -112,6 +112,11 @@ void DtlsAssociation::udpSocketConnected()
void DtlsAssociation::readyRead()
{
if (socket.pendingDatagramSize() <= 0) {
emit warningMessage(tr("%1: spurious read notification?").arg(name));
return;
}
//! [6]
QByteArray dgram(socket.pendingDatagramSize(), Qt::Uninitialized);
const qint64 bytesRead = socket.readDatagram(dgram.data(), dgram.size());

View File

@ -388,8 +388,14 @@ void Dialog::setColor()
void Dialog::setFont()
{
const QFontDialog::FontDialogOptions options = QFlag(fontDialogOptionsWidget->value());
const QString &description = fontLabel->text();
QFont defaultFont;
if (!description.isEmpty())
defaultFont.fromString(description);
bool ok;
QFont font = QFontDialog::getFont(&ok, QFont(fontLabel->text()), this, "Select Font", options);
QFont font = QFontDialog::getFont(&ok, defaultFont, this, "Select Font", options);
if (ok) {
fontLabel->setText(font.key());
fontLabel->setFont(font);

View File

@ -842,7 +842,7 @@
If \c fileName is not empty, we create a QFile object, \c file, with
\c fileName. QFile works with QDataStream as QFile is a QIODevice.
Next, we attempt to open the file in \l{QIODevice::}{WriteOnly} mode.
Next, we attempt to open the file in \l{QIODeviceBase::}{WriteOnly} mode.
If this is unsuccessful, we display a QMessageBox to inform the user.
\snippet tutorials/addressbook/part6/addressbook.cpp saveToFile() function part2
@ -869,7 +869,7 @@
\image addressbook-tutorial-part6-load.png
If \c fileName is not empty, again, we use a QFile object, \c file, and
attempt to open it in \l{QIODevice::}{ReadOnly} mode. Similar to our
attempt to open it in \l{QIODeviceBase::}{ReadOnly} mode. Similar to our
implementation of \c saveToFile(), if this attempt is unsuccessful, we
display a QMessageBox to inform the user.
@ -939,7 +939,7 @@
choose a location for the file. Using the file name chosen, we create an
instance of QFile to write to.
We attempt to open the file in \l{QIODevice::}{WriteOnly} mode. If this
We attempt to open the file in \l{QIODeviceBase::}{WriteOnly} mode. If this
process fails, we display a QMessageBox to inform the user about the
problem and return. Otherwise, we pass the file as a parameter to a
QTextStream object, \c out. Like QDataStream, the QTextStream class

View File

@ -27,11 +27,11 @@
/*!
\example mainwindows/application
\title Application Example
\title Qt Widgets - Application Example
\ingroup examples-mainwindow
\brief The Application example shows how to implement a standard GUI
application with menus, toolbars, and a status bar. The example
\brief The Application example shows how to implement a standard
widget application with menus, toolbars, and a status bar. The example
itself is a simple text editor program built around QPlainTextEdit.
\image application.png Screenshot of the Application example

View File

@ -145,7 +145,7 @@
We show an example of the creation of an action. The
functionality the actions trigger is discussed in the slots we
connect the actions to. You can see the \l{Application
connect the actions to. You can see the \l{Qt Widgets - Application
Example}{application example} if you need a high-level
introduction to actions.

View File

@ -112,8 +112,8 @@
in a submenu of the \b Tablet menu, for selecting which property of each
QTabletEvent will be used to vary the translucency (alpha channel) of the
line being drawn or color being airbrushed.
(See the \l{Application Example}{application example} if you want a
high-level introduction to QActions.)
(See the \l{Qt Widgets - Application Example}{application example} if you want
a high-level introduction to QActions.)
\snippet widgets/tablet/mainwindow.cpp 9
@ -251,7 +251,7 @@
rendering to, we can create a pixmap with the appropriate resolution.
The size of the pixmap with which we fill the window depends on the screen
resolution, as the example does not support zoom; and it may be that one
screen is \l {High DPI Displays}{high DPI} while another is not. We need to
screen is \l {High DPI}{high DPI} while another is not. We need to
draw the background too, as the default is gray.
After that, we simply draw the pixmap to the top left of the widget.

View File

@ -76,6 +76,8 @@ int main(int argc, char *argv[])
? QString() : parser.positionalArguments().first();
QFileSystemModel model;
QFileIconProvider iconProvider;
model.setIconProvider(&iconProvider);
model.setRootPath("");
if (parser.isSet(dontUseCustomDirectoryIconsOption))
model.setOption(QFileSystemModel::DontUseCustomDirectoryIcons);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 356 B

View File

@ -176,6 +176,7 @@ static void initializeImageFileDialog(QFileDialog &dialog, QFileDialog::AcceptMo
mimeTypeFilters.sort();
dialog.setMimeTypeFilters(mimeTypeFilters);
dialog.selectMimeTypeFilter("image/jpeg");
dialog.setAcceptMode(acceptMode);
if (acceptMode == QFileDialog::AcceptSave)
dialog.setDefaultSuffix("jpg");
}
@ -185,7 +186,7 @@ void ImageViewer::open()
QFileDialog dialog(this, tr("Open File"));
initializeImageFileDialog(dialog, QFileDialog::AcceptOpen);
while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().first())) {}
while (dialog.exec() == QDialog::Accepted && !loadFile(dialog.selectedFiles().constFirst())) {}
}
//! [1]
@ -194,7 +195,7 @@ void ImageViewer::saveAs()
QFileDialog dialog(this, tr("Save File As"));
initializeImageFileDialog(dialog, QFileDialog::AcceptSave);
while (dialog.exec() == QDialog::Accepted && !saveFile(dialog.selectedFiles().first())) {}
while (dialog.exec() == QDialog::Accepted && !saveFile(dialog.selectedFiles().constFirst())) {}
}
//! [5]
@ -365,7 +366,7 @@ void ImageViewer::createActions()
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, &ImageViewer::about);
helpMenu->addAction(tr("About &Qt"), &QApplication::aboutQt);
helpMenu->addAction(tr("About &Qt"), this, &QApplication::aboutQt);
}
//! [18]

View File

@ -63,7 +63,7 @@ int main(int argc, char *argv[])
commandLineParser.process(QCoreApplication::arguments());
ImageViewer imageViewer;
if (!commandLineParser.positionalArguments().isEmpty()
&& !imageViewer.loadFile(commandLineParser.positionalArguments().front())) {
&& !imageViewer.loadFile(commandLineParser.positionalArguments().constFirst())) {
return -1;
}
imageViewer.show();

View File

@ -44,7 +44,7 @@ isEmpty(ALL_ANDROID_ABIS): ALL_ANDROID_ABIS = arm64-v8a armeabi-v7a x86_64 x86
CONFIG += $$ANDROID_PLATFORM
ANDROID_MIN_SDK_VERSION = $$replace(ANDROID_PLATFORM, "android-", "")
ANDROID_TARGET_SDK_VERSION = 28
ANDROID_TARGET_SDK_VERSION = 29
NDK_LLVM_PATH = $$NDK_ROOT/toolchains/llvm/prebuilt/$$NDK_HOST
QMAKE_CC = $$NDK_LLVM_PATH/bin/clang

View File

@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.14
QMAKE_APPLE_DEVICE_ARCHS = x86_64
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.

Some files were not shown because too many files have changed in this diff Show More