There's no need of duplicating code all over the place; QString can
reuse the implementation of the indexOf/contains/count/lastIndexOf
family of functions already existing for QStringView.
For simplicity, the warning messages (that our autotests actually check)
have been made more generic, rather than introducing some other
parameter (as in, "which class is using this functionality so to emit
a more precise warning"), which would have just complicated things as
the implementation of these functions is exported and used by inline
QStringView member functions.
Change-Id: I85cd94a31c82b00d61341b3058b954749a2d6c6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
An empty QString(View) is allowed to have nullptr as its data pointer
(of course, only if its size is 0). This wasn't properly
checked in QRegularExpression, which passed such nullptr to
PCRE, and that resulted in PCRE raising an error (PCRE_ERROR_NULL).
Detect this case and pass a dummy pointer to keep PCRE happy.
Fixing and testing this in turn exposed a problem with QStringView
support in QRegularExpression when used over a null QString: the
code is supposed to use the QStringView(QString) constructor and NOT
qToStringViewIgnoringNull. That's because QRE distinguishes null
and empty subjects; when using qToStringViewIgnoringNull over
a null QString, one gets a non-null QStringView (!). Again, this in
turn exposed a problem with a QRegularExpression autotest that assumed
that a null match could only mean "no match" (instead, it can happen at
position 0 of a null QString(View)).
Change-Id: Ifb3cf14dec42ce76fcdbcb07ea1d80784d52ef65
Pick-to: 6.1 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Size 0 is a "valid" answer for QIODevice implementations so we need to
make sure that we only enter the "try to workaround broken files" if we
know there is a size, otherwise the first read of length 4 that libpng
does breaks everything.
Change-Id: I1e396abd206ff90edae4372726f1d82d5d41ccf3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When trying to fix 0-length matches at the end of a QString,
be83ff65c4 actually introduced a
regression due to how lastIndexOf interprets its `from` parameter.
The "established" (=legacy) interpretation of a negative `from` is that
it is supposed to indicate that we want the last match at offset `from +
size()`. With the default from of -1, that means we want a match
starting at most at position `size() - 1` inclusive, i.e. *at* the last
position in the string. The aforementioned commit changed that, by
allowing a match at position `size()` instead, and this behavioral
change broke code.
The problem the commit tried to fix was that empty matches *are* allowed
to happen at position size(): the last match of regexp // inside the
string "test" is indeed at position 4 (the regexp matches 5 times).
Changing the meaning of negative from to include that last position (in
general: to include position `from+size()+1` as the last valid matching
position, in case of a negative `from`) has unfortunately broken client
code. Therefore, we need to revert it. This patch does that, adapting
the tests as necessary (drive-by: a broken #undef is removed).
Reverting the patch however is not sufficient. What we are facing here
is an historical API mistake that forces the default `from` (-1) to
*skip* the truly last possible match; the mistake is that thre is simply
no way to pass a negative `from` and obtain that match. This means that
the revert will now cause code like this:
str.lastIndexOf(QRE("")); // `from` defaulted to -1
NOT to return str.size(), which is counter-intuitive and wrong. Other
APIs expose this inconsistency: for instance, using
QRegularExpressionIterator would actually yield a last match at position
str.size(). Similarly, using QString::count would return `str.size()+1`.
Note that, in general, it's still possible for clients to call
str.lastIndexOf(~~~, str.size())
to get the "truly last" match.
This patch also tries to fix this case ("have our cake and eat it").
First and foremost, a couple of bugs in QByteArray and QString code are
fixed (when dealing with 0-length needles).
Second, a lastIndexOf overload is added. One overload is the "legacy"
one, that will honor the pre-existing semantics of negative `from`. The
new overload does NOT take a `from` parameter at all, and will actually
match from the truly end (by simply calling `lastIndexOf(~~~, size())`
internally).
These overloads are offered for all the existing lastIndexOf()
overloads, not only the ones taking QRE.
This means that code simply using `lastIndexOf` without any `from`
parameter get the "correct" behavior for 0-length matches, and code that
specifies one gets the legacy behavior. Matches of length > 0 are not
affected anyways, as they can't match at position size().
[ChangeLog][Important Behavior Changes] A regression in the behavior of
the lastIndexOf() function on text-related containers and views
(QString, QStringView, QByteArray, QByteArrayView, QLatin1String) has
been fixed, and the behavior made consistent and more in line with
user expectations. When lastIndexOf() is invoked with a negative `from`
position, the last match has now to start at the last character in the
container/view (before, it was at the position *past* the last
character). This makes a difference when using lastIndexOf() with a
needle that has 0 length (for instance an empty string, a regular
expression that can match 0 characters, and so on); any other case is
unaffected. To retrieve the "truly last" match, one can pass a
positive `from` offset to lastIndexOf() (basically, pass `size()` as the
`from` parameter). To make calls such as `text.lastIndexOf(~~~);`, that
do not pass any `from` parameter, behave properly, a new lastIndexOf()
overload has been added to all the text containers/views. This overload
does not take a `from` parameter at all, and will search starting from
one character past the end of the text, therefore returning a correct
result when used with needles that may yield 0-length matches. Client
code may need to be recompiled in order to use this new overload.
Conversely, client code that needs to skip the "truly last" match now
needs to pass -1 as the `from` parameter instead of relying on the
default.
Change-Id: I5e92bdcf1a57c2c3cca97b6adccf0883d00a92e5
Fixes: QTBUG-94215
Pick-to: 6.2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is a no-op. But take the opportunity to make a drive-by update on
the loop, which improves it.
Change-Id: I4a40ccbd3321467a8429fffd169b08590d28c928
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
We already do it for inputs but weren't doing it for outputs.
Change-Id: I4a40ccbd3321467a8429fffd169afeb5730ad75e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Wrap the overloaded methods in qOverload(), to make the examples
compile.
Also remove the extra whitespaces when declaring nested templates.
Pick-to: 6.1 6.2
Change-Id: If438caa6d705d9036dae45278fb26e080918da89
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The code isn't easily linearized to work directly with
QStringTokenizer, which is a forward-only range, but we can at least
remove the (non-error) memory allocations by supplying a
suitably-sized QVLA to tokenize into instead of the default QList.
Change-Id: I1aa11a5fbbe66ede4ec2e5b2090044a39052a241
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
By dropping the clause pointlessly guarding the ranged for loop against
an empty collection, we can reduce the ping-pong being played with the
*ok boolean: Just set it to false at the beginning, and only set it to
true when we reach the success-return.
Pick-to: 6.2
Change-Id: I87365146086aba427b7414e83f077096824ff56f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The variable `i` is initially `suffixPos + 1` and is then incremented
further. It therefore can never be equal to `suffixPos` (ints don't
overflow, that would be UB, and suffixPos doesn't change its value),
so don't check for that.
Change-Id: I3870ddf6ee550cad6c24fececf2a0b662a33d750
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The wasm support files need to be both copied and installed in a
top-level prefix build, to ensure that leaf repos can find them in the
build dir when they are configured.
Pick-to: 6.2
Fixes: QTBUG-95806
Change-Id: I8c09f04fec51cf850299d535bdf3f26542ec4aac
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Like we do for OpenGL. Conveniently enough the QRhi feature flags are
readily available.
This should prevent errors such as:
MTLValidateFeatureSupport:3901: failed assertion `Base Vertex Instance
Drawing is not supported on this device'
on the iOS Simulator. It is not clear since which version or SDK this
became a fatal problem, but the base vertex/instance support is indeed
an optional feature according to the Metal Feature set tables, so not
calling the drawIndexedPrimitives variant taking baseVertex and
baseInstance when the reported iOS GPU family is too low is the right
thing to do regardless.
Pick-to: 6.2 6.1
Fixes: QTBUG-95795
Change-Id: I47c54a77a66a0410b86b8d4e5a1863dc730490f4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This will show packages that were found (or not) with
find_package(QUIET) in summary just before the configure summary.
It's useful for CI logs to determine whether some Qt packages was not
found when cross-compiling.
Pick-to: 6.2
Change-Id: Ic7d5062cf061f7c60b5c74374f957065dd8029f5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
All the tests were using the C locale, so were equivalent to tests of
QTime::toString(). Add a locale column and some test-cases in
preparation for a change to am/pm indicators.
Task-number: QTBUG-95790
Change-Id: I3ad917b7a6f3d3bfe31d6a5a5da596025f173e81
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some internal links to `QSet` methods were missing from the
documentation. In particular, all methods that were written with one
attribute.
It seems that QDoc might automatically recognize method/function
links only if they have zero parameters, such that the identifier is
followed by `()` directly.
To avoid this problem while keeping the current parameter-containing
form of the text; each function of the form `functioname(\a
parametername)` was changed to `\l {functionname()} {functioname(\a
parametername)}.
Furthermore, one of those text instances was modified to use `\a` for
the parameter name, instead of the previously used `\e`, to enhance
consistency.
An instance of `operator<<()` was not recognized as a link.
To resolve this it was marked with the `\l` command.
Fixes: QTBUG-95389
Pick-to: 6.2 6.1
Change-Id: I16b2a7a2fbaf4785c2c6bfa5017a3db46d9db2f4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
ImAbsolutePosition was added in f8dbed1226,
based on requirements on Android, but without an implementation for
QLineEdit. It would seem sensible to fall back to the cursor position
in this case, as QLineEdit doesn't support multiple blocks.
Pick-to: 6.2
Change-Id: Iff1255270ceef069f03ce457df633d7b675f1a28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 359616066e, which incorrectly
changed
- tabList[i].minRect = QRect(0, miny, sz.width(), sz.height());
+ tab->data = QRect(0, miny, sz.width(), sz.height());
in the code laying out verticals tabs (correct done for the horizontal
case).
Since QDockWidget uses the user data for tabs to maintain the mapping
between tabs and dock widget, this broke the layout logic.
Fixes: QTBUG-95841
Pick-to: 6.2 6.1
Change-Id: Ie785e1205b426bbc4954b965f619f4c603490f76
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Let find_package(Qt6 COMPONENTS LinguistTools) for a cross-compiled
Qt fall back to search LinguistTools in the host Qt.
Use the same trick as in QtModuleDependencies.cmake: Prepend both
CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH with the QT_HOST_PATH
(respective ${QT_HOST_PATH}/lib/cmake).
Furthermore adding ${QT_HOST_PATH}/lib/cmake to PATHS argument
makes sure that find_package will work even with NO_DEFAULT_PATH.
Make sure not to match ShaderTools and Tools packages.
ShaderTools is the cross-compiled package, the host package name is
ShaderToolsTools.
Tools is the cross-compiled module from qttools.
Allow an opt out via a QT_NO_FIND_HOST_TOOLS_PATH_MANIPULATION
variable in case that we accidentally match more packages ending in
Tools that are actually cross-compiled packages.
Pick-to: 6.1 6.2
Fixes: QTBUG-95602
Change-Id: Ib0a787716fa529e36f22356da069e705d9eed5fa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The QtConcurrent::RunFunctionTask class keeps a variable to store the
result of QtConcurrent::run when it becomes available, so that it can be
reported afterwards. This requires the result type to be
default-constructible. However there's no need in storing the result, it
can be reported immediately after it becomes available.
Pick-to: 6.1 6.2
Fixes: QTBUG-95214
Change-Id: I95f3dbff0ab41eaa81b104a8834b37d10a0d193a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Add see also link from operator== and operator!=
to matches() to avoid possible confusion.
Fixes: QTBUG-95820
Pick-to: 6.2 5.15
Change-Id: Ica8112da436b57da0d410f8e1f6b71fc6bf0791f
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
This avoids rebuilding the same pattern. Caught by clazy.
Change-Id: Ibd0f2063617df1a9e975f58e34df556d1983afff
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We set the buffer length to 0 for blobs, as we need to do it for each
row, in bindBlobs() (apparently a workaround for MySQL 4.1.8 API). That
function was deleting the buffer and reallocating.
Change-Id: I4a40ccbd3321467a8429fffd169b06422612ca13
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The MariaDB-connector-c version 3.2 and MariaDB server version 10.6
cooperate to avoid re-transferring the query metadata, so the fact that
we were modifying it was causing it to improperly decode the DATETIME
data types into string, as we had asked. We ended up with a 7-byte
string that was actually the date binary-encoded.
References:
- https://jira.mariadb.org/browse/MDEV-26271
- https://github.com/MythTV/mythtv/issues/373
- https://bugs.kde.org/show_bug.cgi?id=440296
Pick-to: 5.12 5.15 6.2
Fixes: QTBUG-95639
Change-Id: I4a40ccbd3321467a8429fffd169afdbb26cf29f6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
With MinGW-W64 9.0.0, _WIN32_WINNT is set to Windows 10 by default, so
_FILE_ID_INFO is already defined.
Fixes: QTBUG-94031
Pick-to: 6.2
Change-Id: I0b29a4a1932425e1c4079aba6768fe94460c60af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
"-framework Foo" arguments must be placed in the inherited_linker_flags
variables instead of dependency_libs.
Pick-to: 5.15
Fixes: QTBUG-2390
Change-Id: Idec4115533ed1f86f44db64931fa64cadeeb4572
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The CFBundleLongVersionString Info.plist entry has been deprecated and
removed from Apple documentation for a long time now.
Remove it.
Pick-to: 6.2
Task-number: QTBUG-95838
Change-Id: I4e4f74e00d678fd67875976c8884a80cdbb8cec4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Without a bundle version and short version string string, the
iOS simulator will refuse to launch the app.
Set a placeholder "0.0.1" version for both fields if they were not set
by the project. Allow opt-out via a QT_NO_SET_XCODE_BUNDLE_VERSION
variable.
Pick-to: 6.2
Fixes: QTBUG-95836
Task-number: QTBUG-95838
Change-Id: I3e959766c7fa13f23ad12882f8bd14cd45e7096c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The value of QT_UIKIT_SDK is used in configure tests via
qt_config_compile_test -> qt_get_platform_try_compile_vars.
Up till now QT_UIKIT_SDK was only available in qtbase only.
Save the value in BuildInternals to ensure it's used for other repos
as well.
Change-Id: I46f372267782f1c8e7d48c237fe0264ac72d33bb
Pick-to: 6.2
Task-number: QTBUG-95838
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Automatically set the CMAKE_OSX_SYSROOT and CMAKE_OSX_ARCHITECTURES
values with the ones Qt was configured with, when configuring a user
project with the Xcode generator and a single arch / sdk Qt build.
This ensures that calling xcodebuild from the command line chooses the
correct architecture and SDK when building the project.
Allow to opt out of this behavior by passing
QT_NO_SET_OSX_ARCHITECTURES and QT_NO_SET_OSX_SYSROOT.
Amends 55a15a1c1b
Amends a6a3b82ffb
Pick-to: 6.2
Task-number: QTBUG-95838
Change-Id: Ifab16e9eee3100a9b80a2a14b3ea29ba8d9aa6fc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The configure summary now suggests "ninja install" for Ninja
Multi-Config builds, because "cmake --install ." does not install all
configurations. See CMake upstream issue #21475.
Pick-to: 6.2
Change-Id: Ie3129a906945db9d09c6772ce66ec7239797b8fc
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Doing the deletion at the end of the block only works if the test
passes. Drive-by: remove spurious braces from single-line bodies of
single-line controls. The QTest macros are done properly.
Pick-to: 6.2 6.1 5.15
Change-Id: I83002547dba49ab9792f4db44d73151b1c036900
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
When the test failed, it never released the blocking slot, so the
tested thread remained blocked indefinitely. Blacklisting doesn't
rescue that: the test run gets killed by Coin's watchdog.
Use a QScopeGuard() to release the clocked slot on failure.
replacing the release that was happening only on success.
As drive-by clean-up, smarten up the code a little and remove an
unused enum.
Pick-to: 6.2 6.1 5.15
Change-Id: Ie035dafe6e4b1d82aea5de38ceb31c0f7fcf81d7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Test both Abort and Continue cases. Test more with successive marked
as expected failure. Test cases with a QSKIP after the marked check.
Unify data functions where practical.
Change-Id: I2eade5e4dd0907d23e37137ce3d93cd5ca79f802
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Remove SRCDIR defines from tests that don't use them. There is a
standard define called QT_TESTCASE_SOURCEDIR that is available to all
tests and serves the same purpose.
Pick-to: 6.2
Change-Id: I2aa237739c011495e31641cca525dc0eeef3c870
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The NSWindow may have style masks set by the user via winId(). We don't
want to wipe those just because we're recomputing the style mask.
Fixes: QTBUG-69975
Pick-to: 6.2 6.1 5.15
Change-Id: Ibca8388d45b623f4cdfaff4b256c4eb012e2ffac
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Various texts copied from QByteArray were still talking about the byte
array, not the byte array view.
Change-Id: Ief46f6053641b7a19f8be7b20562f4b9ed66f6b3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Passing -DFEATURE_developer_build=TRUE did not add the define
QT_BUILD_INTERNAL to src/corelib/global/qconfig.h like
-DFEATURE_developer_build=ON would.
This happened, because the feature evaluation in
qt_evaluate_feature_definition did a string comparison against "ON".
Normalize both sides of the string comparison, and thus support all
booly values for features.
Pick-to: 6.2
Fixes: QTBUG-95732
Change-Id: Ibf03579c05919b35219438361fc93676b7cca7cc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The styles can't control the margin of the icon container, and its value
is hardcoded to a quarter of the iconSize, which is very unfriendly.
Add a PixelMetric enum value to allow styles to control the margin.
Change-Id: I21274b68d24150db7be78513fe9125f775aa2b00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The documention currently incorrectly lists QNativeInterface::QX11Application
as available since 6.0.
Pick-to: 6.2
Change-Id: I13256a1504b2bd93296434438835791f12353089
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Exhausts the entire buffer which double-conversion is left to work with.
Also has a large amount of precision, which apparently we need to store
temporarily.
Task-number: QTBUG-88484
Change-Id: I87e8c323676465f1b8695e086020df1240d0d0d7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When building Qt for Android on Windows, the precompile_headers test
failed if the source directory was passed as absolute path without drive
letter. See CMake upstream issue #22534.
Work around the CMake issue by ensuring that the path is properly
prefixed with a drive letter.
Pick-to: 6.2
Fixes: QTBUG-95652
Change-Id: I3154b6c0bb2f53533306227074b24fbbf5973b05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The workaround of adding a drive letter to
QT_CONFIGURE_PREFIX_PATH_STR should be done when running on any
Windows host, not only when targeting Windows.
Amends 59c3be7117
Pick-to: 6.1 6.2
Task-number: QTBUG-87580
Change-Id: Ic6ca50aa58a4a54fb483e90fe61a907fe86cb002
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Debug tools are excluded from the ALL target for debug_and_release
builds. However, when using the -separate-debug-info option, the same
exclusion wasn't being applied for their dSYM INSTALL commands,
resulting in a CMake install error.
Pass any additional install args like
EXCLUDE_FROM_ALL COMPONENT "ExcludedExecutables"
to the installation rules of qt_enable_separate_debug_info and
install dSYMs for executables per-config in a multi-config build.
All the non-main config executable install rules are optional because
the non-main config executables are excluded from ALL.
Amends 5b136abd21
Pick-to: 6.2
Fixes: QTBUG-93999
Change-Id: I95c3ce28215c3ee535551e4b7a5fa9731f8f1c28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
So that those values are used when configuring other repos in a
per-repo build arrangement.
Pick-to: 6.2
Change-Id: I5ff86260116c52afc87d7fcd5cbd047fcb9dde22
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Forward declaring an Objective-C class in Objective-C/C++ mode is done
by using the `@class` syntax, e.g.:
@class NSString;
In C/C++ mode however there's no documented approach, so we chose
to flatten the type down to the opaque objc_object "base class":
typedef struct objc_object NSString;
As it turns out, when Objective-C classes are used as arguments or return
types in C++, the signature they produce is equal to what it would have
been if the type was a normal class. For example:
void foo(NSString *) -> __Z3fooP8NSString
The is due to @class in Objective-C++ just being just sugar, so an NSString
pointer is not treated as `struct objc_object *` but rather a pointer to a
distinct type, which then gets mangled as such by LLVM's Itanium mangler
in CXXNameMangler::mangleType(const ObjCObjectType *T).
With our current forward declaration however, we are expecting:
void foo(NSString *) -> __Z3fooP11objc_object
As a consequence exported helper functions such as QString::fromNSString()
are not possible to use from plain C++ right now, as it will give a linker
error for the missing QString::fromNSString(objc_object*) function.
And even if we did define the extra signature, it would not be possible
to declare overloaded functions taking Objective-C classes, as they would
all produce ambiguous overloads in C++ mode.
To fix this we change the forward declaration to a plain old class,
which matches the signature in both Objective-C++ and plain C++ mode,
and allows overloads. This is a binary compatible change, as no client
were using any of these functions from C++ anyways as they would have
produced linker errors. It does have a slight source compatible break,
for clients that manually forward declared classes using the old style,
but that use-case is deemed fringe enough to accept, and clients can
work around this by defining Q_FORWARD_DECLARE_OBJC_CLASS to their
preferred format, which Qt will respect.
Pick-to: 6.2
Change-Id: I04813c60a7da22379dd9de1be56cc12c53a38232
Reviewed-by: Lars Knoll <lars.knoll@qt.io>