57626 Commits

Author SHA1 Message Date
Timur Pocheptsov
c827b51195 QCocoaMenuBar: avoid duplication of 'special' entries in the 'Edit' menu
For this, after the app's main menu is set, we are looking for a special
menu (which is essentially translates into 'Edit') and check if AppKit
inserted 'Start dictation' magic item. If not - we apply the solution
that Volker implemented in d42cfeb84faf154b46f2811b2059946b396fcc12
for 'Edit' menu - we call insertDefaultEditItems.

Fixes: QTBUG-104709
Change-Id: I8fee93c43e7cf974f94d173cd53adf8097b263e0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6c2387571a6ccace9edb600ce6798f75affd961d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-22 19:33:37 +00:00
Laszlo Agocs
d1d8a21c53 Fix texture-based native child widget stretching
The new rhi-based approach to compositing has a difference in transform
calculation which becomes relevant with native child widgets (so when
the flush offset is > 0). This is incorrect, so restore how 6.3 and
earlier did this calculation.

Fixes: QTBUG-107814
Change-Id: I98fe866d6c857343f25f39450ee60fd307bcdb63
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit d59b2fde5eef39cc1735cadf2327f99ca6055306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-22 14:59:53 +00:00
Eirik Aavitsland
c2f85da3be Update bundled libpng to version 1.6.38
With this update, there are no longer any diffs to upstream
libpng. Hence, the qtpatches.diff file is removed. Details:

- #define _CRT_SECURE_NO_DEPRECATE: Done on compiler cmdline instead
- #undef PNG_BUILD_DLL: For our usecase, that only caused PNG_IMPEXP
  to be defined to an empty string. Done on compiler cmdline instead.
- #ifdef for WinCE: dead platform.
- A memory leak fix: Included in upstream 1.6.38.

[ChangeLog][Third-Party Code] libpng was updated to version 1.6.38

Change-Id: I229db30e1dd54c209dc93e76d11e6fdb1f7adbdb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2742ceb1cd9b1a383049ac41970bc06e8955c8df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-22 08:56:06 +00:00
Assam Boudjelthia
875e90d249 Android: fix Android assets handler not listing dirs with only sub dirs
Amends edd983071e0a90ee8665d2f45916fb575fc25857.

Remove redundant calls to AAssetDir_getNextFileName() in
AndroidAbstractFileEngine::setFileName(). It's enough to check
if AAssetManager_open() returns null and AAssetManager_openDir() is
valid for the provided asset file name.

As part of this fix, add some unit tests to cover/ensure assets
listing/iterating works as expected.

Fixes: QTBUG-107627
Change-Id: I37ae9cb64fbbc60699bb748895f77fd6a34fae1f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 89f89cedc0e62f4b66de340da57d6c56dc61baf0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 20:17:47 +00:00
Thiago Macieira
033b1ba4dd QBenchlib/Perf: open the perffd with PERF_FLAG_FD_CLOEXEC
This flag was introduced in the Linux kernel version 3.14. Trying to use
perf_event_open() now with a kernel older than that will cause EINVAL
errors, but 3.14 is from 2014, so most likely old enough for all of
Qt 6.

For that, I updated the copied header from v6.0.

Change-Id: I3c79b7e08fa346988dfefffd171f895201ceb4f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8995045c62bb673af1e74bce79e3c500e0217bae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 17:21:32 +00:00
Peter Varga
98fdf50c30 Set alphaBufferSize to -1 when disabling translucency in QtWidgets
-1 is the default value for QSurfaceFormat::alphaBufferSize. Changing it
to 0 may result an unexpected pixel format change by ARB OpenGL
extension.

Fixes: QTBUG-107629
Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 600752aa972d1e46792e18f1ec6dd0b519722e65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 17:11:59 +00:00
Mikolaj Boc
81252ea92a Do not use client-side data pointers in qopenglpaintengine
Buffers can be uploaded - no need to keep these in client memory.
Decouple uploading of buffers from the creation of vao.

Fixes: QTBUG-107539
Change-Id: Idf75bd80033a44c34af6837cd4d65b75c183d886
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit e487b07e18f1cb7ff126744be57b2ae1b9839c6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 16:02:50 +00:00
Eskil Abrahamsen Blomfeldt
c0b54bf6fa macOS: Fix less common writing systems on Catalina and later
Since Catalina, some fonts on macOS have been put into a special
"secret" mode where they are available, but are not enumerated:
https://support.apple.com/en-in/HT210192

It appears that this is done in order to phase the fonts out, as
the article refers to backwards-compatibility as reasoning for
keeping them around, but at the same time, there does not seem to
be any new alternatives. When using e.g. TextEdit, the text is
resolved to the "secret" font, but the font dialog does not
display it, indicating that you are using a non-existent font.

This also causes issues for Qt, since we have our own fontdatabase
and do our own matching. In order to work around it, we assume the
font is available and manually add it to the database and fallback
lists. This also appears to be what others are doing, e.g. Firefox.

[ChangeLog][macOS][Text] Fixed missing text with certain writing
systems on macOS Catalina and later.

Fixes: QTBUG-96384
Fixes: QTBUG-98920
Change-Id: Ifd08ccbfdd0c06e11a44be861ad2c275c5a8e339
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 65279d6e9dfbccf1b97884a1c19111d6ebb3828f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 12:43:34 +00:00
Volker Hilsheimer
520a837888 Windows: Don't force native file dialogs to index compressed files
We use QWindowsShellItem to hook into the native windows file dialog
and interface correctly with special windows folders. We create objects
of QWindowsShellItem e.g. when the user selects a file. We then probe
the shell item for various attributes, e.g. to see if it represents a
folder.

The selected item might be a compress archive of significant size, and
checking whether that archive is a folder can take significant amount
of time during which the UI is completely blocked.

To prevent that, first check whether the item is a compress item, or a
stream, and if so, don't check whether it has sub-folders.

Also, don't use the SFGAO_DISPLAYATTRMASK value, which the API
documentation [1] explicitly documents as "Don't use".

[1] https://learn.microsoft.com/en-us/windows/win32/shell/sfgao

Fixes: QTBUG-107618
Change-Id: Ifcdec53ec3f8a0236d849a0b72a71afbd03d8290
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 933eb68a9d81391174b772fd49f344082b61fa1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 12:43:33 +00:00
Mårten Nordheim
c22bf97cb1 tst_QSql*/sqlite: Don't use random output in the datatags
It makes it impossible to rerun it, bad for both CI and local test runs.

As a drive-by name the database file sqlite.db instead of foo.db

Fixes: QTBUG-100245
Change-Id: I2e4ee01189ccbad2a6add5db7771d35fd7248da8
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 30077d462dca28ba1acecc9413e97d115b46cb6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 12:39:32 +00:00
Thiago Macieira
0c6f3d69a9 tst_QTcpServer: use a random port number in addressReusable
Just in case the same test is being run in parallel. We do that by
creating a listening TCP server in the test process. This test is
supposed to test the address reusability, so a clean close on a server
that never accepted a connection should not cause reusability issues.

Change-Id: I12a088d1ae424825abd3fffd171ccfb9fc5c09ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a94731c2ad85f9dd40050a780f67c911bf12668e)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-21 12:38:45 +00:00
Liang Qi
8760c0c2f6 tests: skip tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() on Wayland
QWindow::requestActivate() is not supported.

This function crashed very often in ci/coin when system is busy.

Task-number: QTBUG-107153
Change-Id: I82523080db40bddce9c9dc000433117d8ef74847
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 63cfab628af937ea33805b698c0b4e08d5117200)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 11:58:37 +00:00
Liang Qi
905b505895 tests: skip tst_QGraphicsProxyWidget::scrollUpdate() on Wayland
QWindow::requestActivate() is not supported.

This function failed in test vm in coin manually very often.

Task-number: QTBUG-107153
Change-Id: I013651b0e5e7618c29742effd85a091ca95a7414
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit d8c078c2b6135e1ccd4b4b676b0d229e23e22c11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 11:58:28 +00:00
Christian Strømme
d9acc25af3 Android: Fix clipboard issue with urls
Both hasUrls() and hasText() can return true when containing urls, as
hasText() checks hasUrls() as well.

Fixes: QTBUG-85773
Change-Id: I91a34f151e7de17ab5b9a2f24bc0b6e6c097d7f9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5f9591bde3f3a67c566f3aa3571b57c82bd59cc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 08:47:27 +00:00
Antti Määttä
495e4c6ad2 QRhi: Allow negative viewport origin
Do not bound viewport rect to surface size, only scirror rect.
Modifying the viewport will move the view origin changing the
way the scene gets rendered.

Task-number: QTBUG-106082
Change-Id: I105516bd460af87727d0e73f580b8cf6b748d87f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit d46ad528727772362b710d68c27d963db81235c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 05:01:45 +00:00
Assam Boudjelthia
97866ffe4a Android: fix Gradle warning about using enableUncompressedNativeLibs
The warning is as follows:

 WARNING:The option setting
'android.bundle.enableUncompressedNativeLibs=false' is deprecated.
 The current default is 'true'.
 It will be removed in version 8.0 of the Android Gradle plugin.
 You can add the following to your build.gradle instead:
 android {
     packagingOptions {
         jniLibs {
             useLegacyPackaging = true
         }
     }
 }

We already define that property in build.gradle, but we also need to
account for cases where an old build.gradle file that doesn't have that
property is used. So androiddeployqt checks if useLegacyPackaging is set
(and not commented out) whether it's true or false, if it's set to true,
then that's what Qt wants to set, and if it's set to false, then we
assume the user setting it to false is explicit and we don't want to
change that.

Fixes: QTBUG-106713
Change-Id: I566232207c458daa4484623beee670c6c6679313
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 466a03e724aa39f7c57010cc2263adb06976ea50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-21 02:33:42 +00:00
Tor Arne Vestbø
6a0bba44c2 qmake: Add CFBundleDevelopmentRegion to the macOS Info.plist
Aligns with what our CMake Info.plist has for macOS, what we do for
both qmake and CMake on iOS, and what Xcode generates for new projects.

The value is hard-coded to English instead of using $(DEVELOPMENT_LANGUAGE)
as the file will be used by both the Makefile and Xcode generator, and
only the latter does variable replacements for $(FOO).

Task-number: QTBUG-63324
Change-Id: I87e1cb14b14a9746b3603016c2ac69c252d37ff6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d4b0e0d02eeb46b400ac726115d840dd05c74c51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 14:00:34 +00:00
Ville Voutilainen
6b67edb23a Android: Add a way to disable accessibility via an environment var
Task-number: QTBUG-102168
Change-Id: I38956c1798b8874b3c5bc5b19c8cb09380e76cc3
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e7553adf16c14ec474b2659ad53757a37b336f95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 14:00:34 +00:00
Timothée Keller
896eb6bcd0 Mention limitation of QDir::drives() on Windows
Added comment to clarify returned drives from QDir::drives()

Task-number: QTBUG-106896
Change-Id: I7cf9642b11f9000a5e6382a2b29070ab2cd6442e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit df89c93d916873c02c0995c76f325e7147858dae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 14:00:34 +00:00
Yuhang Zhao
4bf9f4bc6e QOperatingSystemVersion: add new Win10 version
Win10 22H2 is released already.

Change-Id: Ibd42ee5e8b6e4ceb3cb4f8ee237bd9cdd9473f66
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2e582a0af9c918876c77a62ff827265e9d83e9bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 14:00:33 +00:00
Mårten Nordheim
cbdcdc345f tst_QTcpServer: Unblacklist addressReusable
According to the grafana dashboard it has not failed in the
past week.

Reverts ad736e9150af6ac621393529a72c8e67e05c2d5e

Change-Id: I3eac3c7fd667cfe2cf951b2808dddbfed8eae087
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 9efb27e40ce097f2c761b5e5f9c3b9a5c65b3a49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 14:00:33 +00:00
Doris Verria
e5c23d2a4a iOS plugin: Add support for wheel events
Use UIPanGestureRecognizer to handle mouse and trackpad scroll.

Task-number: QTBUG-99795
Change-Id: I5db7fabf55b6f2e6f7ba90a0b90ecb08734e2329
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 77fcd47febec58eaf35610c72f2d9bdfb1ee4174)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-20 14:00:33 +00:00
Assam Boudjelthia
ed5474aa60 Android: properly retrieve mime type of uri to for openUrl()
Retrieve the mime type of the url regardless of whether QFile::exists()
returns true or false, because it is nonetheless required when calling
openUrl().

Fixes: QTBUG-47979
Change-Id: Ia095b76d5d39addb0b115eb97ac6bbae0c18a21f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 6f418df9cc931032ffc32a15b6ff268452fe9f01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 10:38:51 +00:00
Eskil Abrahamsen Blomfeldt
9ac433b40a Fix generating PDFs with DirectWrite engine
The PDF print engine depends on getting unscaled glyphs and some
metrics from the font engine, and for DirectWrite, we were relying
on the superclass implementations of the functions in question,
giving us approximated values. This caused glyphs to be slightly
the wrong size when the DirectWrite engine was in use, e.g. when
high-dpi scaling is enabled.

[ChangeLog][QtPrintSupport][Windows] Fixed glitches in generated
PDFs when the DirectWrite backend was in use, e.g. when high-dpi
scaling was active.

Fixes: QTBUG-102098
Change-Id: I6ad72bfc8f634a1dcaee02de39960faa93f1ece3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 3158068209b06e8bfa18c8fb83890953221a8176)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 05:58:51 +00:00
Lorn Potter
f5a7514f42 wasm: fix crash when network reply is closed
We do not need to call QNetworkReply::close as that closes the
QIODevice that we do not use (or have)

Fixes: QTBUG-77210
Change-Id: I812bc324f49ae28b8c622cfa89f9690e012bf216
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 9a5a31268e1fc1c86796dcf7f9ab757c4a599a49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-20 01:59:54 +00:00
Mårten Nordheim
a97bfaddc1 Fix duplicated words in documentation
Only did instances where two-and-two words are duplicated,
easy to see when wrong.

Task-number: QTBUG-107777
Change-Id: I11593728acc386e7ef9aba9b39a0a4d9c60a532f
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit b4ad658fa0a65a77961d53c1c6373dc83d1e30ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 20:17:22 +00:00
Mårten Nordheim
94379dd158 QSslServer[docs]: fix grammar
s/a/an

Fixes: QTBUG-107777
Change-Id: I11159202304fc5f892ee41552d110f3a838470f9
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit c238a788464e1f41cd16210bd785ca5b61a763ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 20:17:20 +00:00
Alexandru Croitor
4060a2ee93 CMake: Use unix paths in android xml files
We aim to allow building Qt for Android on one host, and make it
usable on any host.

Previously when built on a Windows host, we embedded windows style
paths into the android -dependencies.xml files, which caused
androideployqt to fail deployment when building a project on a unix
host.

In Qt 5, the dependencies xml files for Windows Android packages had
unix style paths. Thus switch to always using unix styles paths on
all platforms.

Amends a9d2c5b6d7fa6b7365db8690f57aa78002c8bc4b.

Fixes: QTBUG-107249
Change-Id: I851d3e0b08415b4c7f0d22baf43c10c715879ee7
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f7a34630a1c13c054cf06199bbb907ddc718e48c)
2022-10-19 11:35:09 +00:00
Topi Reinio
3608ae4cb9 Add license text file for Creative Commons Zero (CC0) 1.0
Since I38b281c97e039a8158e143ffa16ba1966713d030, qtattributionsscanner
fails the documentation build on missing license file(s).

Task-number: QTBUG-104126
Change-Id: Ia0efcfa44fc26ebcd86d98263bc33336d486d064
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit 665d727a28017fc64724a4cf3e31361fd031d481)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 10:06:21 +00:00
Eirik Aavitsland
30ddd5874a Avoid warning from QPrinter::setFromTo() in the documented 0,0 case
The doc says the setFromTo(0, 0) will print the whole document,
i.e. clear the page ranges. Although this works, it creates a runtime
warning.

Fixes: QTBUG-105292
Change-Id: Ic5de5be71ffc91762c8a4a44875ba133831d981f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 7988cf25a52d26109e60fe5a7b72ec2940c59ecc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 09:27:45 +00:00
Doris Verria
a68acbd0cf QMacStyle: Set NSControlStateValueOn for selected tabs
We draw tab buttons as NSButtons of type PushOnPushOff. To draw a
selected tab, we used state ON (NSControlStateValueOn), which gives it
the accent color, and state OFF for non-selected tabs. To draw a
selected and pressed tab, we use state OFF and set highlight:
depending on isPressed.
This worked fine up until macOS 11 because when setting highlight to
true the push button would draw the accent color no matter the state.

In macOS 12, things are different. A highlighted NSButton doesn't draw
the accent color anymore, but rather a gray background.
So when we draw a selected tab using NSControlStateValueOn (blue/accent
color) and then press it (state changes to NSControlStateValueOff), the
tab will change color from accent/blue to gray. The text remains white,
so it's not clearly visible.

To fix, set the NSControlStateValueOn for selected, pressed tabs on
macOS 12, so the background color doesn't change when pressing on a
selected tab.

Fixes: QTBUG-101000
Change-Id: Iaf48a7e2ae536c7c591578bb3c1065bd0e29b2e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0709af1c02a653f3121c76ae7879cc64b2e246b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 08:41:32 +00:00
Thiago Macieira
4866cac6f1 tst_QLibrary: add a cleanup() method to unload left-overs
QLibrary intentionally does not unload on destruction, so failing tests
may leave libraries already loaded and cause further tests to fail
because of that. So add a cleanup() method to unload everything we may
have loaded.

Note that QLibrary::unload() sets its state to NotLoaded after one
successful call, so we must recreate the object in case it had been
load()ed multiple times.

Change-Id: I12a088d1ae424825abd3fffd171d133c678f910a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 636dbe604596b2860e4f6d9b159fc017dcd2f66b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 05:52:33 +00:00
Timur Pocheptsov
c7c360cd51 QIosTextResponder: stop using deprecated constants and type
Use NSWritingDirection and corresponding enumerators instead.

Change-Id: Ie76ec2b8d07ab70288c7071182f215412d3e133c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 46b290dda8d41f6c2f71ba24d4b9647507a04b26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 05:52:32 +00:00
Timur Pocheptsov
f730cc755b QIosScreen: retain the right window
When initializing m_uiWindow (instead of trying to retain this window
itself, which is harmless, since it's nil, but useless, since it's
not the right window).

Change-Id: I7855fd7c24ebfc28fbb912966f8010caba914fe7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9e5e330a09607c62fa440f6222cb75005be12b01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 03:11:56 +00:00
Timur Pocheptsov
65465c2693 QCocoaWindow::windowStyleMask: make popups non-resizable
Otherwise, context menu can be resized.

Task-number: QTBUG-106925
Change-Id: I409d0113fd92ca89b14f068c391dd9c0ddb79ce7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e17372e723555cd9eb7b4efcb553812e0b98f37b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 03:11:47 +00:00
Timur Pocheptsov
b793c01539 QIOSMessageDialog::exec - work around 'windowsless' exec
While the need for such scenario is arguable, we can imagine that some app
first shows some message box (by calling QDialog::exec()), and then creates and shows
the main UI/window/widget. Without such a widget, app's keyWindow is nil,
its rootViewController is also nil and no alert is presented at all.
To save the situation, we try hard and check the primary screen's uiWindow
(using QIOSScreen::uiWindow) searching for any window and using its root
view controller.

Fixes: QTBUG-79977
Change-Id: I9bf38bdf540f1f1dbe42b86df94d6a1b4694e9f2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f50f6a456aca6f0782eab2bf475d4f9c86a21f4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-19 03:11:39 +00:00
Thiago Macieira
c2a92199b5 QLibrary::setFileNameAndVersion: reset the tag after findOrCreate
If the library we've found is already loaded, set the tag to Loaded.

Change-Id: I12a088d1ae424825abd3fffd171ce3831b884eee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 54df3488aff977e0881b2591fff2e66f270e243e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 20:40:10 +00:00
Timur Pocheptsov
c4405bc5d7 QMacStyle: restore control size after re-initialization
We had to re-initialize NSSlider, due to some hidden problem with
stale geometry, when just setting properties of a cached control
(the remains of another previous QSlider render, using the same NSSlider).
But -initWithFrame: also resets the control size we set earlier,
thus 'small'/'mini' becoming 'normal'.

Fixes: QTBUG-107450
Change-Id: Ice42c787ec65d89c1c15f9c89462b7804aafe51c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 942abaae595ea620bdeacba0f4a18b759785d61b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 16:55:41 +00:00
Ievgenii Meshcheriakov
a40be64759 QNetworkReply: Fix typos in the documentation
Fixes: QTBUG-107719
Change-Id: Ic5bbc59aebeb44595cfde000bfd1cfb28991d311
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit dd0eb89d2e3b196343cbf322b0f35ea0b54f0814)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 16:10:07 +00:00
Friedemann Kleint
fa853a7715 windeployqt: Deploy Qt Designer plugins for QtUiTools
Make QtUiTools a known module with command line options and
plugin dependencies.

Note: There is no automated dependency checking for those
plugins as this can lead to undesired libraries being pulled.

Fixes: QTBUG-104831
Change-Id: I31a0c3620460d6558edcf8245f43502f2bca7748
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ec6b22f67dc6133b280a8f3fe40d7d1cbef819bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 06:49:39 +00:00
Marc Mutz
ae4f63613b QApplicationStatic: avoid use of std::aligned_union
It's deprecated in C++23. Replace with std::aligned_union's
implementation, like done elsewhere in the code base.

Fixes: QTBUG-107569
Fixes: QTBUG-99122
Change-Id: I0c06876c03a3c268298fab0f0bae399f26449bed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fdd0a1bc179e406b4af8c1dd2cc58bf8857d42ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 04:17:12 +00:00
Marc Mutz
93503b0c52 tst_Q{BitArray,ContiguousCache}: check not only count(), but size(), too
Add at least a few, so size() isn't completely untested.

Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f5205bd6a409d736942a4eed8869245cb9646d35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-18 04:17:02 +00:00
Thiago Macieira
2a14dd4f47 Autotest/Unix: request zero-sized core dumps for crashing code
Unix systems have got crash loggers in the past 15-20 years, notably
macOS and Linux (abrtd, systemd-coredumpd, etc.). By setting the core
dump limit to zero, those tools should be mostly inhibited from running
and thus not interfere with the parent process' timeouts. Even for
systems without core dump loggers, disabling the writing of a core dump
to the filesystem should also help.

Change-Id: I12a088d1ae424825abd3fffd171d112d0671effe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c849c48d19cc0b086f98688d760fa6e008adc50e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-17 15:14:20 +00:00
Robert Griebl
789f51eabc Fix QComboBox supressing a QDialogs default button
Commit 64ffe0a broke pressing RETURN aka. the default key in a dialog
to close it, when a read-only QComboBox has the focus.

Before that patch, Enter + Return were actively ignore()d, but this
code path was removed, resulting in those keys to be auto-accepted.

Fixes: QTBUG-107262
Change-Id: I3dd8dca7d2f9d94f5172adc92ef508fe81c0df57
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit f7e2984a1a8ce6fbe933f3905ae79b39ff5438df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-17 15:14:20 +00:00
Marc Mutz
2ce49dfe8c Update Catch2 to v2.13.10
Two patches applied to upstream release.

Fixes: QTBUG-103321
Task-number: QTBUG-99122
Change-Id: Ief451a21e5f61851cb03a9ca94ffe0f864e4b1f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3d6f5e95f0cdf6bc36b5f8483da0c14f3535bce2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-17 15:14:20 +00:00
Timur Pocheptsov
8a24898735 QIosMenu - do not check -undo: and -redo: selectors
With the latest Xcode 14 an attempt to 'Archive' and distribute an
app to the App Store Connect ends with a strange warning:
"App Store Connect operation Error The app references non-public
selectors in Payload/appname.app/appname: redo:, undo:". Googling
finds many similar reports and complains (with a bunch of different
selectors suddenly reported as non-public). We filter out undo/redo
instead, the selectors without parameters.

Change-Id: I9667dc61f650f6b6ec42c64a9aa6fbff57fe5049
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 6e288701e837ca324ad6e95fce301b29879b4a28)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-17 11:33:27 +00:00
Laszlo Agocs
9778edbd6b Add missing repaintManager check
This is likely a problem only after the 6.4 changes to move QQuickWidget
composition from OpenGL to QRhi.

Add an extra check to the condition when bailing out.

In QWidgetPrivate (qwidget.cpp) all similar calls into the
repaintManager are guarded by

  if (tlwExtra && tlwExtra->backingStore && tlwExtra->repaintManager)

therefore it makes sense to perform the same check in the other file too.

The assumption is that the check was not added here due to being outside
of qwidget.cpp.

Change-Id: Ic94d4e5153f4a194a997cd669b0f7c48c7932d97
Fixes: QTBUG-107166
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 2d381001dae9c5e590375232e7a95f245350e4ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-17 10:00:40 +00:00
Alexey Rochev
3fb11be311 QMetaType: explicitly include qobject.h
convertMetaObject() function requires definition of QObject class,
but qobject.h is not included explicitly. Instead it is pulled by
qabstractitemmodel.h.

Include it explicitly to fix builds with -no-feature-itemmodel.

Change-Id: I4386375588c451262923501ab8dd7374c1f729ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1d7e3ef77eccdea566bbb55f24267d70c8a1ebce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-16 07:57:29 +00:00
Marc Mutz
1df7efe377 qcompilerdetection.h: detect Coverity
Just to persist the knowledge of how to detect it for the next guy.

Change-Id: I16847d02ce60fab0ae14ffb2688f2ee92fa6a9f2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 16dbbc8f8c93f28194b8b440b9616119ea2f7b45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-16 01:58:12 +00:00
Yuhang Zhao
3868f2fa5d QAnyStringView: fix MSVC warning
When use /W4, MSVC warns about the code is not reachable.
It's not reachable indeed, so it's no need to include it
in the final binary, just use the same #ifdef guard to
comment it out.

Change-Id: I22a321e2c748bd1c5608475d61ba9a83734c5364
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8ba8d1346a562347c398bdd0529d34f94f2ac698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2022-10-15 17:23:57 +00:00