Commit Graph

46719 Commits

Author SHA1 Message Date
Tor Arne Vestbø
5db69cb5de macOS: Merge keySequenceToKeyEqivalent into call site
Change-Id: Iae33f627ad6abfc9bbba9b098417bd13caee00f8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-10 12:16:57 +02:00
Tor Arne Vestbø
7917f9b7f5 macOS: Add QCocoaKeyMapper::toCocoaModifiers
Change-Id: I489c64733275260bb041f8df5cc5ff4a571d4e9c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-10 12:16:54 +02:00
Andy Shaw
0ef46b41d8 Android: Enable configuring for a single abi architecture
Fixes: QTBUG-80938
Pick-to: 5.15
Change-Id: Id87202e6b2520b18c6b06b71675157f588a28bd6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-10 09:38:13 +00:00
Andy Shaw
c92528b6cc Mark gradlew with Unix eol endings as it is a script
Since this could end up being copied from a Windows machine to another
when it is part of a project using Android then we should make sure the
line endings are preserved to be on the safe side. This avoids a strange
problem when deploying due to gradle failing to run.

Change-Id: Ie170461a351c9279092b58d4e8353b81cc8561d3
Pick-to: 5.15 5.12
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-10 11:38:00 +02:00
Allan Sandfeld Jensen
acc3f19038 Fix one check for AVX2
We should check for the haswell set of features here as well, as we
do in the main switch.

Not that there are supposed to be any processors with AVX2 without the
full set though.

Pick-to: 5.15
Change-Id: Ifa648d605a50748cff21ae0a0c75ae47f620d9c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 11:10:05 +02:00
Andrei Golubev
d9c40cf90e Remove the setting of GrowsBackwards from QList
The flag is practically unused, there is no logic that relies on its
existence. From experience of prototyping prepend optimization (where
the flag actually makes sense), it is better to temporarily remove it:
QList is, in fact, unaware of how to correctly use it at the moment

Once GrowsBackwards-using code is implemented at the lower levels,
the usage of the flag will be reintroduced to QList along with the
changes that ensure correct behavior

Task-number: QTBUG-84320
Change-Id: I618adfcd69b15c76ddafd78cca5e9aa0073e4c91
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 11:49:05 +03:00
Dimitrios Apostolou
14a8fb2321 Rename local variables masking parameters
As found by LGTM.com.

Change-Id: I9a237899dc50009da5643c49c590f3b15bb817bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 02:37:11 +02:00
Dimitrios Apostolou
b800f74fe0 Rename local variable hiding parameter
As found by LGTM.com.

Change-Id: If3024bdaad06cafcd401b4ee04524ad03bd69a97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 02:37:02 +02:00
Dimitrios Apostolou
1e546595e9 Remove unused imports
As found by LGTM.com.

Change-Id: I1704f10f9bab1b11ab22824aca0cfcdcb47fef2f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-10 02:36:54 +02:00
Dimitrios Apostolou
a5e6e0dd2e Rename local variable hiding global one with the same name
As found by LGTM.com.

Change-Id: Ic4c38c02529e7cc7eb7c79c3936b7d5f030fd84f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 02:36:47 +02:00
Dimitrios Apostolou
3736ebf7c8 Remove duplicate dict entry
As found by LGTM.com.

Change-Id: I9d41fec8a9f80fe9cb1cae960418032f84646a99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-10 02:36:40 +02:00
Dimitrios Apostolou
89e3a426a8 Remove local variable masking a global one
As found by LGTM.com.

Change-Id: Ied926a9eace9044ec9abc859557cd28178e5defb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 02:36:33 +02:00
Dimitrios Apostolou
efdfdfa0fc Remove dead code
Found by LGTM.com.

Change-Id: I661e2287a6964b63d5b03c8913bc4b09f21ffdf1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-10 02:36:25 +02:00
Giuseppe D'Angelo
8a13aa0e02 QArrayDataPointer: use move and swap in move assignment
Not plain swap; QADP does not hold just memory but arbitrary
state (depending on T).

Change-Id: I3560577e4109607a51b2c72b67e22e38813977b3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-10 02:16:09 +02:00
Friedemann Kleint
6758f73bb7 Move glxconvenience into QtGui
OpenGL is not quite as dead as initially assumed.

Task-number: QTBUG-83255
Change-Id: I953040149812a5258caad5fe6bac0835e1982dd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-10 00:47:56 +02:00
Allan Sandfeld Jensen
60d72b7ab6 CMake: Fix incorrect SIMD arch_haswell and avx profile conditions
Fix the conditions in qt_add_simd_part for arch_haswell and the
avx512 profiles to mimic what simd.prf does.

Add missing SIMD flags in QtCompilerOptimization for arch_haswell.

Compute the compile flags for the avx512 profiles from the
profile dependencies.

Remove the special case in Gui that hardcoded the compilation of
qdrawhelper_avx2.cpp to be conditional on avx2 being enabled
instead of arch_haswell. The Gui project already has another
qt_add_simd_part that is enabled if arch_haswell is enabled, which
will now work correctly due to the fixes in qt_add_simd_part.

Change-Id: I7a61a03b5565d4fa438f22b329e0d9dd7acd9273
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 23:02:39 +02:00
Ulf Hermann
f9e1674094 moc: For non-STORED QProperties, expect a pointer
This way we can return a nullptr for cases where the class does not want
to provide a property at all. For example outside of bindings when
reading the default value. The moc-generated code can check for such
nullptrs and handle them.

Change-Id: I7ff478cb254012147bb7aed3feb160e3e679cb6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-09 22:34:46 +02:00
Sona Kurazyan
577558daf5 Fix QByteArray::count implementation for longer data
The issue has been introduced when refactoring QByteArray::count
implementation (see 631127126c).

Because the last argument of QByteArrayMatcher::indexIn() method
has a defult value, it has been compiling without issues, but was being
called with incorrect size parameter. Fixed it to pass the length of the
input data correctly.

Change-Id: Ic9c2f33733131ec17276aa889f2d7ea40ec79b01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-09 18:38:33 +02:00
Giuseppe D'Angelo
c023b025ee Qt::Modifier: do some cleanups
Qt::UNICODE_ACCEL had no effect since at least Qt 4.0. We can drop
it in Qt 6. The whole Qt::Modifier enumeration is still widely
used, so we can't drop it yet, but we should aim at doing so in
Qt 7. Add a note.

[ChangeLog][QtCore][Qt::Modifier] The Qt::UNICODE_ACCEL enumerator
has been removed. It had no effect since Qt 4.0.
[ChangeLog][QtCore][Qt::Modifier] Usage of the enumerators in
the Qt::Modifier enumeration is discouraged. The enumeration
will likely get removed in the next major version of Qt.

Change-Id: If25f30d920878d32903b91a38044f5da042c7eab
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-09 18:38:14 +02:00
Jarek Kobus
89ecbf0978 Use QList instead of QVector
Task-number: QTBUG-84469
Change-Id: Ia365c958e3b2d0c8210f5d693d907bb2012887c2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-09 16:10:11 +02:00
Alexandru Croitor
b1f8ca8032 CMake: Fix various issues with the Android build
Certain resources and compiled jar files have to be copied into the
non-prefix build dir location. They were previously only installed,
which doesn't do anything in a non-prefix build.

Change pro2cmake to generate code that places the compiled java
jars into QT_BUILD_DIR, so that non-prefix builds work.

Place the module dependencies xml files into lib folder in non-prefix
builds.

Don't special case the output and install location of the Android QPA
plugin.

Task-number: QTBUG-85399
Change-Id: I4ac9d3929ea8ecc95ec99a77e621ad2121b68832
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 11:56:31 +02:00
Alexandru Croitor
d5e8a5d9cb CMake: Fix missing qdevice.pri values and qt.conf info for Android
qdevice.pri should embed info about the Android SDK, NDK, host,
platform api level and ABI.

The machine tuple test should not be run for uikit and Android
platforms.

Sysroot should also not be prepended for uikit and Android
platforms, otherwise it breaks Qt module include paths.

Task-number: QTBUG-85399
Task-number: QTBUG-82581
Change-Id: Ic48c88f6ab15d75c2ebc323c8d7a3b7e5596f3c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 11:56:26 +02:00
Alexandru Croitor
db397d1113 CMake: Regenerate subdir test projects
And generate a few more test projects that were missing.

Change-Id: I5df51106549aa5ae09bc3c42360e14b143719547
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 09:38:39 +02:00
Alexandru Croitor
e9a328bc0e CMake: Regenerate tests with new qt_ prefixed APIs
Use pro2cmake with '--api-version 2' to force regenerate
projects to use the new prefixed qt_foo APIs.

Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 09:38:35 +02:00
Alexandru Croitor
5417f1e40c CMake: Regenerate tests
This is in preparation for regenerating them with the new qt_foo
prefixed APIs.

Change-Id: Iff34932d642b1c0186ee39f952adf3ad367fd602
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 09:38:31 +02:00
Alexandru Croitor
74cb331af3 CMake: Regenerate examples
Change-Id: I1c51b10af4e2b26f54740f257164c56a0e2a03ce
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-09 09:38:28 +02:00
Joerg Bornemann
d98a6d0463 CMake: Fix path to qt-cmake in configure summary
The path was wrong if CMAKE_STAGING_PREFIX was set.

Change-Id: Iec90c7a5edf0da80a0ac108fe3411c340c01e9a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-09 08:55:38 +02:00
Joerg Bornemann
84dcbe4d5d CMake: Fix qt-cmake-standalone-test when CMAKE_STAGING_PREFIX is set
The qt-cmake-standalone-test script is kind of a "host tool" and
contained paths to CMAKE_INSTALL_PREFIX, which is wrong if
CMAKE_STAGING_PREFIX points to somewhere else.

Fixes: QTBUG-85336
Change-Id: I4828dc6868d55cfc60f3ad2199185230d5cc9028
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-09 08:55:32 +02:00
Joerg Bornemann
acf6ef536f CMake: Introduce QT_STAGING_PREFIX
Add the cache variable QT_STAGING_PREFIX that is the same as
CMAKE_STAGING_PREFIX - if it's set, or CMAKE_INSTALL_PREFIX otherwise.

Use the variable in the places where we check for the emptiness of
CMAKE_STAGING_PREFIX to use CMAKE_INSTALL_PREFIX.

Change-Id: I372d57dfa41818c1965b824c59ab3cac80b38f60
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-09 08:55:27 +02:00
Friedemann Kleint
f4e4ad6d2b Silence some warnings about fallthrough
src/corelib/text/qunicodetools.cpp:1243:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
src/corelib/text/qunicodetools.cpp:1247:55: warning: this statement may fall through [-Wimplicit-fallthrough=]

Change-Id: I441000db46cb6d85a5dcd0534ea2168b39a3f3bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-09 08:32:23 +02:00
Andy Shaw
418901e3f8 Android: Don't depend on the OpenGL module
It is not using this for anything in the code anyway so we can just
drop it. This avoids a need to have the platform plugin depend on
OpenGL if it is configured to be on.

Change-Id: I87de162800be93db00c5022bef85c235b3655528
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-07-09 08:01:47 +02:00
Alexandru Croitor
946fc92d20 Revert "CMake: Propagate configure args to all repositories"
This reverts commit adbadc57df.

The change breaks building of repos other than qtbase when
cross-compiling to Android. Not sure yet why.

Change-Id: I6a6efef5360ed141c0c5056afb03b1a0d90439ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 21:14:18 +02:00
Shawn Rutledge
f941555420 Register a generic keyboard device on cocoa
It's not yet clear how to get any more specific information about it,
or how to detect multiple keyboards.

Task-number: QTBUG-46412
Change-Id: Ib7d6e00e1f6f120b3b8c71cb5d74a8411d61dc00
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-08 20:32:54 +02:00
Friedemann Kleint
e3ce7c87e2 Move qglxconvenience to QtOpenGL
Task-number: QTBUG-83255
Change-Id: I7640caf8afbae0a7310a264f333bb3a6cfa3c6ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-08 19:34:10 +02:00
Giuseppe D'Angelo
d6a724a9b2 QCalendarWidget: code tidies for the internal model
The table model inside a QCalendarWidget was violating
a few QAIM principles:

* returning illegal values from row/columnCount by not checking
the parent index

* not keeping invariants on row/column manipulation.

Pick-to: 5.15
Change-Id: I2c51e59ea2d89e73884bad20f3c06fbb808a26c5
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-07-08 19:19:32 +02:00
Giuseppe D'Angelo
8a78830b0d Item widgets: fix crash in mimeTypes()
*Always* check the result of a dynamic/qobject cast. I'm not positive
if the cast is correct (or should it just be a static cast),
but in principle these models can be used with a different view.

Change-Id: I37108cbb2744b6bf0fb46392d1cc9883f2d0b60e
Pick-to: 5.15
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-07-08 19:19:17 +02:00
Tor Arne Vestbø
26eb4e63e0 Treat -xplatform or -device-option as being a cross compilation
Task-number: QTBUG-85279
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I623108be2cba1dad28c5b692c2b5836a68144854
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 19:18:09 +02:00
Tor Arne Vestbø
17b1c7e6b3 macOS: Exclude 32-bit builds by checking pointer size
Task-number: QTBUG-85279
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I984ec21b9c5ed5e2bd02b3a8b52bbeb72953e454
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-08 19:18:05 +02:00
Tor Arne Vestbø
b10f8ba350 macOS: Don't assume platform has objc_msgSendSuper_stret
It's not used on arm64, and the template magic is not enough to
avoid compilation failures due to references to the undefined
function.

Pick-to: 5.15
Pick-to: 5.12
Task-number: QTBUG-85279
Change-Id: Iac94f59a863c7be1860b51def0fc2de2d8812cf8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-07-08 19:18:02 +02:00
Kai Koehne
03de9a41da CMake: Fix dependency in qt_add_big_resources
Ensure that the second rcc pass is executed whenever the
object file changes.

Patch provided by Hongpeng Liu <lhpzwd@163.com>

Fixes: QTBUG-85186
Pick-to: 5.15
Change-Id: I6e52ec15048ab286efd85500ca535b2b8b01c270
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 17:14:11 +02:00
Fabian Kosmale
986d89c2ee Automatically register comparison operators in QMetaType
This removes the fully manual registration of comparison operators in
QMetaType and replaces it with an automatic registration through
Q_DECLARE_METATYPE().

[ChangeLog][QMetaType] The QMetaType::registerComparator() and
QMetaType::registerEqualsComparator() have been removed.
Q_DECLARE_METATYPE() now automatically registers any
operator==() and/or operator<() for a type visible where
it is used on that type, as part of declaring its meta-type.

Change-Id: I3df451b652b735c093533838bf32f3cc785439f8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-08 14:13:59 +02:00
Lars Knoll
0e2cfdedf2 Constrain the comparison operators for our container classes
This had already been in very few places, where we ran into issues with
this before. More generic constraints here will significantly reduce the
amount of error messages a user has to parse in case he tries to instantiate
an operator by accident (or with a lacking comparison operator for one of
it's template arguments).

Change-Id: I1521d19c55d99732d9742402bd534c390a8e4242
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-08 14:13:56 +02:00
Lars Knoll
16bc995fd1 Add type traits to safely determine the existence of comparison operators
Containers often define an operator==() or operator<() which is very useful
for generic code. But those operators can usually not be instantiated if
the template argument doesn't implement the operator.

This sometimes leads to the compiler trying all possible template expansions
and implicit conversions for the type, giving extremely long error
messages. The traits support can be used to safely constrain those
operators.

Being able to safely detect this will also allow us to fold the comparison
support that is currently a large cludge for user types directly into
QMetaType.

Change-Id: Ib84afb5348c3eb0be5161d6ba9d5fe237709c65f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-08 14:13:55 +02:00
Lars Knoll
b038575a89 Get rid of one call into the TLS when evaluating bindings
Store a pointer to the TLS in the BingingEvaluationState. Like this,
we can save us one TLS lookup in the destructor. Shaves off a couple
of percent during binding evaluation.

Change-Id: Idc9dc5b0ea202aaeb68cdc063700b8e4968753dc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-07-08 11:02:03 +02:00
Alexandru Croitor
1718948ed4 CMake: Regenerate benchmarks
Change-Id: I4154d9ebb8303338a07350b655c7b468751efd10
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-08 11:01:38 +02:00
Alexandru Croitor
1339cc4667 CMake: Regenerate manual tests
Change-Id: Id42b9e481375d2ec0e68b73dc1e2ff36f0cbd49e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-08 11:01:38 +02:00
Alexandru Croitor
adbadc57df CMake: Propagate configure args to all repositories
Currently the configure arguments specified in qt5.git/coin are only
used when building qtbase itself. None of them are used when
configuring other repos like qtsvg.

While in principle passing all the configure arguments to other repos
is not a good thing, we need to do it to circumvent the lack of
support for specifying per-repo configure flags in Coin.

It's needed to disable detection / usage of certain strawberry perl
system libraries in qtimageformats on MinGW. Doing that prevents
crashes of the tst_qtiff test.

Supplements 4b4f0be08debcfde62caf4066222b348ce65dea1 from qt5.git.

Task-number: QTBUG-84886
Task-number: COIN-601
Change-Id: I59be8c62ebb10282db1b0a9da2d3e3e5595c925f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-08 11:01:38 +02:00
Andy Shaw
3439113984 MySQL: Remove anything that refers to lower than MySQL 5.6
Since MySQL 5.6 is currently the lowest version still supported on any
platform then we can safely assume this to be the lowest version that
we support now.

Fixes: QTBUG-683
Change-Id: I177bd87053e9aa6c302164ccb3a4aee444aa3701
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 11:01:38 +02:00
Ulf Hermann
0cd3820e4d moc: Allow out-of-line storage for Q_PRIVATE_QPROPERTY
If you pass "STORED false" the name is interpreted as function to be
invoked in order to access the property. This allows storage of a
property in a lazily allocated data type.

Change-Id: I4d3a9cac6985c6419ce687868cb74b91921595a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-07-08 11:01:38 +02:00
Assam Boudjelthia
eacf83594a Android: check for debug mode before fetching extraappparams
In pre Qt 5.14, the assets folder used to have the file
"--Added-by-androiddeployqt--/debugger.command", that indicate debug
mode, however, in Qt 5.14+ the assets are compressed into one file, so
this current check is obsolete. Qt Creator uses extraappparams to pass
QML debugger args, without it the debugger won't start.

Pick-to: 5.15
Task-number: QTCREATORBUG-24155
Change-Id: Ib3037f4dc8c55af6932d598c6491a046efe13033
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-08 07:07:15 +00:00