summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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-094-9/+36
| | | | | | | | | 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>
* 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>
* 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>
* 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>
* 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>
* Switch-ify QFSFileEngine::fileName and update implementationKarsten Heimrich2021-06-081-27/+35
| | | | | | | Adapt to coding guidelines and use raw string literals. Change-Id: Ice9a87cafb22e01a361ad44221d561a298e5af05 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Android: Use the new runOnAndroidMainThread() callAssam Boudjelthia2021-06-072-3/+3
| | | | | | | | | | | | Remove the [&] capture in runOnAndroidMainThread() for void type. Replace the old private QtAndroidPrivate::runOnAndroidThread() with QAndroidApplication::runOnAndroidMainThread(). Task-number: QTBUG-90501 Change-Id: I41eaf1ea9ee68b22861bf498f12a97a02515cc47 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QTimeZonePrivate: make windowsId return a QByteArrayViewMårten Nordheim2021-06-071-2/+2
| | | | | | | | In debug this cuts off about 4 seconds off of the qtimezone test on my machine. In release it's about 300-400 milliseconds. Change-Id: I92ec18794247e3846704a7c8e87a8c34fdae5e3c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Simplify QDate::weekNumber()Edward Welbourne2021-06-071-7/+5
| | | | | | | | | Eliminate two local variables and don't even compute the year if we don't need it. Change-Id: If968c619750cead317641885a0fb9b9974954782 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: QtCore: Fix more documentation warningsTopi Reinio2021-06-075-8/+10
| | | | | | | | | | | | | | * Omit 'Bluetooth' enum value in QPermission::PermisionType (sic) as that seems to be unimplemented. * Comment out \sa links to internal/undocumented functions. * Fix incomplete template parameters in \fn commands for QProperty methods. Task-number: QTBUG-93995 Change-Id: Ic8e63fca22c9c72325c76f90f537b221f56ebace Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QProperty: Fix source_location feature testingFabian Kosmale2021-06-071-2/+10
| | | | | | | | | | | | | | | | | The presence of the source_location header does not guarantee the availablility of std::source_location. For instance, if using clang 11 with a modern libstdc++, the source_location header is available, but std::source_location is not available as it would require __builtin_source_location, which clang does not implement. Consequently, we need to explicitly check the feature test macro instead, and only use std::(experimental::)source_location when it is defined. Task-number: QTBUG-94194 Pick-to: 6.1 Change-Id: If6fda9a1b98244b1f2944fff6fe1991def30fc0f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Always include standard name in QLocale::uiLanguages()Edward Welbourne2021-06-071-2/+10
| | | | | | | | | | | | | | | | Previously, for locales other than the system locale, no entry was added to the list for the actual locale whose variants - with and without likely sub-tags - were being appended. In most cases the standard name will in fact coincide with the variant without likely sub-tags, so this was unlikely to cause a problem, but it should be present regardless. At the same time, turn tst_QLocale::uiLanguages() into a data-driven test and add another row to its table. Change-Id: I5cb2d805d78fc3415d82b169caa6154b0f284708 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix augmentation of UI language listEdward Welbourne2021-06-072-24/+2
| | | | | | | | | | | | | | | | | | | | Previously, the augmentation wasn't being applied to the system locale, due to a mistaken test claiming the locale's name didn't resemble the string from which it was constructed. The test dates from before various fixes to likely sub-tag processing that should make it redundant now. This makes QLocalePrivate::rawName() also redundant (and its conversion of QLatin1String to QByteArray relied on '\0' termination which wasn't actually present in the various codes). Expanded the test of systemLocale() to also test uiLanguages() turns a single entry into the list we expect; and add two new test-cases. (The test uses a mock system locale class, making this independent of the platform backend.) Fixes: QTBUG-92234 Pick-to: 6.1 5.15 Change-Id: I0cdf6eae152a42dc377f4ea3e62c282ff4be1764 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: allow Qt::AA_DontShowShortcutsInContextMenus overridesVolker Hilsheimer2021-06-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Following the discussion in QTBUG-69452, the resulting change in cc33dd079796437bafed8f42de7fbf8f17d19ec8, and the documentation of QAction::shortcutVisibleInContextMenu, the intention is that the attribute allows the overriding of the platform default. However, QAction did ask both the attribute and the platform integration, making the override impossible. Instead, ask only the attribute, but default the value of the attribute to what the platform integration provides. [ChangeLog][QtGui][QAction] The shortcutVisibleInContextMenu property defaults to the value of the Qt::AA_DontShowShortcutsInContextMenus attribute, which in turn defaults to the platform integration. To override the default, set the application attribute after instantiating QApplication, or override the default for each QAction instance. Task-number: QTBUG-73990 Pick-to: 5.15 6.1 Change-Id: Iaba330913555d93d05efe1b3965a6aea39db5554 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove legacy code path from qt_add_resourceJoerg Bornemann2021-06-071-37/+11
| | | | | | | | All repos use the updated version of qt_add_resource, and we can remove the legacy code path. Change-Id: I15ba64a08c3fad9712a5cf05715594b1ee755bfc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QMetaType: Avoid instantiating QMetaType in Q_DECLARE_METATYPEFabian Kosmale2021-06-071-12/+8
| | | | | | | | | | | | | | | | Having a call to QMetaType::fromType in struct QMetaTypeId causes issues if Q_DECLARE_TYPEINFO is used later, as it will already cause an instantiation of QTypeInfo. Instead, use QtPrivate::typenameHelper to obtain the name. We cannot use QMetaTypeForType::getName, as that would cause similarissues with QMetaTypeId2. However, QMetaTypeId2 is only used for builtin metatypes, which do not use Q_DECLARE_METATYPE. And even if a user would use Q_DECLARE_METATYPE with them, the worst that happens is a superfluous type normalization. Fixes: QTBUG-94124 Change-Id: Ie4a993411214fd009a604de44306131c647095eb Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QProperty: Do not involve semi-destroyed QObjects in bindingsFabian Kosmale2021-06-074-0/+19
| | | | | | | | | | | | | Once we're in ~QObject, only methods of QObject are still valid. Notably, no setter of any derived class is still valid. Thus, to be safe we must no longer react to binding changes of those properties. To ensure that this happens for QObjectCompatProperty properties, we explicitly clear the binding storage. Fixes a particles3d example crash. Change-Id: I10d2bfa5e96621ce039d751cffaf3ac41893623e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Avoid unnecessary work when linking observersUlf Hermann2021-06-051-1/+1
| | | | | | | | We already do most of the work of setFirstObserver() in the method body before. Change-Id: Ia31f19ca656675dddb692609d8875c5d48e967f1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Implement QFileInfo::junctionTarget(), adjust auto-testKarsten Heimrich2021-06-059-2/+80
| | | | | | | | | | | | The change in 004e3e0dc2cab4a4534d2ed3ace41aad6bfbe45d introduces Windows junction awareness, though users were still unable to resolve the junction target. This change adds the ability to solve this. Fixes: QTBUG-93869 Change-Id: I9f4d4ed87b92e757f7b6d8739e2a61b58c096f63 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Unify behavior for long path or UNC prefix removalKarsten Heimrich2021-06-054-40/+34
| | | | | | | | | | | | | Split the code out of QDir::fromNativeSeparator into a separate reusable function to remove the above-mentioned prefixes. Fixes and unifies behavior if the prefix was given with slashes instead of backslashes. Add a couple more test cases. Fixes: QTBUG-93868 Pick-to: 5.15 6.0 6.1 Change-Id: Ibd94ae283e2fb113f9c2db97475fbc7d89522bbf Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QProperty: Refresh the observers after evaluating bindingsUlf Hermann2021-06-041-8/+13
| | | | | | | | | Evaluating bindings may actually break bindings, and remove observers. Therefore, we need to re-fetch for notifying afterwards. Fixes: QTBUG-94220 Change-Id: I96a78a825f983f58f1a574bf886e643f54453fdc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Bring back qt_finalize_executableKai Köhne2021-06-041-0/+5
| | | | | | | | | | qt_finalize_executable was renamed to qt_finalize_target in commit c4df673dd903. Anyhow, app wizards in Qt Creator 4.15 already use it, so let's keep it as an synonym API for the time being. Fixes: QTBUG-94156 Change-Id: I468443c80c027ac49a21208a9b15af1dbb4a5f84 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add support for building with clang-clCristian Adam2021-06-042-15/+40
| | | | | | | | | qmake had support for building with clang-cl as the win32-clang-msvc mkspec. Task-number: QTBUG-89642 Task-number: QTBUG-88081 Change-Id: I0709c289f90fedb121620d1e67ef841602219816 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QProcess: untangle platform-specific detailsAlex Trotsenko2021-06-044-124/+131
| | | | | | | | | - add missing #ifdef in header file; - split some functions (writeData(), _q_canWrite(), cleanup()) into their platform-specific implementations. Change-Id: I4e7c1c377ec8468ed120d38acf2543eef9316c01 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* JNI: Add calls to get field IDsAssam Boudjelthia2021-06-042-0/+47
| | | | | | | Task-number: QTBUG-92952 Change-Id: Ie68ede4b00a411064a29925b28b1f60a84d2d678 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QDateTime{Parser,EditPrivate}: clean up initializationEdward Welbourne2021-06-031-6/+5
| | | | | | | | Initialize members by assigning them where declared, where possible, rather than duplicating initializations in constructors. Change-Id: I35c398581ad649210aaec979ea7c6c2fc2cb0bca Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: mark private android classes as \preliminaryAssam Boudjelthia2021-06-031-0/+6
| | | | | | | Those classes are temporary and will change in the future releases. Change-Id: I1d516e34977bd6f5ae9526704b021e616c4746f3 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QSortFilterProxyModel: create mappings on demand againDavid Faure2021-06-031-10/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling create_mapping in setSourceModel as introduced by 8455bfee76ed3f1bd3bba8bd3688a7afa94ae0bb can lead to an early call to filterAcceptsRow, and some existing applications may crash. It is also an incomplete solution since it was only done for the toplevel index but not for child indexes. Instead, go back to creating mappings on demand. This means coming up with a different fix for QTBUG-87781 (dataChanged not emitted for indexes that haven't been mapped yet, i.e. not queried or shown anywhere). When this happens, we can't know if the index was previously filtered out or not (for lack of a dataAboutToBeChanged signal...). Creating the mapping with the new data only gives us the new state of affairs, there's no reference state to compare to. Therefore, when the mapping is missing (during dataChanged handling), create it, but skip all the logic about row insertion/removal, just forward the dataChanged signal if the row isn't filtered out. Creating the mapping might require creating first mappings for parents, recursively, which wasn't done anywhere in QSFPM yet, hence the new create_mapping_recursive() method. In addition to all this, the handling of removed items was incorrect, remove_source_items did nothing if the parent was gone, and then source_items_removed was trying to adjust indexes in an incorrect list. If the parent is gone, clear the proxy_to_source list, so there's nothing to adjust afterwards. This bug actually doesn't happen anymore in this version of the patch, but the change still seems right and might prevent repeating a long debugging session in the future. Thanks to ChunLin Wang for the unittest in this commit. Done-with: ChunLin Wang Pick-to: 6.1 6.0 5.15 Change-Id: Id543d0cc98f1a03b5852bda01d2f49b980e06be7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QProcess: refine 'Channel' structureAlex Trotsenko2021-06-032-19/+12
| | | | | | | | | | - exclude unused notifier pointer on Windows; - use default initialization for members; - avoid bit fields in declarations as there are extra padding bytes anyway. Change-Id: I2e03c4c269c885c90c0a6d18b8a935885f4b3feb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Fix system locale for IntegrityJanne Koskinen2021-06-021-1/+7
| | | | | | | | | Integrity doesn't have langinfo, default locale is C, set to UTF-8 Change-Id: I6a6374195344641f64da895cd5f2745b61af060a Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
* Avoid use after free in tst_qsequentialanimationgroupFabian Kosmale2021-06-021-2/+6
| | | | | | | | | | | | | | The test connects finished to the groups clear method, which in turn deletes the animation instance. Thus, no member must be accessed after calling stop, unless we use a (costly) QPointer to guard against deletion. Notify earlier that totalCurrentTime changed to avoid the issue. As a drive-by, modernize the connect in the test. Fixes: QTBUG-94143 Change-Id: I923101107b7f79115be69a58c8e8d5177a98d48f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Add a const JNINativeMethod[] overload for registerNativeMethods()Assam Boudjelthia2021-06-023-8/+49
| | | | | | | | | | | The JNI interface expects a const JNINativeMethod[] and our wrapper takes a non-const. Also, this was causing refactoring of exisisting code with a const JNINativeMethod[] to fail because the call expects a non-const. Change-Id: If790c401650cb33fe31f93bafe41aab7714488e9 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* CMake: Add Android's prepare_apk_dir target to ALLAssam Boudjelthia2021-06-021-2/+2
| | | | | | | | | | Since Qt Creator uses androiddeployqt custom commands it still needs a step to prepare the apk dir before building it, so add this to ALL to avoid having to call it manually in creator. Pick-to: 6.1 Change-Id: I0a2816244589e9b296a326fcc1abf8c08aabfea7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix QSettings documentationFriedemann Kleint2021-06-011-4/+6
| | | | | | | | | | QMainWindow::saveGeometry()/restoreGeometry() should be used to save and restore geometries instead of saving pos/size since it also works in multiscreen settings. Pick-to: 6.1 Change-Id: I27cc5ec13e69266367f035796e208d214f84b043 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Simplify storing of notification objectsLars Knoll2021-06-013-7/+159
| | | | | | | | | | | | | | | | | | | | QPropertyChangeHandler is a templated class and it's argument is a functor. That makes it inherently cumbersome to use the class in any context where the change handler needs to be stored. Introduce a QPropertyNotifier class that stores the functor in a std::function<void()>, and add a QProperty::addNotifier() method that can be used instead of onValueChanged(). Also make QPropertyNotifier default constructible. This significantly simplifies the code that needs to be written and makes it possible to store notifications as class members without major hassle. Fixes: QTBUG-92980 Change-Id: Id5b7baec093b9ac0467946cded943d92ad21030b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move QIdentityProxyModelPrivate out into its own headerMitch Curtis2021-06-013-37/+88
| | | | | | | | | qtquickcontrols2 needs to use it. Change-Id: Ic5e3105095a8fcd36a38a3ce4353db4057ada0de Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* Doc: QtCore: Fix documentation issuesTopi Reinio2021-06-017-35/+15
| | | | | | | | | | | | | | | | | | * Add module header wrapper that loads the real QtCore header and qandroidextras_p.h to generate docs for those types * Add missing dummy typedefs to doc/include/jni.h * Use the correct \namespace name (QtAndroidPrivate) and mark it as \preliminary * Add missing 'const' specifier for Q[Untyped]Bindable methods * Drop documentation for removed method QProperty::markDirty() * qmath.h: Fix \fn commands for qFloor(), qCeil() * QHashSeed: Drop incorrect usage of \relates Fixes: QTBUG-93942 Task-number: QTBUG-93995 Change-Id: If76b5aa4b79a64add3cb6275eac82ec44ef10319 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Rework resource finalizer approachAlexey Edelev2021-05-311-10/+9
| | | | | | | | | | | | | | | | In the previous implementation of the resource object finalizer, we used the name of the resource object library without namespaces when recording it in the resource libraries list. This causes an issue when we or users export resource targets. This approach marks resource object libraries with the exporting property instead of collecting resource targets when creating them. Amends 19e789bace887105badae83c0a79429bbf8e8221 Change-Id: I8596815921f2c681ddd78d9b2e9a4e1cafe5000b Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>