summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QProperty: avoid needless std::function copyingFabian Kosmale2020-10-122-2/+2
| | | | | Change-Id: Iea6280b12e7146a9ac92f071a4c21b373e9d3ab0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QProperty: make a few helpers constexprFabian Kosmale2020-10-122-2/+2
| | | | | Change-Id: I1f3b2223530c311a7b40fd36c8162e32adbd9569 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Handle notifier list modification during iterationFabian Kosmale2020-10-123-25/+135
| | | | | | | | | | | | | | As propertyobservers can execute arbitrarily complex code, they can also modify the obsever list in multiple ways. To protect against list corruption resulting from this, we introduce a protection scheme which makes the list resilient against modification. A detailed description of the scheme can be found as a comment in QPropertyObserverPointer::notify. Task-number: QTBUG-87153 Change-Id: I9bb49e457165ddc1e4c8bbdf3d3c9fbf5ff27e94 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove an unneeded includeSona Kurazyan2020-10-121-2/+0
| | | | | Change-Id: Iba171012955e475f51d6319a69d8cd351aa6131b Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Improve QRectF::toRect()Allan Sandfeld Jensen2020-10-121-1/+8
| | | | | | | | | Implement the better rounding mechanism that was previously blocked by requiring C++14 to be constexpr. Change-Id: I4e5b179ce0703f5c0b41c3f0ea00d28dfe53740c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPropertyChangeHandler: mark as nodiscardFabian Kosmale2020-10-121-1/+1
| | | | | Change-Id: Ibf399b5aac732e8f80d0a37df711806c1c5550ac Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add an example to the documentation of QImage::scanLine()Mitch Curtis2020-10-122-0/+15
| | | | | | | | | I couldn't find any examples in Qt's documentation of this when I was trying to use it in a project. Pick-to: 5.15 5.12 Change-Id: Ic7b7b71f219b2c1012829980866940b9a77bd11f Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Link to qAlpha in qRgb() and qRgba() docsMitch Curtis2020-10-121-2/+2
| | | | | | Pick-to: 5.15 5.12 Change-Id: I5a3b8573123e82f4c8c92fa7a2e1af06e2e84eb2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Improve QRgb documentationMitch Curtis2020-10-122-1/+13
| | | | | | | | | - Add examples of how to create QRgb values - Link to qRgba() Pick-to: 5.15 5.12 Change-Id: I2a86b1c8e00137ba868426b8157a3aa0d924d7a6 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Protect QImage work on shutdownAllan Sandfeld Jensen2020-10-124-7/+7
| | | | | | | | | | If the thread pool was not created, or already deleted, make sure the QImage routines can still run as they could before. Fixes: QTBUG-87320 Pick-to: 5.15 Change-Id: I4105a68b6ae0637faf82cdda5f5ae44298759396 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid heap-buffer-overflowRobert Loehning2020-10-121-1/+1
| | | | | | | | | [ChangeLog][QCosmeticStroker] Avoid a heap-buffer-overflow found by oss- fuzz as issue 25243. Pick-to: 5.12 5.15 Change-Id: I36112f183241679e172ad1ee531e1b929d6f3815 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* FileChooser portal: skip empty filters to avoid rejection from portalsJan Grulich2020-10-121-0/+5
| | | | | | | | | | Xdg-desktop-portal will reject any OpenFile request if there is an empty filter. We will just simply skip it to avoid the rejection so users get a file dialog. Pick-to: 5.15 Change-Id: I85c056f46b22cdbc9e14010bc3c49206b6f8f002 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Make the new direct buffer update available for non-uniform buffersLaszlo Agocs2020-10-1212-41/+69
| | | | | | | | | | | | | | | | | The original restriction to UniformBuffer was due to the GL backend where there is no GL buffer object for QRhiBuffers with usage UniformBuffer. However, we can still implement this for cases when there is a true GL buffer object underneath. With other backends it should all work as-is already. This becomes useful when one has buffers with usage Vertex that need full updates every frame. (f.ex. instance data) Unfortunately this involves renaming the function. But while at it, add an autotest case as well. Change-Id: Iff59e4509a8bae06654cc92fe8428bd79eb012fb Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Cleanup qshareddata.h noexcept statusAllan Sandfeld Jensen2020-10-111-46/+44
| | | | | | | Set noexcept on functions where it applies. Change-Id: I5efa632bd1652e1215e9c6d3b06dc40c948420d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: d3d: Save a few cycles in bindShaderResourcesLaszlo Agocs2020-10-113-121/+144
| | | | | Change-Id: Ib11ea33eb695d4599f4f040415d497aaf19cb15b Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: d3d: Calculate dynamic offset usage upfrontLaszlo Agocs2020-10-112-9/+17
| | | | | | | Also remove an unnecessary buffer type test. Change-Id: I6f8312f03d3fe1729fa9b2eb95f6bfbeeccd0d4f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: Avoid shadowing local variableLaszlo Agocs2020-10-111-5/+6
| | | | | Change-Id: I7ad14ff05a1ff10113f5d3985662970d74e68ead Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: vk: Skip buffer/texture registration on read-after-readLaszlo Agocs2020-10-111-6/+19
| | | | | Change-Id: I22027cfc227d3c09e446d193e6b2903b8df34eb2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: vk: Pre-calculate the flags for dyn.offsetLaszlo Agocs2020-10-114-48/+54
| | | | | | | ...instead of doing a loop in setShaderResources() just for this. Change-Id: Iac8d4517783967c6b8bca4926cceca918f7dcdec Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: d3d: Reduce the size of the Command structLaszlo Agocs2020-10-115-23/+36
| | | | | | | Copied by value so the size matters. Change-Id: I17eae99212801a4fb390a0e298b361123644d17d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Move some code out of the inner loopsLaszlo Agocs2020-10-111-4/+4
| | | | | Change-Id: I96c71ef45b93ab95250a2a3f0e9c10e8bc86d650 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Add support for full, direct buffer updatesLaszlo Agocs2020-10-1113-6/+160
| | | | | Change-Id: I02c1f8c32c08d39cde9845d20ba8b02541d9d325 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make the named QColorSpace constructor thread-safeAllan Sandfeld Jensen2020-10-101-5/+24
| | | | | | | | | | Avoid accessing the shared pointer table without using atomic. Cleans up the shared table on exit for leak tracking utilities. Pick-to: 5.15 Change-Id: Ia2d6d79dea1c8be02bae2d8111e290f49eedf409 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Add porting section for QtConcurrent and related classesSona Kurazyan2020-10-091-0/+70
| | | | | | | | Task-number: QTBUG-87096 Change-Id: Ie143db6c0d1e81f7a089799996d468360c44e2ca Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make result finding procedure in ResultStore a free-standing functionAndrei Golubev2020-10-091-28/+38
| | | | | | | | | | Moved the logic of finding a result in ResultStore to separate function and parameterized it with QMap<...>. This is a pre-step to make find procedure uniform regardless of the storage we are looking in (either visible or pending as of now) Change-Id: I41641d70751925f223e992f52fbc7814085c452d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Clear pending results in ResultStoreAndrei Golubev2020-10-091-9/+18
| | | | | | | | Pending results were never cleared by result store. This led to memory leaks when the results never transitioned to "visible" results Change-Id: I674302eb51542ad5f4d918da68d616428c73ae9f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* MinGW: Fix static build using PCHCristian Adam2020-10-092-1/+7
| | | | | | | | | | | | | | | | | | The value of NTDDI_VERSION is computed from _WIN32_WINNT. It makes sense to keep these two in sync. The value used to create the PCHs for _WIN32_WINNT is 0x601, and qwindowspointerhandler.cpp requires for MinGW 0x603. Since the precompile header value cannot be undefined while compiling the source file, it's better not to use the PCH for this particular source file. These problems surface in a static build, in a regular build for some reason the PCH for plugins is not used. Change-Id: Id724490deb9c695ac00b26cd300f9d2382019ea2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Do not use versionless targets in examples (Qt Core)Kai Koehne2020-10-092-6/+6
| | | | | | | | This is confusing, especially because it's not used in the whole snippet. Pick-to: 5.15 Change-Id: Ibd59646da2c77ac19a38441021c5e99f52015c95 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix a compile error on Android in debug buildsLars Knoll2020-10-091-2/+2
| | | | | | | Android uses -Werror,-Wsign-compare. Change-Id: I4e861ebd6ea00914223358629f8e898c2aa67cd0 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix warning: 'open' has superfluous mode bits; missing O_CREAT?Alessandro Portale2020-10-091-1/+1
| | | | | | | | Adding mode flags doesn't make sense if you don't create a file but only open if for reading. Change-Id: I9307b07cbbcddea565fff9258de7f7beb373a8ad Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Disable spurious warning with gcc 9.3Paul Olav Tvete2020-10-091-0/+5
| | | | | | | | | | | | gcc 9.3 gives a warning when compiling with -O2: ‘strlen’ argument missing terminating nul [-Werror=stringop-overflow=] This seems to be caused by a gcc bug that is not present in gcc 8 and fixed in gcc 10: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91490 Change-Id: Ice3c18efb7a41097521ecee22d060f175083c579 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Windows Vista/XP Styles: Remove XP-specific codeFriedemann Kleint2020-10-091-410/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WindowsXPStyle cannot be instantiated via style factory since 5.0. The derived class QWindowsVistaStyle still uses much of its code, though. Remove the XP-specific code as determined by - Adding debug output with the enums added to WindowsXPStyle's functions - Run the widgets gallery example in Vista style - Run the widgets gallery example in XP style - From the lines not appearing in both logs (comm -3), remove the code present in WindowsXPStyle drawComplexControl() QStyle::CC_ComboBox drawComplexControl() QStyle::CC_ScrollBar drawComplexControl() QStyle::CC_SpinBox drawControl() QStyle::CE_ComboBoxLabel drawControl() QStyle::CE_HeaderSection drawControl() QStyle::CE_ProgressBarContents drawControl() QStyle::CE_PushButtonBevel drawPrimitive() QStyle::PE_FrameLineEdit drawPrimitive() QStyle::PE_IndicatorBranch drawPrimitive() QStyle::PE_IndicatorProgressChunk drawPrimitive() QStyle::PE_PanelItemViewItem drawPrimitive() QStyle::PE_PanelLineEdit sizeFromContents() QStyle::CT_SpinBox standardIcon() QStyle::SP_CommandLink standardPixmap() QStyle::SP_ArrowRight standardPixmap() QStyle::SP_CommandLink styleHint() QStyle::SH_Header_ArrowAlignment Change-Id: Ic6a19cabf39d1089328a7cb1afdc282a60a7cf21 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Check validity before adding to a QDateTimeEdward Welbourne2020-10-091-0/+9
| | | | | | | | | | | QDateTime's addDays(), addMonths() and addYears() neglected to check for validity before doing their job, with the result that they could produce "valid" (but wildly inappropriate) results if used on an invalid date-time. Added tests for this case (and the boundary). Change-Id: I7b0d638501cb5d875a678cde213547a83ed7529e Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Check against {und,ov}erflow in more QDateTime methodsEdward Welbourne2020-10-091-11/+39
| | | | | | | | | | QDateTime's range of possible values is wider than anyone generally needs, but let's not do confusing things when someone does overflow it. Change-Id: Ifbaf7a0f02cd3afe7d3d13c829bf0887eba29f7f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Check value is in range when setting a QDateTimeEdward Welbourne2020-10-091-5/+16
| | | | | | | | | | | | | | | | | | | Previously, a QDate representing more than about 0.3 gigayears before or after the epoch would overflow the millisecond count and produce a "valid" date-time that didn't represent the date and time passed to its constructor. Changed to detect such overflow and produce an invalid date-time instead, if it happens. Corrected some tests that wrongly expected to be able to represent extreme date-time values with every time-spec. The (milli)seconds since epoch are from UTC's epoch, so converting to another offset, zone or local time may give a value outside the actual range. Added some tests for the actual exact bounds. Task-number: QTBUG-68855 Change-Id: I866a4974aeb54bba92dbe7eab0a440baf02124f0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix a compiler warning on AndroidLars Knoll2020-10-081-1/+1
| | | | | Change-Id: Ia3d1ee6dccfbf335d689513d51c3920cfa102166 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Avoid double pixel-ratio scaling of dbus tray iconsAllan Sandfeld Jensen2020-10-082-10/+11
| | | | | | | | | | | QIcon::pixmap does automatic scaling to DPR by default, so use QIconEngine API to access internal pixmaps directly instead. Pick-to: 5.15 Task-number: QTBUG-83806 Change-Id: I3ccbed8387811a87bbea3f5d4ad9963e1be28a49 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Allow getting a const pointer out of a variant containing pointerFawzi Mohamed2020-10-081-0/+7
| | | | | | | | | | | | | Currently A a; QVariant::fromValue(&a).value<const A*>() == nullptr; Still casting non const to const is safe, and worked in Qt5. After this change A a; QVariant::fromValue(&a).value<const A*>() == &a; Change-Id: I257049d084c712b00a338a2943d379aa478e0981 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QADP capacity functions use qsizetype instead of size_tAndrei Golubev2020-10-084-20/+20
| | | | | | | | | | | | | | | Change types returned and accepted by capacity-related QArrayDataPointer functions to qsizetype: 1) QArrayData (underlying d-ptr) works with qsizetype 2) QArrayDataPointer::size is of type qsizetype 3) All higher level classes that use QADP (e.g. containers) cast capacity to qsizetype in their methods Additionally, fixed newly appeared warnings through qtbase Change-Id: I899408decfbf2ce9d527be7e8b7f6382875148fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QNetworkRequest: Close gap in enumMårten Nordheim2020-10-081-1/+1
| | | | | | | It was there for binary compatibility reasons, but it's not needed anymore Change-Id: I659dadc710a5bcdbcba74f13fd4db6044a497cd2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* rhi: gl: Silence incorrect compiler warnings about uninitialized useLaszlo Agocs2020-10-081-3/+3
| | | | | Change-Id: I09bd22f3ccb1231ad4ef123f581459ef5c1ac37c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* rhi: gl: Drop the unused WRAP_R memberLaszlo Agocs2020-10-082-5/+0
| | | | | | | | If we do not use it for anything, do not spend time on comparing and copying it either. Change-Id: I3632792847010e5b73c48eb1ca88f5806f3ccd45 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: gl: Fix missing texture bindingsLaszlo Agocs2020-10-081-5/+7
| | | | | | | | The block to update the cached state needs to be run also when the texture parameters have changed. Change-Id: Ifa80c142c6ff31c95a718a1a900ff3db0bbfe4bc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Do not trigger actions disabled directly or on group levelAllan Sandfeld Jensen2020-10-081-2/+5
| | | | | | | | | | | Only allow actions disabled due not being visible to trigger, when enabled is not true. This matches QQuickAction behavior, and doesn't apppear to affect QtGui or QtWidgets. Change-Id: I1a00b80213598ef1560be4c9ee9e65cd6fa6d760 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix compilation on MSVC with /std:c++latestLars Knoll2020-10-081-6/+1
| | | | | | | | | | Inline the definition of QMetaTypeForType::name and make it constexpr. The old code was conflicting in it's definition (only const in the declaration, constexpr in the definition), something MSVC didn't like. Fixes: QTBUG-87225 Change-Id: I7182c421c9f7612e4ff3d538829b2daee0fe4c5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-07112-233/+233
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QApplicationPrivate: iterate QPointingDevPrv::activePoints values onlyShawn Rutledge2020-10-071-4/+4
| | | | | | | | | | | | | | | | | | | In translateTouchCancel() and findClosestTouchPointTarget(), in the context of doing a range-for loop over activePoints: for (const auto &pair : devPriv->activePoints) { ... } clang was warning that the reference to the pair is a copy: warning: loop variable 'pair' is always a copy because the range of type 'QPointingDevicePrivate::EventPointMap' (aka 'QFlatMap<int, QPointingDevicePrivate::EventPointData>') does not return a reference [-Wrange-loop-analysis] But we weren't using the key anyway, so we might as well iterate over values() just as various functions in QPointingDevicePrivate are doing. Change-Id: Id8ee784255af98064e8347d5fa6a806d442933a8 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Allow millisecond-overflow when the result remains validEdward Welbourne2020-10-072-20/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even before adding support for fractional hours, a fraction of a minute might potentially have represented a whole number of seconds by a fractional part that, due to rounding, was less than the whole number of seconds by less than half a millisecond. Previously, the parsing would have clipped the fractional part at 999 milliseconds, in the preceding second, instead of correctly rounding it up to the whole second. For QTime::fromString(), which can't represent 24:00, and for TextDate, which doesn't allow 24:00 as a synomym for the next day's 0:0, applying such rounding to 23:59:59.999999 would produce an invalid result from a string that does represent a valid time, so use the nearest representable time, as previously. Added some tests and amended others. [ChangeLog][QtCore][QDateTime] QDateTime and QTime, in fromString() with format ISODate or TextDate, now allow a fractional part of the hour, minute or seconds to round up to the next second (hence potentially into the next minute, etc.) when this is the closest representable value to the exact fractional part given. When rounding up would turn a valid result into an invalid one, however, the old behavior of clipping to 999 milliseconds is retained. Change-Id: I8104848d246cdb4545a12819fb4b6755da2b1372 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Use fromIsoTimeString() in QDateTime::fromString() also for TextDateEdward Welbourne2020-10-071-37/+2
| | | | | | | | That way it'll be consistent with QTime()'s parsing of the time part. Change-Id: I3f66e5686ba6e2ea4bbc2d5a9a29a177de2d9e69 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use start of day when wrapping 24:00 to the next dayEdward Welbourne2020-10-072-18/+19
| | | | | | | | | | | | | | | Previously we used 0:0 on the next day, which might fall in a fall-back's gap. [ChangeLog][QtCore][QDateTime] When fromString() reads 24:00 in ISO format, it now uses the start of the next day, rather than 0:0 on the next day. This only makes a difference if the next day's first hour is skipped by a time-zone transition. Change-Id: Ib81feca5dc09fa735321b6ab76d5d118d6db6fd2 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>