Commit Graph

37680 Commits

Author SHA1 Message Date
Qt CI Bot
2c5a35f6ed Merge integration refs/builds/qtci/dev/1618306545 2021-04-13 11:46:39 +00:00
Eskil Abrahamsen Blomfeldt
cd9bbcd97a Adapt to Harfbuzz 2.8.0 update
The Unicode 13 language tags are available since Harfbuzz
2.6.7.

For compilation with earlier versions, also update the
hardcoded tags to match the ones in Harfbuzz (and in
iso-15924):

https://unicode.org/iso15924/iso15924-codes.html

Task-number: QTBUG-90217
Change-Id: I4e2cfdf61a5c4189b8aac51644c9d80c816aeebc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 910ac477f013f2af690b66f1ac41d65ab7527843)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-04-13 10:02:02 +00:00
Volker Hilsheimer
742ecf83e5 Silence qdoc warnings
These are internal APIs, so silence qdoc which seems to get confused
by the missing CALLBACK annotation in the implementation.

Change-Id: Iddd9f87257843cc3d43597fe7e6c103aa5e1a646
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:49:02 +02:00
Volker Hilsheimer
ae3d4b8f6b Fix qdoc warnings from new QLockFile members
Change-Id: I06210fe37a3d90a958064fff48331a34bced2a8b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:48:50 +02:00
Volker Hilsheimer
f6651d54df Fix qdoc warning
QPixmap doesn't have a devicePixelSize() method, but
deviceIndependentSize is a relevant method here.

Change-Id: Ie71e6cc88534792a896ea17ec37b1b9737c2f986
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:48:45 +02:00
Volker Hilsheimer
3206840b0e Fix qdoc warning, \function is not a command
Document the size parameter while at it, and rephrase a bit.

This introduces a new qdoc warning since QtLiteral is a new
namespace without any documentation, but that's for a separate
commit.

Change-Id: I849d5cdde8b64dbbe7e6a526214d422930091cd4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:48:38 +02:00
Volker Hilsheimer
5b94f88747 Document parameter correctly, fix qdoc warning
Not needed in 6.1, the method is still (incorrectly) marked as \internal
there.

Change-Id: Idf1d924d8d320eca2388dbd28006eeaf9efedc3a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:48:08 +02:00
Volker Hilsheimer
2cc458abfb Document QLocalSocket::socketOptions as a property
Change-Id: Ifda55ac7afb3fb30d973a01104b012959ae285ab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-04-13 10:48:01 +02:00
Volker Hilsheimer
ace3d4f00e Document new InputMethodQuery enum value
This amends c80f262258.

Change-Id: Iec8a8f5ce50fdf0ba371a287f243186b2435e594
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Piotr Mikolajczyk <piotr.mikolajczyk@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-13 07:33:41 +00:00
Volker Hilsheimer
aab6d336f7 Fix qdoc warning, it's QThread::Priority
Change-Id: If3df55ff95f8bdb510bdc3578ba3c7c03b9029a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-12 23:53:01 +02:00
Volker Hilsheimer
2bdaf28034 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 5b9f6862b1.

Fixes: QTBUG-92040
Pick-to: 6.1 6.0 5.15
Change-Id: I56b6d579e5e94689b43ca84d4637e35dc2cbeb4c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-12 19:30:12 +00:00
Qt CI Bot
a91728b4e8 Merge integration refs/builds/qtci/dev/1618240808 2021-04-12 18:06:39 +00:00
Qt CI Bot
e5d8e2ae6e Merge integration refs/builds/qtci/dev/1618233601 2021-04-12 17:08:06 +00:00
Volker Hilsheimer
3fa778142a Silence qdoc warning from deprecated enum value
The mis-spelled value doesn't need documentation.

Pick-to: 6.1
Change-Id: I709abdca1d515902b3a12d3c5a5b62809d1f9a8b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-12 15:19:41 +00:00
Mårten Nordheim
b1fe3e3d80 QNetworkInformation: Private the destructor
It wasn't meant to be public.

Pick-to: 6.1 6.1.0
Change-Id: Ifa7fff48f82b96bdfa277677d3988dc8881b8c2a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-12 17:19:41 +02:00
Qt CI Bot
6a17a8ba84 Merge integration refs/builds/qtci/dev/1618228407 2021-04-12 15:19:40 +00:00
Mårten Nordheim
b67fe6dc7d QNetworkInformation: Remove the default argument
And the code for loading whatever backend is sorted first.
Though, looking at the code it would've never returned 'true' anyway.

Pick-to: 6.1 6.1.0
Change-Id: I7bc2c740e8cb5343e5843cb1d65715d236b92a25
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-12 15:18:45 +02:00
Mårten Nordheim
5a60657363 QNetworkInformation: make supports(...) not virtual
Pick-to: 6.1 6.1.0
Change-Id: Ib8d27410e6baa495a7351a57c8c1c1b30a64eb26
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-12 13:21:17 +02:00
Mårten Nordheim
bb85831e4d QtFuture::connect: disconnect signals first
During reportFinished we may call a continuation which might end up
triggering one of the signals.

Pick-to: 6.0 6.1
Change-Id: I19546fcca12be71cd536e4287eb5eddd9d236830
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-12 12:37:40 +02:00
Mårten Nordheim
b86176abf6 QtConcurrentIterateKernel: fix warning
src\concurrent\qtconcurrentiteratekernel.cpp(134): warning C5055: operator '*': deprecated between enumerations and floating-point types

Pick-to: 6.0 6.1
Change-Id: I934e767e77e9393e1da3adc390dc8e252e7f5b6a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-12 10:31:54 +00:00
Albert Astals Cid
17db162949 doc: Fix typo
Pick-to: 6.1
Change-Id: Ia4219d06e306b2abd2ac0977cac63ce0492c6397
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-04-12 09:57:59 +00:00
JiDe Zhang
c9bbc025f0 Add "QT_DEPRECATED_VERSION_XXX" macros
Since 6.3 to 6.6, for which version add "QT_DEPRECATED_VERSION_X_6_"
and "QT_DEPRECATED_VERSION_6_" macro.

Change-Id: I10c77b1ed436ce3442960f5594f86a3a3be181f2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-12 10:03:26 +08:00
Niclas Rosenvik
7266bd459e Fix GLX on non-linux X11 systems
Some parts of the GLX code is only enabled for Linux. This makes
builds on other X11 supported platforms break when GLX is found.
To fix this enable these parts of the code when Qt feature
xcb-glx-plugin is enabled. xcb-glx-plugin has to be made public
in order for QT_CONFIG(xcb_glx_plugin) to work correctly in
these parts of the code.

Change-Id: I6bf78b6a64787ed88c8e2fae40675244c9198c37
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-04-11 12:49:04 +00:00
Mike Achtelik
67c3f3f4ff Android: Bump gradle (plugin) versions
Android Gradle plugin 4.1.3 is compatible with the new <queries>
declaration for package visibility on Android 11. If someone adds the
<queries> element or starts relying on a library or SDK that supports
targeting Android 11, they might encounter manifest merging errors when
building the app.

This is important since starting August 2021 the PlayStore requires new
apps from targeting Android 11. So lets update to the newest
Android Gradle plugin version.

This also reverts 1e4dec12d5 as AGP 4.1
requires at least buildToolsVersion 29.0.2.

Change-Id: Id8ce5dadeb8a325dc9f901503946f325f3fd18a0
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-04-10 14:08:07 +02:00
Qt CI Bot
922fbfd2ba Merge integration refs/builds/qtci/dev/1617996746 2021-04-09 21:23:22 +00:00
Niclas Rosenvik
1b7f1aad40 Fix generating mimedatabase with generate.pl using make
When building using make and having set QT_AVOID_CMAKE_ARCHIVING_API
to ON the build breaks with the message "sh: cannot create
.rcc/qmimeprovider_database.cpp: directory nonexistent" .
ninja creates this directory automatically, make does not.
Add a file MAKE_DIRECTORY cmake command to make sure the .rcc directory
is created.

Change-Id: I140279a794753436d427d647ab2231636827d07f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-09 19:30:57 +00:00
Thiago Macieira
183df80b9c QCoreApplication: improve docs on exit() and quit() thread-safety
Reporter of QTBUG-91771 was confused.

Pick-to: 6.1
Change-Id: I26b8286f61534f88b649fffd166c4368167a5638
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-09 18:10:00 +00:00
Thiago Macieira
2e6c37fe51 QCoreApplication::exit: make it a slot
The documentation even refers to it as such. Instead of refactoring the
documentation to explain that it isn't, just make it a slot.

[ChangeLog][QtCore][QCoreApplication] exit() is now a slot, like quit().

Pick-to: 6.1
Change-Id: I26b8286f61534f88b649fffd166c43afbb80927f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-09 11:10:00 -07:00
Allan Sandfeld Jensen
c2348e2c7a Fix futexNeedsWake() on 64-bit systems
It was mistaking semaphore values over 0 as waiters, regardless of
actual waiters.

Pick-to: 6.1
Change-Id: Icebd01592ca8bdc1687a29dc569e3b630a262606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-09 17:58:15 +02:00
Eirik Aavitsland
f3a042c5ab Fix read-only pseudo-state in QPlainTextEdit stylesheet
Was implemented for the other text edit widgets, but not for
QPlainTextEdit.

Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-92490
Change-Id: Idd2a1b5c743fc030d3f2d4dd24e98f806b58f4d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-09 09:44:21 +02:00
Qt CI Bot
d74261b594 Merge integration refs/builds/qtci/dev/1617904724 2021-04-08 21:14:09 +00:00
Qt CI Bot
f35bf993ce Merge integration refs/builds/qtci/dev/1617895155 2021-04-08 20:33:13 +00:00
Qt CI Bot
4e9f6abd62 Merge integration refs/builds/qtci/dev/1617891528 2021-04-08 19:49:42 +00:00
Qt CI Bot
7d37ce8832 Merge integration refs/builds/qtci/dev/1617887904 2021-04-08 18:53:33 +00:00
Alexander Volkov
9667ac1c2d 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.

Pick-to: 6.1 6.0 5.15
Change-Id: Iae9c8b46dcdc96d21ac6b114a51c382b4949d3dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-08 17:57:36 +00:00
Qt CI Bot
9690e7bdd3 Merge integration refs/builds/qtci/dev/1617880670 2021-04-08 16:21:16 +00:00
Niclas Rosenvik
7d3434f970 Fix environ build break on FreeBSD
QMAKE_LFLAGS_NOUNDEF = <EMPTY> for FreeBSD did not get converted
to CMakeLists.txt. This breaks the build on FreeBSD since environ
is missing from libc, it is available at runtime.
Turn -Wl,-no-undefined into warnings on FreeBSD to fix the build.
Also add a comment based on the one from corelib.pro .

Change-Id: I3835884a2682af0f68a4d65dede3e4e5d4104ac8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-08 15:17:28 +00:00
Alexey Edelev
bbe26a7667 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>
2021-04-08 16:15:54 +02:00
Qt CI Bot
5c969aeab1 Merge integration refs/builds/qtci/dev/1617874569 2021-04-08 14:15:53 +00:00
Andy Shaw
f64201c493 Set QGuiApplicationPrivate variables after platform window is destroyed
By setting these variables after the platform window has been destroyed,
it will enable any platform specific code to handle changes in terms of
focus and so on before the destruction of the window changes these
directly. For example, this will prevent a problem with iOS where it
keeps track of the current focus object as the signal indicating that
the change to focus will still be emitted. This is before the variable
is set to nullptr if there is no parent window.

Change-Id: Ie540c10760d06dc62e163ccf6f6edea200b43bbf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-08 14:27:57 +02:00
Alexey Edelev
70464b355e Specify QT_TESTCASE_BUILDDIR for Qt::Test users implicitly
QT_TESTCASE_BUILDDIR was implicitly defined by Qt::Test target for
library users in Qt5. By default, this definition will point to
CMAKE_CURRENT_BINARY_DIR. This logic works similarly to qmake logic.

From user's perspective it might be useful to not rely on standard
search paths, but specify own. This can be done by setting the
QT_TESTCASE_BUILDDIR property for the user's target. CMake will
substute the value of the QT_TESTCASE_BUILDDIR property into the
QT_TESTCASE_BUILDDIR definition.

The implicit QT_TESTCASE_SOURCEDIR also seems to be useful. According
to the current logic, it points to CMAKE_CURRENT_SOURCE_DIR.

Fixes: QTBUG-92079
Change-Id: I8a9065f08e859c713b3c8cc08142a9ced0677770
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-08 13:16:41 +02:00
Alexey Edelev
4ed9402d7a Fix linking order of the resource objects
The generated object resource library depends on the Qt::Core library
because uses the functions defined in qresource.cpp. Dummy linking of
the Qt::Core to an object library has an effect only when the object
library is linked directly to the executable as a target. If we link
the object library as INTERFACE library we miss out all the objects
that need to be linked to the executable. This behavior is explained
here:

    https://bit.ly/3sFWKvI

Thus, the only option to link the object library objects to the
endpoint executable is to use TARGET_OBJECTS property in genex, as
it's already done. But that means we are losing all profits that
target actually has, especially linking the object library dependencies.

The combination of both of the above methods does the job. The only
thing that looks fragile so far is order. Currently, the order we
use in the target_link_library call applies to the linker command line.
This means the object library objects must always appear before the
object library target.

Change-Id: If1f0e35e0445d5e96a1f2249ab44114cd36630e9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-08 11:29:29 +02:00
Volker Hilsheimer
2c2b349974 Don't judge other people's writing systems
Pick-to: 6.1 6.0 5.15
Change-Id: Ifb8265bad4c8c96c6b20f957c376cec47e28f666
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-08 08:48:43 +02:00
Qt CI Bot
1db8b0de0d Merge integration refs/builds/qtci/dev/1617829777 2021-04-07 23:25:09 +00:00
Qt CI Bot
e1cfbc10de Merge integration refs/builds/qtci/dev/1617826149 2021-04-07 22:23:53 +00:00
Fabio Falsini
ea4868c49d Add legacy external storage access flag
Since latest version of Qt need Android
target sdk 29 the qt direct storage access
doesn't work because a new scoped storage
access way has been introduced. This flag
allow to have current storage access
way to work again (but is limited to
target sdk 29 only)

Pick-to: 5.15 6.1
Fixes: QTBUG-92239
Change-Id: If0d0af7c171de4b3e8bb8dd9a88fd61b65d1c839
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-04-07 23:01:59 +02:00
Qt CI Bot
b187ce87f9 Merge integration refs/builds/qtci/dev/1617813097 2021-04-07 21:01:58 +00:00
Robert Löhning
7473317b52 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
Pick-to: 5.15 6.0 6.1
Change-Id: Ib759e3e3ac0b0d0d483f8e8ce11002e079db3ace
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-07 20:07:56 +00:00
Qt CI Bot
5712853061 Merge integration refs/builds/qtci/dev/1617802255 2021-04-07 18:57:36 +00:00
Qt CI Bot
fecba62d32 Merge integration refs/builds/qtci/dev/1617798649 2021-04-07 16:50:55 +00:00
Andrey Butirsky
62e697fd56 fix Alt+` shortcut on non-US layouts
Make it possible for non-letter-keys with Latin 1 symbols (`, !, @ etc.)
to participate in shortcuts also, when the keys generate national
symbols on non-Latin layout.
For example, in Russian layout, "`" key generates cyrillic "ё" letter of
national alphabet, so shortcuts with the key should still work
regardless of the actual layout.

Fixes: QTBUG-90611
Change-Id: Id9a505210ff33a94b82511b88c30ef79f3d03913
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-04-07 16:15:19 +00:00
Alexey Edelev
cbdce59cd2 Add the SIMULATE_IN_SOURCE argument to _qt_internal_test_expect_pass
test_QFINDTESTDATA builds the project in the source tree, this is
necessary because the test requires relative paths to the source file
names. This function could be useful for other tests, so it makes sense
to extend the _qt_internal_test_expect_pass/fail macros to support
build in the source tree.
Note that, the SIMULATE_IN_SOURCE argument doesn't build the test in
the existing source tree, but copies source files to the build tree
first to do not litter the source directory.

Change-Id: I16e790d74be2a0c5ca0593e0f88580dbe09882b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-07 17:56:57 +02:00
Thiago Macieira
89a0ed1009 Allow qrandom_p.h to be included by more than one .cpp in QtCore
I thought we could use C++17 inline variables, but those can't be used
across DLL boundaries:

 qrandom_p.h:75:48: error: definition of 'QBasicAtomicInteger<unsigned int> qt_randomdevice_control' is marked 'dllimport'

Change-Id: Id2983978ad544ff79911fffd1671f857587ef2fb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-07 08:36:03 -07:00
Sona Kurazyan
a4d1ed854d Do not notify about property changes if the value hasn't changed
After 2ffb91ac59 we manually call notify()
for QObjectCompatProperties. Currently we always call it when setting
values to compat properties, even if the value hasn't actually changed.
Fixed to call notify() only if the value is being changed.

Task-number: QTBUG-85520
Change-Id: I385db84c4009c45406e204b96e0e37ce5fa8882b
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-07 14:51:04 +02:00
Edward Welbourne
0c9fc20e7f 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
Pick-to: 6.1 6.0 5.15
Change-Id: I83052b1b6888728c81135db22a9c6298ae439375
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-07 14:51:04 +02:00
Lars Knoll
df54a5d087 Add QRhiTexture::RG16 format
Those are needed to handle 16bit YUV formats in Qt Multimedia.

Change-Id: I39c67bf4fcf558487b7819ea38e578f99c12a3ed
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-04-07 14:29:23 +02:00
Ilya Fedin
0baa26638d 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.

Pick-to: 6.1 6.0
Change-Id: Iee5d0bb610c3ff397babee89ef1ee788ac19f477
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-04-07 11:45:31 +00:00
Mårten Nordheim
587e3bb0ba QSemaphore: fix missed wakes with futex on Windows
We do this by making the 'futexNeedsWakeAllBit' to be part of both the
expectedValue and the pointer we're waiting on.
This makes sense since having the 'futexNeedsWakeAllBit' set is a
requirement for starting a sleep. Thus we should condition
sleeping on whether or not another thread unset it.

Since the futexNeedsWakeAllBit is in the "topmost" bit of the pointer we
wait on we'll need to use the full 64-bits on 64-bit platforms.

This isn't enabled (nor was it an issue) for configurations with
'futexHasWaiterCount' since that works differently, and waits for the
high 32 bits.

Fixes: QTBUG-92148
Change-Id: I424c605f0120ea5e647c5bb19b00ff35eaf1608a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-07 13:35:10 +02:00
ChunLin Wang
b8802071ed 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
Pick-to: 5.15 6.0 6.1
Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6
Reviewed-by: David Faure <david.faure@kdab.com>
2021-04-07 19:30:08 +08:00
Joerg Bornemann
20db8dbeeb androiddeployqt: Fix the fallback location of rcc
Now, that rcc lives in libexec, we need to assume the location of rcc to
be "bin" on Windows and "libexec" elsewhere.

Pick-to: 6.1
Fixes: QTBUG-92245
Change-Id: Idb81a5d02bae9ca3254e7590140a128500572b07
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-07 10:21:52 +02:00
Alexandru Croitor
d0c2425d79 CMake: Choose better defaults for qt_add_plugin STATIC/SHARED
There was a recent behavior change where the public CMake API
qt_add_plugin API took into account the value of BUILD_SHARED_LIBS
to decide whether the plugin should be a static or shared library.

Instead, use the following new behavior

 - If no explicit option STATIC / SHARED option is passed, default to
   whatever flavor Qt was built as.
   Aka if Qt was configured with -shared, qt_add_plugin defaults
   to creating shared plugins. If it's a -static Qt, create static
   plugins.
 - If an explicit STATIC / SHARED option is set, override the default
   computed value with the given value.

As a result BUILD_SHARED_LIBS does not affect Qt plugins anymore. This
is more in line with Qt expectations.

Add SHARED as a new valid option to pass to qt_add_plugin (it wasn't
before).

Add tests to check for the above behavior.

Amends aa4a1006cb

Pick-to: 6.1
Fixes: QTBUG-92361
Task-number: QTBUG-88763
Change-Id: Iae806024ddd5cf10cfe58ddbcebd2818084b0bd7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-07 10:10:55 +02:00
Volker Hilsheimer
1e8b085f8c Fix return type of QMetaType::sizeOf in documentation
Pick-to: 6.1
Change-Id: I6f5a866fa83f0e2720d62c5170c9283997b31a7f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-07 09:57:44 +02:00
Volker Hilsheimer
e9ae8c2b0c Fusion style: don't use large icons in QLineEdit
Partly revert 24226bb5f5 by falling through
to the QCommonStyle implementation, which defaults to PM_SmallIconSize.

Fixes: QTBUG-92460
Change-Id: I82f99e98640a962577fd94556bef04f4da5789e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-07 09:57:30 +02:00
Robert Löhning
d15bfba176 Explicitly set enums' type to avoid undefined behavior
Fixes oss-fuzz issue 31022.

Fixes: QTBUG-92159
Pick-to: 6.1
Change-Id: I8f0dfbe0e198f9ac43754758d18db1f0842d6eae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-07 08:53:01 +01:00
Qt CI Bot
d05118bf10 Merge integration refs/builds/qtci/dev/1617712854 2021-04-06 19:07:48 +00:00
Qt CI Bot
604087361c Merge integration refs/builds/qtci/dev/1617702467 2021-04-06 14:51:16 +00:00
Qt CI Bot
8398f9dada Merge integration refs/builds/qtci/dev/1617698863 2021-04-06 13:47:42 +00:00
Fabian Kosmale
4be2741aa2 Document meta-object revision 10
Amends cb43aaca11

Change-Id: I7bcf2b86aa29d00291f5d8ad44a89320b9eae2f5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-06 14:17:24 +02:00
Volker Hilsheimer
95a31d0738 Assert that pointer is not nullptr before dereferencing
Fix static analyzer warning 0dc0b2a764417025a335a3a60b814335.

Change-Id: I9891194b74dda51032c887b9351fe7314174fcd6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-04-06 14:00:55 +02:00
Eskil Abrahamsen Blomfeldt
70af64433f Update to Harfbuzz 2.8.0
This updates Harfbuzz to the latest version and also
adds an import script to help with this work in the
future.

Task-number: QTBUG-90217
Pick-to: 6.1
Change-Id: I23eae7b7bbbd5001df9873e4784a0c4213de5508
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-06 12:55:18 +01:00
Fabian Kosmale
595b4e1a9b QList: Satisfy contiguous_range requirements
With C++20, there is a new iterator_category: contiguous_iterator, for
containers whose elements are stored contiguously in memory. In Qt 6,
QList satisfies this requirement.

However, we still need to tell the standard machinery about it. Step one
is to mark the iterators as contiguous_iterator; as that exists only in
C++20, we have to ifdef accordingly.
We also have to ensure that the iterators satisfy pointer_traits by
defining element_type due to how contiguous_range is specified. As this
runs afoul of LWG 3346, we check for known bad _GLIBCXX_RELEASE
versions.

Change-Id: I8c134544e694ba937e4d912393eb72fa75b49e3d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-06 11:35:35 +02:00
Doris Verria
0eb0fc8701 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
Pick-to: 5.15 6.0 6.1
Change-Id: Ie63d68d8f564a4a640bdb8e7564f028784faab97
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-04-06 10:55:54 +02:00
Doris Verria
37f9f2e7af 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
Pick-to: 5.15 6.0 6.1
Change-Id: I6ef95d51071c1d79f1cc07425a46958f50091b7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-04-06 10:55:35 +02:00
Mårten Nordheim
9211d04730 QSemaphore: move suspect increment of waiter count
We might return false a few lines down, without decreasing the count.

Change-Id: I0a90c07f279860987e41539e9d5f3b5d2cb15207
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-06 09:55:14 +01:00
Alex Trotsenko
72d1a54763 QWindowsPipeReader: determine pipe state before signaling
The 'pipeBroken' flag must be updated before emitting the readyRead()
signal to avoid deadlock of waitForReadyRead() inside slot connected
to readyRead().

Change-Id: Ie393fdd594c6691da6609ea18307589b7157c624
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-06 11:27:41 +03:00
Nico Vertriest
6cf92f1382 Doc: Fix link errors qtbase
Task-number: QTBUG-90662
Change-Id: I17147d149d9f222c142853805443aff94c5a5ff7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-06 07:34:21 +01:00
Volker Hilsheimer
a395372ccf 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 c501e09efa.

Pick-to: 6.0 6.1
Change-Id: I174a7b6214cd8b9579b029ebf57e4d5b2e28e574
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-04-04 11:02:42 +02:00
Thiago Macieira
451fb66212 QThreadPool: let the started thread have the same name as the pool
If the pool has a name. This should make identifying threads belonging
to different pools easier in process-inspection tools.

Fixes: QTBUG-92004
Change-Id: Id2983978ad544ff79911fffd167225902efeb855
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-03 16:15:29 -07:00
Ivan Solovev
33786e7b02 Fix Q_OBJECT_COMPAT_PROPERTY_WITH_ARGS when using the signal
This commit amends 4ceaf22bed.
Signal parameter was not actually used, even is the signal was
specified.
This patch fixes it and also introduces unit-tests for this issue.

Change-Id: I029d413644eb6a72af3bdce27cc5f5bcadfe946a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-03 17:21:30 +02:00
Samuel Gaist
bc00daae71 Add support to set thread priority to QThreadPool
Currently, QThreadPool's generated threads inherit the priority from the
thread they are created and that cannot be changed. This merge request
adds a property to QThreadPool so that the priority of the threads can
be different.

The default behavior does not change.

[ChangeLog][QtCore][QThreadPool] QThreadPool can now be configured to
use a different thread priority when creating new threads than the one
it inherits from the thread it was created in. This will only apply to
the threads started after the property is changed.

Fixes: QTBUG-3481
Change-Id: Ic98d4312d055a3357771abb656516ebd0715918d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-03 09:14:55 +02:00
Thiago Macieira
c2a09242c8 QGenericAtomicOps: allow pointer-sized non-atomic atomics
Change-Id: Id2983978ad544ff79911fffd1671f696b8a9ca35
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-02 11:12:17 -07:00
Sze Howe Koh
30ac9d5db4 Doc: Fix return type of QCursor::shape()
QCursor::shape() returned an int in Qt 3 but returned Qt::CursorShape
since Qt 4.

Change-Id: I6da9da9bed35c09943a074e7e3a618bce7797ceb
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-04-02 21:18:31 +08:00
Christian Ehrlicher
d1946a0ca2 QTable/ListView: mark functions as reimp instead internal
Some public accessible functions were wrongly marked as \internal
instead \reimp.

Change-Id: I6196427fc1b6535f6725107a00be82ab4cc821c3
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-04-02 14:18:07 +01:00
Alexandru Croitor
659817e287 CMake: Fix building multi-arch universal macOS Qt
Use the same approach we use for iOS, which is to set multiple
CMAKE_OSX_ARCHITECTURES values and let the clang front end
deal with lipo-ing the final libraries.

For now, Qt can be configured to build universal macOS libraries by
passing 2 architectures to CMake, either via:

  -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"

or

  -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"

Currently we recommend specifying the intel x86_64 arch as the first
one, to get an intel slice configuration that is comparable to a
non-universal intel build.
Specifying the arm64 slice first could pessimize optimizations and
reduce the feature set for the intel slice due to the limitation
that we run configure tests only once.

The first specified architecture is the one used to do all the
configure tests.

It 'mostly' defines the common feature set of both architecture
slices, with the excepion of some special handling for sse2 and
neon instructions.

In the future we might want to run at least the Qt architecture config
test for all specified architectures, so that we can extract all the
supported sub-arches and instruction sets in a reliable way.

For now, we use the same sse2 hack as for iOS simulator_and_device
builds, otherwise QtGui fails to link due to missing
qt_memfill32_sse2 and other symbols.

The hack is somewhat augmented to ensure that reconfiguration
still succeeds (same issue happened with iOS). Previously the sse2
feature condition was broken due to force setting the feature
to be ON. Now the condition also checks for a special
QT_FORCE_FEATURE_sse2 variable which we set internally.

Note that we shouldn't build for arm64e, because the binaries
get killed when running on AS with the following message:

  kernel: exec_mach_imgact: not running binary built against
  preview arm64e ABI.

Aslo, by default, we disable the arm64 slice for qt sql plugins,
mostly because the CI provisioned sql libraries that we depend on only
contain x86_64 slices, and trying to build the sql plugins for both
slices will fail with linker errors.
This behavior can be disabled for all targets marked by
qt_internal_force_macos_intel_arch, by setting the
QT_FORCE_MACOS_ALL_ARCHES CMake option to ON.
To disble it per-target one can set
QT_FORCE_MACOS_ALL_ARCHES_${target} to ON.

Task-number: QTBUG-85447
Change-Id: Iccb5dfcc1a21a8a8292bd3817df0ea46c3445f75
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-01 18:14:59 +02:00
Shantanu Tushar
0592123a0c Add std::chrono overloads for QLockFile functions
This makes it convenient to use QLockFile for projects which are able to
use std::chrono to denote durations.

Change-Id: Ib4520f6142412bdefe659fccc1e6d15b81af2f25
Reviewed-by: David Faure <david.faure@kdab.com>
2021-04-01 15:38:08 +02:00
Qt CI Bot
b3281eb6f4 Merge integration refs/builds/qtci/dev/1617269094 2021-04-01 11:38:27 +00:00
Qt CI Bot
bf6f0c6cac Merge integration refs/builds/qtci/dev/1617264361 2021-04-01 10:32:08 +00:00
Lorn Potter
4972fdb350 wasm: add cmake build support
A few configure defines get changed:
QMAKE_WASM_PTHREAD_POOL_SIZE is now QT_WASM_PTHREAD_POOL_SIZE
QMAKE_WASM_TOTAL_MEMORY is now QT_WASM_INITIAL_MEMORY
QMAKE_WASM_SOURCE_MAP_BASE is now QT_WASM_SOURCE_MAP_BASE

device-option EMSCRIPTEN_ASYNCIFY=1 is QT_EMSCRIPTEN_ASYNCIFY=1

To create source maps for debugging. use
device-option QT_WASM_SOURCE_MAP=1

Task-number: QTBUG-78647
Change-Id: If9f30cd7fb408c386d6d69b5f7b1beecf1ab44b5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-01 19:23:42 +10:00
Qt CI Bot
5bf4133c17 Merge integration refs/builds/qtci/dev/1617260319 2021-04-01 09:23:38 +00:00
Fabian Kosmale
29ef667a69 QObjectCompatProperty: Reintroduce operator=
This is a partial revert of a1a2d97e34.
Reason: The new design does not notify automatically anymore, so using
operator= is safe to use.

Change-Id: I6cb735e40c0da72d22fcc426423eb7830901e5f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-04-01 10:04:35 +02:00
Fabian Kosmale
4ceaf22bed QObjectCompatProperty: Emit signal in notfiy
There is no need to write emit and notify at the same time, as not
emitting after notify does not make sense.
This naturally only applies to properties with a changed signal.

Change-Id: I99ff7863a509262ad9d4f7c9c5afbc66fd37001c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-01 10:04:31 +02:00
Fabian Kosmale
2ffb91ac59 QObjectCompatProperty: Require explicit notify
For QObjectCompatProperty, which allows to do basically anything in its
setter, it is actually easier to manually specify when the change should
become visible. This is in line with manually writing emit calls in the
old property system, and allows the preservation of class invariants.

Change-Id: I585bd3f25d722ca3fd721ead85fe73dbee26c5f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-04-01 10:04:27 +02:00
Pasi Petäjäjärvi
d8347bd9fe eglfs: Newer Nvidia libdrm provide device instead driver module name
In newer Nvidia proprietary libdrm binaries display device name is
actual device and not driver module name. Check which provided device
name has been returned with EGL_DRM_DEVICE_FILE_EXT to choose correct
function to open device.

Pick-to: 5.15
Fixes: QTBUG-91184
Change-Id: I95f907dfa30057da0dca4ff32e0605c6bb10e0a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-04-01 06:37:35 +00:00
Piotr Mikolajczyk
2e3f48637e Linux: Add abstract address support for QLocal{Socket,Server}
Takes advantage of Linux's and Android's support for abstract namespace
when binding sockets, which is independent of the filesystem (see man
entry for unix domain sockets).

To make QLocalServer and QLocalSocket use an abstract socket address,
one needs to set the socket options to QLocalServer::AbstractNamespaceOption.

Fixes: QTBUG-16090
Change-Id: Ia9f9c9cc1ac5c28f9d44b0a48d854a7cfbd39b11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-01 06:57:04 +01:00
Qt CI Bot
aa84de1afa Merge integration refs/builds/qtci/dev/1617226155 2021-03-31 23:39:10 +00:00
Alexandru Croitor
f5f56caa39 CMake: Regenerate stale prev_configure.cmake files
Change-Id: I75d7f2f3d9b40ad392bb598b466fec4708b51a61
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-31 23:27:51 +02:00
Alex Trotsenko
007addc0cc QWinEventNotifier: migrate to new thread pool API
Change-Id: I2fb1ba7254ecfd502a22c706404f92dd1bc3a584
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-31 22:52:22 +03:00
Alex Trotsenko
64f02ebf05 QLocalSocket/Win: fix possible UB in _q_pipeClosed()
We must stop the pipe writer before closing the handle on which it
operates.

Pick-to: 5.15 6.0 6.1
Change-Id: I4765dd8393167fe2453653aba76a097b8ace8e3d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-31 19:02:33 +03:00
Alex Trotsenko
97877d7948 QLocalSocket: fix signal name in docs
It should be disconnected() instead of disconnectedFromServer().

Pick-to: 6.0 6.1
Change-Id: I2b816e9c92d675ea5a7a26b4752e831c30950ef2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-31 18:49:20 +03:00
Xing LinKun
6a7d2da7dd Fix coding style in android platform and style plugins
Change-Id: Ic0a1150178c571ea0c20a045ad7520d23d6d878c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-31 01:09:24 +00:00
Qt CI Bot
ae0fe7d4da Merge integration refs/builds/qtci/dev/1617116580 2021-03-30 17:19:59 +00:00
Qt CI Bot
5d5cc3c7c7 Merge integration refs/builds/qtci/dev/1617109351 2021-03-30 16:02:41 +00:00
Laszlo Agocs
7ccd2d0246 rhi: Add support for custom bytes-per-line for uncompressed raw data
Fixes: QTBUG-90770
Change-Id: Icba328c417bcce256e7b44f1d540af7f8e83376b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2021-03-30 16:43:35 +02:00
Qt CI Bot
5ce367a552 Merge integration refs/builds/qtci/dev/1617105725 2021-03-30 14:36:19 +00:00
Qt CI Bot
31c81e08c6 Merge integration refs/builds/qtci/dev/1617098611 2021-03-30 13:30:26 +00:00
Alexey Edelev
9466b3629a 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>
2021-03-30 14:32:28 +02:00
Qt CI Bot
7ae037bc82 Merge integration refs/builds/qtci/dev/1617094992 2021-03-30 12:22:15 +00:00
Bartlomiej Moskal
06b0b2be16 Android: Fix Touch event position depending on Surface
Touch event position is counted from begin of Surface. Later method
QAndroidPlatformScreen::topLevelAt(..) is trying to return the top level
window at the touch event position.

In case when Surface is moved, we should also add this move to event
position. If it is not happening, touch event will not be assigned to
correct window.

Fixes: QTBUG-65927
Pick-to: 5.15
Change-Id: I549b9ec964cb09607153c60b9d9f6e0068a04cc2
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-30 12:01:02 +00:00
Qt CI Bot
32fd331bce Merge integration refs/builds/qtci/dev/1617091379 2021-03-30 10:52:16 +00:00
Andrei Golubev
b1377ed02d Add literal operators for QString and QByteArray
[ChangeLog][QtCore][QString] Added literal operator
u"..."_qs that converts a char16_t string literal to QString

[ChangeLog][QtCore][QByteArray] Added literal operator
"..."_qba that converts char string literal to QByteArray

Change-Id: I4aa59b28cc17bff346b378eb70008fb8185d21ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-30 10:37:07 +01:00
David Faure
b4aac2af19 QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699ce

Fixes: QTBUG-92220
Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b
Pick-to: 6.1 6.0 5.15
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 10:36:06 +02:00
Piotr Mikolajczyk
c80f262258 Android: Add select and copy capability to read-only text widgets
In case of a read-only text editing widget it was imposibble to copy text
from it. In QtWidgets you could not even see the selection handless.
Text selection in QtWidgets module was filtered depending on readOnly
property of the widget. Additionally, in InputMethod the read-only state
was translated into disabled.

Patch also makes the edit menu to be aware of the read-only status of
the control - the menu items are different for rw and ro controls.

Task-number: QTBUG-91417
Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-30 10:35:59 +02:00
Alexey Edelev
9275edbc31 Remove the redundant code related to the QT_NAMESPACE variable
Change-Id: Ib82b199fc7761c8b84f915c2808c7f57bf23927c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 10:31:34 +02:00
Fabian Kosmale
b786c86b91 QList: replace typedef with using
Change-Id: Ie3fa605cf05d65ca422df738dcce1fa49d6371c7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-30 10:01:50 +02:00
Volker Hilsheimer
ccf1a1a953 Replace QTextDocumentResourceProvider with a std::function
376e3bd8ec added the new class for Qt 6.1,
but during header review we concluded that using a class introduces
complexity wrt instance ownership and API design that can be avoided by
using a std::function instead.

The functionality is tied to QTextDocument, so the type definition and
the default provider API is added there.

Since std::function is not trivially copyable, the atomicity of the
previous implementation is not maintained, and concurrent modifications
of and access to the global default provider from multiple threads is
not allowed. The relevant use case can be supported by implementing a
resource provider that is thread safe.

Task-number: QTBUG-90211
Fixes: QTBUG-92208
Pick-to: 6.1
Change-Id: I39215c5e51c7bd27f1dd29e1d9d908aecf754fb7
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-30 08:11:27 +02:00
Andy Shaw
b050d4867f 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
Pick-to: 6.1 6.0 5.15
Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-29 20:47:02 +01:00
Qt CI Bot
3e6b7b3bf6 Merge integration refs/builds/qtci/dev/1617030826 2021-03-29 17:36:45 +00:00
Andreas Buhr
b56fef2da2 Remove outdated comment
In qproperty_p.h and qpropertyprivate.h there were comments
stating this would be used only in certain other headers.
Now qproperty_p.h contains functionality to implement bindable
properties, so it is used pretty much everywhere in qt.
qpropertyprivate.h is only included in qproperty.h.
This patch removes the outdated comments.

Change-Id: Ie7328691215f875e33e58a13160ce88bf41ca228
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2021-03-29 16:31:04 +02:00
Friedemann Kleint
e49e5d87be QFontDialog: Fix crash when passing QFont constructed from empty string/stringlist
The standarddialogs example showed a crash when opening the font dialog
due to the empty list.

Amends d8602ce58b.

Pick-to: 6.1
Change-Id: I93191485c72712d9b2d3ea0ae104f5edb9621f0c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-29 14:19:12 +00:00
Volker Hilsheimer
c8f6f8a222 Rename QUrlResourceProvider to QTextDocumentResourceProvider
While the class name is now a bit more than a mouthful, it's purpose
is very narrowly tied to QTextDocument, so don't use a very generic
name for it. That resources are provided based on a URL is to some
degree an implementation detail, and URLs are resource locators so
we don't need that in the class name.

Address code review comment for 6.1. Add documentation and links to
existing APIs with a similar purpose.

Task-number: QTBUG-90211
Task-number: QTBUG-92208
Pick-to: 6.1
Change-Id: I4f09057cc2f53a5595513c1c9422e6ccaad6ca13
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-29 15:59:40 +02:00
Alex Trotsenko
db1c238a66 QProcess/Win: do not use extended API for polling
We avoid entering an alertable wait state there, so calling
WaitForSingleObject() instead of the ...Ex() analog would be
appropriate.

Change-Id: I7cd23805519f18b3174f66537dcf4c0da5061ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-29 15:54:14 +02:00
Volker Hilsheimer
69dcdbc8da Make getter const, add const overloads
The supportedApiVersions member is new in Qt 6.1, make it const.

We can't change supportedLayers and supportedExtensions, but we can
add const overloads that call the non-const version for now. This
way, those APIs can also be called on const QVulkanInstance
instances or references.

Addresses header review comment.

Pick-to: 6.1
Change-Id: Ie99d74f62cad72990b42566e56234b9c686e86de
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-29 11:58:52 +01:00
Volker Hilsheimer
76b3d024e4 Use official names for Android versions
Google ditched the dessert names as of Android "Q". "Q" and "R" were
development names, the released versions are called  Android 10 and
Android 11, respectively.

Pick-to: 6.1
Task-number: QTBUG-90211
Change-Id: I36225067cc802ebd3ebd1289d509759ae1b2d83d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-03-29 12:58:39 +02:00
Craig Scott
aa4a1006cb Refactor qt_internal_add_plugin() and qt6_add_plugin()
Remove code duplication by calling qt6_add_plugin() from
qt_internal_add_plugin().

Separate out the public and internal arguments for the
variables defined in QtBuild.cmake for these functions.
Provide them via commands instead for greater robustness.
This separation allows other Qt repos to access the appropriate
set of keywords where they define commands that forward
on to *_add_plugin() in their implementations. Retain
the old variables for now to simplify the integration
steps for updating other repos. The old variables can
be removed once there are no more references left to
them in any repo.

Task-number: QTBUG-88763
Pick-to: 6.1
Change-Id: I0105523afd95995923bd20fc963d245bbb15d34d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-29 18:10:22 +11:00
Qt CI Bot
ebf9b3d096 Merge integration refs/builds/qtci/dev/1616760368 2021-03-26 15:17:07 +00:00
Qt CI Bot
cbb0ef5a86 Merge integration refs/builds/qtci/dev/1616748388 2021-03-26 13:45:09 +00:00
Qt CI Bot
16eee0d5cc Merge integration refs/builds/qtci/dev/1616752022 2021-03-26 13:12:46 +00:00
Edward Welbourne
1bdc74ad7b Document a peculiarity that might plausibly confuse readers
It at first sight seems perverse to null-check a variable we've
repeatedly dereferenced before, without visibly setting it since;
however, its address was stored where an event handler could get at
it, to clear it if deleting the object it points to. The check against
null really is needed, but the reason is non-obvious; so document the
reason and save the next developers to come this way some confusion.

In the process, relocate a related comment that belonged one line
earlier.

Change-Id: Id67b86edc5a9a76a827d66b5c0abcd017d98a2bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-26 13:04:48 +01:00
Qt CI Bot
27ebeeb50e Merge integration refs/builds/qtci/dev/1616744759 2021-03-26 10:09:36 +00:00
Giuseppe D'Angelo
0b4ccbf81e 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 697910e5fb.

Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115
Pick-to: 5.12 5.15 6.0 6.1
Done-with: Milian Wolff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-26 10:45:46 +01:00
Assam Boudjelthia
b9f27335e7 Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptions
Address feedback from header view.

Task-number: QTBUG-90211
Pick-to: 6.1
Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-26 09:29:18 +00:00
Fabian Kosmale
e05d666d42 QMetaType::id(): Fix ABI breakage
We cannot replace a non-inline method with an inline one without
breaking the ABI. Instead, we now create a version with a dummy int
parameter (to avoid ODR violations), and hide the non-inline version
behind an ifdef, so that it is only visible in qmetatype.cpp.

Pick-to: 6.1
Change-Id: Ib4e82e44071bdf5c37227409a56d377ff2e07ee0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-26 09:26:51 +01:00
Bartlomiej Moskal
547228bf86 Android: fix wrong position of cursor hander in split screen
Use activity window position to fix position of cursor hander. In case
without splti sceen, position of activity window is equal (0, 0), so it
does not have any effect.

Fixes: QTBUG-91362
Pick-to: 5.15
Change-Id: Icae9f19308112a78bdddf168abe81ffe7b6e4fae
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 08:05:13 +00:00
Bartlomiej Moskal
e402e1103b Android: fix for isSoftwareKeyboard method
isSoftwareKeyboard() method will rely on visibility flag from
activityDelegate. In such case it also need to consider that keyboard is
during the hiding.

Fix the regression related with commit:
e6ca200a3a

Before this change Software Keyboard is not showing after changing the
focus. It is happening when Keyboard is already visible and focus is
changed to widget that also need the keyboard. In such case keyboard is
hiding (and NOT showing again).

Pick-to: 5.15
Fixes: QTBUG-92051
Change-Id: I6a5d07b25442429fda6e715d09ea104432c5ef50
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 09:05:04 +01:00
Andreas Buhr
30016562c2 Add documentation how to formulate a property binding
To correctly formulate a property binding, some rules must be
followed. So far, these rules are not documented. This patch
adds such documentation.

Task-number: QTBUG-90511
Change-Id: Ibb509ea9098212c95f03433feb1f1aac751c4b2e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-26 08:42:25 +01:00
Andreas Buhr
59b0212215 Beautify bindable properties documentation
Some minor formatting changes

Change-Id: I336a442d01cb048397b2a65977cfb96bb7179752
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-26 08:42:07 +01:00
Fan PengCheng
35dd643b07 Fix coding style
Curly brace is supposed to go on the same line as the if.

Change-Id: I92fbd984e9ccdb06acdfe89e45c34b26a08df0cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-26 06:24:04 +00:00
JiDe Zhang
3e65d0408b Use QOpenGLContext::openGLModuleType() instead of QT_CONFIG(opengles2)
In the QOpenGLContext::openGLModuleType(), it will correctly judge
QT_CONFIG(opengles2), there is no need to use QT_CONFIG(opengles2) alone
in QGLXContext.

Change-Id: I012703b6a81b88fa4b8aa53cc1077c8b42d34ed5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-26 11:20:36 +08:00
Qt CI Bot
9c28080f49 Merge integration refs/builds/qtci/dev/1616701589 2021-03-25 22:14:31 +00:00
Qt CI Bot
87308fb95d Merge integration refs/builds/qtci/dev/1616690051 2021-03-25 20:23:15 +00:00
Andreas Buhr
dff67218bc Add documentation for internal Q_OBJECT_COMPUTED_PROPERTY
The internal class QObjectComputedProperty and the associated
macro Q_OBJECT_COMPUTED_PROPERTY did not have any documentation
so far. This patch adds some initial documentation.

Task-number: QTBUG-90511
Change-Id: Ibd31b9c482962b1618daf04fef4256aa52d589e3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-25 20:45:10 +01:00
Qt CI Bot
0c6b0fdcc3 Merge integration refs/builds/qtci/dev/1616682375 2021-03-25 18:47:45 +00:00
Qt CI Bot
ee200cc258 Merge integration refs/builds/qtci/dev/1616678767 2021-03-25 17:47:14 +00:00
Qt CI Bot
2220ddddf0 Merge integration refs/builds/qtci/dev/1616675134 2021-03-25 16:40:07 +00:00
Fabian Kosmale
cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

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

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

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

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
Qt CI Bot
9145650302 Merge integration refs/builds/qtci/dev/1616671507 2021-03-25 15:25:08 +00:00
Andreas Buhr
96796f0619 Add example to QObjectBindableProperty change handler docs
QObjectBindableProperty has a callback, which is called whenever
the value changes. This patch adds an example showing this.

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

Detected by testXkb KWin unit test

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

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

This causes trouble for static Qt builds in the CI.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Amends e57a94cbd8
Amends 3c4c02b3f1

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

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

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

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

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

Change-Id: I99414db4424b4342e0fa3d7a3789f85cad76d190
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-25 13:09:25 +02:00
Qt CI Bot
d30f88cbf1 Merge integration refs/builds/qtci/dev/1616661627 2021-03-25 11:01:18 +00:00
Qt CI Bot
3e8092d183 Merge integration refs/builds/qtci/dev/1616659664 2021-03-25 10:30:38 +00:00
Fabian Kosmale
ce83e56cfe QTypeInfo: Handle T::value_type being equal to T
Fix operator checks for containers whose value_type equals themselves.
It does  not make sense to recurse on value_type in that case. Thanks to
std::disjunction having short-circuiting semantics, we can avoid that
issue by checking first whether T is T::value_type.

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

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

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

Task-number: QTBUG-90511
Change-Id: Ie55e7d7829363bd5a29430a4250ddba14a761912
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-25 11:14:38 +01:00
Volker Hilsheimer
42e659b320 Fix deprecated macros
The QTextCharFormat::fontFamily  methods are deprecated as of Qt 6.1,
not as of Qt 6.0.

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

Address API review comment.

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

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

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

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

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

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

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

Reason for revert: This might cause ICEs in clang

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

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

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

Change-Id: I5e7cc04d5d8e42bdcb0edd2ab5fa34a08b96b6a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-23 12:49:08 +01:00
Edward Welbourne
824d963700 Restore support for reading /etc/timezone for system zone name
This restores one of the two mechanisms removed in
commit b0383cbd38,
transformed to fit in with the new cached system-zone determination.

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

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

Amends 19384f2e8f

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

Amends 5e9b2ade67

Change-Id: Iea51ef905b1cb7f91ca64b718d79bdc4f5c02c3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-23 06:42:16 +01:00
Qt CI Bot
dd7920821e Merge integration refs/builds/qtci/dev/1616448750 2021-03-22 23:46:28 +00:00
Qt CI Bot
adf8ba820a Merge integration refs/builds/qtci/dev/1616446659 2021-03-22 23:17:07 +00:00
Niclas Rosenvik
75296f347f Fix backtrace on non-linux systems
On BSD systems backtrace lies in libexecinfo. Use
FindBacktrace from CMake to be able to resolve
backtrace on more unixes than linux.

Change-Id: Ie14fd1727d2da03645fc2d6de10c0217baabad6b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-22 21:31:09 +00:00
Fabian Kosmale
8771669ca9 QMetaTypeInterface: Do not make member itself const
Dynamic metatypes, like the ones used in QML any Python, benefit if the
pointer in the interface is mutable: They can -either by inheritance
from QMetaTypeInterface or by copying one of its instances- get a
"prefilled" interface, and then replace any member to fit their use
case. Except that before this change, this was not possible for
metaObjectFn.

Change-Id: I6afba13f97174eb08391af38b73fcfc7b37a2276
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-22 21:56:24 +01:00
Giuseppe D'Angelo
647c0e80ed Enforce __cplusplus >= 201703L on MSVC
Client code on MSVC *must* pass /Zc:__cplusplus when using Qt.
Otherwise, this makes Qt code that relies on feature-testing
macros a mess. For instance, in QTBUG-91117, we trip on this code:

  // C++ version guard is necessary: you may have the header,
  // but including it in pre-C++20 will cause an hard error
  #if __has_include(<bit>) && __cplusplus > 201703L
  #include <bit>
  #endif

  #if defined(__cpp_lib_bitops)
  // use some <bit> functionality
  #endif

The #define __cpp_lib_bitops should've come from the preceding include
directive, but there's another possibility: that it comes from
<version> (or some other similar header) included transitively,
when compiling in C++20 mode, and *without* a bumped __cplusplus.
Yes, that's an actual possibility on MSVC.

Then, since we did not include <bit> ourselves due to the __cplusplus
version check, using the functionality will cause a compile error.

We're not going to fix *every* post C++-17 feature detection macro
because of MSVC and feature-test shenanigans. It's time to require
compilers to tell us the truth about what they support.

Fixes: QTBUG-91117
Change-Id: I9d74f9d8b74b5ac35dce3528e7a2006746a00676
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-22 19:57:07 +00:00
Qt CI Bot
65b4937f34 Merge integration refs/builds/qtci/dev/1616419842 2021-03-22 19:25:52 +00:00
Qt CI Bot
f5e300bf6a Merge integration refs/builds/qtci/dev/1616415197 2021-03-22 16:45:12 +00:00
Qt CI Bot
e8c3fc7c43 Merge integration refs/builds/qtci/dev/1616410126 2021-03-22 15:22:00 +00:00
Qt CI Bot
b4afffd6a2 Merge integration refs/builds/qtci/dev/1616406519 2021-03-22 15:19:48 +00:00
Allan Sandfeld Jensen
c32cd44d34 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).

Pick-to: 6.1 6.0 5.15
Change-Id: Ie24e19957d076fdf3ebd333074e26ede187489eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-22 14:29:14 +01:00
Fabian Kosmale
abd7496fba QFutureInterfaceBasePrivate: reorder members to save 8 bytes
And use in-class member initialization where applicable.

Task-number: QTBUG-92045
Change-Id: I54715709f2d8e54017311f45016c16d86ed3078b
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2021-03-22 13:12:15 +01:00
Qt CI Bot
fc76a348e4 Merge integration refs/builds/qtci/dev/1616402489 2021-03-22 11:14:01 +00:00
Zhang Yu
c47bb4478a 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
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-22 18:47:36 +08:00
Qt CI Bot
248ed57e05 Merge integration refs/builds/qtci/dev/1616400978 2021-03-22 10:36:21 +00:00
Qt CI Bot
f7e697f7bc Merge integration refs/builds/qtci/dev/1616400051 2021-03-22 10:31:24 +00:00
Fabian Kosmale
e07aec7eaa QFuture: cleanup headers
Do not include vector; we currently do not use std::vector, and the plan
is to use QList when that one supports move-only types.
Use QMutexLocker instead of std::mutex_locker, considering that the
former is already included with <QMutex>.
Use forward declarations where applicable.
Add header which were currently only indirectly included (to make
QtCreator's code model happy).

Change-Id: I37d5cd3982047a6d8a3132fd66571878298039b3
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
2021-03-22 10:47:13 +01:00
Oliver Wolff
5910adae74 QWinRTFunctions::await: Return proper error in case of timeout
The await function is still used in other Qt modules which depend on UWP
API (like Qt Bluetooth).

ERROR_TIMEOUT is a win32 error not an HRESULT so that the check for
FAILED(ERROR_TIMEOUT) in "static inline HRESULT await" will not work as
expected if we do not use HRESULT_FROM_WIN32.

The await function will fail in asyncOp->GetResults but the error
message will not be related to a timeout but about a function being
called at an unexpected time.

Change-Id: Iac46b27f379f80769913d544e32320c77b799b4f
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2021-03-22 09:40:29 +01:00
Albert Astals Cid
9e837c936f Make QMovableArrayOps::Inserter non copyable
copying it would be a mistake
QGenericArrayOps::Inserter is already mark as non copyable

Change-Id: Ib9eba5e26bf943fe82c5cfc83f0785e214d3cc67
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-22 09:03:29 +01:00
Nico Vertriest
c535933d89 Doc: Fix qdoc warnings on snippet files
qtwidgets-index.qdoc:123: (qdoc) warning: Cannot find file to quote from: 'snippets/snippets.pro'
qtwidgets-index.qdoc:123: (qdoc) warning: Unexpected '\snippet (//! [qmake_use])'

Task-number: QTBUG-90662
Change-Id: I702b685e7cd9c34b5a07480ecb99e913ce250d70
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-22 08:59:23 +01:00
Fan PengCheng
b6fe187f0d Avoid a crash in QMessageBoxDetailsText, just in case
Change-Id: I3322767363c34ad1f131b6ef24e274e5e5cc9f16
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-03-22 15:28:14 +08:00