summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of QT_OPENGL_ES*Eskil Abrahamsen Blomfeldt2020-04-1759-309/+297
| | | | | | | | | | | The QT_OPENGL_ES* macros are leftovers from an earlier, ad hoc configuration system, which has since been replaced by QT_CONFIG. To clean things up in Qt 6, we use the new way instead. Task-number: QTBUG-83467 Change-Id: I578dc7695bff9d5ee303b22e44f60fee22fe0c28 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor tidying for header guard in qopenglversionfunctions_p.hEskil Abrahamsen Blomfeldt2020-04-171-3/+3
| | | | | | | | | The original was too close to QOPENGLVERSIONFUNCTIONS_H for comfort so to avoid future confusion or errors, just use the convention of matching the file name. Change-Id: I57fcc4da239ddec329f75ac29b254b5909c39bf0 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Simplify signature of untyped property bindingsSimon Hausmann2020-04-172-19/+25
| | | | | | | | | Instead of requiring the implementation to do the compare dance, let's do this in the library. This reduces the amount of duplicated code slightly and makes it easier to generate binding code from qml files. Change-Id: Ia3b16cf9769e74d076b669efe4119ab84af3cdf0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make it possible to take bindings from properties without private headersSimon Hausmann2020-04-174-8/+8
| | | | | | | | | | | Passing the QExplicitlySharedDataPointer by reference may lead compilers to wanting to have visibility to the destructor of the contained type (QPropertyBindingPrivate), which is not public. Fortunately QExplicitlySharedDataPointer is safe to use with raw pointers and those can be safely forward declared. Change-Id: I131ab6363eaee10b6dce196fb2c769e09a5c9557 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QEventDispatcherWin32: relax memory ordering on setting wakeUps flagAlex Trotsenko2020-04-171-1/+1
| | | | | | | | | | | | There is no need in 'acquire' operation for the next reasons: - wakeUps is simply used as an atomic boolean that does not require ordering with other loads or stores; - any of testAndSet...() always gets a latest version of wakeUps. Change-Id: Ica38fc62bc181166995946dee9d6887c71d87cec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString::from/toLocal8Bit: Assume locale is utf8 if we don't have codecsLars Knoll2020-04-161-2/+2
| | | | | | | | If there is no text codec support, assume local8bit is utf8, not latin1. This is in line with what 99% of all modern systems do. Change-Id: I35ebcd43ef3572a25f549a8375857dcabcfec4ca Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix compilation with QT_RESTRICTED_CAST_FROM_ASCIILars Knoll2020-04-161-1/+1
| | | | | | | | Fix the QString constructor used for restricted casts from char *. Change-Id: Id7e71f6d0bcd4627bb44b2bd6d6790be2b6ed976 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove QString::from/toAscii()Lars Knoll2020-04-162-64/+0
| | | | | | | These methods have been deprecated since 5.0 Change-Id: I3ceed57a364ea59a63ccc51452ab3b4da7140ce4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove deprecated members from QtWidgets/kernel classesVolker Hilsheimer2020-04-165-86/+1
| | | | | | | | Cleaning up those that are trivial to remove because they have direct replacements. Change-Id: Ie8ac02c3d6273110f1f11e17fdeae496bc66321f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove deprecated members from graphics view classesVolker Hilsheimer2020-04-169-261/+8
| | | | | Change-Id: Ia192de674b1085edcf4a88cdeada6df89b442ddd Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove deprecated QStyle enum valuesVolker Hilsheimer2020-04-164-57/+4
| | | | | Change-Id: I7eba336017844c06b2976df53d440e167abd7894 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove deprecated members from dialog classesVolker Hilsheimer2020-04-168-378/+4
| | | | | | | And a few cleanups of out-dated comments and dead code. Change-Id: I59c6b9129a21b8953626cb63c3ebbf9b6c49a657 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove deprecated QWizard memberVolker Hilsheimer2020-04-162-13/+0
| | | | | Change-Id: If6a0125ab9eba5f1b5040adb2e087003b45f5b3d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move versioned OpenGL functions from QtGui to QtOpenGLJohan Klokkhammer Helsing2020-04-1675-590/+680
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The context—which lives in QtGui—now knows nothing about versioned functions. This changes the public API for getting version functions for a context. [ChangeLog][QtGui][OpenGL] QOpenGLContext::versionFunctions() has been removed. QOpenGLVersionFunctionsFactory::get() from the QtOpenGL module should be used instead. Previously one would call context->versionFunctions<QOpenGLFunctions_4_0_Core>(); Which now becomes QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_0_Core>(context); The rest of the API should be identical. Since glgen no longer compiles, and the links to its input (gl.spec and gl.tm) are dead, I've edited the previously generated files manually. If glgen is fixed, it should be quite easy to make it generate the new way. Task-number: QTBUG-74409 Change-Id: I800527e0af16a79005b276eeb74417770193c62f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Compile fixes for clang10Lars Knoll2020-04-158-19/+19
| | | | | | | Fix some warnings that are flagged as errors on clang10. Change-Id: I906634c8b2bd94db42d74a7f3d10efb086e373cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port QNetworkProxy over to use QRegularExpressionLars Knoll2020-04-152-6/+8
| | | | | | | | The windows and macOS implementations where still using QRegExp in one place. Change-Id: Iaf6c6ead10f7f061ff0edce889abe18751b9d308 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QObject: overhaul narrowing detectionGiuseppe D'Angelo2020-04-151-50/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use P0608's trick to detect convertibility without narrowing; and now that we can depend on C++17, use its features. First, this moves the burden of detecting a narrowing conversion on the compiler, rather than us maintaining a complicated series of checks. Of course, this exposes * bugs in compilers (e.g. GCC < 9 thinks that float->bool is not narrowing; * behavior still not (widely) implemented (pointer to bool conversions are narrowing, P1957); * interesting compiler choices, e.g. GCC 9 thinks that unscoped enumerations are non-narrowing convertible to a datatype big enum to contain all the _enumerators_, even if the underlying type of the enum (and/or its sizeof()) is wider than the target datatype. Second, it allows to detect conversions that have a narrowing conversion as an intermediate step. Given a type like struct Bad { operator double() const; }; then an object of type Bad is implictly convertible to a type like int via a narrowing conversion. Therefore, a connection is possible between a signal carrying a Bad and a slot accepting an int. We can now detect and block this. Tests regarding scoped enumerations have been dropped, for the simple reason that a scoped enumeration is not implictly convertible to an integral type, so we don't have that detection (it would constantly fail). Scoped enumerations do not take part in narrowing conversions anyhow, cf. [dcl.init.list]. [ChangeLog][QtCore][QObject] The detection of narrowing conversions when calling QObject::connect() when QT_NO_NARROWING_CONVERSIONS_IN_CONNECT now takes also into account user-defined implicit conversions that undergo through a narrowing conversion. Change-Id: Ie09d59203fe6283378b36dfbc54de1d58098ef51 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Extend the QRegExp->QRegularExpression porting docLars Knoll2020-04-151-0/+5
| | | | | | | | Mention that . matches newlines in QRegExp, but not by default in QRegularExpression. Change-Id: I9663fe30c7b7e068d673aa8d51884f6828e0ee59 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Move the QRegExp porting docs into the QRegExp class documentationLars Knoll2020-04-154-138/+142
| | | | | | | | | | It used to live in QRegularExpression, but as QRegExp gets removed from Qt Core, the better place for it is to live in the QRegExp docs. Also marked QRegExp as deprecated in the docs. Change-Id: Id5b0e3040e4d46f5d806022b58fbd5b5efd58911 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove two leftover references to QRegExp in the docsLars Knoll2020-04-152-2/+1
| | | | | Change-Id: I7e025d6a03827addb61740649a77dd74f7416962 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove QRegExp based functionality from QObjectLars Knoll2020-04-152-81/+0
| | | | | | | QRegExp is going away for Qt6. Change-Id: I04d6331379dc769394b160d976eb9f21fe649a22 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Remove QRegExp support from QSortFilterProxyModelLars Knoll2020-04-153-218/+27
| | | | | | | | Map setFilterWildcard() and setFilterFixedString() to now use QRegularExpression. Change-Id: I2dff2015234decb2badfd306975dcff8553cdd7f Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Don't anchor wildcard patterns twiceLars Knoll2020-04-151-1/+1
| | | | | | | wildcardToRegularExpression anchors the pattern by default. Change-Id: Ic58e09aa526a7e35803703fa5f7582a250927008 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Add WildcardConversionOptions to QRegularExpressionLars Knoll2020-04-152-8/+33
| | | | | | | | | | There are cases, where the conversion from a wildcard pattern to a regular expression should not lead to an anchored pattern. Allow this, but adding an optional second argument to wildcardToRegularExpression, that allows tuning the conversion. Change-Id: Ida7a32d65ee49bf58d5f8d9906c0a0cd8954a02a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port qfilesystemengine_win.cpp to QRegularExpressionLars Knoll2020-04-151-5/+10
| | | | | | | QRegExp is going away in Qt 6. Change-Id: I282a444b9fdf1c834dcf90d7fd6743781b94643c Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port androidtestrunner to QRegularExpressionLars Knoll2020-04-151-9/+13
| | | | | Change-Id: If135b29996b7036d65472a1b5fa4817cd7907aba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Improve Map|Map-Reduce and Filter|Filter-Reduce implementationKarsten Heimrich2020-04-1411-389/+336
| | | | | | | | | | | | | * support lambda expressions * remove the need to specify result_type * use std::invoke to apply map|filter function * remove usage of FunctionWrapper* and createFunctionWrapper Task-number: QTBUG-33735 Task-number: QTBUG-82646 Change-Id: Ibcbe4278f0742c29182bd506081db0abb516f85f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QTaskBuilder::spawn: add an overload that doesn't return a future objectVitaly Fanaskov2020-04-144-0/+40
| | | | | | Fixes: QTBUG-83175 Change-Id: Idf85e47a2732742884272200d5c753805eaa640b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Remove size assert in QMultiHash::take()Shawn Rutledge2020-04-141-1/+0
| | | | | | | | | | | It doesn't exist in every instantiation of the template; this becomes evident when attempting to build QQuickListView: error: 'using Chain = struct QHashPrivate::MultiNodeChain<FxViewItem*>' {aka 'struct QHashPrivate::MultiNodeChain<FxViewItem*>'} has no member named 'size' Change-Id: I24748c15f3995083eec06d86a3c0dced2209c303 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix qConstexprNextPowerOfTwo(qint64) to return quint64Shawn Rutledge2020-04-131-3/+5
| | | | | | | | | | | | | | It doesn't make sense to lose precision, and that's a fatal warning when used on a 32-bit platform: implicit conversion loses integer precision: 'quint64' (aka 'unsigned long long') to 'quint32' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32] Also fix coding style. Amends 7ef382649754c261ca9eb99dd50b67050e748efb Change-Id: I2c8f51883d74f0c6dc1b5faefe7b3ace1d9c15b9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port tracedef to QRegularExpressionLars Knoll2020-04-131-20/+22
| | | | | Change-Id: I38bbf36719c99d4fda102eca375011c38792dd4a Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
* Port androiddeployqt from QRegExp to QRegularExpressionLars Knoll2020-04-131-18/+24
| | | | | | | As a drive-by, also fix spelling of architecture. Change-Id: Ibeaa6b611ddbb75b9492deb5d97a64ed8b030c3a Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Include QRegularExpression in the bootstrap libraryLars Knoll2020-04-138-53/+142
| | | | | | | | This allows us to use regular expressions in bootstrapped tools such as moc and tracegen. Change-Id: I4310dd15bf26651aac6ab30c884e025ca06b3099 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-04-1113-52/+85
|\
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-1113-52/+85
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| | * Fix warning about deprecated QComboBox::AdjustToMinimumContentsLengthThiago Macieira2020-04-091-3/+14
| | | | | | | | | | | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd1603f5c25dabf78e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * Remove more calls to deprecated TouchPoint functionsShawn Rutledge2020-04-093-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to ed3ed0b9db97a8fab0c03add23228b6b0a96f171 68916fede41d1eca5d07eb6b1db518d41a007616 and 3c159957f863cf8d367a9261e7016e52cd0348c1. In QWindowSystemInterfacePrivate::fromNativeTouchPoints() and QWindowSystemInterfacePrivate::toNativeTouchPoints() we continue using struct TouchPoint's QRectF area as storage for the screen position + ellipse diameters; as the comment says, this is _unrotated_, meaning that rotation is stored separately, and area should not be construed as the bounding box of the rotated ellipse. (In Qt 6 we can make the QPA touchpoint look the same as the QTouchEvent::TouchPoint to eliminate the need to calculate the center of the rect.) In QGraphicsScenePrivate::updateTouchPointsForItem(), setRect() sets the position and the ellipse diameters, but the latter is redundant because the purpose of this function is to localize a touchpoint to the coordinate system of a particular QGraphicsItem. Ellipse diameters should stay the same. In QApplicationPrivate::updateTouchPointsForWidget(), as in QGraphicsScene, we are localizing touchpoints to a widget and to the screen that the widget is shown on, so only the position needs to be set, while preserving the sub-pixel resolution that mapFromGlobal(QPoint) loses. Fixes: QTBUG-83403 Change-Id: I61d29e14cbe38567767b164af6ae895082c5e1a1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * Fix warning about QMetaObject::isEditable() being deprecatedThiago Macieira2020-04-091-1/+11
| | | | | | | | | | | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd1603f482445bff28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Switch to using versioned deprecated macrosAllan Sandfeld Jensen2020-04-091-24/+24
| | | | | | | | | | | | | | | | | | Change-Id: I4728e6ecc7218a6c98fd3a10e50e6edd1704fb83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QCborArray: fix operator[] that extends the arrayThiago Macieira2020-04-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was never tested. The infinite loop in QCborContainerPrivate::grow is the proof. [ChangeLog][QtCore][QCborArray] Fixed an infinite loop when operator[] was called with with an index larger than the array's size plus 1. Change-Id: Ibdc95e9af7bd456a94ecfffd1603df3855c73f20 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QCborMap: fix assigning elements from the map to itselfThiago Macieira2020-04-091-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to the QJsonObject issue of the previous commit (found with the same tests, but not the same root cause). One fix was that copying of byte data from the QByteArray to itself won't work if the array reallocates. The second was that assign(*that, other.concrete()); fails to set other.d to null after moving. By calling the operator=, we get the proper sequence of events. [ChangeLog][QtCore][QCborMap] Fixed some issues relating to assigning elements from a map to itself. Note: QCborMap is not affected by the design flaw discovered in QJsonObject because it always appends elements (it's unsorted), so existing QCborValueRef references still refer to the same value. Task-number: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df846f46094d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QJsonObject: add missing detach2() callsThiago Macieira2020-04-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring to use CBOR missed two places where we could assign from the same object and thus cause corruption. In fixing this issue, I found a design flaw in QJsonObject, see Q_EXPECT_FAILing unit test and task QTBUG-83398. [ChangeLog][QtCore][QJsonObject] Fixed a regression from 5.13 that incorrect results when assigning elements from an object to itself. Fixes: QTBUG-83366 Change-Id: Ibdc95e9af7bd456a94ecfffd1603df24b06713aa Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QFactoryLoader: Fix warning about binary JSON being deprecatedThiago Macieira2020-04-091-0/+3
| | | | | | | | | | | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd1603f4abb1c3dfec Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
| | * KMS: fix warning about hex() and dec() being deprecatedThiago Macieira2020-04-091-1/+1
| | | | | | | | | | | | | | | Change-Id: Ibdc95e9af7bd456a94ecfffd1603f54bcb86fb87 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * MinGW: Fix debug only angle buildsKai Koehne2020-04-091-4/+5
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-83397 Change-Id: I89e21cc8101a17dcdb232ff5df1a76cc08842434 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: André Klitzing <aklitzing@gmail.com>
| | * QTemporaryFile/Linux: don't cut the root dir's slashThiago Macieira2020-04-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally people shouldn't create temporary files on /, but if you're running as root, why not? Caught when running tst_qtemporaryfile as root: openat(AT_FDCWD, "", O_RDWR|O_CLOEXEC|O_TMPFILE, 0600) = -1 ENOENT (No such file or directory) Change-Id: Ibdc95e9af7bd456a94ecfffd1603ebfc17cea220 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
| | * Minimal platform: fix leaking QMinimalScreen instanceShawn Rutledge2020-04-082-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused false alarms in fuzzing tests. The lifetime of the screen is the same as that of QMinimalIntegration. But failure to call handleScreenRemoved() also causes a warning; so as on "normal" platforms, the screen has to be separately allocated. Change-Id: Iad0cc53b8d09687400ced28bc2353b7500b01110 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* | | avoid compile warning when using clang++ with -Wshorten-64-to-32Martin Koller2020-04-114-6/+6
|/ / | | | | | | | | Change-Id: I78a6cd84ac5b8c250d9569d864a7e38269b85e10 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QApplication: remove obsolete globalStrut functionalityVolker Hilsheimer2020-04-1029-112/+44
| | | | | | | | | | | | Change-Id: If56873f86f5291264cac720f8db7dbd4db756f49 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Fix a few size_t / int conversion warningsFriedemann Kleint2020-04-105-6/+6
| | | | | | | | | | | | | | | | Change the hash function of QTypeRevision and QtFontFallbacksCacheKey to use size_t and add a few casts. Change-Id: I89a8fc617abbe8b0c67529ec41795691c99b0574 Reviewed-by: Lars Knoll <lars.knoll@qt.io>