Commit Graph

58772 Commits

Author SHA1 Message Date
Johannes Kauffmann
60de00cb2f qfilesystemengine: port to qsizetype
Task-number: QTBUG-103525
Pick-to: 6.2 6.4
Change-Id: If17227630d48f8170c5ec08ba6bed6baaad5582b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-25 16:39:25 +02:00
Johannes Kauffmann
e38a48200b qlogging: use qsizetype to fix Wconversion warnings
While the strlen() calls don't raise warnings themselves, it seems like
they were artifacts of indexOf() returning int instead of qsizetype.

Task-number: QTBUG-103527
Pick-to: 6.2 6.4
Change-Id: I32fbf69feca38a5977dde084bef9993f24843ccf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-25 16:39:25 +02:00
Morten Sørvig
4711f078b7 wasm: disable run-time check for specialHTMLTargets
Recent versions of Emscripten may abort if module_property()
is used to look up specialHTMLTargets, which makes run-time
checking impossible. The abort is implemented on the JS property
getter on the Module object, which means that it's not possible
to bypass this by using e.g. EM_ASM instead of the C++ API.

Disable usage of specialHTMLTargets on emsdk > 3.1.14 for now,
until we can add API (or find some other means) for opting in.

This commit also adds functions for comparing Emscripten
versions.

Pick-to: 6.4
Change-Id: Ibe5d1a82f267fa95dd62cdfc66595bc23036933f
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-10-25 14:39:24 +00:00
Alexey Edelev
683936d3cb Move install paths from CoreConfigExtras.cmake to a separate file
Move install paths from CoreConfigExtras.cmake to a separate file
for the easier usage. This specifically can be useful to detect
read required paths for android deployment in multi-ABI builds.

Change-Id: Iacdf3a8d3ae7615ac6669a067e6f12bdf5043d5a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 16:05:11 +02:00
Laszlo Papp
faeeb42b85 Add a shortcut editor example
Many applications offer shortcuts for quick interaction with the
application. It is also common in such applications to offer a shortcut
editor in the preferences or separately in a dialog.

However, even though this is a fairly common use case for applications
with more than a couple of shortcuts, there is no good and comprehensive
official Qt example how this could be achieved.

This change is an attempt to bridge the gap.

Change-Id: Ic01a404e6157bda1b0a75a0b792cbfe5d910d48f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-10-25 14:38:46 +01:00
Joerg Bornemann
f263211484 Mark *deployqt tools as user-facing and install versioned links
All *deployqt tools are user-facing and should have a versioned link in
the installation prefix.

Change-Id: I26dde529657da0a68401e4fd721926d9978eb879
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 15:38:46 +02:00
Jani Heikkinen
283e29e539 Revert "Android: fix Android assets handler not listing dirs with only sub dirs"
This reverts commit 89f89cedc0.

Reason for revert: QTBUG-107879

Task-number: QTBUG-107627
Fixes: QTBUG-107879
Change-Id: I31ceec5156837281b25fd17024c01e3477550ce0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-25 13:38:46 +00:00
Laszlo Agocs
2c639aea76 rhi: Add a manual test for simple stencil-based outline
Interesting on its own just because it exercises stencil testing,
unlike any of the other existing manual tests.

In addition it serves as a base example for how outlines could be
done, it is one possible approach at least. (render with stencil
write, then render again slightly scaled up with a solid color with
testing against the stencil buffer content)

Change-Id: I0c845a9004136f229cab037f6f0aab2f772bdd76
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-10-25 15:19:41 +02:00
Laszlo Agocs
ef2cef49a3 vkmemalloc: Disable more warnings
Change-Id: Ifedd263cb39ebad6babdab7687a22ad23f2c9471
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-10-25 15:19:41 +02:00
Mårten Nordheim
481fb5a06a Allow specifying different linkers for MinGW
Locally I cannot build Qt with the default ld linker.
Only enabled bfd and lld because mold and gold is not available
for Windows.

Pick-to: 6.4 6.2
Change-Id: Ib57562b07219acc47f53fe5b0944f54d9c2a6ba6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-25 13:19:41 +00:00
Mårten Nordheim
ba4710a33f qtwindowsglobal: Fix mixed-enum operations warning
With c++20 doing operations between different enums is
warning(-as-error).
Declare operator-overloads for a particular pair of enums to make this
compile again. Requires giving one of them a name as it was previously
unnamed.

Pick-to: 6.4 6.2
Change-Id: I23296117b6d9a84273da6639582e075d631e5602
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-25 15:19:41 +02:00
Mårten Nordheim
70d2437e6f qwindowstheme: Remove unused function
Causes warnings(-as-errors).

Pick-to: 6.4 6.2
Change-Id: I77a40d9427cba277012a8343d6badd2c932798af
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-25 15:19:41 +02:00
Harald Sitter
75e8754875 a11y: support GetAccessibleId for at-spi
This introduces a new helper function accessibleIdForAccessible
(inspired by Windows' automationIdForAccessible) to synthesize an id out
of the objectNames of the accessible parent chain. The id is then
exposed via the GetAccessibleId D-Bus function for consumption in a11y
tools.

Change-Id: If72b86c5864c43f4ca842aa11423dd8aea0dde4a
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2022-10-25 15:19:41 +02:00
Mikolaj Boc
c938752bd1 Use the correct way to check for Asyncify
Asyncify is a scoped object within emscripten runtime main function.
Use of EM_JS seems inevitable at this point.

Change-Id: I4852a7054a5e01583139cb54a0e14f604ac8ed13
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-25 13:54:21 +02:00
Alexey Edelev
54c959643e Add Qt plugins to the dependency list with their dependencies
In androiddeployqt we try to add all plugins that belong to the Qt
modules that Android application links. This works in case if all the
plugin dependencies are linked to the Android application explicitly
or implicitly using a build system linking mechanism. But plugins may
have dependencies that should be resolved implicitly by
androiddeployqt. The following situation is handled by this change:

 App1 links QtLib1.so
 QtLib1.so promotes its plugin plugin1.so to be included to an apk
 plugin1.so links QtLib2.so

In the described example App1 expects that plugin1.so with all the
dependencies is deployed to an apk without the need of linking
QtLib2.so explicitly.

There is a negative side effect of this change. plugin1.so is added to
apk unconditionally so there could be a situation when the plugin is
unused. So QtLib2.so with its dependencies will be included to an apk
without necessity and will increase the size of the apk significantly.

Cleanup forward declarations in androiddeployqt's main.cpp by moving
them to the top of the file.

TODO: Need to add the API which allows to exclude such plugins from apk
or to specify the list of essential plugins that are used in the
Android application. See QTBUG-107634 for details.

[ChangeLog][Android] All plugins that belong to the Qt modules that are
linked to the Android application are now deployed with their
dependencies. androiddeployqt tries to find and resolve plugin
dependencies implicitly instead of skipping plugins with dependencies
that are not resolved explicitly in the user project.

Fixes: QTBUG-107589
Fixes: QTBUG-106035
Change-Id: Ib6d9abd74ae5e21e856d7ccd02789a7a65602f40
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-25 13:54:21 +02:00
Volker Hilsheimer
b3ce494bac Windows 11: draw checked menu items with an explicit background
On Windows 11, the UXTheme API draws both MBI_PUSHED and MBI_HOT in the
exact same color as the icon grove. For menu items with icon, but with
no explicit "On" icon, that makes it impossible to see whether the item
is checked.

Work around this problem by drawing the background in a light version of
the highlight color, which simulates the style on Windows 10.

Note: In modern Windows 11 menus, checkable items with icons render both
the checkmark, and the icon next to each other.

Pick-to: 6.4 6.2
Fixes: QTBUG-98354
Change-Id: I830eca5cdb3317f69dd5c863586e0b0eaa8774d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-25 13:54:21 +02:00
Tor Arne Vestbø
91e7925dde Fix build with -no-feature-highdpiscaling
Fixes: QTBUG-107054
Change-Id: Ie9fd57e8a97c94365ec9e170088af0a82c5e7ba3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-25 12:52:06 +02:00
Fabian Kosmale
3be1509013 QProperty: Update documentation to reflect eager evaluation
Amends cf42a0fe5e.
As a drive-by, reflow the documentation, and mark some code segments
with \c

Change-Id: Id644e841f9990dd7aec2d7ce74efad8b4472b93a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-10-25 12:52:06 +02:00
David Redondo
bb18767af1 Add QNativeInterface::QWaylandApplication
This exposes the same objects that were ere available through
QPlatformNativeInterface except egldisplay for which we may find
a better place.

[ChangeLog][QtWaylandClient][QGuiApplication] Add
QNativeInterface::QWaylandApplication
that allows to access central native wayland objects.

Task-number: QTBUG-94729
Change-Id: I8611522a4c9bddec3afbb5f183ffa68565f61f68
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
2022-10-25 12:52:05 +02:00
Amir Masoud Abdol
3b9330cd40 Replace arg_BIG_RESOURCES with rcc_BIG_RESOURCES
This fixes a typo in the name of the variable, `arg_BIG_RESOURCES`, as
it should be `rcc_BIG_RESOURCES` instead, because `rcc` is the prefix
given to the corresponding `cmake_parse_arguments`.

Fixes: QTBUG-107575
Change-Id: I1ef276ed90f8603121d1dc6e117c02ff821900ef
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-10-25 10:06:59 +00:00
Tor Arne Vestbø
4709c938db Apple: Add CFBundleAllowMixedLocalizations=YES to Info.plist files
We currently don't have any machinery for qmake or CMake to map
translations declared via TRANSLATIONS += or qt_add_translations
to the Info.plist CFBundleLocalizations key.

This results in macOS and iOS falling back to the development region,
CFBundleDevelopmentRegion, as the only supported localization of the
app, which is in most cases set to 'en'.

Unfortunately this doesn't work well with the behavior of iOS 11+
and macOS 10.13+ where the OS will set the locale of the app to
the best match between the app's supported localizations and the
user's preferred language.

https://developer.apple.com/library/archive/qa/qa1828/

Since we only support a single localization, the development region,
the locale always ends up as 'en_<REGION>', which after QTBUG-104930
is also reflected in the QLocale's uiLanguages(), resulting in the
QTranslator machinery always picking English translation for the app.

As long as we don't explicitly declare CFBundleLocalizations we need
to opt out of the system's behavior of finding the best match between
the app's declared localizations and the user's preferences, which we
can do via the CFBundleAllowMixedLocalizations key.

Fixes: QTBUG-63324
Pick-to: 6.4
Change-Id: If7586d342148cbbb1d2a152cef039aad4448b13c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-25 10:06:59 +00:00
YAMAMOTO Atsushi
fe0e76a582 Fix typo in examples/i18n
The name of the variable that handles the qm file is qmlFile.

Change-Id: I873c73cd8f96ff821fe3d2e633e84fef8c687875
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-25 10:06:59 +00:00
Mikolaj Boc
d553ec049d Make Qt on WASM correctly draw windows with QT_SCALE_FACTOR
The GUI scale factor was taken into account twice, once in
QBackingStore::resize and then again implicitly in
QWasmBackingStore::resize, through window()->devicePixelRatio(),
which contains it as one of its multipliers.

Fixes: QTBUG-80992
Pick-to: 6.4
Change-Id: I75ac8d85c14230207379b789834256de4254811b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-25 08:08:32 +02:00
Thiago Macieira
739fb98233 QBenchlib: stop exporting {begin,end}BenchmarkMeasurement
I don't see anything using them in any unit test or other Qt module, and
they are marked internal.

Change-Id: I3c79b7e08fa346988dfefffd172028dae6d9e1ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-24 21:00:11 -07:00
Thiago Macieira
1a769c36e4 QBenchlib: remove unused checkpoint() virtual
It was probably part of the original design to have an intermediate
measurement to determine whether the results were acceptable or not, but
it was never used. So just remove.

Change-Id: I3c79b7e08fa346988dfefffd1720281b2512b8c1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-10-24 21:00:11 -07:00
Thiago Macieira
148c3eaa29 QBenchlib: remove unused repeatCount() virtual
It's not called.

Change-Id: I3c79b7e08fa346988dfefffd172026d41b70ad6f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-24 21:00:11 -07:00
Thiago Macieira
ef6b5fe63f QBenchlib/Perf: remove ioctl(FD_CLOEXEC)
Commit 8995045c62 forgot to remove this
portion.

Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd17202b19665ddc8a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-10-24 21:00:11 -07:00
Thiago Macieira
e693a5ccaf QBenchlib/Perf: use WalltimeNanoseconds for the task time
Avoids the special case in the code and removes the need to run a large
number of iterations to get any useful result, plus makes it's more
readable:

From:
    0.00002125 msecs per iteration (total: 2,125, iterations: 100000000)

To:
    22.082 nsecs per iteration (total: 22,082, iterations: 1000)

Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd171facc98af9e9fc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-10-24 21:00:11 -07:00
Volker Hilsheimer
483ae6c448 StyleSheet: use item background rule when filling row backround
QTreeView draws the different sub-rects of an item's background over
multiple calls to drawPrimitive(PE_PanelItemViewRow). The item row is
not separately stylable, but the item might have a styled background
property. To get a consistent background, we must use the item's
background rule when filling the item's row background.

To fix that, delegate the filling of the branch background to
drawPrimitive(PE_PanelItemViewRow), and implement PE_PanelItemViewRow
handling to render the rule for the ViewItem pseudo element if there is
a background rule defined for it.

Add a baseline test stylesheet for this scenario. Note that the selection
in an item view is better styled via the selection-background-color
qss property.

Task-number: QTBUG-73251
Task-number: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: I5d0c170f78009fe5015dd749975e6df27485b3b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-25 05:16:15 +02:00
Volker Hilsheimer
6f9d31be49 Baseline: add stylesheet setting show-decoration-selected for treeview
The fix for QTBUG-73251 in f4976f86cd
resulted in QTBUG-106227. Add baseline test coverage for the respective
configuration to make sure we don't regress.

Refactor mapping of index to configuration to make accessing of subitems
more robust.

Task-number: QTBUG-73251
Pick-to: 6.4 6.2
Change-Id: I530ecd67fa5663f219884f641bc5e25c7ac5fe73
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-10-25 05:16:15 +02:00
Eirik Aavitsland
273b13dbd1 Initialize flag memory in raster paint engine to avoid valgrind warning
After a new flag bit was added in 6.4, so that the flags no longer
exactly fills a byte, valgrind will sometimes give a "... depends on
uninitialised value" warning.

Fixes: QTBUG-107649
Pick-to: 6.4
Change-Id: Iaaf5ae7bba3ce2476be5b2277839cad1d18aa55f
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2022-10-24 23:43:28 +02:00
Christian Ehrlicher
05ec29f76c SQL/Tests: fix tst_qsqldatabase::caseSensivity() for MySQL on linux
MySQL has a different default setting for case sensitive table names on
linux and windows which makes the test fail on linux but work on
windows when using the database with the default settings. Read out the
respecitive setting so the test will pass every time.

Change-Id: I8651858d47652022ddc4b6386a6153cf70c6fed6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-24 19:08:17 +00:00
Volker Hilsheimer
16e0e7c779 QTreeView: fix drawing of background for alternate rows
After f4976f86cd we never called the style
to draw the background of rows, unless ShowDecorationSelected was set.
This broke rendering of alternate row backgrounds, as painting that
background for the item's decoration was done by the style function that
was no longer called.

QStyleOptionViewItem::showDecorationSelected should store the value from
the widget's style and be used by the style when rendering. This avoids
that a style sheet is ignored when we are already in the virtual table
of the parent style. However, in that style option we conflate both the
style hint, and whether the entire row should be selected when the
selection behavior is SelectRow (as we then need to draw selection in
the first column all the way to the second column, not just around the
text).

To fix this, override the showDecorationSelected back to the style hint
value while we are only painting the background, and reset it back
before calling the delegate to draw the rest (including the selection).

This reverts f4976f86cd.

Fixes: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: I5c1ecdf0a0e07b156f35f4e5614593a984754a34
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-24 14:20:35 +02:00
Volker Hilsheimer
94039c9a6a Baseline test: add coverage for treeview with alternate rows
After f4976f86cd, alternate rows are no
longer painted all the way, as the code is never called for styles that
don't include the tree item decoration in the selection, such as the
Windows styles.

Add a baseline test to record the appearance of such trees.

Task-number: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: If21076393fdf65205cab91299f8e557dbe9c4ea9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-10-24 14:20:28 +02:00
Yuhang Zhao
bea5649cd1 Windows: bump NTDDI_VERSION to latest version and remove some duplicated code
We have NTDDI_WIN10_NI (0x0A00000C) in the Win11 SDK (10.0.22621)
so bump the value in Qt (currently 0x0A00000B) to it.

And when searching for _WIN32_WINNT/WINVER/NTDDI_VERSION throughout
the whole qtbase codebase, I found some duplicated code, mostly
leftovers from the legacy time. Replace them with our own windows
header can achieve the same effect: we have defined all the necessary
macros to unblock the latest features. And place the header at the
top most place to include the macros as early as possible.

Change-Id: I37d9ac40ca9748208c7b2e89f374eda362dbefd6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-10-24 13:22:24 +08:00
Yuhang Zhao
0ae36affed Remove unimplemented function from WinVistaStyle
The implementation of the "scrollBarGripperBounds" function originally
lies in the Windows XP style source code, it was totally removed during
the previous refactor commit, but the function declaration was not
removed at the same time. We need to either remove the declaration or
bring back it's implementation, but since we don't use this function
at all (otherwise there will be link errors), it's better to just remove it.

Amends commit 46f98147f4

Change-Id: I76444d63966f1007114d090837092ea11fda0ccb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2022-10-24 10:05:46 +08:00
Eirik Aavitsland
50120efc50 Doc: Add possible fill rule requirement for QPainterPath text drawing
Task-number: QTBUG-107782
Change-Id: I75b77f076123fb659220ebfb0b9240a412de4cd5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-23 22:43:27 +02:00
Ahmad Samir
1e387cf800 QString: use '\0' instead of 0
Matches other places in the code.

Change-Id: I5ede3a52875235cc6355f651b7205b7c5ed46d90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-23 21:57:36 +02:00
Tor Arne Vestbø
449b45ff34 Emit aboutToQuit from QCoreApplication::exit() instead of execCleanup()
The aboutToQuit signal is documented to be emitted "when the application
is about to quit the main event loop", which is useful "if your application
has to do some last-second cleanup", and is recommended over "putting it in
your application's main() function because on some platforms the exec() call
may not return".

However, if we're on a platform where the exec call may not return, it
will be because the event dispatcher's exec doesn't return, which means
we'll never get out of the call to eventLoop.exec(QEventLoop::ApplicationExec)
and into the execCleanup() code.

In addition, on macOS, where we do currently return to main(), we do so
by telling the platform to cancel the application termination, by returning
NSTerminateCancel from applicationShouldTerminate, after running the quit
logic of Qt via QWindowSystemInterface::handleApplicationTermination().
In the case of quitting applications due to system logout/shutdown, this
cancellation brings up a dialog saying the Qt application interrupted the
process, which luckily disappears again as soon as the application
actually terminates via main(). Moving the emit of aboutToQuit() earlier
in the flow, before we've cancelled the application termination, reduces
the chance that long running code triggered from this signal will keep the
dialog visible to the user.

Task-number: QTBUG-102321
Change-Id: I362737e9563069fc02b1e9639e1251d655d13949
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-23 21:17:09 +02:00
Tor Arne Vestbø
d84ddf5905 Apple: Use 'en' instead of 'English' as development region
This is consistent with what $(DEVELOPMENT_LANGUAGE) reports, as well as
the Apple Locales Programming Guide which states that "Locale names such
as “English”, “French”, and “Japanese” are deprecated in OS X and are
supported solely for backward compatibility."

Pick-to: 6.4
Change-Id: I99779d678ef9d4ea90249572f2f977e9b4df6c62
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-10-23 17:36:46 +02:00
Volker Hilsheimer
a8c6958a87 Add QPlatformTheme::MenuBarFocusOnAltPressRelease
On Windows, pressing and releasing the Alt key moves focus to the
menubar. This is implemented in widgets, but not in Qt Quick.

Add a new theme hint so that we can make Qt behave natively on all
platforms, and make the common style's respective styleHint default to
the theme hint.

Change-Id: I101bec56afd51e81ebb128c288f8a1e9b7efedb4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-10-23 13:04:02 +02:00
Shawn Rutledge
c3e2a624fb QApplication: send QHoverEvents with correct scenePosition()
The QHoverEvent ctor takes two points: pos and globalPos; pos is then
passed as both the scene and global pos to the QSinglePointEvent ctor,
which calls QMutableEventPoint::setScenePosition() on the persistent
QEventPoint instance and then detaches befeore setting ephemeral state.
Therefore, we must construct QHoverEvent with scene position first, not
local position, so that the right value is persisted; it's better to set
local position after the detach(), whereas it's too late to fix the
persistent point then.

Pick-to: 6.4
Fixes: QTBUG-106918
Change-Id: I45726a9ec05bba2fe0cde6f5fb87c269105caca6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-23 09:28:45 +02:00
Peter Varga
55449a6528 Fix bool comparison in tst_qopenglwidget.cpp
This commit amends 1ea73bc29b

Pick-to: 6.2 6.3 6.4
Change-Id: I02000f86ff030ad369ccef1d4488ad22558eb974
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-10-23 00:14:15 +02:00
Timur Pocheptsov
6c2387571a 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 d42cfeb84f
for 'Edit' menu - we call insertDefaultEditItems.

Pick-to: 6.4
Fixes: QTBUG-104709
Change-Id: I8fee93c43e7cf974f94d173cd53adf8097b263e0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-22 19:33:28 +00:00
Harald Sitter
a7bd656cf4 offer an opt out of automatic xdg-desktop-portal use
this allows users to skip over the portal invocation if it is
undesirable (e.g. during early stages of session setup on KDE's Plasma)

Change-Id: I43e3c3a59b9bb71c77012f8f0ec7ad7ba904a050
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2022-10-22 17:35:49 +02:00
Eirik Aavitsland
311e508154 jpeg handler: store Grayscale16 format images as grayscale, not rgb
No point in storing multiple channels when we have single channel
data. And as jpeg anyway has only 8 bpc, information loss is
unavoidable, so just convert to Grayscale8 and store as that.

Fixes: QTBUG-107810
Change-Id: Ib62038acf07d4b875b8416825fb0095510c14b5b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-10-22 13:32:52 +02:00
Christian Ehrlicher
7d99fa8e5b SQL/MySQL: rework driver option parsing
Rework the parsing of client option to make it easier to add new
options. Add the two options MYSQL_OPT_SSL_CRL and MYSQL_OPT_SSL_CRLPATH
and deprecate the SSL_foo options without the MYSQL_OPT_ prefix.

Change-Id: Ibaf5f553d77d9c102ca2bfef2fe68be0572f594b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-22 09:45:13 +02:00
Kai Köhne
603ff45228 syncqt: Do not needlessly rewrite header files on Windows
SyncScanner::writeIfDifferent compares the size in the buffer with
the size of the existing file on disk to see whether the file should
be rewritten. However, on Windows the sizes hardly ever matched, because
the implicit \n to \r\n conversion only happened when writing the file
in text mode using ofstream. Take this into account.

Change-Id: Ic689390396fcc3a640640378743bd058f48a1779
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-10-21 19:47:00 +02:00
Peter Varga
600752aa97 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.

Pick-to: 6.4
Fixes: QTBUG-107629
Change-Id: Ia6a1b90fba6c43b6872b406f4fd946d937135cf8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-21 19:11:51 +02:00
Mikolaj Boc
2c8cf8eb42 Fix the workaround in ~QWasmOpenGLContext
The workaround stopped working because JSEvents is now not a global
object. Update the workaround by exporting the JSEvents object from
emscripten runtime and replacing the function that removes the
event handlers to a dummy function that does nothing temporarily, only
to revert it when the context is destroyed.

Fixes: QTBUG-107197
Pick-to: 6.4
Change-Id: Icceae884c85e04fdafcca6cf3c563094d3f6f0dc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-10-21 18:02:34 +02:00