Commit Graph

57169 Commits

Author SHA1 Message Date
Fabian Kosmale
6a0e59ed50 QVariant: Avoid crash when constructed from unsuitable metatype
If the metatype does not support copy and default construction, then it
it unsuitunsuitable for use in QMetaType. We cannot prevent users from
passing in such metatypes (as we have e.g. a ctor taking QMetaType), so
verify this in customConstruct, and make the variant invalid in that
case.

Pick-to: 6.2 6.3 6.4
Change-Id: Ib1f0149c8fb9a1cce0049fd0311980754cc85d1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-21 08:37:34 -07:00
Tor Arne Vestbø
030923c0de Add -Wshorten-64-to-32 to headersclean
Fix existing warnings by casting to the appropriate type.

Change-Id: Ic44d2a71e1a2e508199dbb46bea7a19e183ec42c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-21 17:14:08 +02:00
Assam Boudjelthia
c1086e1fa7 Android: document the supported clipboard mimetypes
Fixes: QTBUG-82477
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: I31a48acbf5cadc18dfe1fe9a54243b710f4f280c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-07-21 14:54:25 +00:00
Marc Mutz
db09fec6a1 QByteDataBuffer: avoid silent failures of read(n)
On 32-bit platforms, the user can ask for more than INT_MAX bytes to
be returned from read(n), by way of its qint64 argument. We can, of
course, not return so much data because allocation would fail, so fail
early, by detecting this situation and do what resize() would have done
if it was not for the narrowing of its argument: throw bad_alloc.

Reviewers may ask themselves whether byteAmount(), which already caps
the request, would not have physically limited the request size to
INT_MAX, since we cannot possibly hold more data than that on 32-bit
platforms. But this is not correct, since QByteDataBuffer is
essentially a list of QByteArrays, and those can be shared copies of
each other (which isn't uncommon, if you consider how a user of the
class may be piecing together data by reusing existing QByteArrays).

The read(n) and readAll() functions are already documented to be
inefficient and should-not-use, we may want to remove them in the
future to force users to think about this problem in the context of
their domain.

Pick-to: 6.4
Change-Id: Ia152db0a1fc65bbef35acd463f12fba1b7726d4a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-21 14:54:25 +00:00
Fabian Kosmale
2d6ca88512 QMetaType: fix documentation
The doc comments were missing the classname, and therefore did not show
up in the correct places.

Pick-to: 6.4 6.3 6.2
Change-Id: I23a56356dcad862e2fe1f6f8c3da2f39852b80c7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-07-21 15:07:22 +02:00
Fabian Kosmale
c15489579e Purge Q_DUMMY_COMPARISON_OPERATOR usages
It is a noop on all our supported compilers.

Task-number: QTBUG-105098
Change-Id: Ic59d4c86d96ea29a5513d778ddd35df8c7a6877a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-21 14:26:02 +02:00
Samuli Piippo
18ed6a8979 CMake: prepend build dir for examples build
In cross-compilation, the CMAKE_FIND_ROOT_PATH will have path to the
host Qt and examples build will pick up wrong Qt6Config.cmake unless
the build dir path is prepended.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104270
Change-Id: I7fc7499369a2e5446e1c5257155f81c72716fef7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-21 11:54:47 +02:00
Kai Köhne
65d9593413 Examples: Use signals, slots instead of Q_SIGNALS, Q_SLOTS
Pick-to: 6.4
Change-Id: I79a352d1bac11edf2d2b0443d2f1bb202fb4e254
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-21 11:24:36 +02:00
Kai Köhne
5961dbc0e2 Doc: Hide template magic for MSVC from documentation
QT_POST_CXX17_API_IN_EXPORT_CLASS (introduced in commit e996253774)
works around a deficiency of MSVC by marking affected methods as
templated. Anyhow, this doesn't need to be reflected in the
documented API.

Pick-to: 6.4
Change-Id: I9d5dd8b979a84f2fecc582613c2e944bb33eb790
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-21 11:24:36 +02:00
Nicholas Bennett
fc5482cac6 Support pinch zoom gesture in the Mandelbrot example
Used QGesture for this as per the gesture example.
Moved the help and info text to separate lines.
Enabled word wrap to prevent text going off screen.

As a drive-by, the code to center the window at a size that's a fraction
of the screen is replaced with a simple sizeHint() override. The user
should have control over placement, particularly now that it should be
placed manually onto a touchscreen if the user has one.

Done-with: Shawn Rutledge
Fixes: QTBUG-96702
Pick-to: 6.4
Change-Id: I8dba8b09bed474f585341e9a7a8c71fb60293eee
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-07-21 08:38:44 +03:00
Thiago Macieira
eb9ace1cee QVariant: add missing const to QMetaTypeInterface pointers
They're ALWAYS const objects, though they also chock full of relocations
so they are never in read-only sections of memory (except maybe in final
executables that are position-dependent).

These are methods in a private sub-class of QVariant. No one outside of
QtCore (at least qtbase) should be using them directly. QVariant doesn't
have many friends (a bit anti-social); the one that matters is
qvariant_cast and that one does access QVariant::Private. This is not a
BC problem because QVariant::Private::type()'s signature is not
changing. In any case, QVariant's Q_CORE_EXPORT does not apply to
QVariant::Private anyway (see [1]).

[1] https://msvc.godbolt.org/z/r9cer8eWh

Pick-to: 6.3 6.4
Change-Id: I3859764fed084846bcb0fffd17035355f823dc8f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-20 14:57:32 -07:00
Thiago Macieira
48675dfa33 CMake: disable auto-detection of no_direct_extern_access
The feature is not ready for prime-time. Too many linker bugs have been
found, Clang hasn't finished implementing it, and the status of gold and
lld are simply unknown.

Task-number: QTBUG-105002
Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd1702fead133a9a96
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-20 14:54:22 -07:00
Thiago Macieira
2221b25dac CMake: add one more test for no_direct_extern_access
Found while compiling qtdeclarative tests:

FAILED: qtdeclarative/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen
[...]
ld: qtdeclarative/tests/auto/qml/qmlcppcodegen/data/TestTypes/libcodegen_test_moduleplugin.a(codegen_test_moduleplugin_TestTypesPlugin.cpp.o): non-canonical reference to canonical protected function `_Z28qml_register_types_TestTypesv' in qtdeclarative/tests/auto/qml/qmlcppcodegen/data/libcodegen_test_module.a(codegen_test_module_qmltyperegistrations.cpp.o)
ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

See https://sourceware.org/bugzilla/show_bug.cgi?id=29377

Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd1702fe6da341a9e3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-20 14:54:21 -07:00
Thiago Macieira
396170d07b CMake: fix the word order in "no_direct_extern_access"
And take the opportunity to remove the "m" in the qmake feature name and
.prf file.

Pick-to: 6.4
Change-Id: I36b24183fbd041179f2ffffd170224ab75cdd968
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-20 14:54:20 -07:00
Thiago Macieira
78ef9e9d14 Fix attempt to use -mno-direct-extern-access with Clang
Clang has the option, but spells it differently.

Fixes: QTBUG-105002
Pick-to: 6.4
Change-Id: I36b24183fbd041179f2ffffd170217e82ff6d14d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-20 14:54:19 -07:00
Alexandru Croitor
552605b0fc CMake: Rename test to tst_gui_variant_no_application
Coin test collector expects tests to start with the tst_ prefix.

Pick-to: 6.2 6.3 6.4
Change-Id: I5cd49bf75fddc121fdfbde80d8a24a6110098011
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-20 16:51:19 +02:00
Yuhang Zhao
4fbb7db08c CMake: Update description of LTCG
Use the full name of LTCG to make it clearer to the user.

As a drive-by, also remove the "Intel" word from the
CET feature's title, according to MSVC & GCC's manual,
they don't contain "Intel" in the feature title either.

Change-Id: I099ba6c5e7470b5699c1ab6b3c4ef2a4bf084580
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-20 19:16:00 +08:00
Yuhang Zhao
ce9799e4c4 MSVC: Fix the CET parameters
To enable CET for MSVC, only passing "/CETCOMPAT" to
the linker should be sufficient.

Enabling generation of EH Continuation (EHCONT) metadata
is additional protection and should not be necessary.
It also requires all the dependencies to be re-compiled
with EHCONT enabled, otherwise the linker will refuse
to link the obj files. However, this is rather hard
to achieve if your application depends on many 3rd-party
libraries, so to let people enable CET more freely,
we don't enable EHCONT guard by default.

Pick-to: 6.4
Change-Id: Iba08a5ec56c474d291991fb751a0de764719bd85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-20 19:16:00 +08:00
Shawn Rutledge
dcc691c77d Add qt.pointer.dispatch debug message for tablet->mouse synth
We have one for touch->mouse synthesis, so perhaps it's a good idea here
too; then we can confirm that it's missing on Windows, because Windows
normally does the synthesis (setPlatformSynthesizesMouse(false) is not
called on this platform, so the default is true, meaning we expect that
it does that). The cross-platform synthesis (and ability for a platform
plugin to disable) began with f931e5e72d

Pick-to: 6.4
Task-number: QTBUG-102764
Change-Id: Ic6913adbeb6b91e3953ddfe8b401975d95cd9af3
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-07-20 13:16:00 +02:00
Shawn Rutledge
8824a4e19c Fix Wacom proximity on xcb again
Amends 8e506fdd29

Also remove the lcQpaXInputEvents().isDebugEnabled() check to ensure
that the qCDebug output is emitted. It was meant as an optimization, but
skipping of printf-style qCDebugs when the logging category is disabled
is efficient enough.

Pick-to: 6.3 6.4
Fixes: QTBUG-104875
Change-Id: Id8dc710a8fdb596ddce70380a577205fc52df4cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-20 13:15:59 +02:00
Sona Kurazyan
90f3e1d349 Move the docs for porting to QRegularExpression to a common place
Copy them from QRegExp docs in qt5compat to
doc/global/includes/corelib/port-from-qregexp.qdocinc, so that the
porting docs can be included from both Qt 6 porting guide and qt5compat.

Task-number: QTBUG-89702
Pick-to: 6.4 6.3 6.2
Change-Id: I616e2333f60f36e4851398479939fd062016748d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:59 +02:00
Sona Kurazyan
93f7291387 Include the QRegularExpression porting docs in Qt 6 porting guide
The instructions for porting away from QRegExp to QRegularExpression in
the Qt 6 porting guide were mostly copied from the similar docs for
QRegExp, which are moved to
doc/global/includes/corelib/port-from-qregexp.qdocinc. The later now
covers everything that the docs from porting guide did and doesn't have
the issues listed in QTBUG-89702.

Remove the old docs and include the docs from doc/global/includes
instead.

Task-number: QTBUG-89702
Pick-to: 6.4 6.3 6.2
Change-Id: Ifdb79d5775bc0cadd02c21299d58adb27ae13337
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:59 +02:00
Sona Kurazyan
581a342a3c Add \brief descriptions to QtConcurrent topics
Fixes: QTBUG-104213
Pick-to: 6.4 6.3 6.2
Change-Id: Ib787546ef74133aca4b963a4341283147d2e8fb2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:59 +02:00
Alexandru Croitor
5afb5fb8e0 CMake: Rename test to tst_qobjectrace
Coin test collector expects tests to start with the tst_ prefix.

Pick-to: 6.2 6.3 6.4
Change-Id: Idc991273bacc41b62dbbf70f2ae0f3e712d34ab6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-20 13:15:59 +02:00
Sona Kurazyan
7afb093dd7 QtConcurrent::ReduceKernel: fix race conditions
resultsMapSize is modified inside the runReduce() method, and the
writes are protected via mutex lock. However, reads of resultsMapSize
through shouldThrottle()/shouldStartThread() (that can be called by
multiple threads) are done without a lock. Added the missing locks.

Task-number: QTBUG-104787
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I700e7b66e67025bc7f570bc8ad69409b82675049
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-20 13:15:58 +02:00
Marc Mutz
87fabf3e4b QLocale/Win: fix truncation bug in winIso639LangName()
The qstrtoull() function returns ulonglong, not int, so we'd be
incorrectly detecting 0x1'0000'0814 as NyNorsk. Paranoia? Sure.

Fix by using auto to hold the result.

As a drive-by, make the QByteArray const so .data() doesn't
attempt to detach(), and shorten a long variable name to stay
within line-length limitations.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I740d0c5934e54c9f716688fa9c00de0ac4029936
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 11:15:58 +00:00
Marc Mutz
1a40bc37d4 QLocale/Win: replace 0 with nullptr in winLangCodeToIsoName()
The function returns a pointer, not an integer.

Found while working on QTBUG-103721.

Change-Id: I18a9987d99c645a5b410c4b11128bfebcc5dcddd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:58 +02:00
Marc Mutz
424438a220 QLocale/Win: replace hand-written binary search with a call to lower_bound()
Binary search is notoriously hard to implement, and, while I didn't
spend time to prove it, this implementation was probably buggy, too
(any implementation which is missing a ±1 in the loop body is
suspicious).

Replace with a call to std::lower_bound(), which has precise semantics
and no bugs.

Task-number: QTBUG-103721
Change-Id: Ibe12c7d20b8c01e19a6f294f6c1b564b6b484b07
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:58 +02:00
Marc Mutz
25de37381d QLocale/Win: statically assert that is_sorted(windows_to_iso_list)
Consequently, remove the corresponding comment.

Need to mark the array as constexpr in order to run q20::is_sorted on
it.

Instead of overloading op< (which would be wrong, because there's no
one natural ordering of these entries), write the idiomatic manual
mixed-mode comparator By<FieldName> and use that. A follow-up commit
will use the same function object to replace the hand-written binary
search with a call to lower_bound().

Task-number: QTBUG-103721
Change-Id: I47743b5620dc3cece73b2e5bae658d5a636554dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 11:15:58 +00:00
Marc Mutz
3174f44579 Make locale data arrays constexpr
Weirdly, the generator script already has these arrays all as
constexpr...

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-100485
Change-Id: I66d54e097cac1fb6399adfeac155f1e46ff525de
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 11:15:57 +00:00
Marc Mutz
fcd96a441d Fix QLocale::createSeparatedList() for lists > 2Gi items
... by not truncating qsizetype sizes to int.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-105047
Change-Id: Iedb682e6649d4511073b33011f8fcc428f968422
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:57 +02:00
Marc Mutz
5983f8d47d QLocale: remove unneeded c_data static pointer variable
It's the same as locale_data, so use that directly. Saves one
relocation.

Pick-to: 6.4
Task-number: QTBUG-100536
Change-Id: Ic731ad0acfebf10cdf848fc351c08c6536438c62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-20 13:15:57 +02:00
Kai Köhne
74ed70f17a Doc: Add default value for seed param to all qHash overloads
Pick-to: 6.4
Change-Id: I4d559ccd60ec54d2584dceecaece7e0899c0eea9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-20 13:15:57 +02:00
Marc Mutz
d6b38be3df Port qt_repeatCount() to qsizetype
While it's true that the typical user of the function won't expect
more than half a dozen repeats, this function is fed with
user-supplied input, so it could be asked to return in excess of
INT_MAX matches. The truncation then means we're misreporting the
number mod INT_MAX, which is as good as a random number and leads to
false positive matches in users of the function.

Just return the true result instead of a truncated one.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I5e3aa23dec873c6f9af255e90748fb38619d2f5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:57 +02:00
Marc Mutz
d0aedfab09 QCollator: add comments re: missing handling of large strings
Task-number: QTBUG-105038
Change-Id: I4777ef5c5543d6fd550d4a7ceb099835c6302a12
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:56 +02:00
Marc Mutz
d4b7c81e9e QCollator: Extract Method Private::ensureInitialized()
Avoids repetition of if (d->dirty) d->init() all over the place.

Pick-to: 6.4
Change-Id: Ifc819151b7c694e6cc1f48bbb837b37d108ca49a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 11:15:56 +00:00
Kai Köhne
cb8ece3cbd Doc: Remove Qt-5 only part in qimageiohandler.cpp
Change-Id: Ie9c3633be3acca158499a5be8f344331df82b528
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-07-20 13:15:56 +02:00
Marc Mutz
ce2ba5d59d Port QByteDataBuffer to qsizetype
Less impedance mismatch with the other Qt containers.

As a drive-by, fix code style in the touched lines, and remove
superfluous inline keywords.

Pick-to: 6.4 6.3
Change-Id: I2c9444a8f956e58c361104a19f55fcc783cd1a1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 11:15:56 +00:00
Kai Köhne
440f91bd0d Clean up qt-cpp-defines.qdocconf
Cpp.ignoretokens, Cpp.ignoredirectives, falsehoods are not
used anymore by clang based qdoc.

Most defines are not needed, either, because clang based qdoc
will get these defined by scanning the normal headers. And QDOC,
Q_CLANG_QDOC is actually set by qdoc itself.

What's left is Q_GUI_LIB, Q_WIDGETS_LIB, which is used in headers
modules to make some API conditionally available. Finally, there's
QT_KEYPAD_NAVIGATION, which seems to be a Qt 3 thing, but still
some documentation depending on it ;)

Pick-to: 6.4
Change-Id: Ib9cf0debac8d569cc21271087168a46c0f8635ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-07-20 13:15:56 +02:00
Marc Mutz
84e15f662e QByteArray: fix count(ch) for more than 2Gi occurrences
We truncated the qsizetype result of countCharHelper() to int.

Fix by removing the int cast.

Fixes: QTBUG-105027
Pick-to: 6.4 6.3 6.2
Change-Id: I5ef35a6f36b0957d31036f70b5286db034e89a28
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:55 +02:00
Marc Mutz
ccb2e4dbb1 QOpenGLBuffer: add move-SMFs and swap()s
- add move special member functions (docs copied from QHostInfo)

- add member swap

- use move-and-swap, not pure-swap, because these objects hold
  resources (handles) other than just memory

- Q_DECLARE_SHARED (it's not implicitly shared, but explicitly)
  - adds ADL swap and Q_DECLARE_TYPEINFO

[ChangeLog][QtOpenGL][QOpenGLBuffer] Added member-swap(), move
constructor, move assignment operator.

Change-Id: I22dc92108bdd393fff4361db23e94eaf3d7ea9cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-20 13:15:55 +02:00
Marc Mutz
749b2df889 QCollator: port compare(ptr, n, ptr, n) to qsizetype
While the function is inline, the class is exported wholesale, so the
function forms part of the ABI on Windows (but not Unix), so we must
overload, can't replace.

To avoid ambiguities where users pass different integer types as the
lengths of the LHS and RHS strings, QT_REMOVED_SINCE the old overload.

Since the removed function has an inline definition, it suffices to
just include the header into the corresponding QT_REMOVED_SINCE
section of the removed_api.cpp file, to elegantly solve the BiC
problem only for those platforms (MSVC) where it matters.

Pick-to: 6.4
Task-number: QTBUG-103531
Change-Id: I74d446f08fcd6247a2ec44575b8afef8d014c3b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-20 11:15:55 +00:00
Marc Mutz
16c453069f QtBase: eradicate QT_STRINGVIEW_LEVEL uses
It's not used and not useful.

The macro itself has to stay, for now, because Qt5Compat uses it, too.

Task-number: QTBUG-100861
Pick-to: 6.4 6.3 6.2
Change-Id: I5d0557a6c959d6facf6e47f26786a9d365339e95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-20 13:15:55 +02:00
Marc Mutz
ad17a1674c QOpenGLBuffer: remove unused include of QScopedPointer
Nothing in this class uses one.

Pick-to: 6.4
Task-number: QTBUG-97601
Change-Id: I09397ec55ef87ddb5ab05d51c705bab83d6995fc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-20 12:56:18 +02:00
Marc Mutz
0a3ff69738 Long live QT6_{DECL,IMPL,CALL}_NEW_OVERLOAD!
We have in the past found ourselves in need of disambiguating new
overloads from older, QT_REMOVED_SINCE'ed ones, which we usually did
by adding a defaulted int argument, cf. e.g. QMetaType::id().

The problem with a defaulted int argument is twofold: First, an int is
a valid argument type, and users may get confused as to its meaning
when presented with the signature in the IDEs auto-completion popup,
and a lot of things implicitly convert to an int, so any errornous
parameter passing may stay unnoticed until we remove these fake
arguments come Qt 7.

Second, this way of doing things requires a lot of ifdef'ery to keep
the additional argument out of both the docs and future Qt 7 builds.

The solution presented in this patch is to create a tag type,
QDisambiguated_t, which a) more clearly communicates its purpose and
b) doesn't implicitly convert from anything.

To help with the invariably ugly ifdef'ery, provide a set of macros
that hide this stuff from qdoc and Qt 7 builds.

Use the macros to replace the fake int arguments that were added for
6.4.

Pick-to: 6.4
Change-Id: I6916f38c8eb9793ad6dea5f61e7e5fff7e75e273
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-20 12:56:18 +02:00
Marc Mutz
f8976a3e31 Port qt_getJustfication* functions to qsizetype
They're self-contained; callers passing ints will not cause warnings.

Pick-to: 6.4
Task-number: QTBUG-104820
Change-Id: I1dcc1b178b7d72d23dd0596835ab2868c0c6f8c1
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-07-20 12:56:18 +02:00
Marc Mutz
cb9715557c tst_QByteArray: fix custom QCOMPARE for QBAs > 2GiB
The tst_QByteArray test redefines the QCOMPARE macro to check the LHS
to be NUL-terminated. Because the code was never ported from int to
qsizetype, it fails for QByteArrays of size > 2GiB.

Fix by porting to qsizetype.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104985
Change-Id: Ib3951b0efed5f734ae1324ea2d455bb7762fb9c4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-20 12:56:18 +02:00
Thiago Macieira
638893bea0 QEventDispatcherCoreFoundation: fix #include moc location in the file
They must be outside the Qt namespace.

Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd17030ebc62812e09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-20 01:17:20 -07:00
Thiago Macieira
dc45f2b759 QLocale: #include <QList>
It's required by that misguided QT_DECL_METATYPE_EXTERN_TAGGED that uses
QList. I don't know why it is there in the first place, and will not
investigate.

qmetatype.h:1137:9: error: static_assert failed due to requirement 'is_complete<QList<Qt::DayOfWeek>, void>::value || std::is_void_v<QList<Qt::DayOfWeek>>' "Meta Types must be fully defined"

Change-Id: I36b24183fbd041179f2ffffd17026e01888f5e9a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-20 01:17:19 -07:00
Thiago Macieira
2fca51e00f JNI: match the declaration from jni.h
Happens when we switch to protected visibility.

qjnihelpers.cpp:398:1: error: visibility does not match previous declaration
jni.h:1112:1: note: previous attribute is here

Change-Id: I3859764fed084846bcb0fffd17036098322e6b8d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-20 01:17:19 -07:00