Commit Graph

61973 Commits

Author SHA1 Message Date
Ahmad Samir
8d127c5737 QMimeData: de-duplicate some code
- Fix integral narrowing conversion issues by using range-for
- Use QByteArrayView

Change-Id: Ib45c7d6d8ca27c347324b4b259f25282bc84ff3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-06-08 03:09:52 +03:00
Ahmad Samir
aa481854a9 QUrl: Add QUrl::fromEncoded(QByteArrayView) overload
Copy \note about backwards compatibility from
QMessageAuthenticationCode (with minor changes).

[ChangeLog][QtCore][QByteArray] Added QUrl::fromEncoded(QByteArrayView)
overload.

Change-Id: I8a190db2d50467e6191caf0abfe975b8fc656eb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-08 03:09:52 +03:00
Thiago Macieira
533a0d5e54 forkfd: Add support for eventfd(2) in FreeBSD
Drive-by make the code slightly nicer.

Change-Id: Idd5e1bb52be047d7b4fffffd174db9162cf697a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 17:09:52 -07:00
Thiago Macieira
4e2f8bad0a QElfParser: use ELFOSABI_LINUX instead of ELFOSABI_GNU
It seems to be the preferred constant in other OSes. In particular,
OpenBSD does not appear to have ELFOSABI_GNU[1]. Found while researching
if commit 9caac0f176 was still necessary
for OpenBSD.

This reverts commit ded2fd9ff4, which
implied NetBSD 9 doesn't have ELFOSABI_GNU either.

[1] https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-src_corelib_plugin_qelfparser_p_cpp

Pick-to: 6.5 6.6
Change-Id: I63b988479db546dabffcfffd17662020d722af20
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-06-07 17:09:52 -07:00
Thiago Macieira
b1816c2718 QElfParser: fix build if EM_S390 is not defined
Found in the OpenBSD ports patch collection[1] while researching if
commit 9caac0f176 was still necessary for
OpenBSD. They should upstream their changes instead of working around...

[1] https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-src_corelib_plugin_qelfparser_p_cpp

Pick-to: 6.5 6.6
Change-Id: I63b988479db546dabffcfffd17662042c7130f7c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-06-07 17:09:52 -07:00
Thiago Macieira
604eb6f4cd CMake: apply OpenBSD patch to enable $ORIGIN
Found at https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-cmake_QtRpathHelpers_cmake

There are a lot more patches there whose purpose I can't tell. This is
the only CMake one that I do understand. They should upstream those
changes to us with an explanation, instead of carrying patches...

Found while researching if 9caac0f176 was
still necessary for OpenBSD.

Pick-to: 6.5 6.6
Change-Id: I63b988479db546dabffcfffd17661fdd376bf8c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-07 17:09:52 -07:00
Thiago Macieira
f992402f15 tst_QProcess: move the crasher code to a header
So I can use it in tst_QProcess itself.

This also modernizes it a bit by using __builtin_trap() where available.
On x86-64, this expands to the ud2 instruction.

Pick-to: 6.6
Change-Id: Ib5ce7a497e034ebabb2cfffd176288433378731b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 17:09:52 -07:00
Amir Masoud Abdol
1dfa922606 Remove the manual undef of the min/max macros, or def NOMINMAX
We now add NOMINMAX to PlatformCommonInternal target which will be
linked to everything else, so min/max will not be defined upon the
inclusion of `windows.h`, or other headers.

Pick-to: 6.5 6.6
Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-08 01:18:04 +02:00
Amir Masoud Abdol
076b4bed9f Resolve an issue when running /qt-configure-module .
Accounting for the case where `MODULE_ROOT` is set to `.` which then
makes the `get_filename_component` command to return an empty string;
consequently, we cannot find the `config_file.txt`, and cannot process
the features correctly.

Amend f4bf7982a6

Pick-to: 6.5 6.6
Fixes: QTBUG-114085
Change-Id: I55c7529be6caba4691adec80efca8021bd03c500
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-08 01:18:04 +02:00
Amir Masoud Abdol
48014f99dc Remove an unused variable
Pick-to: 6.5 6.6
Task-number: QTBUG-109394
Change-Id: Ib1099e3d4091b0b222e405ce25b5e680f0514476
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-07 23:18:04 +00:00
Amir Masoud Abdol
b738ad7e3a Fix an issue with processing -prefix paths ending with \ on Windows
In cases like `C:\` or `C:\D\E F G\`, we had the issue were Windows'
path separator was acting as an escape and was corrupting configure
arguments', so, we were ending up with `-DCMAKE_INSTALL_PREFIX=C`, or
were cutting the argument list short, and ended up ignoring some of the
arguments.

Pick-to: 6.5 6.6
Change-Id: I433af61d5c143cc37a64dcf8ac82a1a78ce543a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-08 01:18:04 +02:00
Amir Masoud Abdol
958c12273a Add Unity Build to config.summary
Unity Build was missing from the `config.summary`. This fixes that.

Pick-to: 6.5 6.6
Task-number: QTBUG-109394
Change-Id: Icd9898956ec1a5332297272130bce27d4d2675ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-07 23:18:03 +00:00
Marc Mutz
f5ed163c19 QString: add STL-style assign() [2/4]: (it,it) overload for QChar-convertible *it
Restrict the permissible value_types to those QStringView can take,
plus QLatin1Char. All of these implicitly convert to QChar and give
the correct result, even when converted char-by-char.

Task-number: QTBUG-106198
Pick-to: 6.6
Change-Id: Icb44244cb08af391161c4309467d4e0d2d3d3d62
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2023-06-07 23:18:03 +00:00
Timothée Keller
245c2b621f Windows QPA: Fix restore geometry after dragging from maximised - Fix
Small adjustment made to previous patch to fix the following issues:
- restoreGeometry not being updated after moving the window from one
screen to the other with keyboard shortcuts.
- restoreGeometry's size not being changed when moving screens if
WM_GETDPISCALEDSIZE isn't sent.

Pick-to: 6.6 6.5
Task-number: QTBUG-112814
Change-Id: I9dd2340137ce57a731f8881d476e902323887e62
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-06-07 21:41:55 +00:00
Timothée Keller
f4d6d04898 Windows QPA: Change monitor index detection
Monitor index detection changed from comparing deviceNames to comparing
serialNumbers, to prevent the case where two monitors with identical
names might overwrite one another.

Fixes: QTBUG-112829
Pick-to: 6.6 6.5
Change-Id: Ibfad08e178774396c4b347acfcfbdb83ed4fe332
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-06-07 17:31:19 +00:00
Axel Spoerl
c153066baa QDockWidget: Propagate window title when re-docking
When a floating dockwidget's title changes, it is rendered as a
window title. When the title changes while floating, the change will be
reverted to the pre-change title when the dockwidget is docked again.

This patch explicitly propagates the window title, if it has been
programmatically changed while the dock widget is floating.

It adds test functionality in tst_QDockWidget::floatingTabs().

Fixes: QTBUG-113591
Pick-to: 6.6 6.5
Change-Id: I96fa69fb27ad1a85f4ea9ce44c0a22290259fca6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 18:46:56 +02:00
Sze Howe Koh
5a2474b2dd Doc: Clarify how to use QPainter with QTextEdit
The documentation suggests that it is possible to reimplement
QTextEdit::paintEvent(), but doing so might produce cryptic runtime
warnings:

    QWidget::paintEngine: Should no longer be called
    QPainter::begin: Paint device returned engine == 0, type: 1

The correct way to reimplement this function is noted under
QAbstractScrollArea::paintEvent(). This patch updates the note and
copies it to QTextEdit for clarity.

Pick-to: 6.6 6.5 6.2
Change-Id: Ib7d8dadeb2358475bcdb0b2e624857700f9a004e
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 16:46:56 +00:00
Laszlo Agocs
526744ba65 rhi: vulkan: Fix swapchain format check
Fix the treatment of the sRGB flag. That is independent from the value
of format(), and should be checked regardless of wanting a HDR swapchain
or not. On Android for instance Display P3 with RGBA8 or RGBA8_SRGB is
one of the formats offered. While we do not support this right now,
it is an example of a "HDR" format that still uses a color buffer
format where a dedicated sRGB format is available and must be
chosen according to the specified swapchain flags.

Pick-to: 6.6
Change-Id: I2d97689fa5af7c08486702ae690f2230d06db469
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-07 14:42:58 +02:00
Laszlo Agocs
dc341ea284 rhi: d3d12: Fix swapchain format check
Pick-to: 6.6
Change-Id: Ie2c19ce0aa2c30997a682ed25bc69b2b8e9f7ee0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-07 14:42:56 +02:00
Laszlo Agocs
8a1915e04e rhi: d3d11: Fix swapchain format check
...to only return true for HDR formats that are sensible for
Direct 3D. There are currently no other formats, but new ones
may get added in the future.

Pick-to: 6.6 6.5
Change-Id: I4fc6d605da8f6bf2644a4e5c355ab8f1c62ad68d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-07 14:42:54 +02:00
Marc Mutz
e4682408b0 Add tst_QString::prependEventuallyProducesFreeSpaceAtBegin()
This seems to work with prepend(char), but not with prepend("data"),
cf. QTBUG-114167.

Task-number: QTBUG-114167
Pick-to: 6.5 6.6
Change-Id: I7aa4dca7c2b5938c2e5ad416231945c23140d659
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-07 11:39:43 +00:00
Tor Arne Vestbø
f1011bd2ed macOS: Don't assume DnD is handled via internal drag loop
If we have only one item, we're not using beginDraggingSessionWithItems
which requires us to manage our own drag loop, and instead use good old
dragImage, which takes care of the drag loop on our behalf.

In both cases we end up in draggingSession:endedAtPoint, so we need
to explicitly check for the existence of a manually managed drag session.

Amends 8a359343621fa83941946cb4e661b54ca7a1c4cc.

Fixes: QTBUG-114236
Pick-to: 6.5 6.6
Change-Id: Ifa9110945e191c4ffebe099e3e4edf9c571ab376
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
b006d6d9de iOS: Don't invalidate a11y whenever UI elements are added or removed
The UIAccessibilityScreenChangedNotification will result in iOS resetting
its state, focusing the first a11y element on the screen. We shouldn't
tie clearing the a11y cache to this notification, as those are two
separate actions.

In the case of adding or removing individual elements, we still likely
need to clear the cache, but can inform the system of the more granular
UIAccessibilityLayoutChangedNotification to have it re-read the a11y
tree.

We still handle additions and removal of a11y elements with Window
or Dialog roles as UIAccessibilityScreenChangedNotification, as these
likely involve major UI changes.

The implicit UIAccessibilityScreenChangedNotification on QIOSWindow
destruction has been removed, as it's assumed iOS will automatically
refresh its a11y tree when a UIWindow is destroyed, and in any case
it's up to the individual clients of QAccessible to send the relevant
QAccessibleEvent to inform about the situation.

Pick-to: 6.6 6.5
Fixes: QTBUG-100094
Change-Id: If7d5cb961743e5ca97d45553b05ae5e92f82d275
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
0237709e2c Add QOperatingSystemVersion::MacOSSonoma for macOS 14
Pick-to: 6.6 6.5
Change-Id: I22d4a2443e10ef40f498aa48aabad9aaa7aa8d1a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
9decda9063 Remove conanfile.py
The conan experiment has ended, and the file is only bitrotting
nowadays.

Pick-to: 6.5 6.6
Change-Id: I8408265f7db7e52803b1f532d08a11387ea978cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
366923b597 Detect when Xcode is presenting os_log as structured log messages
In that case, just like when os_log mirrors to stderr by itself, we
want to disable Qt's fallback stderr handler.

Pick-to: 6.6 6.5
Change-Id: Ia373b19788edbce616d4f0d3d9f0b217ddc1e5c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
569c78162a Remove compatibility defines for Apple OS versions
These are already defined in AvailabilityVersions.h in the SDK,
and we expect people to build Qt against the latest SDK available.

The corner case of requiring defines for upcoming/beta SDKs can
easily be handled by using the version number directly, which is
the recommended practice anyways.

Pick-to: 6.6
Change-Id: Ica296118ee17608b8c43f9338c3083189083474c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
af47a197a5 macOS: Remove legacy SDK and deployment target check macros
These are no longer in use in Qt.

Pick-to: 6.6
Change-Id: Id07bc0e09a414754493562d3a48df55cc28c5049
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
329db8b64f macOS: Remove fallback defines for MAC_OS_X_VERSION_MIN_REQUIRED
Availability.h from the platform SDK should take care of this these
days.

Pick-to: 6.6
Change-Id: I23dd821682db66a1f22b1240d485f4a9cc877cd8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-07 13:39:43 +02:00
Tor Arne Vestbø
18f966aed1 Update mapping between Apple Clang versions and upstream Clang
For Xcode 14.0 and 14.3

Pick-to: 6.6 6.5
Change-Id: Idd533e2d1f7b0feffa618ddf633165ce29043d5e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-07 13:39:42 +02:00
Laszlo Agocs
bee7d2c610 rhi: metal: Fix a swapchain debug print crash
When enabling the logs, printing hdrInfo() to qDebug
in Qt Quick is something that is done before calling
createOrResize() on the swapchain. (logically since
this is still at the point of configuring the swapchain
settings)

Thus the correct thing to do is to only access m_window,
not the backend data's window.

Pick-to: 6.6 6.5
Change-Id: I3004b0c4a4fdb09cb07a9c0e3c503f79c699c562
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-07 11:39:42 +00:00
Laszlo Agocs
ec27b99c2a rhi widget compositor: Use Nearest filtering
To stay compatible what the OpenGL-based code did before Qt 6.4.

Pick-to: 6.6 6.5
Fixes: QTBUG-113811
Change-Id: I80d89b21dcace9b5c361b964d56f29e996940c24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-06-07 13:39:42 +02:00
Laszlo Agocs
6ec01168d1 rhi: gl: Switch back to Nearest filtering when resolving
...for Qt 5 compatibility. It seems both Qt Gui and Quick calls
the QOpenGLFramebufferObject helper for blitFramebuffer with
the default GL_NEAREST argument for the filtering. In Qt 6 we
must use the same if we want to ensure pixel-perfect compatibility.

Pick-to: 6.6 6.5
Task-number: QTBUG-113811
Change-Id: I03c69448265e7b0d73f021d71135a1725e96fcbc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-06-07 13:39:42 +02:00
Edward Welbourne
3ab7b7e230 Fix deprecation warnings agains u"..."_qs in dnslookup.cpp
Pick-to: 6.5 6.6
Change-Id: I29a177c7d46304c5b494218f5862195eb92c7684
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-07 10:26:04 +02:00
Edward Welbourne
a7c87be888 QCoreApplicationPrivate::initLocale(): report correct encoding
We override the old encoding because it wasn't UTF-8, then we use a
fresh call to nl_langinfo(CODESET) when reporting the encoding that
"is not UTF-8", except that we've just fixed that so it is now.

Store the old encoding in a std::string before we change it, so that
we can report what it was rather than what we changed it to.
Amends commit 3690c202f9

Pick-to: 6.5 6.6
Task-number: QTBUG-113371
Change-Id: I5f7c3648890cb0abf1d4769af24715686762c176
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-07 10:25:44 +02:00
Edward Welbourne
f7e201ba89 Replace 0 with nullptr where the parameter is meant to be NULL
Change-Id: I2c9abf53fd20305903904fa45f620fe4c9d81047
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-07 10:25:23 +02:00
Edward Welbourne
9155a07667 Fix what we can of macOS's divergence for pre-1900 dates
The system locale backend on macOS uses system APIs to format dates
and times in localized ways. Those system APIs appear to know more
about time zones than the time_t functions (which artificially cut off
before 1900) are willing to tell us. As a result, QDateTime is left to
guess the offsets in use before 1900 but the locale-formatting takes a
correct offset into account, which can lead to QDateTime and the
locale-aware APIs using different offsets. This is further compounded
by the system APIs taking into account the calendar transition from
Julian to Gregorian. We can't do much about the latter.

Previously we were formatting dates by passing the start of the day to
the system APIs (which take a date-time, albeit using a "Date" name
for the type), along with a date-format that ignores the time of day.
For dates before 1900, if the system APIs know the offset in use was
less than that in use in the early 1900s, QDateTime (using the latter)
gets the start of the day slightly earlier than where the system APIs
know it is, so the day before is the date at that time. Use noon on
the day in question to avoid this problem, at least for zones that
didn't do whole day offset-shifts (crossing the date line) before
1900. Document the problem and the limited extent to which we can
solve it.

Task-number: QTBUG-54955
Pick-to: 6.6 6.5 6.2
Change-Id: I5be1bfdb3013433ee248846533ef73af39f173f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-07 10:25:15 +02:00
Thiago Macieira
f94e72d3d2 tst_QTimer: ensure that timer activation respects start order
Task-number: QTBUG-114152
Change-Id: Iff484344171647888da4fffd17640daef56f2479
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-06 17:47:00 -07:00
Thiago Macieira
766deb0e43 Fix GCC 13 warning about freeing the global static
I believe the problem is that QGlobalStatic::operator Type *() may
return a null pointer, in which case the compiler is right that we could
attempt to free the shared_null. Instead use QGlobalStatic::operator*,
which doesn't ever return nullptr.

Change-Id: I9201d9ecf52f4146bb04fffd17644782bf0eb9d1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-06 15:26:04 -07:00
Fabio Falsini
211b54ea47 Add flag to hide eye dropper button from QColorDialog
There are cases where this eye dropper control is useful and other
cases where it is useless. In case of an application connected with
graphics it's useful because it allows to select a precise color in
a very simple way. But in the case of a simple app where the user
only has to choose a color for, example, a graph this control is
useless and risks confusing the user (this kind of control is only
present in graphics software, not all "normal" users know what it
is for or understand its use). This patch add a flag to hide the
button.

As a drive-by change, the internal screenColorPickerButton pointer
is renamed to eyeDropperButton to be more consistent with the
qml ColorDialog.

[ChangeLog][QtWidgets][QColorDialog] Added a NoEyeDropperButton
option to hide the eye dropper button.

Change-Id: Ib29d5343383af97c1f488f9e33749517181aead7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-06 19:49:06 +00:00
Volker Hilsheimer
2a7da1b3c8 QTabBar: recalculate scroll offset when showing
If an application sets the current index and resizes the tab widget
before showing it, then the scroll offset might be calculated based on
an old size. Since after ca15f650a1,
resizing explicitly avoids scrolling, this could result in tabs ending
up scrolled outside of the tab bar when showing the tab widget.

Fix that by explicitly making the current tab visible in the tab bar's
showEvent handler, which recalculates the scroll offset based on the
actual size.

This is only reproducible with a tab widget, which lays out the tab bar
for each change and resets the tab bar's layoutDirty flag. Add a test
case there.

Pick-to: 6.5 6.6
Fixes: QTBUG-114204
Change-Id: I1e9506b9dde1dd892291d108dd2c7b675ef99509
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
2023-06-06 21:49:02 +02:00
Amir Masoud Abdol
a471324a03 Use parentheses for Xcode specific variables
If I'm not mistaken we would like to leave this to Xcode, if so, we can
use `$()` to make our intention more clear in the code.

Pick-to: 6.5 6.6
Change-Id: I3867f68f371a1cf1a5db5e639ec740f2546ccd75
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-06 19:49:02 +00:00
Kai Köhne
b63bf98329 CMake: Remove local __PPS target
Remove the local __PPS target and make PPS::PPS itself the
imported target. This is not only simpler, but also hopefully resolves
an issue with static builds, where PPS::PPS was not properly promoted
to a global target, leading to linker errors.

Fixes: QTBUG-108794
Pick-to: 6.5 6.6
Change-Id: Ia9334a27312ba9bfeec964f6bd6a82652e5f9d37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-06 15:33:41 +00:00
Marc Mutz
d6ce0bad67 QFusionStyle: de-pessimize arrow painting
Instead of holding three QPointF's in a QPolygonF, which will allocate
them on the heap, use QVarLengthArray<>, which will allocate them on
the stack instead.

Pick-to: 6.6 6.5
Task-numbber: QTBUG-112200
Change-Id: If078e5a9a5cb82fd03b511e28cceb88bd42996f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-06 16:29:28 +02:00
Marc Mutz
362b5b8428 QFusionStyle: optimize cache-key generation for qt_fusion_draw_button():
Instead of passing a QLatin1StringView to QStyleHelper::uniqueName(),
which takes a QString, allocating, and then using QStringBuilder to
append something to the result of uniqueHelper(), allocating again,
pull the appends to before the call to uniqueName(), folding these two
allocations into one.

Pick-to: 6.6 6.5
Task-number: QTBUG-112200
Change-Id: I501dd4a3df4b9f5267ca931b550d521f4dafe493
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-06 16:29:28 +02:00
Marc Mutz
6ab0d25a09 QPixmapCache: fix leaking of QStrings and Keys on clear()
QPixmapCache maintains a mapping from QString to QPixmapCache::Key, in
the form of the cacheKeys QHash, but QPixmapCache::clear() didn't
touch it, leading to the string data (as well as the Keys) being
retained after any possible use. This can lead to memory slowly being
eaten up, as reported in QTBUG-112200, and prevents a periodic calling
of QPixmapCache::clear() from being a work-around for the issue in the
bug report.

Fix by clearing cacheKeys in QPixmapCache::clear().

This is designed as a low-risk enabler of a work-around, not a fix for
the issue. The work-around enabled by this is periodic calling of
QPixmapCache::clear().

[ChangeLog][QtGui][QPixmapCache] Fixed QString key data not being
freed on clear().

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-112200
Change-Id: Ica6fa0e27e1b47b8df58d5e996378a2ececa5f9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-06 16:29:27 +02:00
Eskil Abrahamsen Blomfeldt
d390ac99f2 Upgrade Harfbuzz to 7.3.0
Fixes: QTBUG-114098
Pick-to: 6.2 6.5 6.6
Change-Id: I7bc766e6edada6f964c2dc40f18ff710249fb159
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-06 14:09:03 +00:00
Friedemann Kleint
79436bd34d uic: Generate QFont::Weight
Check for the new "fontweight" attribute before "bold".

Pick-to: 6.6 6.5
Task-number: QTBUG-113670
Change-Id: Ib34ab5a19872adb3c063861ffbe6b2d3374afcaa
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-06-06 14:09:03 +00:00
JiDe Zhang
71bf2a3a32 Fix can't create rhi if VkInstance is not enable VK_KHR_surface
The VK_KHR_surface is not need if we not using QRhiSwapChain, such as
using QQuickRenderControl on QtQuick, it's using "beginOffscreenFrame"
without QRhiSwapChain.

It's useful if you using a custom VkInstance to QVulkanInstance, and the
VkInstance is not create by other library and isn't enable the
VK_KHR_surface extension.

Pick-to: 6.6 6.5
Change-Id: I7623630adea9c933f38c180d4d73044b0e88f5b8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-06 14:09:02 +00:00
Joerg Bornemann
08f3aa32b7 CMake: Add version tagging sources only if the linker supports it
If the TEST_ld_version_script configure test fails with GCC or Clang,
then we still added qversiontagging.cpp, and linking failed.

Use the result of the configure test to decide whether to add
qversiontagging.cpp or not.

Task-number: QTBUG-111514
Change-Id: Id09e372a7a1e5cdbe59987be4481f64c6c45251e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-06-06 10:43:54 +02:00