Commit Graph

58512 Commits

Author SHA1 Message Date
Christian Ehrlicher
2b35b89803 SQL/MySQL: misc cleanup
Cleanup the code a little bit and use qsizetype on some obvious places.

Change-Id: Ib9e5ec79a39c45c9fab7e21dbda70ed728025191
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-21 09:29:52 +02:00
Mikolaj Boc
3f86c62a81 Gather file infos synchronously on no-thread builds
QFileInfoGatherer is implicitly dependent on threads - there are
no compile guards but the file scan loop runs on a thread.
Make it gather file infos sync if threads are not enabled so that
signals are properly fired from it on filesystem scans.

Fixes: QTBUG-85445
Backport-to: 6.4 5.15
Change-Id: I55f37497aa97bde2fc0fa2dece33c95acc870e99
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-21 09:14:10 +02:00
Yuhang Zhao
738e05a55a QWinRegistryKey: fix assert when querying default value
I wrongly assumed we can't query a value with an empty name ""
during the previous refactor commit, however, in Windows registry,
an empty name for a value means the default value of a key, we can
read and write it through the "Default" name.
Remove the wrong assert to fix the crash when we are trying to query
a default value of a key.

Add a new test case to test this kind of scenarios.

Amends commit 40523b68c1

Fixes: QTBUG-107794
Change-Id: Idacbcb86df4435a8c1ca1c19121599390ae8f3d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-21 11:51:31 +08:00
Assam Boudjelthia
466a03e724 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.

Pick-to: 6.4 6.2 5.15
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>
2022-10-21 05:33:30 +03:00
Ahmad Samir
d60aa6a8cf Layouts docs: pass parent widget in the ctor
This is a follow up from commit 1e904ab342c1aaa; changing more
documentation to pass a widget * in the ctor of a layout, rather
than creating a parent-less layout then calling setLayout().

Change-Id: I4fc59c6cfa46ccd279a153acd67335a6daf22ff9
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-10-21 00:57:24 +02:00
Thiago Macieira
77eef32917 QLibrary: fix loading multiple versions of a library
The libraryMap only stored the file path, so we couldn't load two
versions of the same library as we'd find the other version already
loaded. Change the map to index by file name and version (using a NUL as
separator, since that can't appear in file names).

[ChangeLog][QtCore][QLibrary] Fixed a bug that caused QLibrary to be
unable to load two different versions of a library of a given name at the
same time. Note that this is often inadviseable and loading the second
library may cause a crash.

Pick-to: 6.4
Change-Id: I12a088d1ae424825abd3fffd171ce3bb0590978d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-20 15:38:47 -07:00
Assam Boudjelthia
3731e04668 Android: skip tessellation(Vulkan)
Fails on CI's Android 12 emulator.

Amends c681c7c23f.

Change-Id: Icb0c39a9d0b7952aea76b7b0c45fbfc7f2b0556f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-20 20:52:47 +00:00
Thiago Macieira
8995045c62 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.

Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd171f895201ceb4f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-20 08:39:16 -07:00
Christian Strømme
5f9591bde3 Android: Fix clipboard issue with urls
Both hasUrls() and hasText() can return true when containing urls, as
hasText() checks hasUrls() as well.

Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-85773
Change-Id: I91a34f151e7de17ab5b9a2f24bc0b6e6c097d7f9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-20 15:39:13 +00:00
Mikolaj Boc
fffea48ea5 Fix typo in QWasmWindowStack's name
'Wasm' in it is duplicated.

Change-Id: Ie00e02fb7ae4d9e13f490ce2d46a4eabf3f5710c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-10-20 16:36:23 +02:00
Eskil Abrahamsen Blomfeldt
cdd7163c60 macOS: Fix synthetic bold on scaled painters
Bold synthesizing on macOS works by redrawing the text at a
subpixel offset. However, since the text position is given
in user space (pre-transformed) we need to scale the offset
by the current matrix, otherwise you can get large gaps between
the two instances of the text.

[ChangeLog][macOS] Fixed an issue with synthetic bold on
fonts when the painter had a scale

Fixes: QTBUG-103215
Change-Id: Idf0ae3da75a55825cbb5598561ef8fd9a512c6a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-10-20 16:05:25 +02:00
Laszlo Agocs
2decbe0417 rhi: gl: Apply a workaround for macOS
We do not yet have a solution on the platform plugin level. All we can
tell so far is calling clearDrawable when making an Offscreen surface
current has unintended effects in certain situations. As well behaved
clients pass in a window when creating the QRhi, we can try to prefer
that in place of our QOffscreenSurface while the window is still
valid. However, to not potentially deoptimize on other platforms
(e.g. where surfaceless contexts are a thing), do this only for
macOS for now.

Fixes: QTBUG-107666
Change-Id: I23c7340a769f474712f7f6d7bb191c70aeec3924
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-10-20 14:05:25 +00:00
Laszlo Agocs
8f985af8b1 rhi: vk: Switch to cheaper VMA statistics API
Now that we upgraded to 3.0.1 vmaCalculateStatistics can be replaced
with a less-expensive call.

Change-Id: Icb444354ce9e091cf69f82aff2e2f828b8302072
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-10-20 16:05:25 +02:00
Laszlo Agocs
8cf4f9c449 vkmemalloc: Disable nullability warning on Apple with clang
Change-Id: I6602d1cb695d6483177d3c3722b468a0c9df235a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-10-20 16:05:25 +02:00
Laszlo Agocs
c31b3d052e Update Vulkan memory allocator
Fixes: QTBUG-107715
Change-Id: I8ab0dc22cf4207e1ef6bc2a170dbd7c2cdd52ee4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-20 16:05:25 +02:00
Antti Määttä
d46ad52872 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.

Pick-to: 6.4
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>
2022-10-20 17:05:24 +03:00
Tor Arne Vestbø
d4b0e0d02e 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
Pick-to: 6.4
Change-Id: I87e1cb14b14a9746b3603016c2ac69c252d37ff6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-20 14:21:32 +02:00
Ville Voutilainen
e7553adf16 Android: Add a way to disable accessibility via an environment var
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-102168
Change-Id: I38956c1798b8874b3c5bc5b19c8cb09380e76cc3
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-20 14:47:49 +03:00
Timothée Keller
df89c93d91 Mention limitation of QDir::drives() on Windows
Added comment to clarify returned drives from QDir::drives()

Task-number: QTBUG-106896
Pick-to: 5.15 6.2 6.4
Change-Id: I7cf9642b11f9000a5e6382a2b29070ab2cd6442e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-20 13:47:49 +02:00
Yuhang Zhao
2e582a0af9 QOperatingSystemVersion: add new Win10 version
Win10 22H2 is released already.

Pick-to: 6.4
Change-Id: Ibd42ee5e8b6e4ceb3cb4f8ee237bd9cdd9473f66
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-20 08:16:42 +00:00
Mårten Nordheim
9efb27e40c tst_QTcpServer: Unblacklist addressReusable
According to the grafana dashboard it has not failed in the
past week.

Reverts ad736e9150

Pick-to: 6.4 6.2
Change-Id: I3eac3c7fd667cfe2cf951b2808dddbfed8eae087
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-10-20 07:47:36 +00:00
Eskil Abrahamsen Blomfeldt
3158068209 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.

Pick-to: 6.2 6.4
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>
2022-10-19 19:24:26 +02:00
Amir Masoud Abdol
71f020b365 Fix Some Typos
Changed `proviude` to `provide`, and removed an extra space in a `xcrun`
command.

Change-Id: Iccbf6f87b9f4c86b686a6b1d0723458a1387a7ea
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-19 19:24:26 +02:00
Mårten Nordheim
b4ad658fa0 Fix duplicated words in documentation
Only did instances where two-and-two words are duplicated,
easy to see when wrong.

Task-number: QTBUG-107777
Pick-to: 6.4
Change-Id: I11593728acc386e7ef9aba9b39a0a4d9c60a532f
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-10-19 17:24:26 +00:00
Mårten Nordheim
c238a78846 QSslServer[docs]: fix grammar
s/a/an

Fixes: QTBUG-107777
Pick-to: 6.4
Change-Id: I11159202304fc5f892ee41552d110f3a838470f9
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2022-10-19 17:28:13 +02:00
Santhosh Kumar
46f98147f4 Refactor windows vista style for Qt widgets
Removed windows xp style and Cleanup windows vista style for Qt
widgets.

Change-Id: Ia05e8bca9bad477cec535d2288d9773546e0e116
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-19 17:28:13 +02:00
Morten Sørvig
ef3813fc1e wasm: add wasm_simd configure feature
Add Qt configure feature for enabling WebAssembly SIMD usage:

   ./configure ... -feature-wasm-simd128

Enabling this feature makes Qt add the -msimd128 flag to
the compile options, which enables SIMD instruction usage
for the compiler.

(This should not be confused with the previously added SSE
SIMD support, which uses Emscripten's support for translating
SSE SIMD to WASM SIMD)

Change-Id: I84a36ccef8abf9199c304d68ce371c6b1747b832
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-19 15:02:36 +00:00
Volker Hilsheimer
f5de333192 MSVC: Disable conformance check that breaks with default WinSDK
The default Windows SDK installed for VC++ 2022 is 10.0.19041, and still
has the issue described here, breaking builds if -Zcpreprocessor is set:

https://developercommunity.visualstudio.com/t/stdc17-generates-warning-compiling-windowsh/1249671

The issue might be fixed in SDK version 2104 (10.0.20348.0), but until
that is the default SDK when installing the compiler, turn that
conformance check off again.

Partially reverts commit 8cb832090a

Change-Id: Ib22f8d196b978274ce31be727826b902e79aaa99
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-10-19 17:02:36 +02:00
Alexey Edelev
f037e85dc2 syncqt: Use "ERROR:" preamble for warnings that are treated as errors
Use the "ERROR:" preamble for all syncqt warnings if warningsAreErrors
flag is set.

Amends 658c166f96

Task-number: QTBUG-107088
Change-Id: Idc4a0e9196dce9788fd5a25bdac6783779c1bc85
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-19 15:39:09 +02:00
Assam Boudjelthia
6f418df9cc 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().

Pick-to: 6.2 6.3 6.4 5.15
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>
2022-10-19 16:39:09 +03:00
Tor Arne Vestbø
dd40306968 Make qt_mac_ensureResponsible QT_BUILD_INTERNAL and Q_AUTOTEST_EXPORT
Its primary purpose was to be used by permission auto tests, so to
avoid App Store compatibility issues we disable it in non-dev builds.

Task-number: QTBUG-107167
Change-Id: Iaacec807808cfe52df0cf850b287e50da1bd59e5
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-19 15:56:42 +03:00
Fabian Kosmale
7502e57ca8 Apply Q_FLAG to flag type instead of enum type
Change-Id: I05cebef521a532654ae8fa306eed9c8db5a0db69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-19 13:54:07 +02:00
Tor Arne Vestbø
87f8159c6a QCoreTextFontEngine: Mark CGAffineTransformConcat as unused
We don't know at this point why the result isn't assigned back to
cgMatrix, but for now mark it as unused to fix warnings-are-errors
builds.

Pick-to: 6.2 6.4 5.15
Change-Id: I6b32bbc42b2147b5304e1c72026e39d3e1eb8a4d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-10-19 13:44:47 +02:00
Maximilian Blochberger
bbad6440ae Ensure proper format of Info.plist
The Information Property List (Info.plist) is a property list that
contains information about macOS and iOS application and framework
bundles. There are multiple supported formats, those property lists can
be stored in, most notably XML and binary.

Problem
If the Info.plist file is edited with an external editor, such as Xcode,
it is possible that it is stored in binary format. A Makefile generated
by the qmake tool contains a call to sed, which works on text but not
binary files. Consequently, this call would fail.

Solution
Since Mac OS X 10.2, the plutil tool is available. It can be used to
convert the property lists into a specific format. The plutil tool is
now used to convert the plist to XML, so that the sed invocation
succeeds.

[ChangeLog][qmake] Fixed handling binary Info.plist files in generated
Makefiles by always converting them to XML before substituting
placeholders.

Fixes: QTBUG-45357
Change-Id: I066039301c391a5034710458500a096f09e5ca24
Pick-to: 6.2 6.4
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-19 12:06:09 +02:00
Topi Reinio
665d727a28 Add license text file for Creative Commons Zero (CC0) 1.0
Since I38b281c97e039a8158e143ffa16ba1966713d030, qtattributionsscanner
fails the documentation build on missing license file(s).

Pick-to: 6.4
Task-number: QTBUG-104126
Change-Id: Ia0efcfa44fc26ebcd86d98263bc33336d486d064
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-10-19 12:06:09 +02:00
Eirik Aavitsland
7988cf25a5 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
Pick-to: 6.4
Change-Id: Ic5de5be71ffc91762c8a4a44875ba133831d981f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-19 11:27:35 +02:00
Doris Verria
0709af1c02 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
Pick-to: 6.2 6.4
Change-Id: Iaf48a7e2ae536c7c591578bb3c1065bd0e29b2e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-19 06:07:15 +02:00
Lorn Potter
9a5a31268e 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)

Pick-to: 6.4
Fixes: QTBUG-77210
Change-Id: I812bc324f49ae28b8c622cfa89f9690e012bf216
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-19 12:14:43 +10:00
Thiago Macieira
823b7c7bce QLibrary: fix load() after a failed load()
Regression introduced by commit 8d4eb292b2
in 6.0, when QTaggedPointer was introduced. We set the tag even when the
loading failed and failed to reset it because d = {} retains the tag.

Pick-to: 6.2 6.4
Fixes: QTBUG-103387
Change-Id: Ie4bb662dcb274440ab8bfffd170a07aa9c9ecfca
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-18 17:10:42 -07:00
Thiago Macieira
636dbe6045 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.

Pick-to: 6.2 6.4
Change-Id: I12a088d1ae424825abd3fffd171d133c678f910a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-10-19 00:10:42 +00:00
Mikolaj Boc
9c6b8ea290 Add the toDOMRect/fromDOMRect functions to QRectF
These are very helpful when converting to and from DOMRect.

Change-Id: I4a7fc6318f45bed8e2b82fd5d6ec174dc1762326
Fixes: QTBUG-107740
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-10-19 00:19:11 +02:00
Ben Fletcher
fda5061abd RHI: Align setViewport behavior on Metal/Vulkan with OpenGL/D3D
Fixes to prevent crash on Metal/Vulkan when setViewport is called with no current graphics pipeline is set. This normalizes behavior across Metal/Vulkan/OpenGL/D3D.

Change-Id: I8057e01005cfe89ea02a8415f06eaee0f27865fc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-18 22:17:15 +00:00
Timur Pocheptsov
f50f6a456a 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.

Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-79977
Change-Id: I9bf38bdf540f1f1dbe42b86df94d6a1b4694e9f2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-19 00:10:09 +02:00
Shawn Rutledge
bb1f616ff1 Add flicking behavior hints to platform integration and theme
These will be used in QtQuick Flickable.

Flickable.flickDeceleration is a sort of friction, the rate at which a
flick will decelerate when the user is flicking on a touchscreen or
rolling a clicky mouse wheel, and then flicking stops. So far, the
default has always been 1500 (defined in qtdeclarative), which (everyone
seems to agree) prevents Flickable from slowing down reasonably fast
when scrolling stops. So let's try 5000 logical pixels / sec² as a
default, and each platform will be able to customize it. The docs
already say "The default value is platform dependent"; now it can come
from StyleHint::FlickDeceleration.

FlickMaximumVelocity: the units are in logical pixels / sec. The default
has always been 2500 in qtdeclarative, but there were some early
complaints that Flickable was too slow on Android, for example (which
were somewhat mitigated by DPI conversions). So now that also becomes
adjustable on each platform (although really, it should be mainly the
DPI that matters, because the user's perception is in actual distance
moved per second).

FlickStartDistance is how many logical pixels the Flickable must be
dragged by a finger before it begins the animation to keep moving when
the finger is lifted. (Analogous to StartDragDistance for mouse-drags)

[ChangeLog][QPA] Added platform FlickStartDistance, FlickMaximumVelocity
and FlickDeceleration hints for the benefit of QtQuick Flickable

Task-number: QTBUG-35608
Task-number: QTBUG-35609
Task-number: QTBUG-52643
Task-number: QTBUG-97055
Change-Id: If50c1de895c127f4b0ab0634c865f469a38e08ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-18 20:22:32 +02:00
Timur Pocheptsov
942abaae59 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
Pick-to: 6.4 6.2
Change-Id: Ice42c787ec65d89c1c15f9c89462b7804aafe51c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-18 18:55:32 +02:00
Thibaut Cuvelier
e8d6accb93 Fix a typo in a comment
Change-Id: I3ff1bd0d00fd56fa980bc86f71c557f8f833cb45
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-10-18 18:09:55 +02:00
Ievgenii Meshcheriakov
dd0eb89d2e QNetworkReply: Fix typos in the documentation
Fixes: QTBUG-107719
Pick-to: 5.15 6.2 6.4
Change-Id: Ic5bbc59aebeb44595cfde000bfd1cfb28991d311
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-18 18:09:55 +02:00
Timur Pocheptsov
9e5e330a09 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).

Pick-to: 6.4 6.2 5.15
Change-Id: I7855fd7c24ebfc28fbb912966f8010caba914fe7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-18 16:15:51 +02:00
Thiago Macieira
d9280bb63b tst_QSet: fix flakiness after we removed the fixed, non-zero seed
The "qhash" test relied on the fact that those four elements would
produce a different order with a zero and a non-zero seed. But since
commit b057e32dc4 removed the setting of a
deterministic non-zero seed, this test had a 1 in 4! chance of failing.
Since 4! = 24, 128 retries should be more than enough to ensure we do
find at least hash seed that provokes a different order.

Fixes: QTBUG-107725
Change-Id: I3c79b7e08fa346988dfefffd171ee61b79ca5489
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-10-18 14:15:51 +00:00
Eskil Abrahamsen Blomfeldt
6ba003f732 Freetype: Fix transforming bitmap fonts
Freetype itself does not support transforming bitmap fonts, so
FT_Set_Transform() is just ignored in this case. This causes
problems in particular for fonts rotated at 90 degree multiples
when used as tab labels. So we need to rotate the actual glyph
images after they have been rasterized instead.

Since we do have most of the mechanisms in place for this when
using the regular glyph cache, we set cacheEnabled to false
for all non-scalable fonts to ensure we take the correct code
path.

In addition, we need to transform the alpha maps before
returning them.

Note: This changes the glyph format to alpha8 for the glyphs
when they are transformed. This is a simplification because
the mono code path requires that glyph widths are aligned
to 8, so there would be more adaptation needed if we wanted
to use this code path. This will only affect non-antialiased
fonts that are drawn with a transform.

[ChangeLog][QtGui][Text] Fixed an issue with the Freetype
backend where rotations would not be applied correctly to
bitmap fonts.

Fixes: QTBUG-81540
Change-Id: Ia68815b425ca1776a5ff81d26d227569467095cf
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2022-10-18 16:15:51 +02:00