Commit Graph

63667 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
a890df0283 coretext: Support variable application fonts
Named instances of variable application fonts are exposed
automatically through CTFontManagerCreateFontDescriptorsFromData()
(and also for the URL equivalent).

The main change here is just to call this instead of the overload
which only returns the first font.

Note that this also updates the test: This is because the conversion
from CoreText normalized weight values to TTF values is not 100%.
In the CoreText code, we map Heavy (0.56) to ExtraBold, but ExtraBold
gets converted to 0.6, which is closer to the CoreText value for Black
(0.62).

To avoid hitting this inconsistency, the QtExtraBold has been changed
to Black weight instead, which resolves to the same on all platforms.

Task-number: QTBUG-108624
Change-Id: Ied6d42e9e3e1ba8b7102936c5be3d285b3d9e07f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-03 19:25:46 +02:00
Alex Bu
1aba24a2ed Egldevices: Use valid DRM handle to get platform display
Use a valid DRM handle as display attribute to get platform display.
This fix is used together with the default framebuffer fix for the
display issue of egldevices backend on Jetson AGX Orin devkit.

Pick-to: 6.6 6.5
Change-Id: Ia1975936653461c5a7e534c714a123837c62bc10
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2023-10-03 18:47:42 +03:00
Kurt Kiefer
17a68dae5e eglfs: add a default framebuffer to NVIDIA eglstreams
Newer versions of NVIDIA's DRM driver are rejecting the previously
accepted but non-standard use of framebuffer_id -1 in order to set
the output mode but not issue a page flip.

This change adds a default framebuffer to the egldevice driver for
use with the initial calls to set the CRTC mode and plane.

Pick-to: 6.6 6.5
Change-Id: I63dbb6b099250fcff7d995eec38fb75c675894cd
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2023-10-03 08:47:42 -07:00
Anton Kudryavtsev
8419b56097 qFindChar: pass char16_t by value
Cheaply-copied types should be passed by value
according to https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in

Change-Id: I341193c0a65931c1406fc7d711ef74d763178dee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-03 08:38:02 +03:00
David Faure
3d631da88b Fix copy/paste typo in qdom.cpp leading to wrong errorColumn
Detected by KDReports unittests ;-)

Pick-to: 6.5 6.6
Change-Id: I33ab4c16a0fa55d7feffccc807998213132676fb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-02 23:23:01 +02:00
Topi Reinio
f0f0a5ccb6 Doc: QtCore: Fix documentation issues
* Fix references to Wait Conditions Example, Semaphores Example, and
  MIME Type Browser Example as they were renamed.

* Rename 'Shared Memory' example as its title clashes with
  the title of another page (sharedmemory.html).

src/corelib/global/qfloat16.cpp:
    * warning: Invalid '\relates' (already a member of 'qfloat16')

Pick-to: 6.5 6.6
Change-Id: Ia28be8e3882a7ad1fadcdbd50a657705d58526bd
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-10-02 21:10:59 +00:00
Topi Reinio
b5169b5c90 Doc: Fix QIcon documentation
* Move \externalpage topics to external-resources.qdoc, as that command
  cannot be embedded in other topics.

* Fix references to non-existent function fallbackIconTheme().

Pick-to: 6.6
Change-Id: I5d08206c53aea9c2d4c6fddf5d04df187b01ef53
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-10-02 21:10:59 +00:00
Tor Arne Vestbø
8606f33641 Simplify tst_QShortcut
There's no need for the manual sendKeyEvent, as QTest already
has the ability to send synthetic clicks, and we don't need
a colored window to test shortcut activation.

Pick-to: 6.6
Change-Id: I8409888664e2316bec4ea64f21dbb8b6915091f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-10-02 22:53:11 +02:00
Ahmad Samir
42c4d6c249 String views: de-duplicate API docs
Will be reused in later commits.

Change-Id: I078ad7eb0aac6eb389453d8bc32c414c840bc22e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 23:28:13 +03:00
Tor Arne Vestbø
26b279eda1 Make QKeyMapper::possibleKeys's event argument const
To match the QPA layer (QPlatformIntegration, QPlatformKeyMapper).

Change-Id: If1b4817eb334c6cdf1ccd587794701245076bd2f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-10-02 22:13:36 +02:00
Ahmad Samir
9dfa0b5711 QStringList: de-duplicate API docs
Change-Id: I806634b859b8fed9b7a42aac55a056b0c6408fb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 22:12:35 +03:00
Ahmad Samir
76afc35328 QStringList: refactor a unittest
- Initialize QStringList with an initializer_list instead of old style
  operator <<()
- Use Qt::StringLiterals more, better readability
- Test CaseSensitivity

Change-Id: If7dde14333d54b8c2f682036634ad94d5f9f9c74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 22:12:35 +03:00
Anton Kudryavtsev
ab651c22ae QString::section: replace QList with QVLA
to reduce allocations

Change-Id: Ib996549a018b457d2ee4f073efb0d950268c7738
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 22:12:35 +03:00
Rym Bouabid
4aab2ef0ac Revamp Queued Custom Type Ex: Revisit the documentation
Remove "Example" from the title.
Add \examplecategory {Data Processing & I/O}.

Task-number: QTBUG-117147
Pick-to: 6.6 6.5
Change-Id: Ieaab75dedb60329dcdcbbcfe6e2ad360df4d98df
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-10-02 19:08:42 +02:00
Rym Bouabid
74318643ce Revamp Queued Custom Type Ex: Declare stopProcess() as a method
Declare stopProcess() as a method because it's used in the connect()
overload taking a pointer-to-member-function, so it doesn't need help
from moc.

Task-number: QTBUG-117147
Pick-to: 6.6 6.5
Change-Id: Iaa1c02de82cffdea455af520c37dc0e6e6861443
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-10-02 19:08:42 +02:00
Rym Bouabid
34ff72d0ba Revamp Queued Custom Type Ex: Add const when applicable
Task-number: QTBUG-117147
Pick-to: 6.6 6.5
Change-Id: I2fe342fa585f8c1203fa64d2a9ceabc07070cc77
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-10-02 19:08:42 +02:00
Rym Bouabid
aa95294080 Revamp Queued Custom Type Ex: Fix includes
Fix includes order and add the needed ones to avoid transitive includes.

Remove QT_{BEGIN,END}_NAMESPACE because these are private Qt macros that
should not be used in the examples.

Task-number: QTBUG-117147
Pick-to: 6.6 6.5
Change-Id: I6caa0a59f2ab4dfec6fb558a0896c27b05b6a5db
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-10-02 19:08:42 +02:00
Tor Arne Vestbø
fa54471050 QCocoaInputContext: Don't emit locale update on startup
We're just resolving the initial locale, via the call site
in the constructor.

Change-Id: I186f4c491c013cce265a855963a8624ce5c6da97
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-10-02 19:08:41 +02:00
Eskil Abrahamsen Blomfeldt
500be123f4 Support variable applications fonts with DirectWrite
For GDI, there doesn't seem to be any way to do this, so it depends
on selecting the DirectWrite font database explicitly.

This moves the supportsVariableApplicationFonts() check into the
QPlatformFontDatabase instead of the font engine, since that's
where it belongs.

[ChangeLog][Fonts] Added support for selecting named instances in
variable application fonts when using the DirectWrite backend.

Task-number: QTBUG-108624
Change-Id: I51e0fedd7a9616088a06453a1d17f48bd18fa5a7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-10-02 18:00:33 +02:00
Eskil Abrahamsen Blomfeldt
0138d910b2 DirectWrite: Fetch correct style name in font info
When getting the font info for a resolved QFont on DirectWrite,
the style name would not be set, so there would be no way to
check the style name of the actual resolved font.

Change-Id: I5ff27e95619a330b7d2a0252222fad8629837418
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-10-02 18:00:33 +02:00
Morten Sørvig
d4e5898ba0 wasm: Don't assert on empty getRelocatablePrefix()
Emscripten expects to find shared libraries at the root
of the in-memory file system; set prefixPath accordingly.

(Emscripten does not always use the file system though,
for example when linking the main wasm file).

Change-Id: Ia8053274e23f15fb9ea74a6bebf1ed607cc2c2fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 18:00:33 +02:00
Axel Spoerl
c10a50ac3c QHeaderView: Fix columsMoved/rowsMoved connection to item model
Amends f8fc93fdef and corrects wiring to
wrong slot.

Found-by: Marten Nordheim <marten.nordheim@qt.io>
Task-number: QTBUG-117698
Change-Id: I9833f7abc190e2f89b534ad5761db83ba5b895a3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-10-02 16:00:33 +00:00
Tor Arne Vestbø
d50bf18726 Support more verbose debug output for QKeyEvent
Sometimes it's useful to know the scan code and virtual key as well.

Change-Id: Ic120189470a9ff44a5cb7f6dcc1405654136424f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-10-02 18:00:33 +02:00
Jan Grulich
e25c773f2b QCryptographicHash: don't forget to unload OpenSSL providers
Automatically unload loaded crypto providers on cleanup. In most cases
we don't load them, but when we do (e.g. when MD4 is used), we would be
leaking memory.

Fixes: QTBUG-115233
Pick-to: 6.5 6.6
Change-Id: I91318d391ab35d00647d1e9e2408fc987811a2d3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-10-02 16:34:31 +02:00
Antti Määttä
cd7c1037c2 Fix compiler error
Fix missing ';' before '}' error.

Change-Id: If377623b65c00b728c00db20a0d81e200150ae7d
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-10-02 16:54:46 +03:00
Axel Spoerl
975c0bdf73 QDockWidget: Don't use QWidgetResizeHandler on Windows
QWidgetResizeHandler sets its own mouse cursor, which can cause the
wrong icon being shown in corner cases (e.g. floating dock with custom
title bar and windows container).

Windows handles resizing of toplevel windows on platform level. A
QWidgetResizeHandler is not necessary.

=> Do not create one on Windows.

Resizing of floating dock widgets is tested in
tst_QDockWidget::dockPermissions(), floatingTabs(), hideAndShow().
=> No separate autotest needed.

Fixes: QTBUG-102196
Pick-to: 6.6 6.5 6.2
Change-Id: I20ab203e6b7ecc1dbda0524c7ff9bef271a7c04f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-10-02 14:50:57 +02:00
Morten Sørvig
5f1c29376c Add catch-all DPR update to expose event handling
The platform plugin should already DPR (or DPI) change
events, however if that does not happen we update in
the expose event as well as a last resort to make sure
the window's DPR value is in sync.

Also print a warning and ask for a bug report.

Pick-to: 6.6 6.0
Change-Id: Ibb144f163281a28216c2fa3353ed50237e91ce25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-10-02 12:50:57 +00:00
Morten Sørvig
628692a2f2 wasm: make haveAsyncify() return true for any asyncify
User code usually don't need to differentiate between asyncify
1 or 2 (JSPI), since the differences are abstracted over by
the wasm event dispatcher.

haveJspi() returns true for JSPI only as before, and can be
used to differentiate between the two.

Add canBlockCallingThread(), which returns true also for
secondary threads (which don't need asyncify to block).

Change-Id: Ia37513f2d4c56ef6351c950b5fc31ad15fa389d9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-10-02 09:41:50 +02:00
Christian Ehrlicher
4536ff2533 QDataWidgetMapper: use pmf-style connect
Use pmf-style connect, remove Q_PRIVATE_SLOT and remove the _q_ prefix
for the private slots.

Change-Id: I7e606e24f4f89183eb12fefcf53d0d8952a90516
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-02 09:28:03 +02:00
Øystein Heskestad
c73ee7353a Fix not emitting proxyAuthenticationRequired signal for NTLM
During NTLM http proxy authentication QHttpSocketEngine did
not emit the proxyAuthenticationRequired signal during
handling of HTTP 407 responses. As a consequence, the proxy
server was spammed with connection requests that never
worked.

Fixes: QTBUG-109718
Pick-to: 6.6 6.5
Change-Id: Icf0ccf58e3f2690d210652713155a303026ed3b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-10-02 07:13:45 +00:00
Mitch Curtis
ccda336246 Doc: state that models are not thread-safe
Fixes: QTBUG-107598
Pick-to: 5.15 6.2 6.5 6.6
Change-Id: I0e7ea8d4b2094d92b3cad5eec5b30e6e3ac64018
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-02 12:22:44 +08:00
Thiago Macieira
da0571d878 QtTest: block almost all Unix signals in the WatchDog thread
Signals delivered via kill(2) are delivered to any thread that is
running, so let's make sure the WatchDog thread doesn't get them.

This may be hiding bugs in the user's handler code, but in simple unit
tests the user may not be expecting there to be multiple threads in the
first place.

Pick-to: 6.6
Change-Id: I512648fd617741199e67fffd17822cdcdf30926c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-10-01 16:29:42 -07:00
Christian Ehrlicher
011d71664b QAbstractItem/Column/TreeView: rename private functions (remove _q_ prefix)
Cleanup the private function names after the change to pmf-style
connections.

Task-number: QTBUG-117698
Change-Id: Id15ef245cacca9c00bf65271bccf4da82fb7fd2f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 19:33:30 +02:00
Christian Ehrlicher
81e53db238 QTreeWidget: rename private functions (remove _q_ prefix)
Cleanup the private function names after the change to pmf-style
connections.

Task-number: QTBUG-117698
Change-Id: Ib03acba5823101f05d695aa31fd0d7f131443c01
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 19:33:28 +02:00
Christian Ehrlicher
490dc22ebd QListWidget: rename private functions (remove _q_ prefix)
Cleanup the private function names after the change to pmf-style
connections.

Task-number: QTBUG-117698
Change-Id: I38f13fff8312ac1f3f9da6e034f3131de7bd6247
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 19:33:27 +02:00
Christian Ehrlicher
72a39ed3ed QHeaderView: rename private functions (remove _q_ prefix)
Cleanup the private function names after the change to pmf-style
connections.

Task-number: QTBUG-117698
Change-Id: I9a5e178af997bfcfef78f7a3b9b84da6d653186d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 19:33:25 +02:00
Christian Ehrlicher
03b437bbad QTableView/Widget: rename private functions (remove _q_ prefix)
Cleanup the private function names after the change to pmf-style
connections.

Task-number: QTBUG-117698
Change-Id: I60275b7da6bf5e78562ccfd38a02719cc313eb49
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 19:33:24 +02:00
Christian Ehrlicher
3ad6bdcc62 Widgets/Itemviews: remove unused private slot macros
Remove the now unused Q_PRIVATE_SLOT() macros for all itemviews classes
after the conversion to the new style-connection syntax.

Task-number: QTBUG-117698
Change-Id: Id4b8077d9f07741cc418a2126843565940701125
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:31 +02:00
Christian Ehrlicher
f8fc93fdef Widgets/Itemviews: use pmf-style connect in QHeaderView
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: Ia0745dc10a917f3af4b448b3156d66bdb5d6ce64
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:23 +02:00
Christian Ehrlicher
39d486171b Widgets/Itemviews: use pmf-style connect in QColumnView
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: I955bd088e24ada7aa87645d28dc9b201bc67e927
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:22 +02:00
Christian Ehrlicher
063e25e512 Widgets/Itemviews: use pmf-style connect in QListWidget
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: If2c259c3f7737cec736c134c8bc83c4cb14906ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:20 +02:00
Christian Ehrlicher
2666c773ba Widgets/Itemviews: use pmf-style connect in QTableWidget
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: I2b5bb99c77e6e783a4cd7b0065d2f52a0266d88b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:19 +02:00
Christian Ehrlicher
c55a7e4167 Widgets/Itemviews: use pmf-style connect in QTreeWidget
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: I652c8d6f27b23a7d4467dc39b7c12850f4d25f66
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:18 +02:00
Christian Ehrlicher
0bb35ee2f0 Widgets/Itemviews: use pmf-style connect in QTreeView
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: Ic6617b3611a2ce156e9e568c1d07343f649562c4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:17 +02:00
Christian Ehrlicher
3e144bdc74 Widgets/Itemviews: use pmf-style connect in QTableView
Replace all connect() calls with pmf-style connection syntax. This also
means that we have to properly disconnect everything in the ctor to not
trigger an assertion in QtPrivate::assertObjectType().

Task-number: QTBUG-117698
Change-Id: Ifd6a55080a803b3aba2e35b9679a5194ff3f633c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 17:10:15 +02:00
Christian Ehrlicher
2203dec57b Tests/QAbstractiItemView: fix runtime warnings
Fix runtime warnings about testdata with the same name.

Pick-to: 6.6 6.5
Change-Id: I5d4927cc53be3e08a524498db42a8a08396ced8e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-10-01 15:44:01 +02:00
Marc Mutz
fd89295562 Add a script for updating from publicsuffix/list.git
Upstream changes every few days, so make this as easy as possible.

Older branches have a different way to update the list. The idea of
this script is to paper over the these differences.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-117138
Task-number: QTBUG-116236
Change-Id: Ib7c6187e4b9c09de715a014d22af9c20d4783086
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-10-01 13:27:03 +02:00
Marc Mutz
64b07fc811 QAtomicScopedValueRollback: fix a typo
Pick-to: 6.6 6.5
Task-number: QTBUG-115107
Change-Id: I9ca5d143b5c89443fc40859c035be43cde3d73c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-01 10:48:49 +02:00
Marc Mutz
e054d9f558 QAtomicScopedValueRollback: make store_part() static
... because we can.

Pick-to: 6.6 6.5
Task-number: QTBUG-115107
Change-Id: I23b5edc6111615cbd0352847b2f1a1667948c40a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-01 10:48:45 +02:00
Albert Astals Cid
88c74240a8 FileChooser portal: Make sure filter.name is not empty
Xdg-desktop-portal will reject any OpenFile request if there is an empty
filter, so if we can't find the mimetype in the mimedatabase we just
use it's "raw name"

Pick-to: 6.6 6.5 5.15
Change-Id: I705ae7523445e5c2ec97a42ee334401bc90adb68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-10-01 08:23:32 +02:00