summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Move eglconvenience to QtGuiFriedemann Kleint2020-07-1366-289/+292
| | | | | | | Task-number: QTBUG-83255 Change-Id: I8a008d8906308dd73a0793db5b88d3a1b6fdaf5c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix passing QDBusUnixFileDescriptors over peer-to-peer connectionsSteffen Kieß2020-07-135-12/+41
| | | | | | | | | | | | | | | | | | | Passing QDBusUnixFileDescriptors over peer-to-peer connections currently does not work, because QDBusConnectionPrivate::setPeer() does not set this->capabilities (unlike QDBusConnectionPrivate::setConnection() which is executed for bus connections). Keep track of whether the connection already has been authenticated, and once the connection does get authenticated, update this->capabilities. Note that sending a message directly after connecting (before any message has been received from the peer) might still fail if the message contains a QDBusUnixFileDescriptor. Pick-to: 5.15 Fixes: QTBUG-85396 Change-Id: Ib83213ebcd3255fb091c6faefb3618745b8d736c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix sporadic build failures of eglfs_kms_vsp2Joerg Bornemann2020-07-131-0/+1
| | | | | | | | | | The eglfs_kms_vsp2 subproject depends on eglfs_kms_support. Add the missing build dependency. Pick-to: 5.15 Fixes: QTBUG-85486 Change-Id: I1110d0f02166d9cdec1d734de679e2d36c6b026a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtConcurrent: Get rid of code repetition for RunFunctionTask::run()Jarek Kobus2020-07-132-34/+21
| | | | | | Change-Id: If270982e54d2b11be00c71b9d012af629d181dfe Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* macOS: Use Cocoa to map key events to possible shortcut key sequencesTor Arne Vestbø2020-07-131-3/+19
| | | | | | | | For now we just verify that the Cocoa API produces the same keymaps as we get from Carbon. Once that's verified we can solidify the code. Change-Id: I0d2aa1bb0a006d29c0149e3ff2fd5299ba922326 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Modernize QCocoaKeyMapper key mapTor Arne Vestbø2020-07-132-53/+36
| | | | | Change-Id: I3e8a4cfa611b6ae575466c493aac438dc831e89a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* rhi: Allow null resources in srbLaszlo Agocs2020-07-133-64/+135
| | | | | | | | | | In this case the srb represents the layout only, and can still be used to create a pipeline. For setShaderResources() one will then need to use another, layout compatible, srb that references valid resources. Change-Id: I3ea5b63df3be8847540ca4c0c40fbd29dbed8fb7 Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use numeric_limits instead of hand-coded equivalentsEdward Welbourne2020-07-134-22/+20
| | | | | | | | | | | | | | As a comment noted, the reason for QLocaleData rolling its own values describing the ranges of digits and exponents in a double were all about std::numeric_limits's constants not being constexpr - which they have now been since C++11, so we can do away with our own. One of the constants was used in two places in the same way; so abstract that use out into an inline function in qlocale_tools, to save duplication and give somewhere to document it. Change-Id: I7e3740ece9b499c0ec434de18d70abe69e1fe079 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QRegExp and its remaining mentions out of QtCoreSona Kurazyan2020-07-137-5438/+0
| | | | | | Task-number: QTBUG-85235 Change-Id: Ibd6c98d952c1bb9916b64715c6430fb0d3fe3843 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Check returns of hex2int in get_hex_rgbRobert Loehning2020-07-131-0/+2
| | | | | | | | | | Avoids undefined behavior when trying to shift negative values. Fixes: oss-fuzz-21860 Fixes: oss-fuzz-23968 Pick-to: 5.15 5.12 Change-Id: I879c97624e3f8ba9cf01e0a3a682379cd8c4a199 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtGui: Clean up event headersFriedemann Kleint2020-07-132-3/+12
| | | | | | | | | | - Remove unimplemented QSinglePointEvent() - Remove forward declaration of QTouchEventTouchPointPrivate - Update copyright and add comment to qevent_ph.h Task-number: QTBUG-72173 Change-Id: Ie64b6071f2611001dcd8e3deec2f5ed382bb2312 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QVariant::setValue(): enable move semanticsGiuseppe D'Angelo2020-07-133-22/+36
| | | | | | | | | | | | Given we optimize for the case where the new value is of the same type of the one already stored in the variant, enable move assignment for that case. As a drive-by, avoid a path to detach() for data() if we know we're detached. Change-Id: I9abbdc10637ce77ebb747b49d83e1ef914d997bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCryptographicHash: explicitly activate the used union memberGiuseppe D'Angelo2020-07-121-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | A union member lifetime does not start automatically if one takes a pointer to a union member and writes into the member. Only the subscript syntax in an assignment features such automatic lifetime start [class.union§6]. In the other cases, one is allowed to get a pointer to the storage ([basic.life§6]) but has to start lifetime explicitly via placement new. Hence, do so, or we end up in UB land. We're left with the problem of reset() which may be called multiple times. I think we can actually just create a new object in the same storage without destroying the pre-existing object by exploiting [basic.life§5]: reusing the storage causes lifetime end for the old object. Moreover, since the union is over trivial datatypes (C structs), there's no side effects in the destructor of the old object, so there is no need to call it. Drive by fix, apply some DRY for SHA3. Change-Id: Idc351568635e59d45421311f043956ab3aabf389 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Linus Jahn <lnj@kaidan.im>
* QVLA: use std::aligned_storageGiuseppe D'Angelo2020-07-121-5/+1
| | | | | | | Remove the hand-rolled union used only to achieve alignment. Change-Id: I8e635fa0d09042f30fd67d589db9bc384c0ec8ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStringView: Remove outdated note about usage with QListLinus Jahn2020-07-121-4/+0
| | | | | Change-Id: Id1cef09642ccde701e57e8f0a3a3d0e5fcf47e5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable PCRE2 JIT on macOS ARM64Tor Arne Vestbø2020-07-103-2/+13
| | | | | | | | | | | | It's already disabled for many other ARM platforms, and upstream support for Apple Silicon is still pending, so we disable it for now. See: https://bugs.exim.org/show_bug.cgi?id=2618 Fixes: QTBUG-85528 Pick-to: 5.15 Pick-to: 5.12 Change-Id: I42b6e5efaa07c9b832cd05a47436eb86a214e9bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix buffer overflowRobert Loehning2020-07-101-1/+1
| | | | | | | Fixes: oss-fuzz-23988 Pick-to: 5.15 5.12 Change-Id: I4efdbfc3c0a96917c0c8224642896088ade99f35 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove that casts to int/uint that shouldn't be there anymoreLars Knoll2020-07-101-35/+26
| | | | | | | Remove casts that truncate a qsizetype or size_t in qstring.cpp Change-Id: Ibc1515f9906d5a0840254e60e2e7dfca716b63b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clarify relation between Qt::Keys and Unicode rangesTor Arne Vestbø2020-07-101-101/+114
| | | | | | | | | | | | | | The Qt::Keys have been re-ordered and comments added to reflect the layout of the enum values in relation to the Unicode ranges. Bits 0x00200000, 0x00400000, and 0x00800000 have been reserved in case we want to use them for Qt::ModifierKey later on. Doing so would require changing Qt::Key_unknown to not overlap with these bits, or to accept that Modifier + Qt::Key_unknown is not a supported usecase. Change-Id: I580a01b0a47a28948a0f0018c47931395933b8f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move all the QProperty related code into one compilation unitLars Knoll2020-07-107-441/+325
| | | | | | | | | | | | | And mark some methods as inline. Performance is critical for our new property system. Compiling it in one unit makes it possible for the compiler to do a much better job at inlining and generating optimized code. Improves performance of binding evaluations by another 20%. Change-Id: I5a2aa93c74d2b68418b0a9d2e34d8199bb71e3ad Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cache whether a property is a booleanLars Knoll2020-07-102-4/+6
| | | | | | | | | We have the space anyway, and this cuts away another couple of percent during binding evaluation to avoid a call that checks whether the type is bool. Change-Id: I41c320f93bf0a33f0cb15962a154c59a2e47fd7a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Significantly improve performance of binding evaluationLars Knoll2020-07-105-52/+75
| | | | | | | | | | | | | | Avoid any QVariant or type dependent code in the cpp files. Instead, let the binding wrapper determine if the value has changed and return true/false accordingly. This required also some reworking of the guard mechanism for notified properties, where the guard function wrapper now calls first the binding evaluation function and then passes the result to the guard. Change-Id: I350d07a508ccc0c5db7054a0efa4f270b6a78ec3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Separate the error case when evaluating bindingsLars Knoll2020-07-104-37/+19
| | | | | | | | | | | | | | | | | | | | | There's no point in returning a usually empty error when evaluating bindings, adding overhead to the regular code path. Instead, the error can be set on the currently evaluating binding if required. This streamlines the functor used to wrap the binding and should thus expand to less code and execute faster in the regular case. To achieve this, expose a pointer to the currently evaluating binding in the private API (as QtQml needs it to be able to report errors). The error case now requires one additional TLS lookup, but we don't really care about performance in that case anyway. Change-Id: Iecb450e765244930a41d813fcf8eb4013957a6a3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Cleanup QPropertyBindingErrorLars Knoll2020-07-103-19/+10
| | | | | | | | | | | | Remove location(). The method would always return an empty value. If you need the location, the binding itself has it. Remove setDescription() and require that the description gets passed in the constructor. Never create a d pointer if type is NoError, so we can quickly check for it inline. Change-Id: I7eb8a94786281069d6ea2d82567c09aa50c52ef6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Refactor pointer event hierarchyShawn Rutledge2020-07-1038-1384/+1019
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some goals that have hopefully been achieved are: - make QPointerEvent and QEventPoint resemble their Qt Quick counterparts to such an extent that we can remove those wrappers and go back to delivering the original events in Qt Quick - make QEventPoint much smaller than QTouchEvent::TouchPoint, with no pimpl - remove most public setters - reduce the usage of complex constructors that take many arguments - don't repeat ourselves: move accessors and storage upwards rather than having redundant ones in subclasses - standardize the set of accessors in QPointerEvent - maintain source compatibility as much as possible: do not require modifying event-handling code in any QWidget subclass To avoid public setters we now introduce a few QMutable* subclasses. This is a bit like the Builder pattern except that it doesn't involve constructing a separate disposable object: the main event type can be cast to the mutable type at any time to enable modifications, iff the code is linked with gui-private. Therefore event classes can have less-"complete" constructors, because internal Qt code can use setters the same way it could use the ones in QTouchEvent before; and the event classes don't need many friends. Even some read-accessors can be kept private unless we are sure we want to expose them. Task-number: QTBUG-46266 Fixes: QTBUG-72173 Change-Id: I740e4e40165b7bc41223d38b200bbc2b403e07b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove unused method QKeyMapper::clearMappings()Tor Arne Vestbø2020-07-104-15/+0
| | | | | | | | | | | The plumbing from QKeyMapper to the platform specific key mappers via QPA was never done, so this method is unused. The code path in QKeyMapper that would trigger it would be changeKeyboard(), but that's already handled in QCocoaKeyMapper, and wouldn't be initiated from the cross platform code in any case. Change-Id: Ibc0c419627fc0430d028945038c1f2fbafe42d4b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Simplify dead key handlingTor Arne Vestbø2020-07-101-2/+2
| | | | | Change-Id: Ie2e2c6e1b1daf08146fd42f3ce58194ee1918794 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Simplify Ctrl+LeftMouse->RightMouse handlingTor Arne Vestbø2020-07-101-2/+1
| | | | | Change-Id: I080bfaec273ea45809d72e513add16b7114c7bbb Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Merge keySequenceToKeyEqivalent into call siteTor Arne Vestbø2020-07-101-17/+13
| | | | | Change-Id: Iae33f627ad6abfc9bbba9b098417bd13caee00f8 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Add QCocoaKeyMapper::toCocoaModifiersTor Arne Vestbø2020-07-104-23/+18
| | | | | Change-Id: I489c64733275260bb041f8df5cc5ff4a571d4e9c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Android: Enable configuring for a single abi architectureAndy Shaw2020-07-101-1/+1
| | | | | | | Fixes: QTBUG-80938 Pick-to: 5.15 Change-Id: Id87202e6b2520b18c6b06b71675157f588a28bd6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Mark gradlew with Unix eol endings as it is a scriptAndy Shaw2020-07-101-0/+1
| | | | | | | | | | | | 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>
* Fix one check for AVX2Allan Sandfeld Jensen2020-07-101-1/+1
| | | | | | | | | | | | 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>
* Remove the setting of GrowsBackwards from QListAndrei Golubev2020-07-101-4/+0
| | | | | | | | | | | | | | | 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>
* Rename local variables masking parametersDimitrios Apostolou2020-07-101-6/+6
| | | | | | | As found by LGTM.com. Change-Id: I9a237899dc50009da5643c49c590f3b15bb817bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename local variable hiding parameterDimitrios Apostolou2020-07-101-2/+2
| | | | | | | As found by LGTM.com. Change-Id: If3024bdaad06cafcd401b4ee04524ad03bd69a97 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename local variable hiding global one with the same nameDimitrios Apostolou2020-07-101-4/+4
| | | | | | | As found by LGTM.com. Change-Id: Ic4c38c02529e7cc7eb7c79c3936b7d5f030fd84f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove local variable masking a global oneDimitrios Apostolou2020-07-101-2/+1
| | | | | | | As found by LGTM.com. Change-Id: Ied926a9eace9044ec9abc859557cd28178e5defb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QArrayDataPointer: use move and swap in move assignmentGiuseppe D'Angelo2020-07-101-1/+2
| | | | | | | | | 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>
* Move glxconvenience into QtGuiFriedemann Kleint2020-07-1019-58/+48
| | | | | | | | | 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>
* CMake: Fix incorrect SIMD arch_haswell and avx profile conditionsAllan Sandfeld Jensen2020-07-091-9/+0
| | | | | | | | | | | | | | | | | | | | 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>
* moc: For non-STORED QProperties, expect a pointerUlf Hermann2020-07-092-37/+158
| | | | | | | | | | | 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>
* Fix QByteArray::count implementation for longer dataSona Kurazyan2020-07-091-2/+2
| | | | | | | | | | | | | The issue has been introduced when refactoring QByteArray::count implementation (see 631127126cc14e7c01cc611532b3256b58785670). 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>
* Qt::Modifier: do some cleanupsGiuseppe D'Angelo2020-07-093-4/+2
| | | | | | | | | | | | | | | | | | 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>
* Use QList instead of QVectorJarek Kobus2020-07-092-6/+5
| | | | | | Task-number: QTBUG-84469 Change-Id: Ia365c958e3b2d0c8210f5d693d907bb2012887c2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Fix various issues with the Android buildAlexandru Croitor2020-07-096-17/+12
| | | | | | | | | | | | | | | | | | | 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>
* Silence some warnings about fallthroughFriedemann Kleint2020-07-091-2/+2
| | | | | | | | 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>
* Android: Don't depend on the OpenGL moduleAndy Shaw2020-07-094-16/+0
| | | | | | | | | | 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>
* Register a generic keyboard device on cocoaShawn Rutledge2020-07-081-0/+3
| | | | | | | | | 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>
* Move qglxconvenience to QtOpenGLFriedemann Kleint2020-07-0821-95/+82
| | | | | | Task-number: QTBUG-83255 Change-Id: I7640caf8afbae0a7310a264f333bb3a6cfa3c6ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>