Commit Graph

58744 Commits

Author SHA1 Message Date
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
Mikolaj Boc
e487b07e18 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.

Pick-to: 6.4 6.4.0
Fixes: QTBUG-107539
Change-Id: Idf75bd80033a44c34af6837cd4d65b75c183d886
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-10-21 16:02:34 +00:00
Maxime Roussin-Bélanger
3f8e3c3335 dbus: use same type of matching quotes
There is no reason to use different style of quotes when printing
messages.

Change-Id: I7d513ec04c803702974054569d28f26947942fbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-10-21 12:02:34 -04:00
Assam Boudjelthia
89e92a11e7 Android: fix include statement for Android Extras classes
use \inheaderfile QtCore/private/qandroidextras_p.h to override the
default include statement.

Pick-to: 6.4 6.2
Change-Id: I6ab691fc23d04b5f174729e9828039153bc05d1e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-10-21 16:54:29 +03:00
Assam Boudjelthia
89f89cedc0 Android: fix Android assets handler not listing dirs with only sub dirs
Amends edd983071e.

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
Pick-to: 6.4 6.2 5.15
Change-Id: I37ae9cb64fbbc60699bb748895f77fd6a34fae1f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-21 16:54:29 +03:00
Laszlo Agocs
d59b2fde5e 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.

Pick-to: 6.4
Fixes: QTBUG-107814
Change-Id: I98fe866d6c857343f25f39450ee60fd307bcdb63
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2022-10-21 15:36:26 +02:00
Eskil Abrahamsen Blomfeldt
65279d6e9d 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.

Pick-to: 5.15 6.2 6.4
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>
2022-10-21 14:43:21 +02:00
Volker Hilsheimer
933eb68a9d 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
Pick-to: 6.4
Change-Id: Ifcdec53ec3f8a0236d849a0b72a71afbd03d8290
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-10-21 14:43:21 +02:00
Liang Qi
63cfab628a 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
Pick-to: 6.4 6.2
Change-Id: I82523080db40bddce9c9dc000433117d8ef74847
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-21 13:58:19 +02:00
Liang Qi
d8c078c2b6 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
Pick-to: 6.4 6.2
Change-Id: I013651b0e5e7618c29742effd85a091ca95a7414
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-10-21 13:58:19 +02:00
Luca Di Sera
e2fef733be Replace usages of Q_CLANG_QDOC with Q_QDOC
To allow the user to customize the C++ code that QDoc sees, so as to be
able to work-around some limitations on QDoc itself, QDoc defines two
symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an
entire execution of QDoc.

At a certain point in time, QDoc allowed the user the choice between a
custom C++ parser and a Clang based one.

The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol
would be defined only when the Clang based parser was chosen.

In more recent times, QDoc always uses a Clang based parser, such that
both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent.

To avoid using different symbols, and the possible confusion and
fragmentation that derives from it, all usages of Q_CLANG_QDOC are now
replaced by the equivalent usages of Q_QDOC.

Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-10-21 09:48:36 +02:00
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