Because leaving the pointer untouched is a much more expected behavior
The tests for this (and not only) logic can be found in the following commit
Change-Id: Iec9eec9bbce04c9fd90cb6be9627c135cd989b7f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 38bba2a87c6c5c2b8100870add6d0d7ad559e669)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Test the relocation logic through the QADP::relocate() method which
basically calls q_relocate_overlap_n inside and then ensures that
the data pointers are in good state
Running these locally in fact revealed a bug in the implementation,
so these tests are definitely good to have
Task-number: QTBUG-93019
Change-Id: I353ed46a31c5c77cd0c5fcacd3dfce46e5cf3e67
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 65d0f6829cc124f6d0d4003a17bedcb74dddf33b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the data moves to readjust the free space in the QList,
which ultimately fixes the out-of-memory issues caused by
cases like:
forever {
list.prepend(list.back());
list.removeLast();
}
Task-number: QTBUG-91801
Task-number: QTBUG-91360
Task-number: QTBUG-93019
Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9)
We already used it in QString and QBA. And implicitly in QADP (see
parent commit). Might as well move to a common location and reuse
Change-Id: I694f0f1dbd109f17c134f64b3f3dc28d19556c88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit 10b46e7f0faecc42a94cc2e25ad3edd08ae28083)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added branching to plugandpaint example to get correct library
architecture to the build
Fixes: QTBUG-56322
Pick-to: 5.15
Change-Id: I4d0eb4e24681642991d08c3dd2bad73d10caf962
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When configuring a Qt module with qt-configure-module, we want to use
the same CMake generator that was used for building qtbase.
That generator is encoded in qt-cmake-private. But qt-configure-module
overrides the generator after trying to detect what generator should be
used. That auto-detection is only useful for qtbase-builds and top-level
builds. Turn it off for repo builds other than qtbase.
Pick-to: 6.1
Fixes: QTBUG-91405
Change-Id: I07efb4afb51ba69d2f5467d272118fa51637ab54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is the counterpart of the qmake variable
ANDROID_TARGET_SDK_VERSION.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: Idd64ee06eb94826430e6be5d9d878631db67c949
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This is the counterpart to the qmake variable ANDROID_MIN_SDK_VERSION.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: I4e1434a794f3a8345f9b4e045ab4366d486221af
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Those are the CMake counterparts of the qmake variables
ANDROID_VERSION_{NAME|CODE}.
Pick-to: 6.1
Task-number: QTBUG-86033
Change-Id: I57534ff04db0c78871fe7ba81bedaf377422054b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
It's important for conan CI builds where the correct installation
location of Qt should be used when configuring standalone tests.
Task-number: QTBUG-93037
Change-Id: I2465a439aea6826dedfb3217d1c909ad639d4ac0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error:
unknown type name 'QString'; did you mean 'XXXX::QString'?
int createUnixKeyFile(const QString &fileName);
^~~~~~~
XXXX::QString
Pick-to: 5.15 6.0 6.1
Change-Id: I455526503f059efc2f496b159b4cb098385dda00
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add override to addPaths and removePaths in kqueue filesystem watcher
Fixes build break in developer-build with gcc 10 on *BSD
Pick-to: 6.1
Change-Id: I7d91251d6bcb1614bb9f21c319abc9c2df681cda
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
DEFAULT_IF needs to be true so that in a static build the
built plugin is automatically linked into the test executable
using the special static plugin per-repo behavior in
qt_internal_add_executable.
The QtPostProcess routines are not executed for this test project
because we don't use qt_build_repo. This means that no
QtFooPluginCMakeConfig.cmake file is generated and thus there's no
point in using qt6_import_plugins because the pulic plugin genexes
won't know about this target anyway.
Explicitly set the CLASS_NAME so that the name expected by the
Q_IMPORT_PLUGIN macro matches the name of the plugin instance that moc
generates in QT_MOC_EXPORT_PLUGIN.
Amends 22e967c304
Task-number: QTBUG-87580
Task-number: QTBUG-90341
Pick-to: 6.1 6.0
Change-Id: I5ef361e7e2cebc46b35310c679f15c84cd61b4a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Previously, in a top-level build we always generated the final prl
file somewhere under QT_BUILD_DIR (which is qtbase_build_dir). After
each repo was processed by QtPostProcess.cmake, we installed the prl
files found in PROJECT_BINARY_DIR.
For qtquickcontrols2 this meant that qml plugin prl files were placed
under qtbase/qml, but we tried installing the prl files from
qtquickcontrols2/qml, which didn't have any prl files.
In a static Qt build, qmake's qt.prf calls qmlimportscanner to
identify which plugins should be linked to the executable. This worked
fine because the plugin .pri files were installed correctly.
None of the qml plugin library dependencies were linked in though.
This is supposed to happen in qmake's C++ code where it tries to
find the associated prl file of a linked library in order to extract
all its dependencies. Because no prl file was found, linking failed
with multiple undefined symbols.
Fix this by installing the prl files from QT_BUILD_DIR rather than
PROJECT_BINARY_DIR.
Note that this will create multiple install rules for certain files,
but it's harmless. An example is imageformats.
We process qtbase plugins, see qjpeg, issue an install rule from under
the qtbase/plugins/imageformats folder. We then process
qtimageformats plugins, see webp, issue another install rule from
under qtbase/plugins/imageformats.
The first install rule will install both qjpeg and qwebp, the second
install rule will merely say all plugins are up-to-date.
Pick-to: 6.1 6.0
Change-Id: I8a4bb67bfafc1d016eab62f4fe66b6ba378ceeb2
Fixes: QTBUG-93021
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The six properties duration, updateInterval, currentTime,
direction, loopCount and easingCurve have been ported to the
new property system and are now bindable.
Drive-by renamed a local variable to avoid shadowing.
Task-number: QTBUG-85520
Change-Id: Ibabf106f5200d2dd4329a1e1f96112eccc29d6b1
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
For items that are children of other items, removeRows calls
beginRemoveRows directly and then once again inside takeChild()
The signal blocker that dates back to the monolitic import from Nokia
prevents the model from emitting extra signals
but the persistent indexes are corrupted nonetheless.
Fixes: QTBUG-90030
Pick-to: 6.1 6.0 5.15
Change-Id: I5bc4b2598bf13247683b113faeec22471f1f04a4
Reviewed-by: David Faure <david.faure@kdab.com>
When inserting rows to a branch with no columns
the tester should not complain about indexes being invalid
Pick-to: 6.1 6.0 5.15
Change-Id: I466f4e5140b10f6dcf65a71f109c2d3be7336507
Reviewed-by: David Faure <david.faure@kdab.com>
The qt_ForceTlsSecurityLevel symbol is not defined if SSL is not configured,
so don't use it in the QNetworkReply test if it's not.
Change-Id: Id3110a1997fea1648b48bfc411e90e7efe306678
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In a cross built Qt, for example Qt for Android, calling "qmake -spec
android-clang" led to an error message:
"Could not find qmake spec '-qtconf'."
This happened, because:
- the qmake in Qt for Android is a wrapper script that calls
"qmake -qtconf qt_target.conf -spec android-clang"
- the first stage of command line argument handling in qmake garbled the
call to "qmake -spec -qtconf qt_target.conf android-clang"
We do not modify the order of arguments anymore.
Instead, we skip the "-qtconf <file>" arguments in the first argument
handling stage that is supposed to determine qmake's modus
operandi (like -project or -query).
In addition, we need to fix the assignment of
QLibraryInfoPrivate::qtconfManualPath which was only done if
QMakeGlobals::addCommandLineArguments returned ArgumentsOk. However,
this function returns ArgumentUnknown, if it encounters an argument it
cannot handle - like the project name.
Now, we assign QLibraryInfoPrivate::qtconfManualPath if there was no
error detected.
Document the return values of addCommandLineArguments.
This amends commit 661b586a69.
Pick-to: 6.1 6.0
Fixes: QTBUG-93079
Task-number: QTBUG-85136
Change-Id: I12ec25b17d64c00be2a3904b7c4a975b781500a0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Routine update with minor changes to locale data, no new languages,
territories or scripts. Various Spanish locales change m_grouping_top
from 1 to 2, reversing a change to a test of Costa Rica's currency
formatting made in commit bb6a73260e.
Includes updates to time-zone IDs.
Fixes: QTBUG-91478
Pick-to: 6.1 6.0 5.15
Change-Id: I78ee161275b3c456c5800a7317a96947c932cf8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The kernel appends that to the symlink targets in /proc for files that
have been deleted.
Change-Id: I7a386ad4f0cb4e2ba629fffd16789b5a52491627
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
There's no need to find the local time zone and do expensive conversions
to compare regular, old seconds-since-1970 to the time now.
Task-number: QTBUG-93069
Change-Id: I6cdea00671e8479b9c50fffd167897b91a04ce03
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
A c&p mistake manage to slip through in 5fabad9a61, amend it.
Change-Id: I706a6643d0745f336afca7bda0d8b0359354a0d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt defines some integral datatypes (qsizetype, qintptr, quintptr,
qptrdiff) not in terms of the corresponding language datatypes (resp.
make_signed_t<size_t>, intptr_t, uintptr_t, ptrdiff_t) but as "integer
types with the same bit size of the corresponding language type" (and of
course the corret correct signedness for the target type).
This makes the Qt datatypes not printable via printf-like formatted
output, incl. qDebug, qWarning, QString::asprintf and so on; that's
because there isn't a format modifier that would universally work
with the Qt definitions.
For instance, on a 32 bit platform, ptrdiff_t may be a typedef for long,
while qptrdiff is a typedef for _int_ instead. Both long and int would
indeed be 32 bits, but they still are different types, and this means
that the ptrdiff_t-specific 't' length modifier would be wrong for
qptrdiff:
qptrdiff p;
printf("%td", p); // WARNING: -Wformat: wanted long, got int
Similarly, not using 't' breaks on 64 bits, and so on and so forth.
There isn't a way out, short of inserting casts on every print
statement.
So, let's adopt the same solution C/C++ use for their own integer
typedefs: the PRIx macros. This allows one to always use the correct
formatting specifier without the need of a cast.
I'm not adding the macros for the qintXX datatypes, as they already
exist in the Standard Library.
[ChangeLog][QtCore][QtGlobal] A series of PRIxQTDATATYPE macros have
been added. They make it possible to print some Qt type aliases
(qsizetype, qintptr, etc.) via a formatted output facility such as
printf() or qDebug() without raising formatting warnings and without
the need of a type cast.
Change-Id: I473226a661868aed9514d793c8e6e4d391ab5055
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use QBENCHMARK_ONCE rather than QBENCHMARK to avoid skewing the results:
when the QBENCHMARK block is repeated multiple times after the setup
code above runs once, only the first setFilterRegularExpression() call
unfilters some rows, while the subsequent calls simply check that there
is nothing to do.
The added benchmark is sensitive to the inefficiency - quadratic rather
than linear time complexity - fixed by
7d92ef63d7. The following two tables
contain the benchmark results on my GNU/Linux system. The numbers denote
milliseconds per iteration.
1. Qt 5.15.2 without the performance fix:
10K 25K 50K 100K 250K 500K
no match 0 1 2 5 14 28
all 0 0 0 1 3 7
first 0 1 2 5 14 28
1000th 2 6 12 25 68 302
middle 3 34 132 518 3300 13665
1000th from end 1 4 9 19 50 103
last 0 1 2 5 14 30
each 10'000th 0 39 211 937 6326 41050
each 100'000th 0 1 2 5 4226 34780
Without the fix the benchmark times out and aborts at 1000K and 2000K
data rows.
2. Qt 5.15.2 with the performance fix:
10K 25K 50K 100K 250K 500K 1000K 2000K
no match 0 1 2 4 12 26 56 136
all 0 0 0 1 3 7 14 28
first 0 1 2 4 12 26 56 136
1000th 0 1 2 4 13 28 62 145
middle 0 1 2 4 13 27 59 142
1000th from end 0 1 2 4 13 28 60 145
last 0 1 2 4 13 27 59 141
each 10'000th 0 1 2 6 22 69 290 1413
each 100'000th 0 1 2 4 13 30 81 261
Change-Id: I419a5521dd0be7676fbb09b34b4069d4a76423b1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
On all the platforms we support, we require these sizes in bits:
* char: 8
* short: 16
* int: 32
* long long: 64
We can get rid of the MSVC-specific type aliases (MSVC guarantees
__intXX to be aliases anyhow, not extended integer types) and just
use the builtin types.
Also, we require C++11 and C99, so "LL" and "ULL" are the correct
standard suffixes for (unsigned) long long. Remove the non-standard
suffixes from the Q_(U)INT64_C macros.
Change-Id: If007cd88d74064a163b5e910ca1983acd1dd1d10
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Let N = proxy_to_source.size() before the code modified in this commit.
Let M = (N - proxy_start). Let K = source_items.size(). The algorithmic
complexity of the removed loop is O(N+K+K*M), assuming the number of
O(N+K) reallocations is a constant. The complexity of the QList::insert
and std::copy implementation is O(N+K). This is much faster in practice
when K and M are of the same order of magnitude as N.
For example, this quadratic complexity issue results in noticeable
slowdown in the following scenario:
* a QSortFilterProxyModel is used only for filtering, not sorting;
* first set a filter that matches a single item in the middle of a
huge number of items (about one million) - this is reasonably fast
(takes about a second);
* then clear the filter (i.e. set an empty filter so that no item is
filtered out) and watch your application's UI freeze for a minute.
The "Add QSortFilterProxyModel clear-filter benchmark" commit (with
Change-Id I419a5521dd0be7676fbb09b34b4069d4a76423b1) adds a benchmark
that runs much faster with this performance fix.
Pick-to: 6.0 6.1
Change-Id: Ieaec173e6910f5d21eaee49402087f7711abbedf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Even if the user (usually accidentally) sets a thread count of zero or
negative. The reporter in the bug report did
QThread::idealThreadCount() - 1 on a 1 CPU system...
Drive-by add to the documentation and the missing #include.
Pick-to: 6.1 6.0
Fixes: QTBUG-93007
Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Linking the object resource library to the static library still
causes an issue if the static library contains symbols that are
used in the resource library. The proposed approach creates the
following linker chain:
executable <- resource objects <- static library <- Qt::Core
For the static qml plugins this means that the qmlcache_loader
object file will state in the linker command line before the
plugin library that implements '::qmlData' and
'::aotBuiltFunctions' functions.
We also need to keep the INTERFACE linking of the resource library
to the targets that it belongs too, to collect all the dependencies
that resouce library supposed to propagate to top-level targets.
Pick-to: 6.1
Fixes: QTBUG-93002
Change-Id: Ice0aabb6817317724abeb3db3bb8a954905cfad1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
"Just in case", together with all the others platform checks we
have in qglobal.cpp, check that we're not accidentally breaking
our type aliases for fixed size integers.
Change-Id: Iaa9438741b3a7e89f3c458763c7d222ef2abe961
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Don't call pre routine function in qAddPreRoutine if
the qt_call_pre_routines is not called
Pick-to: 6.1 6.0
Task-number: QTBUG-90341
Change-Id: I0ee70561dc57b857f8b3b1cf42c9dfe0cf45bd49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Passing Android-related variables to the initial CMake call would have
no effect if no (or an empty) value of CMAKE_TOOLCHAIN_FILE was
specified. To alleviate user confusion, yield an error if an Android
build was apparantly requested, but the toolchain file is missing.
Change-Id: I28ec94eabe436d4b9b410b48c7cad1b48d3e1bec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Before, we relied on the deprecated "ndk-bundle" subdirectory being
present in the SDK root. Now, we choose the NDK with the latest version
in the SDK's ndk subdirectory.
Pick-to: 6.1
Fixes: QTBUG-87579
Change-Id: I37a9e03184f4518b4074d55375af08209591de94
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When ANDROID_NDK_ROOT is explicitly set by the user, there's no point in
detecting the NDK. The detection had no effect, because the already set
ANDROID_NDK_ROOT variable would not be overwritten by our set call.
Fix the condition of the check: There is no CMAKE_ANDROID_NDK_ROOT
variable.
Pick-to: 6.1
Change-Id: I8f0d4f2a1a67445f67a79c7d2d0932099828b05e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's needed in qtconnectivity, but currently the
qt_disable_apple_app_extension_api_only function is defined in
QtInternalTargets.cmake which is loaded only in qtbase.
Move the function to cmake/QtTargetHelpers.cmake.
Amends e189126f1a
Pick-to: 6.1
Change-Id: Ia2470e48a91385239394368780f5bbb223000113
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QDateTimeParser::findTimeZoneName()'s invalidZoneNameCharacter() check
was using QLatin1String::contains(QChar), which converts the Latin-1
string to UTF-16 on each call, despite having pre-checked that the
QChar is ASCII. So use memchr() instead.
Change-Id: I011e2b4ba3be20711fc5005f62e4f9f6a392dd16
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Start in root folder so that large directories (/bin/, Windows)
are easily reachable
- Remove the line edit and navigate by double clicking instead
since this is more in line with expectations
- Use a QPlainTextEdit for logging
- Make the log message more informative
- Add icons
Change-Id: Ia3cd7fc143efef80772923291f0b711913aa47be
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Define the template calls in the header to allow for better type
handling and checking with constexpr and avoid overuse of macros.
Depending on the type provided in the QJniObject's call, the
signatures and the correct JNI function variant is used.
If a type is not supported a static_assert throws a compiler error.
Pick-to: 6.1 6.1.0
Change-Id: I8a4d3ce85e1ff76ef385633f2a68511fffd12e55
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Error: qtbase/src/corelib/io/qstandardpaths_android.cpp:49:17: error: no
namespace named 'QNativeInterface'; did you mean
'XXXXX::QNativeInterface'?
Pick-to: 6.1
Change-Id: I0f9fbf1879f72683d31ee0e8603b9bb26c31ae3c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When cross compiling from a case sensitive file system, casing
matters, and mingw headers and import libraries consistently
use lowercase.
This was uncovered by d385158d5213ef568b7629e2aa4a818016bbffac;
prior to that, the schannel TLS plugin didn't end up built (at
least when cross compiling).
Fix other similar cases that can be found by grepping the repo.
Change-Id: Ia696e17b7aaa979d7b7f5b0801383f338a8b585b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>