Commit Graph

46595 Commits

Author SHA1 Message Date
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
Sona Kurazyan
631127126c Introduce QByteArrayView
Created a QByteArrayView in symmetry with QStringView.
Added the basic tests symmetrical to QStringView tests.

Moved the implementations of non-modifying methods of QByteArray to
namespace QtPrivate, to be reused inline from both QByteArray and
QByteArrayView. Changed QByteArray's counterparts of those methods to
take QByteArrayView as argument instead of QByteArray. Removed
QByteArray's operator QNoImplicitBoolCast(), because it was causing
ambiguity when calling those methods with QByteArray argument (it was
there to perevnt if(!ba)/if(ba) from compiling, but currently that would
be ambiguous and won't compile anyway).

[ChangeLog][QtCore][QByteArrayView] New class.

Task-number: QTBUG-84321
Change-Id: I05f92e654cf65c95f2bb31b9c9018746ac110426
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-08 08:45:49 +02:00
Sona Kurazyan
a55e938fb4 Add tst_QByteArrayApiSymmetry test
Created tst_QByteArrayApiSymmetry test for the common APIs  of
QByteArray and QByteArrayView. Moved the tests for startsWith(),
endsWith(), indexOf(), lastIndexOf(), compare(), from tst_QByteArray
to tst_QByteArrayApiSymmetry and adapted them to check different
QByteArray/QByteArrayView combinations. Added tests for first(),
last(), sliced(), chopped(), chop(), truncate(), count(), contains()
(test inputs are taken from corresponding tst_QStringApiSymmetry
tests).

Task-number: QTBUG-84321
Change-Id: I4e712b1692e3c1271d51ddcda6c9eb8bb01e11d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-08 08:45:14 +02:00
Joerg Bornemann
f96244f614 Don't set the environment variable QT_RCC_TEST anymore in tst_rcc
The reason for setting this variable was removed in commit 300bd7fff8.

Task-number: QTBUG-25078
Change-Id: Id06072c099481a258cb65b4603efe010e306b7b2
Reviewed-by: hjk <hjk@qt.io>
2020-07-08 07:56:40 +02:00
Joerg Bornemann
22b663f55d CMake: Fix -pch configure option
This amends dbd3c75965.

Change-Id: Ia87d60f1da65624bc5c6ffb915eecf99a2d8bdc0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:09:18 +02:00
Joerg Bornemann
544b08f664 CMake: Support the -rpath configure argument
Task-number: QTBUG-85373
Change-Id: I04bdf307556aeab607a95d153cbe19254044c1f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:09:14 +02:00
Joerg Bornemann
619ec7bc15 CMake: Support the -c++std configure argument
Task-number: QTBUG-85373
Change-Id: I071c1d0c8bf96b34c5733d039b8a61e54e416800
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:09:10 +02:00
Joerg Bornemann
23216a6193 CMake: Support the -qtnamespace configure argument
Task-number: QTBUG-85373
Change-Id: I3f995b31339a3c2b0c97ca806c652bc67846fc69
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:09:05 +02:00
Joerg Bornemann
63e90281b2 CMake: Support mkspec-related configure arguments
Task-number: QTBUG-85373
Change-Id: I44ae15b4c05f23442ac6b9d69d31f22f01d0a48c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:09:00 +02:00
Joerg Bornemann
fe5fa1d974 CMake: Support -static, -shared and -framework configure arguments
Task-number: QTBUG-85373
Change-Id: I0a1db7dcb4cb1738fa1ba0a687d41c5f5a613364
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-08 07:08:56 +02:00
Tor Arne Vestbø
45d4e4b06c macOS: Map Qt::KeyboardModifier to a single Carbon modifier
The modifier is passed to UCKeyTranslate, and we don't need to turn
e.g. Qt::ShiftModifier into both shiftKey and rightShiftKey. One is
enough to map the virtual key to a unicode character.

Change-Id: I33c46c016df03ecf17b5d87885d80a6d581767bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:39 +02:00
Tor Arne Vestbø
055c2bebda macOS: Don't rely on Carbon for QCocoaKeyMapper::queryKeyboardModifiers()
The semantics of the Cocoa API matches that of the Carbon API we are
replacing, in that it reflects the "state of devices combined with
synthesized events at the moment, independent of which events have
been delivered via the event stream.", which is the same semantics
as QGuiApplication::queryKeyboardModifiers() expects.

Change-Id: Ic00ccbb3e8ae571522245df30924952aa2cc71de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:39 +02:00
Tor Arne Vestbø
b982385bcf macOS: Simplify QCocoaKeyMapper::fromCocoaModifiers
Change-Id: I6c25c1cfd4253d13623b2706c3b93632711fc577
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:39 +02:00
Tor Arne Vestbø
f67fe01ac6 macOS: Use helper method in QCocoaKeyMapper for swapping Ctrl and Cmd
Centralizes the logic for swapping the two modifiers. The debug logging
for modifier mapping has been removed as that level of granular logging
is overkill.

Change-Id: Ib4818c77f5b32ff20c9fe6df56528a120e5bd80e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:38 +02:00
Tor Arne Vestbø
1c8953e520 macOS: Move AA_MacDontSwapCtrlAndMeta logic out of QPlatformTheme
Change-Id: Ia36f60587d98902406de7de8acdc3c4521cfd05a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:38 +02:00
Tor Arne Vestbø
e255146183 Replace use of deprecated Q_OS_MACX in favor of Q_OS_MACOS
Change-Id: I1059d56f67be28a4cc1a66b744e81df6d0b5d00d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-08 01:09:38 +02:00
Volker Hilsheimer
4f952aaea1 Move method only used in keypad navigation to a better place
QDesktopWidget in particular doesn't use that code anymore.

Change-Id: I8eed752175c5478663b25872c7ffe78c814245d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-07 23:09:38 +00:00
Lars Knoll
a2cef41a31 Extend QSharedMemory to work with qsizetype for sizes
This allows larger than 2G memory segments to be allocated.

Fixes: QTBUG-76995
Change-Id: I95309eeea511fadb28724c7592298c2fcc6f1d1a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-07 20:38:57 +00:00
Tor Arne Vestbø
9ad1c6d835 Rewrite AA_MacDontSwapCtrlAndMeta documentation
Change-Id: Ifc41d0d341aed029e89baa3fc20f9535c1fb01d9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-07 22:01:58 +02:00
Volker Hilsheimer
359616066e Refactor QTabBarPrivate::Tab and much of its usage in QTabBar
The type was broken in that it pretends to be a value, but didn't
implement the necessary operators for save copy, move, or comparison.
Tabs are supposed to be managed by Tab instance, as the crazy
implementation of operator== demonstrated.

Refactor the code to use it as a pointer consistently, even though this
means additional allocations for each tab. This is however acceptable
since there are not millions of tabs, and there is only a single place
where tabs are removed from the list.

Also use ranged for where possible, and never access the tabList using
operator[] to avoid detaches.

Use a std::unique_ptr for the animation in the tab, which implicitly
protects against attempts to copy a Tab, and allows us to use the
compiler generated default destructor. Add Q_DISABLE_COPY_MOVE for good
measure, the compiler-generated move semantics would not work either
due to the back-pointer from animation to the tab.

Change-Id: I8e8c071472f8f1f401b0f4f1dde074d800842934
Fixes: QTBUG-85394
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-07 21:40:50 +02:00
Lars Knoll
652459afde Improve performance of property binding evaluation
Improves performance of binding evaluation by ~20% for
simple C++ bindings by simplifying and inlining the code
that clears the array of property observers.

Change-Id: I829ac1895f1673367d737944d950360015a5b435
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-07-07 21:20:04 +02:00
Tor Arne Vestbø
086ca457b5 Fix no-EGL build
Fixes: QTBUG-85464
Change-Id: If3a3acfb514c9b787bc3e9350da378d2f5d1bfa5
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
2020-07-07 21:07:58 +02:00
Tor Arne Vestbø
357966a72c Make QGuiApp::platform(Function|NativeInterface) internal
Task-number: QTBUG-83252
Change-Id: I3d53114f6cf43aa482d0c30938dabc86bb05ea67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-07 21:07:52 +02:00
Giuseppe D'Angelo
1e8d623340 QThread::create: remove the pre-C++17 codepaths
As we require C++17 now. The configure-time test checking for
future/async is left in for the moment being.

Change-Id: Ifde39d420673f70a2277f5a645bfaad30935a381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-07-07 20:54:12 +02:00
Jarek Kobus
471e4fcb22 Use QList instead of QVector in gui implementation
Task-number: QTBUG-84469
Change-Id: I366e845249203d80d640355a7780ac2f91a762f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-07 20:35:05 +02:00