Commit Graph

63659 Commits

Author SHA1 Message Date
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
Ahmad Samir
00c1c04bd5 String classes: make first/last/chopped() delegate to sliced()
De-duplicates code.

Change-Id: Id29511e7e571ed14f9e3cfd4355b901d81ea2562
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-30 19:29:51 +03:00
Tor Arne Vestbø
fdd2fc2c71 Remove QKeyMapper::changeKeyboard()
As described in QTBUG-27681, we no longer send KeyboardLayoutChange
events in Qt 5 and up. We have QInputMethod::localeChanged, but that
doesn't cover the cases where the input language stays the same, but
the layout is changed.

None of our widgets react to KeyboardLayoutChange these days, but
ideally we should send KeyboardLayoutChange if we can plumb it from
the platforms.

However that plumbing wouldn't live in QKeyMapper, and having it
around as dead code doesn't help, so remove it for now, and track
the work to implement it in QTBUG-27681.

Task-number: QTBUG-27681
Change-Id: I480590550f3bc741b829fb30aa85393b07d5c16f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-09-30 11:11:39 +00:00
Tor Arne Vestbø
eb4103e0b9 Remove QKeyMapperPrivate
There is no point in maintaining the keyboardInputLocale and
keyboardInputDirection in the QKeyMapperPrivate, as these
things are handled by QInputContext nowadays. The values
were never updated either, so the base class implementation
of QPlatformInputContext referring to them was confusing.

With those gone, we can remove the entire class.

Subclasses of QPlatformInputContext typically only override
locale(), so we now base the input language direction on the
current locale(), giving dynamic updates of the direction as
well (without the signal, but this will be fixed in a follow
up patch).

Change-Id: I16ae4097eadadd278e60edea3c1101ab90ed7444
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-09-30 13:11:36 +02:00
Marc Mutz
fdf7774bc6 QPersistentModelIndex: fix relational operators not being noexcept
They actually can be, so the implementation need not change. Just add
the noexcept tag (which is BC, it's not part of the name mangling on
any compiler).

Silences a bunch of XFAIL in the test (the test is automatically
picking up the change, no need, and no way, to manually remove the
QEXPECT_FAIL).

Change-Id: I24b6ba1248001056de64f341617943e7aea5ae93
Reviewed-by: David Faure <david.faure@kdab.com>
2023-09-30 13:02:05 +02:00
Marc Mutz
49f9271360 QPersistentModelIndex: fix UB (op< on unrelated pointers)
Pointers can only be legitimately compared with less-than (<) if they
point into the same array (or one past the end). This is decidedly not
the case for heap-allocated objects like
QPersistentModelIndexPrivates, so doing it is UB.

Fix by using std::less, which is guaranteed to be a total order, even
for unrelated pointer values.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If04341b4b55784e7732782f3ae829f53b0ceab9c
Reviewed-by: David Faure <david.faure@kdab.com>
2023-09-30 13:02:00 +02:00
Thiago Macieira
94df3f8d6b QStorageInfo/Unix: check the mount point length before isParentOf()
Execute the cheaper test first, so we loop over the entries more
quickly.

Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd178749a12c966739
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-29 19:55:48 +00:00
Thiago Macieira
da95ad91b3 QStorageInfo/Linux: move from MountInfo's contents
Copying QStrings and QByteArrays is reasonably cheap, but moving is
cheaper.

Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787498ead687da2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-09-29 12:55:47 -07:00
Thiago Macieira
914b3bc985 QStorageInfo/Linux: don't copy the mount info's contents until the end
All these where somewhat cheap to copy (QStrings and QByteArrays), but
why copy multiple times at all? Just copy at the end.

Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1787497434632dd4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-29 12:55:47 -07:00