Commit Graph

61640 Commits

Author SHA1 Message Date
Fabian Kosmale
79ae79d05c QVariant::fromValue: Add rvalue optimization
When passing an rvalue-reference to QVariant, there is no reason to make
a copy if the type is moveable. Moreover, we know that the pointer which
we construct from the object passed to fromValue non-null. We make use
of both facts by parametrizing custom_construct on
non-nullness and availability of a move-ctor, and then dispatching to
the suitable template.
We need to keep the const T& overload, as otherwise code which
explicitly specializes fromValue and passes a const lvalue to it would
stop to compile.

[ChangeLog][QtCore][QVariant] Added fromValue() overload taking rvalues.

Change-Id: I44fb757d516ef364fe7967bc103b3f98278b4919
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-02 22:31:36 +02:00
David Redondo
581c4bcb62 Use platform drags for drags of docks and toolbars on wayland
On Wayland we can't know where windows are in relation to
each other so the whole mechanism was broken, toolbars
were unmovable once undocked and could be blindly redocked.
Dockwidgets had native toolbars to move them around but could
not be redocked.
This introduces an alternative code path that uses a platform
drag with a special mimetype that enables the platform to
issue a combined drag and window move using the relevant protocol.
Should the protocol not be available this doesn't make things
actively worse as it will be similar broken as before.

Fixes: QTBUG-87332
Change-Id: I3b8bdc0b1bc22569a64cb8bf7ca7d37d223936a6
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-02 19:53:34 +02:00
Amir Masoud Abdol
1eb4d17cb4 Generate and set a CFBundleIdentifier when none were provided on macOS
When using Ninja generator on macOS, we now do a bit of extra work to
make sure that bundle identifier is always set.

- In the case where no identifier was provided, the warning message has
  been updated indicating that the user can set either of the
  properties.
- If both `MACOSX_BUNDLE_GUI_IDENTIFIER` and
  `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` were set but have
  different values, a warning will be shown to encourage the user to set
  only one of them.
- In addition `_qt_internal_get_ios_bundle_identifier_prefix` is renamed
  to `_qt_internal_get_apple_bundle_identifier_prefix` to be more
  platform specific.

Note:
    In general, if Ninja is the generator, we set the value of
    `MACOSX_BUNDLE_GUI_IDENTIFIER` and don't touch the
    `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER`. If Xcode is the
    generator, we set the value of
    `XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER`, and in addition, to
    silence a Xcode warning, we set the `MACOSX_BUNDLE_GUI_IDENTIFIER`
    to `${PRODUCT_BUNDLE_IDENTIFIER}`, ie., let Xcode figures it out if
    needed.

[ChangeLog][CMake][macOS] When using Ninja generator, if neither
`XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER` nor
`MACOSX_BUNDLE_GUI_IDENTIFIER` is provided for a target, a bundle
identifier, i.e., `com.yourcompany.<teamid>.<target>` will be generated
and set as CFBundleIdentifier.

Pick-to: 6.5
Fixes: QTBUG-110889
Change-Id: Ie071085bbaf465afcb022b760423eb6b3c921f6d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 19:28:04 +02:00
Antti Määttä
d67abb9de1 CTF: Use static with operator
Also fix coding style in the operator.

Pick-to: 6.5
Change-Id: Ia8f85a7bb7aa2d6f55923c80f72b734fc8dbd693
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-06-02 17:53:29 +03:00
Antti Määttä
d214c56e43 CTF: Properly handle invalid session file
Pick-to: 6.5
Change-Id: Iabb2621364b5256ac89ec8cb7fafb0a9d346515d
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-06-02 17:53:27 +03:00
Antti Määttä
6639285ad7 CTF: Add qt_error_string to file open warning
Pick-to: 6.5
Change-Id: I85e1aff7689b6592ad2da1e91f480848eea317eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-02 17:53:26 +03:00
Antti Määttä
fdce0cbbc9 CTF: Fix coding style
Pick-to: 6.5
Change-Id: Idf3a593949c3ac58438d499e2487375d20bebab7
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-06-02 17:53:26 +03:00
Antti Määttä
dad95f4a43 CTF: Use QT_FSTAT to read file size
Pick-to: 6.5
Change-Id: Ic4b184e1ed51d8e30c2305a5ead619117a505518
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-06-02 17:53:25 +03:00
Antti Määttä
5e2b4c401d CTF: Use access to check if location is writable
Pick-to: 6.5
Change-Id: Ic6afcf74432f176374d47e828b480e4d2499c670
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
2023-06-02 17:53:24 +03:00
Alexey Edelev
0006a564c8 Collect module_sync_headers targets from the target deps
Use the internal target property to store the module_sync_header target
name. The property then is used to collect module_sync_header targets
and build the dependency tree between them. This mechanism only works
for Qt dependencies that are added using qt_internal_extend_target call
that works well at least for out CI builds. The mechanism allows to
omit the race in sync_header runs that might lead to unexpected results
since internal targets like automoc or headersclean_check only depend
directly on module_sync_header target that belong to the module.

Change-Id: I564f3ea0f3c1703e70c4c300fd1307c3214d39d8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 15:12:09 +02:00
Alexey Edelev
251e3b44fa Add the description for the QT_ALLOW_DOWNLOAD option
Introduce QT_ALLOW_DOWNLOAD option that should be used the downloading
of the resources from web in Qt builds. Calls like file(DOWNLOAD or
FetchContent_* should be wrapped with this option, so users that build
Qt could control this and disable functionality that requires
resources from web.

Change-Id: Ie0494265c0c5fe93a7ef0d1cbcee1af919d57fa5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 15:12:08 +02:00
Alexey Edelev
f323fa818c Add Gui_sync_headers as the explicit dependency for Test module
The Test module uses Gui header files implictily without explicit Gui
linking. We need the dependency chain at least between the
module_sync_headers targets to make sure that all header files required
for successful module build are present "in time".

Change-Id: I40fd81cceeb0e0e8271db4ba33fd914eb484d001
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 15:12:07 +02:00
Tor Arne Vestbø
1d3ae5f0e9 cmake: Add known translations to CFBundleLocalizations in Info.plist
For untranslated applications we set CFBundleAllowMixedLocalizations to
true, so that the application's locale will not be limited to the
development region "en".

But once we have a set of known translations, added by qt_add_translations,
we can turn these into CFBundleLocalizations, which lets macOS/iOS
choose a best match between what the app supports and what the user
preferences are.

[ChangeLog][Internationalization] Translations added via
qt_add_translations are now reflected as CFBundleLocalizations
entries in the application's Info.plist file on Apple platforms.
to disable this behavior, set QT_NO_SET_PLIST_LOCALIZATIONS.

Change-Id: I3f7ae1a1884eaf269038fa8ee49dbe6cac855706
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 15:12:06 +02:00
Tor Arne Vestbø
21000ede37 cmake: Always copy Info.plist to build directory manually
Allows us to modify this file in place, before CMake copies it into
the application bundle during its generator step.

Change-Id: I73325c66b5b8919f57dbaa1cc76a7edbc145609c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-02 15:12:05 +02:00
Tor Arne Vestbø
eb09d98065 Link to Application Permissions docs from Qt Core overview
Pick-to: 6.5
Change-Id: Ida5ff78967b5e9165f83131ee67ac4f12bd1936b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-02 15:12:05 +02:00
Antti Määttä
c26c72a370 CTF: Do not check nullptr before delete
Pick-to: 6.5
Change-Id: I3935d7a0898f20804e8dc6f916cb9a5954230c0f
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-06-02 13:10:29 +03:00
Antti Määttä
fab8bbd79f CTF: Use qEnvironmentVariable
Pick-to: 6.5
Change-Id: I492da6862491cc476355a318652bd9901fffcd76
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
2023-06-02 13:10:28 +03:00
Antti Määttä
3c7bf8e189 CTF: Remove extraneaus include
Pick-to: 6.5
Change-Id: I6ebe1d6a492e8606762a78bae422fa86440d18be
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-06-02 13:10:27 +03:00
Marc Mutz
5862819918 QVariant: fix shadowing of QVariant::Type/List
QDoc mis-interprets the Type and List template arguments as referring
to the QVariant::Type enum and its List enumerator, resp.

To fix, rename the template parameters from Type to T and from List
to U.

Task-number: QTBUG-112187
Change-Id: Ib4093acdd84cc86a0f85dcc5046b6e7da7885a44
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-02 09:13:09 +02:00
Fabian Kosmale
f564e905c1 QVariant: Support emplace
[ChangeLog][QtCore][QVariant] Implemented in-place construction for
QVariant. The constructor taking std::in_place_type<Type> constructs
an object of type Type directly inside QVariant's storage, without any
further copy or move operations. QVariant::emplace() does the same
when replacing the content of an existing QVariant and tries to reuse
previously-allocated memory.

Fixes: QTBUG-112187
Change-Id: I16614ad701fa3bb583976ed2001bb312f119a51f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-02 09:13:08 +02:00
Dennis Oberst
18a2c62c07 QByteArray: add STL-style assign()
Implemented assign() methods for QByteArray to align with the
criteria of std::basic_string, addressing the previously missing
functionality. This is a subset of the overloads provided by the
standard.

Reference:
https://en.cppreference.com/w/cpp/string/basic_string/assign

[ChangeLog][QtCore][QByteArray] Added assign().

Fixes: QTBUG-106199
Change-Id: I899b14d74e8f774face8690303efb8610ead95b5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-02 06:43:31 +02:00
Ievgenii Meshcheriakov
1ee7aa741a qdbusxml2cpp: Fail if -c option is used with multiple interfaces
Exit with an error code when -c option is specified by the command
is not processing a single interface. Mention this in the option
description.

Fixes: QTBUG-36405
Change-Id: I7ea217c780d37332278c634f030d20040b7459e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-02 02:11:37 +02:00
Amir Masoud Abdol
6f6bd2c4dc Set QT_FORCE_FEATURE_neon to ON for x86_64h arch as well, on macOS
We were not accounting for `x86_64h` arch, and as a result
cross-compiling with `-DCMAKE_OSX_ARCHITECTURES="x86_64h;arm64`
was failing.

Pick-to: 6.5
Fixes: QTBUG-113694
Change-Id: Ieb50a7a62aabcca76b09f9c853b3faf915eab1a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-01 22:27:06 +02:00
Marc Mutz
6f529c38ce QVariant::fromStdVariant(): protect against accidental fromValue() ADL pick-ups
The use of unqualified fromValue(arg) in the visitor implementation
invites non-QVariant fromValue(T) overloads to be found using ADL,
which just happen to compile because their return value implicitly
converts to QVariant (like most stuff does).

To rule this out, use FQN QVariant::fromValue() to switch off ADL.

[ChangeLog][QtCore][QVariant] The fromStdVariant() function used an
unqualifed fromValue() call to convert each alternative type in the
std::variant. It now uses qualified QVariant::fromValue() to avoid
picking up unrelated fromValue() overloads whose return value just
happens to implicitly convert to QVariant.

Amends 5927acaf65.

Pick-to: 6.5 6.2
Change-Id: Ica21b08c919459d0a740af03f451e4ffe224b641
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-01 18:39:26 +00:00
Dennis Oberst
60f739f51f tst_ContainerApiSymmetry: make assign_impl() more robust
Refactor the 'CHECK' macro to eliminate the capacity check and
explicitly verify that no reallocation occurred. The previous
implementation had to pass constants to suppress the issue arising
from differing growth rates between implementations.

Additionally, improve the 'std::stringstream' versions of the test
by incorporating the correct values. In the previous implementation,
the usage of:

    auto tData = V(9);
    ~~~
    std::stringstream ss("9 9 ");

had several issues. Firstly, it used the wrong test data since the
container's value_type of '(char) 9' resulted in a tab character '\t',
which was not accurately reflected in the stringstream assignment.
Secondly, this value caused problems in how stringstreams interprets it.

To address these issues, let's make the following improvements:

1. Use a default test value of 65 instead of (char) 9. This value, which
represents the character 'A', is less likely to cause errors and is more
intuitive.
2. Use the tData variable for the assignments in the stringstream. This
ensures that the correct data from the container is used.
3. Change the test value between the assign() calls to verify that the
container's contents are successfully overwritten.

These changes ensure, that the test cases are more accurate and
reliable.

Amends: 3b0536bbe8.

Change-Id: I9441c4818106bf93e93a1a5d2d2d54c89d80e7b0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-01 18:39:25 +00:00
Amir Masoud Abdol
63a0f4dc3b Set CMAKE_<LANG>_FLAGS in PARENT_SCOPE as well
Previously, we were not setting the CMAKE_<LANG>_FLAGS, instead we were
only processing the CMAKE_<LANG>_FLAGS_<CONFIG>. This patch amends that
so we also update the default flags list as well.

Pick-to: 6.5
Change-Id: I7ceb87850a806fe8ad4eac6f8147b312eba01bc6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-01 19:10:12 +02:00
Dennis Oberst
c06bdc316f tst_QByteArray: add Qt::StringLiterals to the namespace scope
... and remove all previous function-level occurrences.

Pick-to: 6.5
Change-Id: I90df40922e3aed15efc04e885d9f54c577a948b6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-01 19:10:11 +02:00
Mårten Nordheim
9a4da4569a QHash: reduce duplication between two lookups
findNode and findBucket are virtually the same

Change-Id: I9ba8534d66f0feaa2dea7c2b9beacf8d5faddb52
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-01 19:10:11 +02:00
Mårten Nordheim
288326eaf8 QWaitCondition/win: Enable actually waiting longer than u32::max
This is done, in part, by swapping the dependency between the wait() overloads.
Furthermore, since QDeadlineTimer is 64-bit and the Win32 API is 32-bit
we have to wait more than once to actually wait until the deadline
is reached.

The unsigned int overload has no documented concept of waiting
'forever'. Though, internally we turn u32::max into 'forever'.

Change-Id: I47d719c0c29bcd6fa0c0043d168a456f2c05774e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-01 17:10:10 +00:00
Orkun Tokdemir
443068dbba Add SKIP_LINTING for generated source files
Since the `SKIP_LINTING` source property was added to upstream cmake
here https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8467,
that source property should also be set for source files generated by
qt's cmake public api

Change-Id: Ic9d6c119abbc7c51b146176970c1d0bafb097abf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-01 19:10:09 +02:00
Tor Arne Vestbø
2f273f5dfd cmake: Copy template Info.plist for macOS manually, like we do for iOS
Unifies the approach between iOS and macOS. By copying the Info.plist
to the build directory, we also open up the possibility to modify it,
which we can't do when CMake does the copy during its generator step.

Change-Id: I59f9f69ac368166bb26d8a5c57bf4ea3f503d51b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-01 14:07:18 +02:00
Yuhang Zhao
d6ed400037 Platform theme: fill QPalette::AccentColor with OS value
The AccentColor role, added in Qt 6.6, is currently populated with a
default value.

This patch implements populating the brush with OS values for Windows
and macOS.

Change-Id: Ic243c3b8664d50db3a2096a034de6ba672d9e2d2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-01 10:02:29 +00:00
Amir Masoud Abdol
a33dd60e21 Add TRY_RUN option to qt_internal_add_tool
To make sure that Qt essential tools can be executed after a successful
build, we can now pass the TRY_RUN argument to `qt_internal_add_tool`.
On Windows, this option creates a custom command and a custom target
(${target}_try_run) for the tool, and tries to run the tool from a batch
script. If the program fails to run because of missing libraries, an
error will be shown, and build halts; otherwise,
`${target_name}_try_run_passed` file will be generated and the build
continues.

Pick-to: 6.5
Task-number: QTBUG-113273
Task-number: QTBUG-112747
Change-Id: I760588714bcf9db69505abe3df717733352a8284
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-01 12:02:28 +02:00
Antti Määttä
344bf51cfd CTF: Cleanup writing uuid to Ctf packet
Use QUuid::toBytes instead of manual conversion.

Pick-to: 6.5
Change-Id: Iba2c32eb258e21cd207b5bc19af0409b6b9e26b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-01 13:02:27 +03:00
Laszlo Agocs
8c0b657c9a Refine the rhi-based flush logic
Amends 244daf4cfc

Fixes: QTBUG-113557
Fixes: QTBUG-113652
Task-number: QTBUG-108277
Pick-to: 6.5
Change-Id: I9e369b0e1261ea37eb2dedd80083f82f5df97b30
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 12:02:26 +02:00
Laszlo Agocs
da4de6b6e3 Polish forward decl in vulkan and opengl examples
Pick-to: 6.5
Change-Id: I9f05aedc7649ab7e248b7332c04a6664e85182d8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-01 09:09:49 +02:00
Vladimir Belyavsky
3c6c3eccd1 QStringBuilder: remove unneeded specializations
Remove legacy QStringBuilder's specializations:
template <> class QStringBuilder<QString, QString>
template <> class QStringBuilder<QByteArray, QByteArray>

Change-Id: I49238356620712009b32286ebc42e52fe43ede63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-01 06:44:15 +00:00
Thiago Macieira
77e89dcce4 Remove the mandatory x86-64 features from its feature list
The x86-64 architecture mandates support for MMX and SSE2, so we don't
need to tell that the compiler generates them. They're implied.

This could serve to determine that the user specified no -march= or -m
flags that affect the architecture on the CMAKE_CXX_FLAGS, but fails if
the compiler does that on its own for this particular target. For
example, both for Android and macOS, the minimum feature set is SSSE3
for 32-bit and SSE4.1 for 64-bit.

Change-Id: I76216ced393445a4ae2dfffd172a94b17e8a9a37
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-05-31 14:55:37 -07:00
Thiago Macieira
2e1318f691 QSemaphore: add a note to update to noexcept in Qt 7
The QSemaphore acquire & release functions, plus the constructor and
destructor, can be made noexcept on platforms that use futexes
(currently, Linux and Windows; likely macOS by the time we make 7.0). I
didn't make the change right now because the acquire and release
functions have narrow contracts on the int n values. I didn't make that
change now because it make a mess of the code, for little gain as this
class isn't used that often.

Plus, we may want to investigate whether we want to keep the multi-token
semaphore functionality around (something neither POSIX sem_t nor
std::counting_semaphore have), or split that off into a separate class
like QBasicMutex / QMutex / QRecursiveMutex was done.

Change-Id: Ieab617d69f3b4b54ab30fffd175b27813728f2ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-05-31 14:54:57 -07:00
Thiago Macieira
52fa66d087 QNativeSocketEngine: fix warning about uninitialized variables
In function ‘int qt_safe_connect(int, const sockaddr*, socklen_t)’,
    inlined from ‘bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress&, quint16)
qnet_unix_p.h:111:38: error: ‘sockAddrSize’ may be used uninitialized [-Werror=maybe-uninitialized]
qnativesocketengine_unix.cpp:396:18: note: ‘sockAddrSize’ was declared here
qnativesocketengine_unix.cpp:476:14: error: ‘aa.qt_sockaddr::a.sockaddr::sa_family’ may be used uninitialized [-Werror=maybe-uninitialized]
qnativesocketengine_unix.cpp:471:17: note: ‘aa’ declared here

Introduced by commit 45a03fc506.

Change-Id: I5f7f427ded124479baa6fffd175fbf006c098854
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-31 14:54:56 -07:00
Tor Arne Vestbø
ea1af6b7ed Only consider QScreen virtual siblings that have been added
If a platform builds up a list of QPlatformScreens, and then adds
them incrementally, while at the same time implementing virtualSiblings
in QPlatformScreen to return the full list of screens, the virtual
sibling QScreens will contain nullptrs for each non-added screen.

It could be argued that this is the fault of the platform plugin,
since it's reporting a virtual sibling that it hasn't added yet,
but we can easily work around it in QScreen as well.

Fixes: QTBUG-113977
Pick-to: 6.5
Change-Id: I4b9472646a5cc10b6fd35c606e3ae15941da1587
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-05-31 16:37:26 +02:00
Amir Masoud Abdol
672a1d022c Implement qt_internal_get_file_path_mode for changing the file path mode
In cases where we allow symlink, we need to use ABSOLUTE path, and don't
resolve the symlink. This function returns ABSOLUTE only if we are on
Apple platform, and have QT_ALLOW_SYMLINK_IN_PATHS enabled. While this
is mainly to resolve the issue report by Homebrew, it might be useful if
a user really want to build with symlink.

Pick-to: 6.5
Task-number: QTBUG-113463
Change-Id: Ided141ed8de66cc1d3717ec2719eb703fa7fc589
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-31 16:37:25 +02:00
Fabian Kosmale
7041d9dd75 QVariant: visually separate PrivateShared and Private nested classes
Add an empty line between the two.

Pick-to: 6.5
Change-Id: If1c50ebb0b825acc53364cce2e083332367e757c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-31 16:37:24 +02:00
Fabian Kosmale
1e0e16b5f3 QVariant: Extract Method PrivateShared::computeOffset()
Will be re-used in the upcoming emplace() function.

No attempt is made to re-write the expression to be more
readable. That's left for another commit.

Task-number: QTBUG-112187
Change-Id: Id391b78f1477c5225beda8a32c4f6c1393dd51bb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-31 16:37:23 +02:00
Amir Masoud Abdol
585dd9d8d5 Add NOMINMAX to PlatformCommonInternal
By not explicitly disabling min/max macros of `windows.h`, we may see
some unintended substitutions. This is especially important now that we
are moving toward enabling Unity Build, and some of the constructs for
manually dealing with this issue, eg., `#ifdef max`, `#undef max`, might
not make it to the pool, and as a result we get build failure.

Pick-to: 6.5
Change-Id: Ie3c31aebe00300126a2ac3a6044876ab92d5d99c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-31 16:37:22 +02:00
Fabian Kosmale
4e860a66d6 QVariant: Extract Method PrivateShared::computeAllocationSize()
Will be re-used in the upcoming emplace() function.

Task-number: QTBUG-112187
Change-Id: Ie2b4570b7ba6c9d0ce938203933758a0d0d59f5a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-31 16:37:21 +02:00
Marc Mutz
3a7ddd7274 QVariant: simplify condition guarding customClear() calls
Due to short-cut evaluation of the built-in op||, we can do the
following transformation:

    - (X && Y) || !X
    + !X || Y

Pick-to: 6.5
Change-Id: Ia5ae1dd60bdb663aa4648c09372be1598591110d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-05-31 14:37:20 +00:00
Marc Mutz
496bd9e975 QVariant: remove outdated docs about reimplementing clear()
QVariant::clear() hasn't been virtual since at least Qt 4...

Pick-to: 6.5 6.2 5.15
Change-Id: If6b5669d91f8d9c7ed2d152d18852a8d6f8e491a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-31 16:37:19 +02:00
Dennis Oberst
e07710007b QArrayDataPointer: fix optional projection in assign()
When a custom projection is used in the assign() function, there is a
problem with the optimization step at:

    dst = std::uninitialized_copy(first, last, dst);

The issue arises because this copy doesn't respect the custom
projection. To address this problem, we need to ensure that the
optimization is only applied when using the identity projection.

Amends: 7ca633d9a8.

Change-Id: I912525c716333ee2c22c419f2bf70201086c5635
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-31 14:37:19 +00:00
Edward Welbourne
9da9ca0ac7 Remove unused IS_RAW_DATA() macros from q{string,bytearray}.cpp
They were made redundant at Qt 6, so now they're just defined and undefined.
Don't even do that any more.

Change-Id: Ic4a4a4c39c50c9af417ea6c52be5f69a2d4856c6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-31 16:37:18 +02:00