Commit Graph

65795 Commits (14a9a593a2a60ccedad92ef7fbeb6fb0501ac835)

Author SHA1 Message Date
Morten Sørvig 14a9a593a2 wasm: fix copy/paste error in FS export check
The check for environment variables was copied over
from the ENV export test, but is not relevant for FS.

Remove it and then inline at the call site since this
this is now only three lines of code.

Change-Id: If377401154ff1ef6c71a5f1ebeb6459118d4d395
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-02-19 17:03:11 +00:00
Alexandru Croitor 573778de60 CMake: Introduce a CMake coding style document
Better to have something, than nothing at all.

Mention it in the cmake readme.

Task-number: QTBUG-120225
Change-Id: Ieffeeaac714b89d5d8b5a8b0c51abf3fe8e0a6c6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-19 16:41:47 +01:00
Wladimir Leuschner 6bfdfea6d6 QWindows11Style: Set mask for MDI Window only in case widget is valid
Fixes: QTBUG-122398
Pick-to: 6.7
Change-Id: I3f7e01548f4a243b2356cbc1e669384fce1d1261
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-02-19 15:41:47 +00:00
Tinja Paavoseppä 0e95d3ab57 Android: Implement input connection listener in QtInputDelegate
This way we can just pass the input delegate as the listener for
QtEditText when we create it, and having the listener in a separate
member doesn't provide a real benefit anyway.

Task-number: QTBUG-118139
Pick-to: 6.7
Change-Id: I0125c87ecd39eed550a120ea8326d2c50a1b016e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-19 17:05:54 +02:00
Tinja Paavoseppä c545a3a086 Android: Fix code style issues in QtEditText
Remove m_ prefix from function arguments. Move constructor to be
the first method.

Pick-to: 6.7
Change-Id: I8854c3964ccd609666d8bbae631e59bcaee768f3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-19 17:05:54 +02:00
Petri Virkkunen 1ed1122fc3 Android: Move textfield option handling to QtEditText
Previously QtEditText input method hints, input type and caps mode were
parsed and set inside QtInputDelegate. Given these things are only
relevant for QtEditText and did not use any QtInputDelegate internals,
moved them to QtEditText.

Task-number: QTBUG-118139
Pick-to: 6.7
Change-Id: I5162e890679f6e14adf42647572c0fb96ad451b9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-19 17:05:54 +02:00
Alexey Edelev 1c287cea29 Force linking against versioned libraries when building Qt artifacts
Replace Qt:: namespace with Qt6:: namespace in target_link_libraries
for the Qt modules/plugins/libraries.

Fixes: QTBUG-114706
Change-Id: Idfd0917dbe1a6a266bc4e9d5f465e550788b5aaf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-19 15:24:07 +01:00
Joerg Bornemann 9c56c1f7c2 QMake: Fix quoting of WASM's ASYNCIFY_IMPORTS linker option
WASM projects failed to link on Windows if "CONFIG += silent" was
specified in the .pro file and the build environment did not contain
sh.exe.

In that case, QMake prepends "@echo linking && " to the link command.
The mingw32-make tool then considers this command as "complex command"
and runs it through either sh.exe or cmd.exe, depending on whether
sh.exe is found in PATH. If cmd.exe is used, the single quotes around
the ASYNCIFY_IMPORTS option are passed verbatim to em++. Then em++
thinks 'ASYNCIFY_IMPORTS=qt_asyncify_suspend_js,qt_asyncify_resume_js'
is an input file. That file is of course non-existent, and linking
fails.

Remove the single quotes around the linker option. They are not
necessary.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-122192
Change-Id: Id362b51ac787f7f235bcb3d9102c5dee66ce5768
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-19 15:24:07 +01:00
Kai Köhne f54d222d22 Assign a category to Contiguous Cache Example
Pick-to: 6.6 6.7
Change-Id: I98e62adce63df7e940d96cd50dcb243366dca216
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-02-19 13:20:08 +01:00
Kai Köhne d3117e9701 Doc: Mention AA_DontUseNativeDialogs in QFileDialog
Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-119551
Change-Id: I54f7e8f4b855b15d22b2180095cbf454b31412c3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-02-19 13:20:08 +01:00
Friedemann Kleint 8aceccc7eb Documentation: Rename 'Qt Designer' to 'Qt Widgets Designer'
Task-number: QTBUG-122253
Change-Id: I04ab521decaf908b1c1491987f6de1e816a42a33
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-02-19 09:21:16 +01:00
Rayam Pinto 72d129c45e Implement icon mapping for Apple, Android, and Windows
Not all xcb icons have a corresponding icon on all other desktop
platforms, so we might want to remove those enums for which we have
almost no coverage in a follow-up commit.

Pick-to: 6.7
Change-Id: I8fdc64f773768ce4ed1e0050f2a3bddef976e688
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-18 22:51:50 +01:00
Ahmad Samir adc0920c48 QTimer: make both defaultTypeFor() methods constexpr and noexcept
Also de-duplicate the code by using defaultTypeFor() in singleShot(),
this way the comment and the calculation are done in one central place.

Pick-to: 6.7
Change-Id: Ib822cae0e9228e546b664fbac728a60d65c4bbc3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-17 22:34:55 +02:00
Marc Mutz 1461fbb5d1 QLoggingRegistry: cut out the QMap middle-man
In Qt 6, QMap is just a shared pointer to a std::map.

QLoggingRegistry::qtCategoryEnvironmentOverrides is never copied,
though, so the implicit sharing that QMap adds on top of std::map is
useless.

Use the underlying std::map directly.

Yes, the std::map API is a bit raw around the edges (std::pair
value_type), but we're professionals here.

This saves more than 1.1KiB in TEXT size on optimized AMD64 GCC 11
C++20 Linux builds.

Change-Id: Id72b2432ed41a97700cc2d9ecafa902b919efe84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-17 17:20:52 +01:00
Marc Mutz 6b59ff5730 QLoggingRegistry: further defend against non-NUL-terminated strings
Various functions in QLoggingRegistry took QByteArrayView, but they
continued to assume that the data was NUL-terminated (converting back
to const char* by calling data()).

Make sure only NUL-terminated strings are passed by taking in the
tranditional way, as const char*. Keep QByteArrayView when storing in
the map as key, to avoid comparing just pointer values (as opposed to
the string content).

Amends 806545fcc8.

Pick-to: 6.7 6.6 6.5
Change-Id: I232167d4c91070369e770c41d3ea53bd2406a03f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-17 16:20:21 +00:00
Axel Spoerl ec24b36d3d QXcbWindow::handleLeaveNotifyEvent(): Consume when leaving geometry
QXcbConnection::mousePressWindow() returns the XCB toplevel window,
which has consumed the window system's last mouse press. When the
function returns a valid pointer, QXcbWindow::handleLeaveNotifyEvent()
didn't propagate the leave event to QWSI::handleLeaveEvent(). Instead,
the leave event was ingored.

That behavior is correct, e.g. when a button on the main window is
pressed and the mouse hovers away from the button, with the mouse
button continuously being pressed. It is not correct, if the mouse
cursor leaves the main window.

=> Ignore the leave event only as long as the mouse cursor remains
within mousePressWindow()->geometry().
=> Deliver the leave event, when the mouse cursor leaves the window.

Fixes: QTBUG-119864
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I30a6ebedcd148285b9f17dfd87885ff67726b54c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2024-02-17 10:19:34 +00:00
Christian Ehrlicher 7a4b307210 Style icons: fix artifacts in media icons
The media svg icons had some unneeded transparent objects which lead to
artifacts during png export/pngcrush optimization. Fix it by removing
the unused objects and re-export the pngs again.

Pick-to: 6.7
Fixes: QTBUG-122272
Change-Id: I7e63ef53e5a78ce3a06c0053dea98e13c6ba264b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-16 22:57:37 +01:00
Ivan Solovev 4c93115504 Add QUtf8StringView vs QLatin1StringView relational operators
... by using the new comparison helper macros.

This allows to remove dummy comparison operators from
tst_qstringapisymmetry.

This is also a pre-requisite for a follow-up commit that introduces
relational operators between QLatin1StringView and QByteArrayView.

Task-number: QTBUG-117661
Task-number: QTBUG-108805
Change-Id: I5837b457a777fddff1071bc252982e68d004fa94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 18:39:22 +01:00
Ivan Solovev 3a5ee774e8 QMetaObject: consistently use QByteArray(View) in the implementation
The implementation was inconsistent.
The `stringData()` method was returning QByteArray, while
the `stringDataView()` method was returning QLatin1StringView.
Update the second method to return QByteArrayView instead, and fix all
related places.

Found while trying to resolve ambiguities in QL1SV <-> QBAV comparison.

Change-Id: I94f10a5eeeb80a6e512c1f7623becf5e7f543fd9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-02-16 18:39:10 +01:00
Ivan Solovev e26914fa0f Refactor tst_qcomparehelpers
Previously the test consisted of just one cpp file. An attempt to add
more test cases to the file resulted in the minGW compiler complaining
about a too large object file:

 Fatal error: tst_qcomparehelpers.cpp.obj: file too big

This patch splits the implementation into a header and a cpp file.
This itself does not fix the issues, but now we can add the new test
cases in a separate cpp file. This patch also adds some comments
that advocate doing so.

Pick-to: 6.7
Change-Id: I451987370fa4e18b7ad81dfc064ea016f1d0da47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-16 18:39:06 +01:00
Giuseppe D'Angelo cfaed64873 QByteArray/QString: add resizeForOverwrite
For these classes it's not really a new feature, but exposing
the current resize() behavior (which does uninitialized resizes)
under a proper name.

Changing the existing behavior for resize() is a behavioral
break that we can only likely afford in Qt 7.

[ChangeLog][QtCore][QString] Added resizeForOverwrite().
[ChangeLog][QtCore][QByteArray] Added resizeForOverwrite().

Change-Id: I15b3104aee2bc29d23e91d97b0e64f87612d0099
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:29:18 +01:00
Giuseppe D'Angelo 73bf1c1a9b QList: add uninitialized resizes
Creating a QList of a given size, or resizing it to a given size, will
always value-initialize its elements. This commit adds support for
uninitialized construction and resizes. The intended use case is using a
QList as storage-to-be-overwritten:

  QList<int> list(size, Qt::Uninitialized);

  fillWithData(list.data(), list.size);

How do we define "uninitialized":

1) if T is constructible using Qt::Uninitialized, use that;
2) otherwise, default-construct T.

In detail:

1) covers (Qt-ish) datatypes that have a default constructor that
   initializes them, but also a dedicated constructor that doesn't
   initialize (e.g. QPoint, QQuaternion, ...).
2) covers everything else. Default initialization of scalars and
   trivially constructible datatypes will leave them uninitialized.

A type which isn't trivially constructible will still get its default
constructor called (and possibly actually gets initialized); we can't
really do better than that, as we still have to construct objects and
start their lifetimes.

[ChangeLog][QtCore][QList] Added support for uninitialized construction
and resizing.

Change-Id: I32c285c7dddbf7e01475943f24e14e824bb13090
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:20:50 +01:00
Thorbjørn Lindeijer 277d77029d QGtk3Theme: Fix QGtk3Interface::fileIcon
By failing to set the G_FILE_ATTRIBUTE_STANDARD_ICON attribute, the
"icon" returned by g_file_info_get_icon was always null and a
GLib-GIO-CRITICAL warning was output to the console (at least since glib
2.76.0)[1].

After adding the necessary attribute, the code was crashing, because now
a valid icon was returned, however the icon should not be freed[2],
which is why I removed the "g_object_unref(icon)".

Now it was no longer crashing, but the size of the icons was off. It was
passing GTK_ICON_SIZE_BUTTON (4) to gtk_icon_theme_lookup_by_gicon where
a size in pixels was expected. I chose 16 because that's the pixel size
associated with GTK_ICON_SIZE_BUTTON[3].

Finally I noticed the returned icons had the wrong color. It seems that
a GdkPixbuf uses RGBA8888 format[4]. Adding an explicit conversion to
ARGB32 made the icons look correct for me.

[1] ed8e86a7d4
[2] https://docs.gtk.org/gio/method.FileInfo.get_icon.html
[3] https://docs.gtk.org/gtk3/enum.IconSize.html#button
[4] https://docs.gtk.org/gdk-pixbuf/class.Pixbuf.html#image-data

[ChangeLog][Platform Specific Changes][Linux] Fixed file icons provided by QFileIconProvider when using the gtk3 platform theme.

Pick-to: 6.5 6.6 6.7
Change-Id: I312ef76ac28bc28435b756d299998485db122906
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-16 14:20:50 +01:00
Marc Mutz 8fc37349e3 QLibraryStore: cut out the QMap middle-man
In Qt 6, QMap is just a shared pointer to a std::map.

QLibraryStore::libraryMap is never copied, though, so the implicit
sharing that QMap adds on top of std::map is useless.

Use the underlying std::map directly.

Yes, the std::map API is a bit raw around the edges (std::pair
value_type), but we're professionals here.

This one saves more than 3.7KiB in TEXT size on optimized AMD64 GCC 11
C++20 Linux builds.

As a drive-by, port iterator- to range-based loops, and take advantage
of loop variables being real references now.

Change-Id: I1a8970b21e34a69d88a122f31699a51fd982feb9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-16 13:20:50 +00:00
Zoltan Gera 9a0098f4b3 Android: Do not double finger size for touch events
Fingers in touch events are modelled by rotated ellipses with their
major and minor axes stored respectively. The axis is the diameter of
the ellipse in one direction, not its radius. These values should be
converted to a rectangle correctly, without doubling their extents.
The pair of this fixed code is located in function
QWindowSystemInterfacePrivate::fromNativeTouchPoints().

Pick-to: 6.7
Change-Id: I4fea7e8168a9c248a744964d4821b774b85a6cf4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-16 15:20:50 +02:00
Marc Mutz 039b2e4e5d QTzTimeZoneCache: don't hold mutex while parsing files
The QTzTimeZoneCache::findEntry() function is always called with
QTzTimeZoneCache::m_mutex held, from its only caller,
QTzTimeZoneCache::fetchEntry().

However, findEntry() performs quite heavy parsing, reading
e.g. /etc/localtime or a file in /usr/share/zoneinfo/. These files are
larger than 2KiB file on my system.

Even though findEntry() doesn't touch m_cache during its operation¹,
it thus prevents other threads from looking up (and even parsing)
other entries in the cache.

A straight-forward solution is therefore to drop the mutex in
fetchEntry() for the duration of the findEntry() call² and then
re-acquire it for the final m_cache.insert().

This means, of course, that more than one thread could parse the same
file concurrently, and then one of the thread's result would be
discarded. Having the file already in the OS cache makes this probably
less of an issue than it sounds, but more complicated protocols are
readily implementable, should it become necessary. QTBUG-122138 has a
sketch.

¹ It's a static function, so it cannot access NSDMs.
² Incl. the heap allocation required to store the result in QCache.

Fixes: QTBUG-122138
Pick-to: 6.7
Change-Id: If0cba6d041fb21a48cbde6b43190662a2c55cd25
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:20:50 +01:00
Giuseppe D'Angelo 913f4f1a6f QDataStream: also disable streaming of member pointers
2fd4a86dc5 disabled the streaming
of pointer with QDataStream, as they would otherwise accidentally
select the `bool` overload. Do the same for member pointers.

Change-Id: I4910953a2856957518b4e51bdc4a0c26d75addab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:13:09 +01:00
Christian Ehrlicher 8eb599566e QDockWidget: fix dock buttons size
The previous fix calculated an icon size of 12 instead 10 for the icon
size when SH_DockWidget_ButtonsHaveFrame is set. This lead to a too
large icon. It was also rendered blurry because there was no native png
with 12x12 pixels so it has to be scaled.

This amends 04f4b27774

Pick-to: 6.7
Fixes: QTBUG-122214
Task-number: QTBUG-118643
Change-Id: Iaf332a21681e5b84222299d79d4b28d0c26b0cda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-16 14:13:09 +01:00
Lucie Gérard 76a7057bf5 Change wasm files license
The other files in this directory are non-LGPL

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I9c319f723dafd7205029d7632c456412d1a3010b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-16 09:05:44 +01:00
Mårten Nordheim 1dd89bfb04 QLocal8Bit::convertFromUnicode[win]: limit fprintf to !NDEBUG
Because there is no other way to stop it from printing the output.

Pick-to: 6.7 6.6 6.5
Change-Id: Ie6dcb393351f50691366849ba85d60e2e186f9fb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 00:33:46 +01:00
Marc Mutz 7192b11841 Avoid double-lookup in QLibraryStore::findOrCreate()
The code is in a critical section, so don't waste time traversing the
QMap twice.

Now that two previous commits have re-arranged the code such that
lookup and insertion are symmetric, we can combine them into a single
lookup using operator[].

Pick-to: 6.7 6.6 6.5
Change-Id: I4a10cece65b8c35d05a9b80967bf15d2e15bd73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-15 22:29:53 +01:00
Andreas Eliasson 57388179a4 Doc: Fix readString() and readByteArray() code snippets
Both of these functions return a StringResult, which has no
StringResult::code member. Instead, use the existing
StringResult::status member.

Fixes: QTBUG-122254
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I0b9bfa1fc9a30e9c542ab90f3d8f4243bdeda762
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-02-15 21:35:00 +01:00
Ahmad Samir 026e1e3fdb QTimer: use QTest::ingoreMessage() for negative internvals tests
Pick-to: 6.7 6.6 6.5
Change-Id: I87d095b748a7488a71b22710ab7ed72d9451c769
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-15 22:35:00 +02:00
Lucie Gérard 039d51835f Correct license in widget/kernel
According to QUIP-18 [1], all module files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only
LGPD and non-LGPL licenses should not be mixed in a
given directory.
The files in this patch now match the other files
in the same directory and QUIP-18 rule.

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: Ied60c775fbae38d6edeabc669f782b39d02c28f4
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-15 21:34:59 +01:00
Tor Arne Vestbø 7a512d1267 iOS: Propagate focus changes to VoiceOver
Changing the focus object should update the VoiceOver focused element,
the same way we do it on macOS.

There's no NSAccessibilityFocusedUIElementChangedNotification on iOS,
but we can pass the focused element as an argument when posting the
UIAccessibilityLayoutChangedNotification.

The class method on QMacAccessibilityElement to get an element for
an QAccessible::Id was not used by any callers, and has been modified
to resolve the container from the QAccessibleInterface, so that we
don't need to plumb that all the way from the focus change event.

Inspired-by: Jan Möller <jan.moeller@governikus.de>
Fixes: QTBUG-114608
Pick-to: 6.7 6.6 6.5
Change-Id: I2e43ae649bc7e3a44c1e1200e8de66bf420b1949
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-15 21:34:59 +01:00
Marc Mutz af051f9be2 QVarLengthArray: re-publish Prealloc as a nested PreallocatedSize
This gives users of the class easy access to the Prealloc template
argument, without having to write a pattern-matcher like

   template <typename T>
   constexpr qsizetype preallocated_size_v;
   template <typename T, qsizetype N>
   constexpr qsizetype preallocated_size_v<QVarLengthArray<T,N>> = N;

first.

[ChangeLog][QtCore][QVarLengthArray] Added PreallocatedSize nested
constant, equal to the Prealloc template argument.

Change-Id: I928eaa5e62967445cdd7b0c2759567483fdb8997
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-15 17:44:36 +00:00
Tinja Paavoseppä e703feea40 Android: Request QtEditText focus when its window is touched
This allows switching focus between different Qt windows,
which combined with the previous changes enables keyboard
focus for child windows.

Task-number: QTBUG-118139
Pick-to: 6.7
Change-Id: I4b237166dee264a22b2e3dd1ca4d82e0cfce376b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-15 19:44:35 +02:00
Petri Virkkunen 2c192c6f5f Android: QtActivityDelegateBase listens to focus events from child views
In order to detect gaining/losing and moving focus between windows,
implement GlobalFocusChangeListener for the root View.

Add a surfaceFocusChanged native function in QAndroidPlatformWindow in
order to follow these focus changes.

Task-number: QTBUG-118139
Pick-to: 6.7
Change-Id: Ia9bf6249c28a420f42793a9829aef31b12757630
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-15 19:44:35 +02:00
Tinja Paavoseppä f4050cc5ea Android: Move QtEditText to QtWindow
Every QtWindow has its own QtEditText. QtInputDelegate
uses QtEditText from the QtWindow which has the focus.

QtEditText is a View class which handles the creation
of the input connection, and encapsulates other various
keyboard input related functionalities. Previously
we have only had one, which requests focus when the
software keyboard is opened. However, with the
introduction of child windows, it does not make
sense for all the windows to operate through this
one instance.
Furthermore, since it always needs to have focus
to be able to open the software keyboard, this
leads to a bit surprising behavior in the focus
chain if we want to make each window focusable,
not just the top level one. Having each window
have its own QtEditText makes sure when a window
gets focus, the focus doesn't leave outside
of the matching view's own scope, making it easier
to handle.

This should also make it easier to clean up keyboard
input related events tied to a window when that window
is removed.

Task-number: QTBUG-118139
Pick-to: 6.7
Change-Id: Idd1a9407bc0c48660f2885d3bda28e46d42c08a0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-15 19:44:35 +02:00
Eirik Aavitsland 4449dbe737 Baseline tests: avoid rendering items that are blacklisted on the server
Blacklisting items on the baseline server would avoid any mismatch
failures for such items. However, they would still be rendered. That
is undesirable if the rendering itself has unwanted side effects for
such items, e.g. crashing the test executable.

Fix by adding new functionality in the baseline testing framework to
allow checking blacklisting status ahead of time, and add a new macro
QBASELINE_SKIP_IF_BLACKLISTED to do just that.

Add usage of that macro to the QPainter baseline test.

Pick-to: 6.7 6.5 6.2
Change-Id: I35f6df8cff2c6cb985c25ab5470cd42b53d44940
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-02-15 18:44:35 +01:00
André Klitzing ad8047daf1 Fix documentation of used digest and signature algorithm
SHA-256 is used since 2019.
This amends c9f8893000.

Pick-to: 6.7 6.6 6.5
Change-Id: I005aa3414e4606045c8c3b01d71547efcf4122ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-15 16:24:29 +00:00
Tor Arne Vestbø ef37889845 macOS: Expand and tighten plumbing of QWindow's requested color space
A QWindow can have a requested target color space via its QSurfaceFormat.
This allows users who know what color space their source material is in,
or who do their own color matching, to ensure a consistent target color
space.

In the past we plumbed this to NSWindow's colorSpace property. This meant
that you could only have one color space per top level, even if child
windows were in play, and we could only set the color space if we were
the ones creating the NSWindow, failing the color space request in cases
where the window was embedded in a non-Qt window hierarchy.

We now store the requested color space in our QNSView, and propagate it
to both the IOSurfaces we use in QCALayerBackingStore, and to the view's
layer, in case it's a CAMetalLayer. We also pick up any changes to the
backing properties of the view, and ensure we update the color space
accordingly.

We still propagate the color space to NSWindow, as for OpenGL we don't
use CAOpenGLLayer (which has a colorSpace property), but instead use
NSOpenGLContext. This is not something we're going to change, so as
a workaround we set the NSWindow color space, which does affect GL
drawing via NSOpenGLContext. The granular color spaces we set on
the IOSurfaces and CAMetalLayer will override the NSWindow state.

Pick-to: 6.7
Change-Id: I5d9765d95140b8523ee09f70ff09a8c9400ffdc7
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
2024-02-15 16:27:19 +01:00
Mårten Nordheim 775a57f266 tst_QNetworkReply: Try to stabilize qtbug68821proxyError
The test is a bit silly, it was originally written to make sure that
we produce meaningful errors when trying to connect to a proxy server
where the connection is refused or the server doesn't respond at all.

To test that, it creates a local QTcpServer and starts listening to any
free port (by specifying port 0) and then it closed the server and
uses the address-port of localhost:serverPort as the proxy to use, since
we know it _was_ unused, since we were able to bind to it.

However, just calling close() doesn't immediately tear down the internal
socket descriptor, so the OS may still have the port reserved for
some time.

By moving the QTcpServer to a narrower scope we will quickly destroy it
and the internal socket engine, which is parented to the server, and
this in turn releases the socket descriptor.

Pick-to: 6.7 6.6 6.5
Change-Id: If12128fc21d1f545df152f08f0d52c1b14ac6037
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-15 16:27:19 +01:00
Eskil Abrahamsen Blomfeldt de3d5dd73b Fix kerning errors when using DirectWrite backend
There were a couple of errors when calculating advances
in the DirectWrite font engine: First of all, we would
apply the CLEARTYPE_NATURAL glyph metrics when using
GDI_CLASSIC rendering, causing text to look compressed
in some places, because we always passed TRUE for the
useGdiNatural parameter to GetGdiCompatibleGlyphMetrics().

In addition, we would pick the GDI-compatible metrics even
when design metrics had explicitly been requested on the
layout. This is the case for distance field rendered text,
which always operates with design metrics and scalable
layouts, so it was visible as kerning errors on some text
there.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-122139
Fixes: QTBUG-122167
Change-Id: Ic28da6b3235d7af0452bdcb836e037594f8a20ba
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2024-02-15 14:51:37 +01:00
Rym Bouabid 760043ea8c QDir: Use QT_TEST_EQUALITY_OPS macro in unit-tests
Replace QTestPrivate::testEqualityOperators() helper function with
QT_TEST_EQUALITY_OPS macro to get a reasonable debug output in case of
failure.

Task-number: QTBUG-120303
Change-Id: I1ca23cabfe62ab78e012cf95fd2add631fc88a64
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-15 14:51:37 +01:00
Alexey Edelev 02e516281b Fix framework headers copying when module don't have header files
Amends 103eca1070

Change-Id: I3caae60c022cd46a6d33691760b619920d6e778e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-15 14:04:44 +01:00
Matti Paaso 0d9c92bfdf Fix mount command
Mount on Virtual machine uses NFS version 4 as default,
and it was causing disk I/O errors when trying to access disk.
Forcing the mount use NFS version 3.

Change-Id: Ibc5958d8a7e71c463ffa9c3282344c08b2c5019a
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2024-02-15 09:52:52 +02:00
Alexandru Croitor b3cc89e81c CMake: Fix AUTORCC_OPTIONS INTERFACE_LIBRARY error with CMake 3.16
Make sure not to set the AUTORCC_OPTIONS property on INTERFACE_LIBRARY
targets, because it's not allowed with CMake versions lower than 3.18.

Amends 329dbfcc78

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-122266
Task-number: QTBUG-106466
Task-number: QTBUG-101353
Task-number: QTBUG-121948
Change-Id: I9ab606c0b11e2b4f8689e0bde9c001f59c81fa42
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-02-15 08:32:06 +01:00
Volker Hilsheimer 5b993fa8ed AppleIconEngine: fix aspect ratio adjustment
The requested icon might not be square, so fit the image
we have correctly into the requested size.

Fixes: QTBUG-121764
Pick-to: 6.7
Change-Id: I877dedf5aa779cd82a75a1a49b26c08e3cea6163
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-15 05:07:22 +01:00
Volker Hilsheimer 477381993a Iconbrowser: render theme icons as list with large icons
In icon mode, the name of the icon gets truncated.

Pick-to: 6.7
Change-Id: I8e2081a68006907ae916c8e8fa1aeb6006acbc6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-15 05:07:18 +01:00