summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Deliver WindowActivate/Deactivate events to QWindowVolker Hilsheimer2021-06-112-1/+10
| | | | | | | | | | We need those events to trigger palette color group changes in QQuickItem without having to connect every item to yet another QWindow signal. Task-number: QTBUG-93752 Pick-to: 6.2 Change-Id: I8534808cdaab828e5876f8fda31567aeb1b4272a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix date parsing when local time lacks the start of the dayEdward Welbourne2021-06-111-13/+26
| | | | | | | | | | | | | | | | | | | The case where a parsed date-time fell in a transition, but only because the default value for some field lead it there, only dealt with the case of parsing a date-time, which is the only time it should be relevant. However, since the date and time do get combined as a date-time (even when only one of them is relevant) the same problem could arise when parsing a date (on which the current time-zone happened to make a transition at the start of the day) or a time (if the default date happens to be one on which the current zone had a transition). So handle both of those cases, as well as the date-time case. Fixes: QTBUG-91120 Pick-to: 5.15 6.1 6.2 Change-Id: I565d115eb85cd2ee69fa500fcd40b05bcf8f6fff Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Record useful URL in qlocale_unix.cppEdward Welbourne2021-06-111-1/+3
| | | | | | | | The Open Group's documentation of the meanings of the locale-determining environment variables. Change-Id: I5e3ae7de033b569b1c691b85ed65e441832359c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1String: optimize indexOfMårten Nordheim2021-06-115-24/+163
| | | | | | | | | | Some time ago I wanted to use QStringTokenizer with a QL1S haystack and needle to optimize a particular bottleneck. Only to realize the new bottleneck was more expensive (continuously converting both the strings to QString). Change-Id: Ica86db0043c839c2336a3c3886ffbe3875659b5b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix reading gamma from PNGs without ICC profileAllan Sandfeld Jensen2021-06-111-2/+2
| | | | | | | | | | The decoding of PNG_INFO_gAMA to QColorSpace was incorrect, the PNG gamma is the inverse of the gamma value we use. We revert it everywhere else, just not here. Pick-to: 6.2 5.15 Change-Id: Ic0ae1963b2dde3004cac8a6430ddaf99e7096915 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QSemaphore: Fix warning in 32-bit buildNodir Temirkhodjaev2021-06-121-1/+1
| | | | | | | | qtbase\src\corelib\thread\qsemaphore.cpp(157): warning C4293: '>>': shift count negative or too big, undefined behavior Change-Id: Iddf76e52770576bd57a4630884c0e0d6310cd4ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QLatin1String: Add overloads taking QLatin1CharMårten Nordheim2021-06-112-0/+48
| | | | | | | | | Without the overloads using QLatin1Char in QL1S member functions results in the QL1Char being converted to QChar and QL1String being converted to QString. Change-Id: Ic19545539a207f025a6293f0b2d929de475dc166 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLatin1String: Remove a non-null assert in comparisonMårten Nordheim2021-06-111-1/+0
| | | | | | | | | | | It's a latin-1 string so embedded nulls are weird, but it makes it easier for the follow-up patch adding overloads for QLatin1Char. A test case in tst_qstringapisymmetry.cpp, which checks handling of "empty" values, end up with a '\0' latin-1 char. Which makes the code assert. Change-Id: I0ff6628087cfac4d875b19f572c59ef7b5406293 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QObject: Fix memory leak in queued_activateFabian Kosmale2021-06-111-12/+34
| | | | | | | | | | | | | | | | | | | | | | | | queued_activate adds a reference to the slot object. It also attempts to deref it again, but that did not work correctly so far. We could end up with T1 | T2 queued_activate | checks isSlotObject | adds ref | locker.unlock() | | QObject::~QObject | //In disconnect all senders loop | sets isSlotObject to false | derefs slotObj, but not deleted checks isSlotObject | (no deref because it's null) | To solve this issue and others caused by early returns, we now use a RAII helper, which always takes care of calling destroyIfLastRef if the ref count has been incremented. Change-Id: I9c011cdb8faa5f344d7e70f024fc13f407e39ccf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Fix Qt tool apks not to be built as part of default all targetAlexandru Croitor2021-06-111-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | The code already checked for QT_BUILDING_QT to decide whether the 'apk' target should be part of the default 'all' target, but it only worked properly for qtbase. The 'apk' target was created before the value of QT_BUILDING_QT is set when building other repos like qttools. Postpone the decision on whether 'apk' should be part of 'all' to the first call of qt_add_executable -> qt_android_add_apk_target. At this point QT_BUILDING_QT will be defined. Achieve that by relying on an additional 'apk_all' target as an implementation detail. Amends 8b8679f73d6cfb513141cc0a9f4925a64ca19455 Pick-to: 6.2 6.1 Fixes: QTBUG-94442 Task-number: QTBUG-94264 Change-Id: I92ff0a7eef2caad244340ab7835e77c9fb3377c0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QNetworkInformation: Rename the plugins and typeMårten Nordheim2021-06-1117-15/+15
| | | | | | | | | | To better match other plugins in Qt Pick-to: 6.2 Change-Id: I6ab19603f13c80a8afe4fe69f64669559a0eea15 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Yuhang Zhao <2546789017@qq.com>
* Correct handling of last second of 1969 (again)Edward Welbourne2021-06-111-48/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In my prior attempt to handle the last second of 1969, I forgot that the QTime we're describing is a local time, so whether *it* thinks we're at the last second of the day is beside the point. Fortunately, preceding second should get -2 as return if mktime()'s initial -1 actually meant the last second of 1969, so we can test via that, after a cheap pre-test to save doing this too often (albeit we only even attempt the check if mktime() returned -1 in any case). Restructured qt_mktime() in the process to deal with the error case's early return promptly instead of doing it in an else clause. Also repackage the calls to mktime to isolate various quirks and simplify the logic in qt_mktime(). This also prepares for setting tm_isdst as a hint when we know when we came from, in massageAdjustedDateTime(). Refined one test, added two more test cases. These didn't fail before this fix, but a judiciously-placed qDebug() in testing revealed that localMSecsToEpochMSecs() resorted to its fall-back handling - as if the date-time were outside the time_t range - due to qt_mktime() failing, for these test-cases (and several others). This fix evades that fall-back behavior; a judiciously-placed qDebug() shows none of our test-cases now fail callMkTime(). Change-Id: I11aa5015191dc4a565c28482307f7bc341c207e7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rework setMSecsSinceEpoch() to avoid local->UTC conversionsEdward Welbourne2021-06-111-44/+41
| | | | | | | | | | | | | The function takes a UTC time, which it converts to local time when needed, but its (two) calls to refresh a local time instance were doing the (more expensive) reverse conversion, which we don't need (because we knew UTC to start with) and, in this case, it can't land on an invalid time, so we don't need to cope with that. Change-Id: I49b42bfa9f6a5fde12810f5a0da9ff4466ca86a4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove old Android code that have now has alternative public APIsAssam Boudjelthia2021-06-115-2901/+3
| | | | | | | | | | * Remove the old qjni private APIs. * Remove the Android permission private APIs. * Remove runOnAndroidThread(). Pick-to: 6.2 Change-Id: I37ba8b4cb87a099f067e2e0b6744b8d01a0f9bbc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Hangul composition: use < base + count checks, not <= checksEdward Welbourne2021-06-111-2/+2
| | | | | | | | | | | | | | | Before Unicode 4.1.0 there was an error in the example code for Hangul normalization that used <= on the ends of some ranges of values, where they should have used < tests. This was faithfully copied but the need for correction has only lately come to light. Thanks to Ma Lin for pointing this out and providing the fix and test-cases. Fixes: QTBUG-71894 Pick-to: 6.2 6.1 5.15 Change-Id: I5c7fec1f9fac1f7a25b2d5e9c3109a90a7ff49e1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build without features.itemmodelTasuku Suzuki2021-06-111-2/+6
| | | | | Change-Id: Ic768f12861db5366ff3fa25b28f9252358ce3a72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix unaligned specialData formatsAllan Sandfeld Jensen2021-06-111-4/+9
| | | | | | | | | Handle the case were a format was applied that does not align with the fragments. Pick-to: 6.2 6.1 5.15 Change-Id: I27593a50c587a5ec0290ff9d0a7a9767a3981cac Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* macOS: close visible gap between tab bar base line and tabsVolker Hilsheimer2021-06-112-2/+2
| | | | | | | | | | | | | | | | Dock widgets enable the QTabBar::drawBase property, but the clip region left a gap of 3 pixels on each side between the base line and the tabs. Correct the size of the hole cut into the clip region accordingly. Visually tested on macOS 10.15.7 and macOS 11.2.1 using the dockwidgets and tabdialog example. As a drive-by, fix a spelling mistake in related documentation. Fixes: QTBUG-86362 Pick-to: 6.2 6.1 Change-Id: Iada027999467741d0590576ee4508e6f41fb056d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Correctly support style sheet for toolbutton menus and arrowsVolker Hilsheimer2021-06-111-25/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | QToolButton can show an arrow instead of an icon, and that arrow can, as per the documentation, styled via the ::down/up/left/right-arrow pseudo element. This was not working at all, as the implementation confused the down-arrow with the menu arrow. Implement this correctly for all arrow types. A QToolButton can also have different ways to show a menu, either by using a separate section of the button that can be clicked; this section can be styled via ::menu-button and ::menu-arrow. Or by instant or delayed menu popup when clicking the button itself, in which case the button shows an indicator in the button itelf; that indicator can be styled via the ::menu-indicator pseudo element. The old implementation confused the various options, and the name of the PseudeoElement_ToolButonDownArrow didn't help with that. So rename that element to PseudoElement_ToolButtonMenuIndicator, and render it when there is no separate drop down. Fixes: QTBUG-27640 Pick-to: 6.1 6.2 Change-Id: Ia142a5d7498fa717e70f4e5382305e305b29effa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* In headers with only the arrow styled, prevent overlapping with textVolker Hilsheimer2021-06-111-2/+19
| | | | | | | | | | | | | | | | | | A style sheet that styles only the header arrow, but not the header section or label, resulted in an overlapped text and header if the text was also right aligned. To prevent this, add the space required by the arrow to the size calculation, and shorten the space accordingly before rendering the right-aligned label. Make corresponding adjustments to vertical headers with bottom-aligned labels. Fixes: QTBUG-84117 Pick-to: 6.2 Change-Id: I782d9538b695ad55d2d70b6d230f66059598768f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Disable text gamma-correction when painting on linear color spaceAllan Sandfeld Jensen2021-06-101-0/+2
| | | | | | | | | We currently only support full gamma corrected painting by using linear color space images, the text logic however did its own gamma correction on top of that. Change-Id: I4ef41745f4bc1c3a5815426abbcee6968987e70d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix QColorTransform on RGBA64_PremultipliedAllan Sandfeld Jensen2021-06-101-6/+15
| | | | | | | | | The lack of an unsigned pack 32bit->16bit without SSE4, meant the premultiplied path would saturate color values over 32735. Pick-to: 6.2 Change-Id: Ia76e0369fd11a6767e8db78bf9a10eea30d91d2c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add shortcut for QImage::applyColorTransform on indexed imagesAllan Sandfeld Jensen2021-06-101-0/+7
| | | | | | | | This also helps preserve bitmaps. Pick-to: 6.2 Change-Id: I8aa1ea63dc7dfb948a9c8821f0fe1ddd07f1bc3a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Check scrollbar ScrollBarOverlap when computing QListView marginsZhang Hao2021-06-101-0/+1
| | | | | | | | | | | | | | | | | When the listview setWordWrap is true and ScrollBarPolicy is ScrollBarAsNeeded, if QStyle::PM_ScrollView_ScrollBarOverlap returns true, the text displayed an empty line. Fix this by not reserving the width of the vertical scrollbar if the flow is TopToBottom and the vertical scrollbar, and QStyle returns true for PM_ScrollView_ScrollBarOverlap. Amends aeef92c3c33e4ebcb7e5d8dd955020f4f4600e84 Pick-to: 6.1 6.2 Fixes: QTBUG-94248 Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I4d47c7e86bbb86474cb1a99bb26d8b67f0e8a7e2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add the check for linker capabilities to resolve circular dependenciesAlexey Edelev2021-06-101-1/+15
| | | | | | | | | | | | | | 'ld' only capable to resolve circular dependencies by wrapping the suspected static libraries and objects using --start/end-group arguments. We want to detect if linker is 'ld' at configure time to decide how to link the resource objects if finalizers are not enabled. The qt_config_compile_test function is extended with an extra argument since it's required to pass custom cmake flags to the ld-related test. Pick-to: 6.2 Change-Id: I484fcc99e2886952d8b0232f37e4e6a35d072931 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* JNI: check if clazz is null before doing a jni callAssam Boudjelthia2021-06-101-8/+16
| | | | | | | | | | Also add missing \since keyword. Task-number: QTBUG-92952 Pick-to: 6.2 Change-Id: Ia1472f04955809fb5132a4b6239dbcbdf63cca93 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* JNI: state that findClass() returns a global refAssam Boudjelthia2021-06-101-11/+13
| | | | | | | | | Fix docs to state that findClass() returns a global ref from the cached classes list. Pick-to: 6.2 Change-Id: I7c45cc4c9e1c6e109db7cf7d926a250592798972 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QLocalSocket/Win: avoid double buffering on writeAlex Trotsenko2021-06-096-40/+47
| | | | | | | | | As QWindowsPipeWriter now maintains a chunk queue, there is no need to use the internal QIODevice buffer and wait for the previous operation to complete. Change-Id: Id4d54edfe920aeb4a534980cb0cc85a56c067a70 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix inexplicably changed condition in GL backingstore compositionLaszlo Agocs2021-06-091-1/+2
| | | | | | | | | | | | | | | In a13e8d6660913bec172d1374f78083498c539df0 which provided the move and decoupling of OpenGL code the !makeCurrent-succeeded && !context-is-valid condition got changed to !makeCurrent-succeeded && context-is-valid which makes no sense because what we test for is context lost situations, in which case makeCurrent fails and isValid() reports false. Restore the ! that went missing in the above mentioned patch. Pick-to: 6.2 6.1 Change-Id: I94f84d2853bcbd2965f76ecd665d3614b1f0e746 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QTabBar: don't let tab shine through (semi-transparent) scroll buttonsVolker Hilsheimer2021-06-091-0/+14
| | | | | | | | | | | | | | | On styles where the tab bar's scroll buttons are rendered semi- transparently, or where the buttons don't fill their entire rect (for example have rounded edges), the tab that's covered by the buttons should not shine through the gaps, or even shine through the button. Clip the painter so that the area of each button is not painted by the tabs. Fixes: QTBUG-50866 Pick-to: 6.1 6.2 Change-Id: Ie81f6d260f36d5a17868822e683745844a6a6b2f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QAbstractItemView: block autoScroll from interfering with QScrollerVolker Hilsheimer2021-06-091-0/+4
| | | | | | | | | | | | | | | | When pressing an index in order to start a flick gesture, QAIV sets the current index. When QScroller changes state to Dragging, then QAIV restores the current index to what it was before the press, as the user is clearly scrolling the view. With autoScroll enabled, this will produce an ugly jump if the old current index is no longer in the viewport. To prevent this, disable autoScroll before restoring the currentIndex. Fixes: QTBUG-64543 Pick-to: 6.2 6.1 5.15 Change-Id: I3e0a18a6a179d80b9d810fce5aa658f0cfff9a29 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix scrolling of tab bar when the visible tab is wider than the visible spaceVolker Hilsheimer2021-06-091-4/+9
| | | | | | | | | | | | | | When finding the index we need to scroll to, use the one where both start and end of the tab rect are outside the currently visible section. Otherwise we wouldn't scroll when the left-most index ends outside the visible section. Add test, which requires that the scroll buttons have object names. Fixes: QTBUG-70498 Pick-to: 6.2 6.1 5.15 Change-Id: Id153c77dd5fca146612375e0ff39bd1f3e0536b1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Add disclaimer about QtPrintSupport not being available on iOSPaul Wicking2021-06-092-0/+3
| | | | | | | Fixes: QTBUG-91025 Pick-to: 6.1 6.2 Change-Id: I9f206509a3f3e74e01ae76ae36e275dc79743d11 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QHttpSocketEngine: Fix memory leakMårten Nordheim2021-06-091-1/+1
| | | | | | | | The reply needs to be parented or it's not guaranteed to be deleted Pick-to: 6.2 6.1 5.15 Change-Id: I7cbc31682f80dbbd9fb240fff9e6781cb6ca7b36 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* macOS: Allow programatically minimizing frameless windowsMorten Johan Sørvig2021-06-091-1/+4
| | | | | | | | | | NSWindowStyleMaskMiniaturizable also controls programatic minimize, in addition to the window decoration button. Fixes: QTBUG-65637 Pick-to: 6.2 6.1 5.15 5.12 Change-Id: Iac5fb483433441173d770f4fcfb9e93440b9fe6a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Fix QVariant documentationKai Köhne2021-06-092-61/+56
| | | | | | | | | | Update documentation to not reference API that is obsolete in Qt 6. Also fix documentation for changed behavior (isNull()), and fix snippets. Pick-to: 6.1 6.2 Change-Id: I526efeff63d907bbadd5e8a539ccf237cb992125 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* macOS: Keep NSWindow alive after handling windowShouldClose callbackTor Arne Vestbø2021-06-091-0/+9
| | | | | | | | | | | | | | | | | | | | | Option-clicking the close-button on a window in macOS is a request to batch-close all the windows. When this happens we get an event in through the window that was clicked, which in turn results in AppKit calling windowShouldClose: for each window. We respond to that by explicitly closing each window (instead of just responding YES or NO), which results in the window being released and deallocated. This causes a crash when AppKit then follows up by closing each window after we responded YES to windowShouldClose. We work around this by keeping the window alive in the closest auto release pool, which is typically at the level of the runloop. This ensures that the window is alive for the duration of the logic that AppKit has for batch-closing windows. Fixes: QTBUG-92232 Pick-to: 6.2 6.1 5.15 Change-Id: I68b6138eb8325af0576b438ffa011137fec27926 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Revert "QMetaType: Don't normalize name which should already be normalized"Fabian Kosmale2021-06-091-2/+3
| | | | | | | | | | | This reverts commit f6fa4b39ee32ba4a5c6a3db5581dd50b3afc7a47. Reason for revert: c76a2d7c9cfc5e2edd45a30681df51b37125bc01 was not enough to catch all cases. Pick-to: 6.2 Change-Id: I5830ab20b1f4d26a0a201c3dd5aaee6b10aa12ac Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* windows: gl: Print GetLastError() when makeCurrent failsLaszlo Agocs2021-06-081-1/+6
| | | | | | | | | | | | | This matches the behavior of other implementations, such as QEGLPlatformContext: doing a qWarning with the relevant error from eglGetError() or equivalent is helpful when something goes wrong and should be common among QOpenGLPlatformContext implementations. Pick-to: 6.1 Task-number: QTBUG-85714 Change-Id: Ifa5d22b83808c92ae92efcbcddc8d8c3d3ba34b1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QListView: add assert for static analyzerVolker Hilsheimer2021-06-081-0/+2
| | | | | | | | | | | | The loop that initializes the item should execute at least once, so the pointer should be pointing to something valid. The static analyzer doesn't see that, and warns about unguarded access to the item pointer in report with hash d008dbef4573afca54be0139e2971a4a. Add asserts for both the condition that makes the loop run at least once, and for the item pointer not being nullptr. Pick-to: 6.1 Change-Id: I94b9f3db3b3ce3d82445cf66788c05854b441aaf Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Correct examples for int validation in QValidator documentationVolker Hilsheimer2021-06-081-2/+2
| | | | | | | | | | | | QIntValidator::validate documents correctly that any input with "at most as many digits as the top of the range" returns Intermediate. This is needed to avoid input deadlocks where one can't go from 9 to 15 if the range is 8 to 16. Fixes: QTBUG-94269 Pick-to: 6.1 5.15 Change-Id: I6776e09fc231249fe78f9e6106492f8454b70a03 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* QPromise: doc fixesGiuseppe D'Angelo2021-06-081-1/+1
| | | | | | | | Add a noexcept from a doc signature that was missing it. Change-Id: I30b429a6ec4d182551ca68767d1c8aa61c9e4c09 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QFutureInterface(Base): code tidiesGiuseppe D'Angelo2021-06-082-5/+6
| | | | | | | | | | | | | | | | refT()/derefT() can be marked noexcept; we don't care about not overflowing the refcounter as a precondition. (This is BC, as no compiler mangles noexcept.) This in turn allows to mark a constructor calling refT() as noexcept. Driveby: mark also the same functions to not be `const` in Qt 7. They clearly are meant to modify *this, and constness only works because of the unmanaged (raw) d-pointer. Change-Id: I8d7d365640ff2e1cedc0a234c9abccdfc95ba6e3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QPromise/QFutureInterface: in Qt 7 take std::exception_ptr by const-refGiuseppe D'Angelo2021-06-084-0/+19
| | | | | | | | | | | std::exception_ptr is a reference-counted "smart pointer", so we shouldn't copy it around freely. Unfortunately QFutureInterface has exported functions taking it by value, so we can't just change the signatures and keep BC. Simply prepare the code for Qt 7. Change-Id: Ic5aae6a095c8c842872a40db440c99d2dfe371f1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* CMake: Fix global 'apk' target to actually build all apksAlexandru Croitor2021-06-082-11/+30
| | | | | | | | | | | | | | | | | | | | This means calling 'ninja apk' in a user project with multiple android applications will build all their respective apks. For user projects, make the 'apk' target part of the global 'ALL' target, so that a regular 'ninja' call implies the 'apk' target. We don't do it currently for Qt builds, because certain test executable apks fail to build. Add a QT_NO_GLOBAL_APK_TARGET_PART_OF_ALL variable to allow removing the global apk target from the 'all' target. Pick-to: 6.1 Task-number: QTBUG-94264 Change-Id: I171b9da50eb7d670176704bd26dc1c492118b434 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* rhi: Use QByteArray for storing data in QGles2BufferRobert Löhning2021-06-082-14/+12
| | | | | | | | | | Mainly to avoid leaking memory again. A possible reduction of memory allocations would be a welcome side effect. This reverts parts of 89f7389494c6fc917f189150e06ed1fcfaa238e8. Change-Id: I65a7529f532175967a4e408450aa55549b77d7e4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QIcc: Update test for invalid valuesRobert Löhning2021-06-081-1/+1
| | | | | | | | | | | This should have happened when changing the code in f493d41722fc76a04f699ea26128fdf3d215d913 Fixes oss-fuzz issue 31633. Pick-to: 5.15 6.1 Change-Id: I7945c3f90651f8fa04df20fbaf0b0c7f68619407 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QMetaType: Don't normalize name which should already be normalizedFabian Kosmale2021-06-081-3/+2
| | | | | | | | | | | | | | | The name stored in a QMetaTypeInterface should already be normalized, as a static metatype uses typenameHelper, which takes care of normalization via QTypeNormalizer. For dynamic metatypes, we don't have that guarantee, but those can only be created by Qt, as there is no public API for it. We can thus ensure that we only create normalized typenames (which we currently do anyway), and skip the normalization in registerCustomType. Change-Id: I18728031825cd39fdbe17cad0fbc6e3b5fd03c93 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* normalizeTypeFromSignature: Beware of anonymous struct/unionFabian Kosmale2021-06-081-2/+11
| | | | | | | | | | | | | | | | | | Do a quick check whether the type name contains an anonymous type. If so, do not try to use optimized version. The simple check should still be faster than calling normalizeType unconditionally. Also only apply the faster version for clang and gcc, instead of all non-MSVC compilers. Applying it to other compilers would require further testing to handle anonymous structs. Moreover, remove space before '(', which is necessary for function pointers. Fixes: QTBUG-94213 Change-Id: I795d1964f7a68daa6f9a5f262816d51ee7728788 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QNetworkInformation: Adjustments to captive portal APIMårten Nordheim2021-06-086-50/+18
| | | | | | | | | | | | | | | Make it return bool since the TriState was really only used signify that the property was unsupported but there is already a separate way to check if it's supported. More importantly there is no different set of actions available to a user if they're in the Unknown or False state. Because of the change to bool, we also rename the property to have an 'is'-prefix. Change-Id: Iaaaad5ac31e663c36e00223bf5b0e719f412fc69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>