Commit Graph

51491 Commits

Author SHA1 Message Date
Alexandru Croitor
3a62f9e0c9 CMake: Resurrect test_import_plugins cmake build tests
Now that we run tests for static Qt builds in the CI, it makes sense
to restore the CMake build tests that check that static plugin
importing works correctly.

Resurrect the previously commented out test_import_plugins project and
port the mockplugins qmake projects to CMake.

mockplugins is a CMake project that uses the internal Qt CMake API to
build and install some Qt modules and plugins.

test_import_plugins depends on that test (via a CMake fixture) to
build public projects that use those plugins.

The installation of the mockplugins modules pollutes the Qt install
prefix, but in the CI that only happens on the test VM, which means
the release packages are not affected.

Locally on a developer machine the Qt install path will be polluted,
but it's not that much of a big deal. We could try and address that in
a future change by using the QT_ADDITIONAL_PACKAGES_PREFIX_PATH
functionality added for Conan to allow the installation of Qt packages
into a non-standard prefix.

Task-number: QTBUG-87580
Task-number: QTBUG-92933
Change-Id: I0841064a60a5ffba5118640d3197527a38ba6c30
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-11 14:35:30 +02:00
Alexandru Croitor
22a992cb12 CMake: Skip building CMake build tests in a prefix in-tree config
The Qt CMake packages are not installed yet, so the CMake build
projects can't find Qt and fail to configure.

Skip the CMake build tests in a prefix in-tree configuration and issue
a warning for informational purposes.

Change-Id: Ie5cb5b9f6f1d8ec258b70528680e31c711c20f85
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-11 14:35:30 +02:00
Assam Boudjelthia
f379446230 Handle checkPermission() below api 23
Although Qt 6 supports API 23+, it's still not bad to do this fix, it
achieves two things:
* Avoid the use of reflection when checking for permission state
* It works for all api versions

With this we would be sure we don't need to do a check in c++

if (androidSdkVersion < 23)
    return true;

The platform api checks if permission is granted or not, irrelevant of
the api version.

Change-Id: I9766dc35bbc8347ad0d60fde54b95710c8866736
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-11 12:35:30 +00:00
Kai Köhne
c113c88aa2 Move qmlimportscanner to libexec
Task-number: QTBUG-88791
Change-Id: I71150af4965458225e7bbbd72ffc4f60c6854625
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-11 12:35:30 +00:00
Chen Bin
aeef92c3c3 Check scrollbar visibility when computing QListView margins
When the listview setWordWrap is true and ScrollBarPolicy is
ScrollBarAsNeeded, if the text needs a newline display and the
vbar is not shown, the width of the item was subtracted from
the width of the scrollbar.

In most cases, the listview needs to reserve the size of the scrollbar.
But if the flow is TopToBottom and the vertical scrollbar is not
visible, the width of the vertical scrollbar cannot be reserved.

Fixes: QTBUG-92366
Pick-to: 5.15 6.0 6.1
Change-Id: I73cce691099a253d409019dbb3fe9a16e1830bb1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-11 20:35:30 +08:00
Giuseppe D'Angelo
2be9e6cc26 Q_DECLARE_OPERATORS_FOR_FLAGS: also define operator&
Bitwise ANDing an enum and a QFlags should yield identical results
as ANDing a QFlags and the enum. This latter operator already existed,
so add support for the former.

Plus, ANDing two enumerators of a flag type should yield a QFlags, and
not a plain int. (Note that an arbitrary amount of bits can be set
in the result of such operation, as the enumerators themselves may be
masks with more than 1 bit set.)

This is slightly source incompatible, as we're changing the return
type of operator&. Code that was assigning that result to `int` still
works as expected, but code that wanted the value back in a QFlags may
have inserted some conversions like:

  flag = Enum(enumerator & otherFlag);
              ^---------------------
                used to yield int, now QFlags

which are now going to break as there's no QFlags->Enum conversion.

An earlier attempt of this patch, introduced -- and immediately
deprecated -- such a conversion, under the form of

  explicit operator Enum() const;

in order to keep such old code working both before and after this
change. The problem is that MSVC has a bug with explicit conversions to
enumerations [1], which get accidentally considered when they shouldn't,
and thus making a lot of code stop compiling due to (false) ambiguities.
So, I'm not adding that operator any more.

Note that there's a way to keep code working before and after this
change: just use

  flag = Flags(enumerator & otherFlag); // Flags, not Enum

(thanks Edward), which goes through a int -> QFlag -> QFlags conversion,
and arguably is the idiomatic way of writing such code; or use

  flag = otherFlag & enumerator;

which, as discussed above, has always returned a QFlags.

[1] https://developercommunity2.visualstudio.com/t/explicit-conversion-operator-to-enum-is/1412616

[ChangeLog][Potentially Source-Incompatible Changes][QFlags] Bitwise
AND-ing two values of an enum type for which flag operations have been
declared now produces a QFlags object. Similarly, AND-ing a value
of enum type and one of type QFlags now produces a QFlags object.
Before, it produced an integer in both cases. This may introduce a
slight incompatibility in user code; it is possible to keep the code
working in Qt versions before and after this change by inserting
enough conversions to QFlags, and/or by changing expressions such as
`enum & flag` to `flag & enum` (the latter has always produced a QFlags
object).

Change-Id: I6e645c010d3aa677820545b0c25678f1dc9a3295
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Giuseppe D'Angelo
d2759e0e32 QFlags: add operator& / &= overloads taking a QFlags object
It makes no sense to offer the "type-unsafe" operators taking a plain
int, and not offer the ones taking a QFlags object. Using these
operators has actually always worked by going through a conversion to
int, but we're going to limit that possibility in the future.

[ChangeLog][QtCore][QFlags] The operator& and operator&= now accept
a QFlags object.

Change-Id: Iee0845640014d35b646787e8bdb77854f180a9ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Giuseppe D'Angelo
53049d6027 QFlags: plaster Q_IMPLICIT
Change-Id: Ic56a32d354e6868f2e01771975c00509a9d91296
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Giuseppe D'Angelo
ddee595d58 QFlags: add qHash overload
Stop going through the implicit int conversion.

[ChangeLog][QtCore][QFlags] QFlags now has a qHash() overload.

Change-Id: Id380ed252695f24af2e8c239b650dcb6f44e2893
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Giuseppe D'Angelo
e906bb84fb QFlags: add (named) explicit conversion from/to int
There are some use cases where one may want to convert a QFlags object
from/to an integer deliberately; for instance, to store it in a
bitfield, saving some space. So far this worked by means of a implicit
conversions; instead, also add named conversions for this.

[ChangeLog][QtCore][QFlags] Added the fromInt() and toInt() functions
for explicit conversions from/to a plain integer.

Change-Id: I705559bf75b28c30b4446bb6d0753aedfc808eed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Eskil Abrahamsen Blomfeldt
f385b8827a Windows: Add synthesized fonts also when there is a style name
Since Windows can synthesize certain font traits for us, we
used to register these in the font database so that we could
match against them. But after change
469b139169, this in principle
no longer happens, because we opt out whenever there is a
style name (which there usually is, this could be e.g.
"Regular" for a normal font). The result of this was that
if we looked for a bold variant of a font, we would not find
it.

In cases where a multi-engine was used, the request for bold
would still survive in the multi engine's fontDef, so we would
still pick it up later and apply the synthesis. But when
NoFontMerging was set, then we would override the weight in
the fontDef with the one from the font database.

Since the comment documents that the additional registrations
are there to make sure all the variants that Windows can
synthesize are available for matching, it does not make sense
to skip them just because the font has a style name. So this
is a partial revert of 469b139169.

Note: This exposed an error in QFontDatabase::isSmoothlyScalable().
The style parameter here is not the "styleName" (as in sub-family),
but actually predates that API. Instead it is the "style" as
returned by QFontDatabase::styles(), which may be the style
name, but it can also be the generated description of the style
and weight. In the latter case, we would return false for fonts
that are actually smoothly scalable, which is incorrect. This
caused a failure in tst_QFontMetrics::metrics(). To remedy this,
we add an additional condition, and also match the style if it
matches the generated descripion of the style key.

[ChangeLog][Windows] Fixed an issue where bold/italic would not
be synthesized for fonts if QFont::NoFontMerging was set.

Pick-to: 5.15 6.1
Fixes: QTBUG-91398
Change-Id: Id2166a47ae2d386536cf6e5e27ff09165ae8a23a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-11 13:22:44 +02:00
Tor Arne Vestbø
8929e90e86 macOS: Remove MIME plumbing from QCocoaNativeInterface
The functions are available as private API though
qt_mac_addToGlobalMimeList and qt_mac_removeFromGlobalMimeList for
those that need it.

Task-number: QTBUG-83252
Change-Id: Ibc17aedd9aaced236a082d3d8de4b28313406a02
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-05-11 13:22:44 +02:00
Karsten Heimrich
2a5ac24917 Purge QFILESYSTEMENTRY_NATIVE_PATH_IS_UTF16
This was probably introduced for Symbian and did not change since
the Qt4 import (except for the Symbian code cleanup). Since it seems
only to effect Windows, use Q_OS_WIN instead.

Change-Id: I36f4d83ed5254d8b77073fc216551dfa0cc64a9f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-11 13:22:44 +02:00
Karsten Heimrich
ec9e856563 Fix QSaveFile and QTemporaryFile issues with windows network shares
The commit amends commit 3966b571 to take UNC prefix into account as
well. Fixes the weird file name output as reported in QTBUG-74291 and
QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(),
this is another spot where UNC prefix handling needs to be applied.

Also make QTemporaryFile operate on '/' as file separators to fix
creating both file types with native path separators on network shares.

Fixes: QTBUG-74291
Fixes: QTBUG-76228
Fixes: QTBUG-83365
Pick-to: 5.15 6.0 6.1
Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Lars Schmertmann
a120d11cb5 Prefer previously used channels in QHttpNetworkConnection
When IPv4 and IPv6 are supported by a server, QHttpNetworkConnection
will start up two connections and pick the network layer of the one
that finish first. In this case the channel with index 1 is used for
IPv6. When IPv6 wins, there is no channel at index 0. This situation
needs to be respected and we should try to use existing channels first
when there is a next request.

This is especially important when TLS session resumption is used.
Creating a new channel will cause to lose the ephemeralServerKey
used in the first connection.

Fixes: QTBUG-93295
Pick-to: 5.15 6.1
Change-Id: Ic9dc6a24ef793a29c2652ad37bc11120e2e6ceef
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-11 09:29:58 +02:00
Robert Löhning
1a63217021 rhi: Fix memory leak
The leak can be reproduced by running the test project from QTBUG-63557
with asan, although that report is about yet another leak.
[ChangeLog][gui][QRhiGles2] Fixed a memory leak in QRhiGles2

Task-number: QTBUG-63557
Pick-to: 6.1
Change-Id: Ic4d346abb36a5666feb3ceb881865b029f5a6945
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-10 22:16:41 +00:00
Tor Arne Vestbø
edceff30b4 Move QtX11Extras into QtGui as private API
from qt/qtx11extras 0e67fb41cfc4b4bfbaa7dc75f8ddebdf5a08e836.

The plan is to expose these as native interfaces, so this is a first
step.

Task-number: QTBUG-83251
Change-Id: Iecba8db9a4f616a08a3750ddaae08cc30ec66f89
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-05-10 21:19:46 +00:00
Pekka Gehör
066a1de8e7 Android: Remove NoSuchMethodException error
CleanUp NoSuchMethodException error(QtActivity.notifyQtAndroidPluginRunning)
appears on application start up.

Fixes: QTBUG-93620
Pick-to: 5.15 6.1
Change-Id: Ic835e00d02af17e1b48c0ff66d82e5957c635deb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-10 17:43:40 +00:00
Allan Sandfeld Jensen
ab216eaebf Fix antialiasing of rotated non-smooth scaled images
The fast-path can't antialias edges, and shouldn't be used when
that is requested.

Pick-to: 6.1 5.15
Change-Id: I3a0ce120ab96a6f95d11c165d1f5b356dae009fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-05-10 16:48:31 +00:00
Sona Kurazyan
78d8afed1f Remove the broken qToVoidFuture() function
QFuture already has a constructor from QFuture<T> to QFuture<void>. It's
safe to remove this function, since it couldn't be ever used: it tries
to access QFuture's private member, which leads to compilation error. It
was never documented or tested.

Change-Id: Iaed9602e2737455d159012ea18ca241954e1f7df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-10 18:01:49 +02:00
Assam Boudjelthia
3b096530e1 Add hideSplashScreen() back temporarily to qjnihelpers_p
This causes a build fail for androidextras, bring it back untill
the full refactoring to use qtbase APIs is done.

Change-Id: I3528c92d7c36818b105ae300ed1df9a7b281bb92
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-10 16:01:49 +00:00
Samuli Piippo
60c87c6801 CMake: use additional search paths also for tool package
Use paths configured with QT_ADDITIONAL_PACKAGES_PREFIX_PATH
to search also for the tool packages.

Task-number: QTBUG-93565
Pick-to: 6.1
Change-Id: I611b275dd7c4e7ecceb073d16643cd225bbb21d8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-10 17:52:23 +03:00
Alexandru Croitor
2a86ea10ae CMake: Allow passing arguments to tests/auto/cmake test command
Useful to pass -V if the test command is 'ctest'.

Change-Id: I77193ff2c15d8df4de71730f66afc0ee87953384
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-10 16:52:23 +02:00
Alexandru Croitor
326c7ecdfd CMake: Split qt_repo_build() into reusable macros
Sometimes projects don't follow the standard directory layout, so they
end up copy-pasting the guts of qt_build_repo and adapting that.

Split the macro into smaller ones so it's easier to reuse.

Change-Id: I8cc72ba2a2eaf58afd44950b3ac78378b7b1fdfd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-10 16:52:23 +02:00
Giuseppe D'Angelo
e830a8c7b6 PRIx macros: add missing \relates to the docs
Otherwise they won't appear.

Change-Id: I19d93aef9acb9d7afced8acbc76813a30b572953
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-10 11:38:19 +02:00
Alexandru Croitor
c457e65bf4 CMake: Don't use list(PREPEND) in qt.toolchain.cmake
list(PREPEND) command was added in CMake 3.15+, but so far we claim
support for CMake 3.14 in user projects.

Use set command instead.

This is not the only place where we use list PREPEND in public API,
but it's the first immediate issue that comes up when using CMake
3.14.

Amends 963017f588

Pick-to: 6.1
Change-Id: I7ba4507fc7da2dc550317848751502b8b46c298c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-10 11:28:52 +02:00
Alexandru Croitor
0d8eb8a5ab CMake: Don't build cmake build tests as macOS universal
We want standalone tests added by qt_internal_add_test to be built as
universal executables, so we can build them on an intel machine and
run them on an ARM machine.

But CMake build tests will be built on the final machine that runs the
tests and it might lack a universal SDK. That's why they should be
built only targeting the architecture of the machine they're running
on.

Change the generated qt.tooclhain.cmake file to allow opting in or out
of building projects with the same architectures as Qt was configured
with.

Now standalone tests will be multi-arch, but CMake build tests will be
single-arch.

Amends e379147f95

Task-number: QTBUG-85447
Task-number: QTBUG-87580
Task-number: QTBUG-92933
Change-Id: I41ab047983115f84eb2333cc9ac2d19ca08d621f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-10 11:20:44 +02:00
Tor Arne Vestbø
b0e8c52fd4 Move QNativeInterface helpers to their own header file
The machinery is not needed for all translation units, so keep it out
of qglobal.h.

Change-Id: Ib0459a3f7bc036f56b0810eb750d4641f567f1fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-10 10:56:56 +02:00
Marius Kittler
590f70a849 Fix passing QJniEnvironment to ANativeWindow_fromSurface
The function ANativeWindow_fromSurface (as declared by
`$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h`
from version r22.b of the Android NDK) takes a `JNIEnv*` so `.jniEnv()` must be used.

This prevents the following compilation error:

```
error: no matching function for call to 'ANativeWindow_f
romSurface'
        m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object());
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h:45:16: note: candidate function not viable: no known conversion from 'QJniEnvironment' t
o 'JNIEnv *' (aka '_JNIEnv *') for 1st argument
ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);
               ^
1 error generated.
```

Pick-to: 6.1
Change-Id: I70d75cb7edc5875314fcb8a70d51d0ef40442101
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-10 10:49:25 +02:00
Jan Arve Sæther
4d4eb11fe3 Improve handling of minimumHeightForWidth()
This also aligns the implementation with QWidgetItem::heightForWidth()

Fixes: QTBUG-92599
Pick-to: 5.15 6.1
Change-Id: I0de68c61ec37a16a8c338575d07ff9e8168a0b98
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2021-05-10 08:24:13 +00:00
Allan Sandfeld Jensen
036c13a0f4 Avoid coverage overflow
We end up excluding more than 65536 from 65536 of rowHeight.

Perhaps better fixed earlier, but I can't figure this logic out right
now.

Pick-to: 6.1 5.15
Change-Id: I5721c469441f15ac112180f971c857cd67edbf96
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-05-10 08:16:23 +00:00
Allan Sandfeld Jensen
ddc5af9f17 Avoid fast transform paint path on values it can't handle
It has a problem with very small targets, and coordinates can't exceed
the same bounds we have on dimensions.

Pick-to: 6.1 5.15
Fixes: QTBUG-93475
Change-Id: If5b3af324f4e525cee3dc448ba41fdd8a91cc880
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-05-10 10:16:19 +02:00
Joerg Bornemann
23e6eb53f3 Fix developer build
The -developer-build had not the desired effect anymore.
That argument must not be hidden from the feature logic.
This amends commit d5c3e1336b.

Change-Id: I96562ea2df43ba7de002e705f28c7cc7edb4a589
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-05-10 10:08:53 +02:00
Assam Boudjelthia
ee05af296f Move Android Extras as private APIs under qtbase
To the option to users to use some needed APIs until we make them
ready as proper cross-platform public APIs.

Change-Id: I53006397463331ebae8314bf8a3a019474aec617
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-10 10:40:40 +03:00
Andy Shaw
75d8623752 SQLite: Update SQLite to v3.35.5
[ChangeLog][QtSQL][SQLite] Updated SQLite to v3.35.5

Pick-to: 6.1 5.15 5.12
Change-Id: I7e1f5a4b6eb48d9f6105d7f08b35a2c62fc79660
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-09 20:12:55 +02:00
Assam Boudjelthia
8221b6b8c1 Add objectClass() and className() for QJniObject
This can be handy sometimes to avoid doing a env->GetObjectClass() call
to get the jclass object.

Change-Id: I015fe5ed73304338826e468e59778bcd3ceadc3b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-08 15:32:39 +00:00
Assam Boudjelthia
3d430935cf Simplify setAndroidSdkVersion in qjnihelpers
Change-Id: Ib4695ffa1443a0b393d152a51a811f4afb163100
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-08 16:04:07 +03:00
Assam Boudjelthia
b621edddd5 Move hideSplashScreen() from qjnihelpers_p to QNativeInterface
Hiding the splash screen require one JNI call instead of having to keep
it as a global in qjnihelpers, and since it's not really easy to have a
cross platform way for it it makes sense to have it under
QNativeInterface. The alternative is probably removing it altogether
since it's not useful often.

Task-number: QTBUG-90500
Change-Id: I9b375c52afbf07e1ddd7957c1ec60af5c258f404
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-08 13:04:05 +00:00
Assam Boudjelthia
fcbba3c622 Remove unused functions in qjnihelpers
* Remove setNative{Activity,Service} and runOnUiThread functions
which are not used anywhere, probably left overs.

Change-Id: Ic7502dfd50d8eb4a9fa7abbe540a594a3614f14b
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-08 16:04:04 +03:00
Allan Sandfeld Jensen
f94b0e1dd9 Allow background inheritance between non-body block elements
Most nested block elements are merged together, so while we shouldn't
do real inheritance we need to do it when block elements are combined.

Pick-to: 6.1
Fixes: QTBUG-91236
Change-Id: I9e37b15f705db92c79a620d0d772f25d0ee72b8d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-05-08 09:28:02 +02:00
Friedemann Kleint
e3141d5507 Style sheet example: Fix doc url for Qt 6
Pick-to: 6.1
Change-Id: I5c66b472b1687eec0ed1109ce2723d747b1a4193
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-05-08 01:35:44 +02:00
Fabian Kosmale
300dec66ce QMetaMethod: Store method constness in metaobject system
[ChangeLog][QtCore][QMetaMethod] It is now possible to query the
constness of a method with QMetaMethod::isConst.

Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-07 21:50:58 +02:00
Kai Köhne
d5c3e1336b Allow to load -developer-build without configurations into an IDE
Let -developer-build, -cmake-file-api set up the CMake File API query,
so that the build can be loaded directly into IDE's like Qt Creator.

[ChangeLog][Build System] configure -developer-build now sets up
the CMake File API query, so that a build can be loaded without
reconfiguration into Qt Creator and other IDE's. Pass
-developer-build -no-cmake-file-api to configure to disable this.

Fixes: QTBUG-89487
Change-Id: I69199b8f96da02e42e5610aa6f49881c1582f7da
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-07 21:06:58 +02:00
Andy Shaw
5c29f981fa iOS: Accessibility: Don't cut off the last character from the text value
The second parameter is the position of the first character not to be
returned when calling text(). So it needs to be passed the length of
the text, otherwise the last character is cut off.

Task-number: QTBUG-93494
Pick-to: 6.1 5.15 5.12
Change-Id: I7dd8324b3939220de125ba819b7b77588b21bd4b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-07 18:59:00 +00:00
Shawn Rutledge
688602704d Support CSS text-decoration-color in underlines, overlines, strikethrough
Also add a feature to the textedit example to set this value.

[ChangeLog][QtGui][CSS] The CSS text-decoration-color attribute is now
supported in rich text spans with underlines, overlines and strikethrough.

Fixes: QTBUG-82114
Task-number: QTBUG-39617
Change-Id: I0065cb5431833da55b0f503ce7ff2b83b74b718a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-07 17:00:20 +02:00
Doris Verria
05f7dd5ead Don't draw focus frame if widget has style rules that affect border
Skip drawing the focus ring if the widget has a custom styled
border, custom focus ring, or any rule that affects the border.
For QPushButton, if the style rule has a background
set, the bevel will be drawn in the Windows style.
Skip drawing the Mac focus frame in that case too.

Fixes: QTBUG-93032
Pick-to: 5.15 6.1
Change-Id: I7c4d4bf6f6ce7bbcd17cd620586c5efa44f2b8d6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-07 12:41:02 +00:00
Volker Hilsheimer
441ff065e5 Fix compiler warning, explicitly use 64bit shift
The 1 literal is an int, shifted by an int, and then passed into resize,
which takes a 64 bit value. This makes MSVC complain about

warning C4334: '<<': result of 32-bit shift implicitly converted to 64
bits (was 64-bit shift intended?)

Silence that warning by explicitly making the 1 a 64bit long long.

Change-Id: Ica354166de4adae20e05e176dc72b7ccd1af053f
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-07 14:41:02 +02:00
Volker Hilsheimer
6fd480142b Add note about the risk of setting min-width/height in a style sheet
Task-number: QTBUG-86677
Pick-to: 6.1 5.15
Change-Id: I1e5e10ee79d80fee40d04afe439489d6ce16a43e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-05-07 14:41:02 +02:00
Tang Haixiang
acb0065cc7 xcb: Update _NET_SUPPORTED when the window manager changes it
In some cases, the application may start before the window manager, and in some window managers
_NET_SUPPORTED may be changed. These situations will cause the _NET_SUPPORTED value obtained by Qt
to be inconsistent with the window manager.

Fixes: QTBUG-91396
Change-Id: I63c6934ad2538cdb9f05926b3748216bd0dcf04e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-07 12:41:01 +00:00
Samuli Piippo
57ede9217e tst_qlibrary: don't use absolute paths for symlinks
The libs and symlinks are in the same directory, no need
to have absolute paths.

Change-Id: I22dab933b1f3bdf244b0953c6bb7caaeedef5697
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-07 11:11:51 +03:00