Commit Graph

60202 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
4dbd97c8f9 q_uninitialized_relocate: use memcpy, not memmove
The [first, first+n) and [out, out+n) ranges cannot possibly overlap, as
by definition the former contains live objects while the latter points
into uninitialized storage. So we can use memcpy here, and not memmove.

Change-Id: I4a1b39f73ffa67915c5252938554f45f4444293e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 21:34:49 +01:00
Ahmad Samir
eb4641210c QString: change unittests to compile with QT_NO_CAST_FROM_ASCII [7/13]
I.e. the second arg to QCOMPARE isn't what's being tested.

Drive-by changes:
- More _L1 usage, less blocky and easier to read
- QCOMPARE's second arg can be a View, it is smart enough and can
  compare them just fine
- Replace a "//15 chars" comment with a QCOMPARE check

Pick-to: 6.5
Change-Id: I4f4b84b16b543df37b0ba2f9dd781b045b2ed397
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 22:34:49 +02:00
Alexey Edelev
c4d177897c Add extra documentation about QT_ANDROID_EXTRA_LIBS
Document the potential issue caused by using QT_ANDROID_EXTRA_LIBS from
the project build tree.

Inspired by QTBUG-111173.

Pick-to: 6.5
Change-Id: I39fcda6e19b15eb13a390978230944dad41ec8d1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-02-17 18:16:09 +01:00
Tor Arne Vestbø
c26c91b208 macOS: Pick up QWizard background from keyboard assistant via NSBundle
As of macOS 10.14 the keyboard assistant background is shipped as part
of the compiled asset catalog of the app, so looking it up via a URL
will fail.

Instead we look it up via NSBundle's dedicated image lookup function,
which handles both cases.

The logic has also been moved to qwizard.cpp, since the additional
plumbing via QPlatformNativeInterface was unnecessary.

The keyboard assistant itself no longer shows the background image
as of macOS 12, so we might consider doing the same, but the design
of the assistant has also changed significantly, so as long as our
QWizard layout looks like the old keyboard assistant we keep the
background as well.

Pick-to: 6.5 6.2
Change-Id: I7d42dd79b285f3518837458864bca6bc353b3b6d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-17 18:02:25 +01:00
Alexey Edelev
8d99866f17 Revert "Add the NO_CMAKE_PACKAGE_REGISTRY option forwarding to qt_find_package"
This reverts commit 545400addd.

Reason for revert: Adding NO_CMAKE_PACKAGE_REGISTRY doesn't resolve the initial issue. So reverting this change as redundant.

Change-Id: I284600d6f0e0f2408a7a8b31827251dad4c73eba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-17 16:59:59 +00:00
Piotr Wierciński
36ba00aa5c Make feature topleveldomain optional in wasm build
This feature should not be needed in most wasm applications.
Disabling it by default can save ~50KB in QtQuick apps.

Task-number: QTBUG-110843
Change-Id: Iac0a51bfd016db1da40b59ed32e3faf6ad4267e0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-02-17 15:43:07 +01:00
Tor Arne Vestbø
667aec810f Darwin: Ensure encrypted library is loaded before parsing plugin metadata
Application delivered via the macOS or iOS App Store might have their
libraries encrypted, in which case we can not read any of the sections
of the binary until it has been dlopened.

This was causing issues for our plugin loading code, which assumed we
could read the .qtmetadata section of a yet to be loaded plugin to
determine its suitability, before loading it.

We now detect whether a library is encrypted during the Mach-O parsing,
and propagate this back to QLibraryPrivate::updatePluginState(),
which can handle the case by explicitly loading the library before
continuing with metadata validation. We still ensure that the library
has a .qtmetadata section, so that we don't need to dlopen any random
library in our path.

This does mean that we will potentially load more plugins than we
need, and since the Qt version validation happens as part of meta
data validation, we might dlopen() incompatible plugins, but it's
expected that in an App Store deployment scenario you control both
the versioning and set of shipped plugins, so this should not be
an issue in practice.

As encrypted libraries are only produced for apps that are fully
published to the App Store, and then deployed via MDM, VPP, or
Apple Configurator 2, we don't have an easy way to test this,
but the existing code paths should be unaffected, and hopefully
this patch improves the situation for the encrypted library case.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iff733505f7067ce5571854ea978bc95e8376e347
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-17 15:43:07 +01:00
Mårten Nordheim
61bfe87a64 TLS[openssl]: Use optional<> for CA cert we are fetching
The QSslCertificate ctor is somewhat expensive, especially when we are
shutting down. By using optional<> we simply reset() it and no longer
need to create a new, valid, certificate.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-102474
Change-Id: I514433b0d380dd3ceabbed3a6164f7e3efc490c7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-02-17 12:00:03 +01:00
Ahmad Samir
4499600fc7 QString: split toNum unittests
- Port macros to QTest data rows in separate unittests
- Move DOUBLE_TEST-related data to toDouble() unittest
- Drop one redundant unittest:
    QTest::newRow("const-charstar") << (const char*)0;

Pick-to: 6.5
Change-Id: Ie809895e9f5d58c2d3ec419689f409b55e24fcf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:05 +02:00
Ahmad Samir
fdf112fd1d QString: unittests: clean-up creating a QChar[]
Pick-to: 6.5
Change-Id: I3864d145c05ae4268fe576f84723acc5eba3c2cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:05 +02:00
Ahmad Samir
b9b7f44563 QDir: when sorting use the cached filename if it was assigned to
After commit b5a54d488c, we now use QCollator and so no toLower()
when caching the filename, we can re-use it from the cache after
sorting.

Change-Id: I8602a11c6f68cfe61db3ec6330596066cd257dab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:05 +02:00
Ahmad Samir
4f1d3426ac QString: change test data to compile with QT_NO_CAST_FROM_ASCII [3/13]
Pick-to: 6.5
Change-Id: I5127831d5f9dcf200d0892b1ab58760180dda610
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:05 +02:00
Ahmad Samir
5a2ebc9f40 QString: build count/contains() unittests with no ASCII casting [11/13]
Drive-by change: Test more count/contains() overloads.

Pick-to: 6.5
Change-Id: Ife3afe9aab68e18cc1587c11108a18a413c339c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:05 +02:00
Ahmad Samir
2ade07b39e QString: change test data to compile with QT_NO_CAST_FROM_ASCII [9/13]
Pick-to: 6.5
Change-Id: I20dcf2d69c1446faef79bd24a78b1b86feec4ccb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:04 +02:00
Ahmad Samir
448683809b QString: change test data to compile with QT_NO_CAST_FROM_ASCII [8/13]
Pick-to: 6.5
Change-Id: I72ebb7bb19e35a10aa85ea7da6ee6b1b332050a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:04 +02:00
Ahmad Samir
19b52ad2e5 QString: change test data to compile with QT_NO_CAST_FROM_ASCII [6/13]
Pick-to: 6.5
Change-Id: Ib747bd69f15c3e1d2deaa5a0168fcbcddbbb8f8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 10:36:04 +02:00
Ahmad Samir
c6eabb58d6 QTimerInfo: add missing qplatformdefs.h include
Change-Id: I74b5b5cfe0257d980b600bc1a61b656fea9770df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-17 07:42:24 +02:00
Ahmad Samir
fcb9ef5062 QString: split some double/Nan/Inf unittests
And switch to using test data rows (rooting out two macros in the
process).

Pick-to: 6.5
Change-Id: Ib31e6b59f90f0983c0efc4bef7cb246aedfcab5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 23:38:25 +02:00
Ahmad Samir
5c56fc6d2c QString: change test data to compile with QT_NO_CAST_FROM_ASCII [5/13]
Drive-by change: change C-style cast, (qlonglong)0, to C++ style cast
qlonglong(0).

Pick-to: 6.5
Change-Id: Ie7a36c17ac9c14f0606fcb4b112eba3f0180232e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 21:17:52 +02:00
Ahmad Samir
4f30d4f456 QString: change test data to compile with QT_NO_CAST_FROM_ASCII [4/13]
Pick-to: 6.5
Change-Id: I086d20547912da45282b88e290fdae9d2029c6bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 21:17:43 +02:00
Ahmad Samir
6542f4174e QString: change test data to compile with QT_NO_CAST_FROM_ASCII [2/13]
Pick-to: 6.5
Change-Id: If3b5eaf9964b3834c116522bc9a6bb89cd5b1626
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 21:17:10 +02:00
Ahmad Samir
6e5c6ef739 QString: change test data to compile with QT_NO_CAST_FROM_ASCII [1/13]
Change test data to compile with NO_CAST_FROM_ASCII uncoditionally where
casting from ASCII isn't what's being tested by a unittest.

The goal is to add a variant of tst_qstring that is compiled with
QT_NO_CAST_FROM_ASCII so that the unittests cover that code path too.

The commits are split into smaller chunks (where there is a common
link between changed code, that code is put in a commit, otherwise I
kept the number of changed lines below ~150) to make reviewing them
easier.

Pick-to: 6.5
Change-Id: I14256f1bde7749a3023753dbb7ed8be72cb6bc14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 21:17:04 +02:00
Marc Mutz
93060e1b0e tst_ContainerApiSymmetry: fix -Wsign-compare
Amends 7cbdc8abbd.

Change-Id: Ieed5e771bb716475d6e0fe9566627f664e04a432
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-02-16 16:48:45 +01:00
Edward Welbourne
20fd00effc Check return from time() in getCurrentStandardUtcOffset()
It's possible for time_t to overflow and time() to thus fail, so check
against that. We don't need to think about the last second of 1969 for
this, as that won't be the current time for anyone running this code.

Change-Id: I14f34d5d3e2ab9713593fcd06d6771e1d7f357ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-16 16:42:58 +01:00
Friedemann Kleint
64dc6fe87d Add some exclusions for CMake Unity (Jumbo) builds
Add exclusions for issues that are likely not fixable
(3rd party code, X11 define clashes, etc) in 3rd party,
tools and plugins.

Pick-to: 6.5
Task-number: QTBUG-109394
Done-with: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I698c004201a76a48389271c130e44fba20f5adf7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-16 16:03:06 +01:00
Volker Hilsheimer
557dcd8a87 QAbstractItemView: don't start editing on Ctrl-Click
Amends 17c1ebf8bf, after which dragEnabled
item views toggled selection on click rather than on press. If the edit
trigger included SelectedClicked at the same time, then Ctrl-Clicking a
selected item would start editing the item, instead of toggling
selection.

Fix this by ignoring clicks with modifier when evaluating whether
editing should start.

Extend the mouseSelection test case by including a column for the
editTrigger, and cover the respective combinations.

Fixes: QTBUG-111131
Pick-to: 6.5 6.4 6.2
Change-Id: I9605f9b3d5a49e292551a34c3c4c7a5f9ecb2a89
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-02-16 15:28:18 +01:00
Marc Mutz
0cfaa6e896 QVarLengthArray: protect against aliasing in resize(n, t)
Amends a00a1d8806.

Pick-to: 6.5 6.4
Change-Id: I3fa6183466715555530d4042006049e286897343
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-16 14:38:29 +01:00
Marc Mutz
af233cb969 QVarLengthArray: use new assign() in op=(initializer_list)
DRY. Besides, assign() is optimized more.

Change-Id: I6c47ed99292d69f887dd187cdc7fef596e2e7d37
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-16 14:38:29 +01:00
Mårten Nordheim
d5e98cde1a Delete references to deleted examples
The bearer code hasn't been in Qt for some years.

Pick-to: 6.5 6.4 6.2
Change-Id: Id69ad1ce5035a0970f3507d4b6ba4a5549bf1d6c
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-16 14:16:34 +01:00
Thorbjørn Lindeijer
3e7226f107 Fix QStatusBar::removeWidget to hide the right widget
`QStatusBar::removeWidget` was hiding the wrong widget (the next one),
since the `removeAt` call changed the item that the `item` variable
is referencing.

This fixes a regression in Qt 6.3.0 (7166a82844).

Pick-to: 6.5 6.4
Change-Id: I9977b47e6208f8d451ff1037bcb9f4e8414cb431
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
2023-02-16 12:40:07 +01:00
Alexey Edelev
2a69f96e16 Fix syncqt.cpp build warnings
Remove the deprecated timeStamp argument from the parseHeader function.
Fix signed/unsigned comparison between file size and buffer size.
User the correct oder when initializing variables.

Pick-to: 6.5
Change-Id: I483cc175c9aaf42917053b6731833e1b4f5cad3a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-16 11:57:29 +01:00
Toni Saario
e3248a85d8 Add downstream test config
This will cause coin to test the newly integrated HEAD for the
given modules. In case a failure occurs in the check a message
in gerrit is sent to the commits which were integrated in the
HEAD.

Change-Id: I656316c7cceb126ccf570fd3db3f7fd2b22cc4fa
Reviewed-by: Simo Fält <simo.falt@qt.io>
2023-02-16 07:02:54 +00:00
Assam Boudjelthia
df47d7d1ff Android: use test QFileInfo fileName() instead of completeBaseName()
using fileName is more correct in this case.

Task-number: QTBUG-98974
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I7c547bfc1c2321d4817dc087d3e962dbc2a0b7fd
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-02-16 03:02:25 +02:00
Marc Mutz
e24df8bc72 QVarLengthArray: fix UBs in emplace()/insert() ([basic.life], broken class invariant)
There are two problems in emplace_impl() (the same code exists as
rvalue insert() since 5.10):

First, the old code updated size() at the end of the function.

However, if, after constructing the new end element, one of the
subsequent move-assignments fail (throws), then the class invariant
that size() be the number of alive elements in the container is
broken, with the immediate consequence that the QVLA dtor would not
destroy this element, but surely other unpleasantness (UB) that the
C++ lifetime rules decide to throw our way.

Similarly, in the trivially-relocatable case, the memmove() starts the
life-time of the new end object, so if the following placement new
fails, we're in the same situation.

The latter case is worse, though, since here we leave *b in some weird
zombie state: the memmove() effectively ended its lifetime in the
sense that one mustn't call the destructor on the source object after
trivial relocation, but C++ doesn't agree and QVLA's dtor will happily
call b->~T() as part of its cleanup.

The other ugly thing is that we're using placement new into an object
that C++ says is still alive. QString is trivially relocatable, but
not trivially copyable, so we can't end a QString's lifetime by
placement-new'ing a new QString instance into it without first having
ended the old object's lifetime.

The fix for both of these is, fortunately, the same: It's a rotate!™

By using emplace_back() + std::rotate(), we always place the new
object in a spot that didn't contain an alive object (in the C++
sense) before, we always update the size() right after doing so,
maintaining that invariant, and we then rotate() it into place, which
doesn't leave zombie objects around.

std::rotate() is such a fundamental algorithm that we should trust the
STL implementors to have optimized it well:
https://stackoverflow.com/questions/21160875/why-is-stdrotate-so-fast

We know we can do better only for trivially-relocatable, but
non-trivially-copyable types (ex: QString), so in order to not lose
the memmove() optimization, we now fall back to std::rotate on raw
memory for that case.

Amends dd58ddd5d9.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iacce4488ca649502861e0ed4e084c9fad38cab47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-02-15 23:19:43 +01:00
Tasuku Suzuki
7346de6491 Fix build with -no-feature-mdiarea
qmainwindowlayout.cpp:(.text+0x2976): undefined reference to
`_q_tb_tabBarShapeFrom(QTabWidget::TabShape, QTabWidget::TabPosition)'

_q_tb_tabBarShapeFrom is implemented in qmdiarea.cpp which is not
compiled when the feature mdiarea is disabled.

Pick-to: 6.5
Change-Id: Ib0c6447b9381b8ce01542fabf831a9db7f5e6675
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-15 21:02:56 +00:00
Rami Potinkara
6968eea88e Update Gradle to 8.0 and Android Gradle Plug-in (AGP) to 7.4.1
Gradle 8.0 and AGP 7.4.1 are the latest versions at Feb 2023.

Fixes: QTBUG-110875
Pick-to: 6.5
Change-Id: Ia13b9e7859a873d2aade8782c279266d0982da21
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-15 21:55:33 +02:00
Tor Arne Vestbø
19fc78e967 Remove QCocoaWindow::setContentBorderThickness
Its only client was QMainWindow, but that use was removed in
3b8b47db6a and replaced with a
call to setContentBorderEnabled.

This effectively reverts 0caaf9966a.

Pick-to: 6.5
Change-Id: Iaba4d5fd9256632b4a3b935e3fb30d7f5c39851e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-15 17:14:54 +01:00
Joerg Bornemann
2af494c930 Revert "CMake: Fix configure -no-rpath"
This reverts commit 854986836a.
This reverts commit 392d9a5419.

Turns out that enabling this option is now breaking the Qt build,
because tools that are called by the Qt build cannot run anymore due to
the lack of rpaths.

Before, QT_DISABLE_RPATH was simply turning off Qt's additional rpaths
but left CMake's rpath defaults intact.

To implement a working -no-rpath switch we must add Linux and macOS code
paths to _qt_internal_generate_tool_command_wrapper and set
LD_LIBRARY_PATH/DYLD_LIBRARY_PATH and friends.

Pick-to: 6.5
Fixes: QTBUG-110816
Change-Id: I021d5e6cd775cbe5b2411d6771ab2545cb04f799
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-02-15 16:24:03 +01:00
Andreas Eliasson
d6bdc5e9b6 Doc: Fix member name in code snippet
QstyleOption has no init() member, only initFrom().

Fixes: QTBUG-107770
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I00ff0b980fbfac813f113a7052bd3df32c7912b6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-15 15:21:53 +00:00
Marc Mutz
c889ffed9f QTextStream: make dtor non-virtual come Qt 7
There's no reason to treat QTextStream polymorphically: it has no
virtual functions other than the dtor. So don't.

Removing the vtable is BiC, so we can only do it come Qt 7, but let's
warn already, and "deprecate" the virtual'ness (indirectly) by marking
the class final as an opt-in.

The extra macro beside the class name throws off syncqt, so add a
#pragma qt_class.

[ChangeLog][Deprecation Notice] Inheriting QTextStream is
deprecated. QTextStream will no longer have a virtual destructor in
Qt 7. If your code inherits QTextStream, port to a design that doesn't
require a polymorphic QTextStream. You may define the macro
QT_NO_INHERITABLE_TEXT_STREAM to mark QTextStream as final to assist
you in checking for such code. This is the default if you're compiling
with QT_DISABLE_DEPRECATED_UP_TO set to Qt 6.9.

Fixes: QTBUG-111051
Change-Id: Ib32b8c0e49990d791cdc502bf40cb250f034404b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-15 16:21:53 +01:00
Alexey Edelev
545400addd Add the NO_CMAKE_PACKAGE_REGISTRY option forwarding to qt_find_package
Allow forwarding the NO_CMAKE_PACKAGE_REGISTRY option to the
find_package call from qt_find_package.

When we look for host tool packages the package dependencies are
recorded in the cmake package registry. This leads to the situation
when the lookup retry will use the package that is already found in
host path instead of looking the right one in target paths.
Adding the 'NO_CMAKE_PACKAGE_REGISTRY' to the qt_find_package calls
suppresses records in cmake package registry and starts a clean search
using target paths.

Task-number: QTBUG-111140
Pick-to: 6.5
Change-Id: I97ce1755b2f8e3413f1b0276fe26568b2f5efe33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-02-15 15:12:12 +01:00
Ivan Solovev
b34bea5e96 QFuture: fix continuation cleanup
Not clearing the continuationData could lead to use-after-free when
there is an attempt to cancel an already finished future, which belongs
to an already-destroyed promise.

This patch fixes it be explicitly resetting continuationData to nullptr
in the clearContinuation() method, which is called from the QPromise
destructor.

Task-number: QTBUG-103514
Pick-to: 6.5 6.4 6.2
Change-Id: I6418b3f5ad04f2fdc13a196ae208009eaa5de367
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-15 15:12:12 +01:00
David Edmundson
ec8e6ed200 Fix connections in QWidgetWindow
A recent update moved handleScreenChange out of being a private slot.
Porting to the new syntax fixes the warning and moves to a compile-time
check.

Pick-to: 6.5
Change-Id: Ibd85c6caf7dca051d669250a94a82fbddbd3435d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-15 15:12:12 +01:00
Tor Arne Vestbø
5d13e05651 macOS: Remove machinery for attaching NSToolBar to QWindow
It was only used by QMacToolBar in QtMacExtras, which no longer exists
in Qt 6. Attaching a toolbar can be done manually via the NSWindow of
the NSView retrieved from winId(). There are no public uses of the native
interface in GitHub outside of Qt.

Improvements we want to make to toolbars in QtWidgets and QtQuick in the
future, possibly backed by native toolbars, would be done behind the
scenes and would not need this API.

This effectively reverts e8fd6b9604bac334404dc52daa63b9e6d9cd71d8.

Pick-to: 6.5
Change-Id: I33b090fa19f9f3af029ae8c269efcf739a4b1b22
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-15 13:12:34 +01:00
Mårten Nordheim
2294e68559 Schannel: Enable users to let schannel pick a certificate
Schannel is by default able to pick out and transmit a certificate
it can find in the user's certificate store. The reason why we
disabled it by default is because some applications create and store
certificates in the store that is searched, so it may grab unexpected
certificates. However, in some environments this is not an issue, so
let these users re-enable this feature.

Fixes: QTBUG-89556
Change-Id: Iffa8550ee64c70bb0955041072ed5a49f600f6a1
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-02-15 13:08:31 +02:00
Timur Pocheptsov
402a526b2a QIosFileDialog - properly handle QUrl for assets-library
For QT_PLATFORM_UIKIT 'PicturesLocation' manually appended by "assets-library://".
When converted to QUrl, such a path becomes a valid url, having empty path
and scheme "assets-library". Later in QIOSFileDialog we convert this
path (options()->initialDirectory()) calling QUrl::toLocalPath, which
gives us an empty string and thus we erroneusly select document picker
dialog, not an image picker. So let's also check a scheme, not path
only.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-107844
Change-Id: If4dd453549b37933cba07b5d7af6e45f2504dd29
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-02-15 08:36:50 +01:00
Mikolaj Boc
3dc6fdc6d8 Fix the handling of dead keys and test the mechanism
An effort has been made to support more keyboard layouts that provide
dead keys (US international, Mac-specific dead keys).

The dead key is translated now at the event conversion phase, not
when it is actually used for modifying keys, which simplifies the logic.

Unittests have been created to check the translation mechanism.

Fixes: QTBUG-86272
Change-Id: I07f7d63f5a37f8469c693b034b400da99379f519
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-02-14 23:18:42 +01:00
Thiago Macieira
6d17697913 QFileSystemWatcher/Win: remove the pre-QFileInfo path normalization
It's completely unnecessary, since QFileInfo will query the file system
anyway and that has a much better view of what is normalized and what
isn't. More importantly, this fixes the mistake in failing to normalize
properly in removePaths(), which removed the ending slash of a root
directory such as "C:\\". That caused the path to become "C:", which
QFileInfo interprets as "current path on drive C:".

[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that prevented
removePaths() from removing the root of a drive on Windows.

Fixes: QTBUG-110986
Pick-to: 5.15 6.2 6.4 6.5
Change-Id: I9671dee8ceb64aa9b9cafffd17419b6d69670876
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-02-14 11:27:24 -08:00
Mikolaj Boc
0e520e5814 Skip the tst_QStringConverter::threadSafety test on WASM temporarily
The test needs investigation. Skip it for now so that we can enable
CI for WASM but leave a note to investigate it.

Task-number: QTBUG-109954
Change-Id: I9448312c2c16ec4f31279dcbe4e2213681cabe8a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-02-14 20:24:15 +01:00
Fabian Kosmale
9483fcd68a QObject: Handle pointers to incomplete types in auto-connections
The code for the QMetaMethod queuedConnectionTypes overload relied on
QMetaMethod::parameterMetaType and QMetaType::flags() to detect whether
we're dealing with a pointer (and then use the VoidStar metatype instead).
However, if the type was incomplete when the slot was defined, and the
type was not registered when connect was called, we would not find a
metatype for the argument.
However, in that case we might still be able to handle the method, by
checking whether the type name of the arguments ends with a "*".
This patch does that, fixing a regression from 5.15.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-108537
Change-Id: I54cc48a3343444480ab9094fe1ebaaa5aa75cee0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-02-14 19:24:22 +01:00