Commit Graph

51284 Commits

Author SHA1 Message Date
Ville Voutilainen
e439fab4be Resurrect tests for QSharedPointer
Task-number: QTBUG-93093
Change-Id: I030c18db1ab9e48cbd3339bc2040ba0b46cd1370
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-27 01:33:42 +03:00
Joerg Bornemann
52077d4f01 Inhibit CMake generator detection for qt-configure-module
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>
2021-04-26 23:11:28 +02:00
Joerg Bornemann
7d48b64f41 Add QT_ANDROID_TARGET_SDK_VERSION target property
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>
2021-04-26 23:11:28 +02:00
Joerg Bornemann
d1eeef2625 Add QT_ANDROID_MIN_SDK_VERSION target property
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>
2021-04-26 23:11:28 +02:00
Joerg Bornemann
8fdaa081fd Add QT_ANDROID_VERSION_{NAME|CODE} target properties
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>
2021-04-26 23:11:28 +02:00
Alexandru Croitor
adf29329ea CMake: Make qt-internal-configure-tests relocatable
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>
2021-04-26 23:11:28 +02:00
Lars Schmertmann
d81a9206ac Fix build error on iOS with the configure option -qtnamespace
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>
2021-04-26 21:16:05 +02:00
Liang Qi
6a91ad7b5b xcb: Add more debug info for XCB_INPUT event
Pick-to: 6.1 6.0 5.15
Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-04-26 17:35:55 +00:00
Niclas Rosenvik
96f493f3b8 Add override to addPaths and removePaths in kqueue filesystem watcher
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>
2021-04-26 17:35:55 +00:00
Alexandru Croitor
2fccea3b70 CMake: Fix tst_qaddpreroutine to work with static builds
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>
2021-04-26 19:35:55 +02:00
Alexandru Croitor
31ee3c84a7 CMake: Install prl files from all repo build dirs in a top-level build
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>
2021-04-26 19:35:55 +02:00
Robert Löhning
7acce0c525 Fuzzing: Test different calendar systems
Change-Id: I61be9f09d4299674e9cf9daf1d4dbbf90f3d2d2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-26 17:51:38 +02:00
Andreas Buhr
6a3cc36e4a Port of QTimeLine to new property system
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>
2021-04-26 16:44:54 +02:00
Luca Beldi
6ec3fa2842 Fix QTreeModel calling beginRemoveRows twice
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>
2021-04-26 13:44:51 +01:00
Luca Beldi
fcea8e7aa8 Fix QAbstractItemModelTester false positive
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>
2021-04-26 13:44:51 +01:00
Volker Hilsheimer
3f98ff474f Fix linking on Windows when SSL is not configured
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>
2021-04-26 14:44:51 +02:00
Joerg Bornemann
63a812b851 Fix "qmake -spec foo" call for cross builds
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>
2021-04-26 10:59:32 +02:00
Edward Welbourne
6235893d54 Update CLDR-derived data to newly-released v39
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>
2021-04-26 10:59:32 +02:00
Volker Hilsheimer
5f5fc9bf6f Fix QMetaType API deprecation warning in benchmark
Slipped through 1d3fe418e2.

Change-Id: I7ff39852a878ce76d48d5a1798a49f9137e00a13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-26 10:59:32 +02:00
Kai Köhne
89f51a0680 zlib: Disable MSVC warning C4267
Pick-to: 6.1
Change-Id: Ifc51c1847841bb7172f79067facf0c7e425a042b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-04-26 10:59:30 +02:00
Thiago Macieira
c58be606dd QLockFile/Unix: remove the " (deleted)" suffix from kernel-supplied names
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>
2021-04-26 04:42:32 +00:00
Thiago Macieira
615972b74f QLockFile: don't use the local timezone to compare file times
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>
2021-04-26 04:42:30 +00:00
Giuseppe D'Angelo
37edc6ab49 PRI* datatypes: fix typos in documentation
A c&p mistake manage to slip through in 5fabad9a61, amend it.

Change-Id: I706a6643d0745f336afca7bda0d8b0359354a0d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-25 20:57:56 +02:00
Giuseppe D'Angelo
5fabad9a61 Long live PRI*Qdatatypes
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>
2021-04-25 15:24:45 +02:00
Igor Kushnir
7c9597ef56 Add QSortFilterProxyModel clear-filter benchmark
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>
2021-04-25 13:25:01 +03:00
Giuseppe D'Angelo
49609f58a5 Fixed type integers: streamline the definitions
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>
2021-04-24 17:22:24 +02:00
Igor Kushnir
7d92ef63d7 Optimize quadratic-time insertion in QSortFilterProxyModel
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>
2021-04-24 15:37:08 +03:00
Thiago Macieira
885eff0537 QThreadPool: obey the docs that say we always use at least 1 thread
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>
2021-04-24 00:37:14 +00:00
Alexey Edelev
ddaa7150d8 Switch to target_sources approach for the static library resources
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>
2021-04-23 21:31:57 +02:00
Giuseppe D'Angelo
b5e9130c44 QtGlobal: check the Qt fixed size integers
"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>
2021-04-23 20:59:45 +02:00
JiDe Zhang
22e967c304 fix: The QtStartUpFunction function may be called repeatedly
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>
2021-04-23 18:51:30 +02:00
Joerg Bornemann
f1c37ead59 Error out if requesting Android build without toolchain file
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>
2021-04-23 16:50:55 +02:00
Joerg Bornemann
74310cb36f Android: Choose latest version when autodetecting the NDK
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>
2021-04-23 16:50:55 +02:00
Joerg Bornemann
ff7f32f26b Android: Do not auto-detect NDK if ANDROID_NDK_ROOT is set
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>
2021-04-23 16:50:55 +02:00
Alexandru Croitor
393f45de90 CMake: Allow enabling Apple app extension API in other repos
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>
2021-04-23 16:50:55 +02:00
Edward Welbourne
7c65935810 Make zone-name part of date-time parsing a little faster
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>
2021-04-23 16:50:54 +02:00
Andreas Buhr
c36f18b449 Improve error message in bindable property test
Change-Id: I96a9f36657b49814b540c0b909c4642422d49b35
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2021-04-23 16:50:54 +02:00
Friedemann Kleint
2393a40ccd Rewrite the fetchmore example
- 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>
2021-04-23 12:43:28 +00:00
Jarek Kobus
43d6778ce5 Fix a build when QT_DISABLE_DEPRECATED_BEFORE is set to 6.1.0
Amends: ff8d757e22

Task-number: QTBUG-93033
Pick-to: 6.1 6.1.0
Change-Id: I67b7bda0f63fdb3c4e1864e38c872b96df90a8ae
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-04-23 14:43:28 +02:00
Allan Sandfeld Jensen
ffb5635c1a Do not access internal allThreads data unlocked
Pick-to: 6.1 6.0 5.15
Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-23 14:43:28 +02:00
Assam Boudjelthia
f4e23bf3de Fix QJniObject templates implementations
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>
2021-04-23 15:43:28 +03:00
Assam Boudjelthia
2666f3e37d Fix build error when using -qtnamespace flag
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>
2021-04-23 14:31:04 +03:00
Martin Storsjö
236ae73ed8 Lowercase system includes and lib names for Windows, fix cross compiling
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>
2021-04-23 14:31:04 +03:00
Cristian Adam
0a1256a52d CMake: Allow usage of QtStandaloneTestTemplateProject as package component
Currently in order to compile a Qt6 test standalone one needs to use
the qt-cmake-standalone-test script which will load the
Qt6BuildInternals/QtStandaloneTestTemplateProject/CMakeLists.txt project
with the current test source directory to create a complete CMake project.

This commit will allow a test to have these lines at top:

cmake_minimum_required(VERSION 3.16)

if (NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
    project(a_qt_test LANGUAGES C CXX ASM)
    find_package(Qt6BuildInternals COMPONENTS STANDALONE_TEST)
endif()

and be standalone and work with any IDE capable of loading CMake projects.

Fixes: QTCREATORBUG-25389
Pick-to: 6.1
Change-Id: If3f878b7e560a8bfbb604a8f1aa30b7962742e66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-23 13:31:04 +02:00
Andy Shaw
66acee69a1 SQLite: Handle tables and fields with a dot in the name correctly
Fixes: QTBUG-91885
Pick-to: 6.1 6.0 5.15
Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-23 10:46:58 +02:00
Volker Hilsheimer
83eca9a087 Mark obsolete QMessageBox members as deprecated
Those overloads have been documented as obsolete, but never been deprecated.
Add the deprecation macros to trigger warnings as of Qt 6.2.

The overloads taking a single StandardButton should not be deprecated until
Qt 7, as otherwise porting from old to new API will require an unnecessary
cast to StandardButtons for calls with only a single enum value.

The unit test explicitly tests the deprecated members, so disable warnings
there.

Fixes: QTBUG-92483
Change-Id: I283ddce4681eafda2378607f999946e56bbb777e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-04-23 08:52:01 +02:00
Volker Hilsheimer
00988adcf9 Port example away from deprecated QTextCharFormat API
Change-Id: I1d62f14f9e64f14809bdced4e5d906979034cbdc
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-04-23 08:52:01 +02:00
Fan PengCheng
4dc7102c84 Avoid adding null-objects to the icon cache
When we can't get the icon for the first time, we would use the data
in the cache later, and we will never get the new icon when the system
theme is updated while the application is running.

Pick-to: 6.1
Change-Id: I839ad9983918561a1dc6bc842f85477bba53f64a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-04-23 03:49:28 +00:00
Thiago Macieira
3458dd2d47 QDuplicateTracker: store the current seed in the hasher
It's allowed to change asynchronously by another thread.

Pick-to: 6.1 6.0 5.15
Change-Id: I6cdea00671e8479b9c50fffd167836a08a42cc1d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-04-22 22:55:12 +00:00
Timur Pocheptsov
d385158d52 Move plugin code from QtNetwork to qtbase/plugins
All TLS (and non-TLS) backends that QSsl classes rely
on are now in plugins/tls (as openssl, securetransport,
schannel and certonly plugins).

For now, I have to disable some tests that were using OpenSSL
calls - this to be refactored/re-thought. These include:
qsslsocket auto-test (test-case where we work with private keys),
qsslkey auto-test (similar to qsslsocket - test-case working with
keys using OpenSSL calls).
qasn1element moved to plugins too, so its auto-test have to
be re-thought.
Since now we can have more than one working TLS-backend on a given
platform, the presence of OpenSSL also means I force this backend
as active before running tests, to make sure features implemented
only in OpenSSL-backend are tested.
OCSP auto test is disabled for now, since it heavily relies on
OpenSSL symbols (to be refactored).

[ChangeLog][QtNetwork][QSslSocket] QSslSocket by default prefers 'openssl' backend
if it is available.

[ChangeLog][QtNetwork][QSslSocket] TLS-backends are not mutually exclusive anymore,
depending on a platform, more than one TLS backend can be built. E.g., configuring
Qt with -openssl does not prevent SecureTransport or Schannel plugin from being
built.

Fixes: QTBUG-91928
Change-Id: I4c05e32f10179066bee3a518bdfdd6c4b15320c3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-04-22 22:51:54 +02:00