70243 Commits

Author SHA1 Message Date
Volker Hilsheimer
37638c84ef QJniArray: fix local reference leak
We get a local reference from New*Array, and then construct a QJniArray
from that, which will create a new global reference, without deleting
the local reference.

Instead, go through QJniObject::fromLocalRef, and release the local
reference also in case of failure.

Pick-to: 6.8
Change-Id: I88108315240133369efab30e55fdbea17a17a26d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
2024-11-25 04:25:27 +01:00
Cage Lee
c034ffd527 doc: Fix a typo for QCborMap
Pick-to: 6.8
Change-Id: I2579205350ffc6ec00cb002e0d68f1125d9885d6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-11-24 18:57:35 +00:00
Jøger Hansegård
a315a9e70e Document that size is number of code units in QString::fromWCharArray
Other functions that creates QString instances from buffers document
that the size argument represents the number of characters to copy. This
patch adds this statement to QString::fromWCharArray too, but makes it
explicit that the size represents the number of code units.

Pick-to: 6.8
Change-Id: If3c0ebe299281a3c0ffc2d9e609b89df2578811d
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-11-23 18:29:40 +00:00
Wladimir Leuschner
ea88b0e244 QWindows11Style: Draw inactive MDI window texts lighter
Fixes: QTBUG-130673
Pick-to: 6.8
Change-Id: I431ac917ac159d54c35b6a8da270f3bac8117019
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-11-23 15:30:52 +01:00
Johannes Grunenberg
ac73079dee QJson: Allow writing any QJsonValue
Any QJsonValue can be written as JSON now, not just objects and arrays.

Change-Id: I7076ecf23091d382caab2f27bc7874c4cf0a81bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-23 11:05:38 +01:00
Johannes Grunenberg
65fda988e9 QJson: Allow parsing any JSON value to QJsonValue
QJsonValue can now parse all its types (arrays, strings, objects,
numbers, booleans, and null) at the top-level. QJsonDocument will still
return an error when parsing types that aren't objects or arrays.

[ChangeLog][QtCore][QJsonValue] QJsonValue now follows RFC 8259 and is
thus able to parse any JSON value, not just arrays and objects.
QJsonDocument remains at the level of RFC 4627 in that only arrays and
objects can be parsed.

Fixes: QTBUG-62502
Change-Id: I10f3895a7646953a6f6b5f132196267e700782a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-22 21:25:23 +01:00
Thiago Macieira
5c3f768409 QMetaType: rename qRemovePointerLike with uppercase Q
It's a type.

Drive-by removal of the template alias, which wasn't necessary as we
only ever use this in one place.

Change-Id: I2fbcc3bcc8d7bc1d193ffffdbf1c7fc89f3c2641
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-11-22 11:09:24 -08:00
Thiago Macieira
bb0c61b42f QMetaType: make iface() constexpr
And use it in QtMocHelpers.

Change-Id: Iacc9d5759653b2828575fffd4109425a120ccb22
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-22 11:09:23 -08:00
Thiago Macieira
6acacb36dd moc: move the StringData creation into qt_create_metaobjectdata()
This removes the last file-scope static variable by moving the
stringdata into a merged MetaObjectContents resulting structure. We now
only have two class-scope private static inline member template
variables. It also removes the wish to merge the strings' integer data
into the regular uint array, since effectively they are now merged.

Eventually, this should lead to moving the strings into the XxxxData
classes so moc doesn't have to collect them early. I don't have a
solution for this yet but have some ideas.

I've left the StringData class behind because I've found it useful for
QMetaObjectBuilder::toCode().

Generated code for QDeviceClosedNotifier (qtextstream.cpp), c++filt'ered:

        .section        .rodata,"a",@progbits
QDeviceClosedNotifier::qt_staticMetaObjectStaticContent<(anonymous namespace)::qt_meta_tag_ZN21QDeviceClosedNotifierE_t>:
        .long   13                              # 0xd
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   1                               # 0x1
        .long   14                              # 0xe
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   0                               # 0x0
        .long   1                               # 0x1
        .long   0                               # 0x0
        .long   20                              # 0x14
        .long   2                               # 0x2
        .long   10                              # 0xa
        .long   1                               # 0x1
        .long   43                              # 0x2b
        .long   0                               # 0x0
        .long   24                              # 0x18
        .long   21                              # 0x15
        .long   46                              # 0x2e
        .long   11                              # 0xb
        .long   58                              # 0x3a
        .long   0                               # 0x0
        .asciz  "QDeviceClosedNotifier\000flushStream\000"
        .zero   1

        .section        .data.rel.ro,"aw",@progbits
QDeviceClosedNotifier::qt_staticMetaObjectRelocatingContent<(anonymous namespace)::qt_meta_tag_ZN21QDeviceClosedNotifierE_t>:
        .quad   QtPrivate::QMetaTypeInterfaceWrapper<void>::metaType
        .quad   QtPrivate::QMetaTypeInterfaceWrapper<void>::metaType

        .globl  QDeviceClosedNotifier::staticMetaObject
QDeviceClosedNotifier::staticMetaObject:
        .quad   QObject::staticMetaObject
        .quad   QDeviceClosedNotifier::qt_staticMetaObjectStaticContent<(anonymous namespace)::qt_meta_tag_ZN21QDeviceClosedNotifierE_t>+88
        .quad   QDeviceClosedNotifier::qt_staticMetaObjectStaticContent<(anonymous namespace)::qt_meta_tag_ZN21QDeviceClosedNotifierE_t>
        .quad   QDeviceClosedNotifier::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
        .quad   0
        .quad   QDeviceClosedNotifier::qt_staticMetaObjectRelocatingContent<(anonymous namespace)::qt_meta_tag_ZN21QDeviceClosedNotifierE_t>
        .quad   0

Change-Id: I484c9165989ae4eaeea1fffd196c08947c083cb5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-22 11:09:23 -08:00
Thiago Macieira
a079964638 moc: rewrite the stringData() algorithm so we can have a temporary store
First step in moving it inside of the qt_create_metaobjectdata()
function and passing as a parameter to QtMocHelpers::metaObjectData().

Change-Id: Ie2d2603b12daab33d36bfffd297d91af46e26c3d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-22 11:09:23 -08:00
Thiago Macieira
74a5c18c36 moc: make the result of QtMocHelpers::metaObjectData not have UniqueType
That way, there are fewer types that get stored as global variables,
possibly reducing the number classes detailed in the debug symbol table.

            Core    Gui   Widgets
Before        84    122      208
After         45     72      110

This breaks NRVO by returning a different type than the local variable,
but since this is all running at constexpr time, it doesn't really
matter.

We need to pass the unique type to the metatype resolver, so the copyTo
functions are modified to take it as a template parameter.

Change-Id: I4083f1d1c2c44ed6dd22fffd9840da7741b723d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-22 11:09:23 -08:00
Tor Arne Vestbø
c853054910 macOS: Return high-DPI pixmaps from QCocoaTheme::standardPixmap
Most consumers feed the pixmaps into a QIcon, pulling out pixmaps
of sizes 32, 64, 128, 256, 512, so consumers of that QIcon will
not see low-resolution pixmaps for the common sizes like 64x64.

However if someone uses standardPixmap directly, or request an
icon with size 512x512, we won't have a high-DPI pixmap.

Unlike QStyle::standardPixmap we don't have a QWidget/QWindow
argument we can use to resolve the target DPR, so we have to
assume the pixmap can be used anywhere, and use the highest
DPR we've seen so far, via QGuiApplication::devicePixelRatio().

Change-Id: I3f41299b180f9361e3c7b1cd1f9bf4b1d00344da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-22 20:09:23 +01:00
Tor Arne Vestbø
0c0fe5f2f1 iconbrowser: Add support for QAbstractFileIconProvider
Which uses the platform theme under the hood, but returns QIcon
instead of QPixmap.

We now also render the platform pixmaps as 64x64 to more easily compare
the rendering to the other APIs.

Change-Id: I1418c8c144747b25d4cc39cad887560931ea7a1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-22 20:09:22 +01:00
Jonas Karlsson
ae9006b72d test: baseline: Call finalizeAndDisconnect
Pick-to: 6.8
Change-Id: I4379b4b982b869ca8d502d2f102ddc3b3858b5c8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-11-22 19:21:42 +01:00
Axel Spoerl
eca169b8d9 QFusionStyle::pixelMetric() - set PM_ButtonMargin to 6
Amend b92b7c69a93e1df61ec1bf59580eae51662c1ea6, which has set
PM_ButtonMargin to 4 and caused a baseline deviation.

Change-Id: I4097e6a4789a5e123442ad3954b9de41b0f82ad3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-11-22 18:38:49 +01:00
Michał Łoś
bc99725404 Fix disabling QEXPECT_FAIL in tst_qlineedit for VxWorks
Amends 3e1d5843f3, in which I failed to replace "#ifdef" with "#if
defined" when adding condition to turn off QEXPECT_FAIL for VxWorks in
tst_QLineEdit::testQuickSelectionWithMouse test function. This ends up
with additional warning from compilers ("extra tokens at end of #ifdef
directive" from both clang and gcc), and ignoring check for
Q_OS_VXWORKS, causing 3e1d5843f3 patch effectively not changing
anything.

Fix this by replacing "#ifdef Q_PROCESSOR_ARM_32" with proper "#if
defined(Q_PROCESSOR_ARM_32)".

Task-number: QTBUG-115777
Task-number: QTBUG-131362
Change-Id: I915789ece497879d557e95bc7ded51116d6ea167
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-22 14:53:57 +01:00
Edward Welbourne
0da34e6ac2 Fix an assertion failure in QLocale::uiLanguages()
Discovered by an Android 'phone configured with inconsistent system
locale and UI language list. The system locale specified more than the
en of what likely subtags expand to en-Latn-US and the single entry in
the UI language list was en-NO, so we fell back to adding the former,
but added the bcp47name() of the locale alongside the locale ID of the
CLDR entry for the system locale. The BCP47 name omits tags that what
remains will imply given likely-subtag rules, some of which may be
included in the CLDR entry's ID. This lead to an inconsistency
contradicting a later assertion.

Since we generally do want to search more specific names before less,
stick with the more specific ID from CLDR and use the name derived
from it as the uiLanguages entry to match, fixing the assertion. The
later post-processing of the list shall add the remaining
less-specific entries at suitable positions.

Change-Id: I1f1554dfb4c0198b04f8276fcb5d7869c9e58aac
Reviewed-by: Eimen Oueslati <eimen.oueslati@qt.io>
Reviewed-by: Nils Petter Skålerud <nils.petter.skalerud@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-22 11:12:06 +01:00
Morten Sørvig
8ae392b9dc wasm: remove canvas-as-container-element fallback
Qt used to accept a canvas created by user code. This
is no longer supported and user code should provide a
div container element instead.

Make this an error case with a qFatal()

Change-Id: I5c5ceef85916632bd95347546a8098b9a650afa6

Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-11-22 12:00:40 +02:00
Dheerendra Purohit
0c96528e8d QDebug: add streaming operators for std::set
The stream insertion operator for QDebug is not overloaded
to handle std::set

Overload the stream insertion operator for QDebug
to handle std::set

[ChangeLog][QtCore][QDebug] Added support for std::set.

Fixes: QTBUG-130574
Change-Id: I8e1589589c8f23318bf5073609995f7da4ea1108
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-22 04:52:58 +00:00
Thiago Macieira
278d2255e2 QThreadData: inline ref() and deref()
You *should* be using LTO if you want performance, but these functions
are trivial enough that it makes sense to inline them.

The !QT_CONFIG(thread) support seems wrong and is probably leaking
memory for the QAdoptedThread for the main thread. But since that only
happens because the program is exiting anyway, it's a case of "leak" in
quotes and one I don't care about.

Pick-to: 6.8
Change-Id: I2bb6e519239ea33cc521fffd71f57574f940ed62
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-21 17:35:48 -08:00
Thiago Macieira
296b46f593 QThreadData: repack members for efficiency
This combines the 4-byte padding hole between the integers and
QThreadData::eventLoops with the 4-byte tail padding, reducing the size
of the structure from 152 bytes to 144 (on 64-bit systems).

Change-Id: I0d87543952cbbbb0bd0bfffd6997a7c3fe4f81a6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-21 17:35:47 -08:00
Thiago Macieira
4716f502c5 QThreadData: make the constructor inline and use NSDMI
Change-Id: I3de01ca51f8d850ad283fffdd14a04a32f6f5840
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-11-21 17:35:46 -08:00
Rami Potinkara
5a3867a5e7 Android: Add QEXPECT_FAIL to flaky tst_android testFullScreenDimensions
This patch temporarily adds QEXPECT_FAIL to testFullScreenDimensions
test on Android 15.

Reason for this is that the testFullScreenDimensions from tst_Android
had been flaky on Android 15 and recently it had started to fail
continuously. QEXPECT_FAIL keeps CI status same between Android 14 and
15, before this test case is fixed.

Task-number: QTBUG-131338
Pick-to: 6.8 6.5
Change-Id: I32a610283b5b9f1502251d1dcc940897b389f092
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-11-22 00:42:49 +02:00
Assam Boudjelthia
fe672c3db8 AndroidTestRunner: don't run build command twice and print on failure
Print an error log when the build command fails that make it clear
that the build has failed and not necessarily the test.

Also, it seems according to the code, that if the build command fails
and --skip-install-root is set, the build command is run again.

Prepare the build command after parsing the args considering all the
other args and simply run the final build command in main() to simplify
things.

Pick-to: 6.8
Change-Id: I2f5a9d26bcea78349e1ef1cec4f717c37afd0225
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2024-11-21 21:15:08 +02:00
Tor Arne Vestbø
6d4a717152 Improve windowflags manual test
Group the Qt::CustomizeWindowHint specific flags separately, to make
it clear that they only apply if Qt::CustomizeWindowHint is set, and
give the QWindow preview window a title.

Add option to visualize the safe areas of the window.

Change-Id: I25ae7229b47ceaaa02f4be5a8210dbe44f54b6fa
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-11-21 17:49:37 +01:00
Even Oscar Andersen
efa0d60fe4 wasm: handle isComposing for platforms that support it
Fixes
(Alt + '~') + 'a' -> ã
(Compose) + '\'' + e -> é

A key change is to look at "isComposing" for events
Related bugs:
    QTBUG-107139
    QTBUG-124932
    QTBUG-117096

Fixes: QTBUG-130887
Pick-to: 6.8
Change-Id: I0d4641d89952e0b4117226994a91e40039ad8a03
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-11-21 17:49:37 +01:00
Mårten Nordheim
3307d593dc Use QHttp2Connection in qhttp2protocolhandler
After introducing QHttp2Connection earlier we ended up having some
duplication. For 6.9 let's be brave and get rid of that :)

This patch drops all the code that can now be handled by
QHttp2Connection, and uses that directly.

Fixes: QTBUG-129211
Change-Id: Ie82b532452010b06f33e29457da8fb698898a29f
Reviewed-by: Mate Barany <mate.barany@qt.io>
2024-11-21 17:48:13 +01:00
Matthias Rauter
ba5a2fbe7e Add QStringConverter to string class group
Task-number: QTBUG-77020
Change-Id: Ic11de8f815b7c742761ad9d0884f1eb58534b6ce
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-11-21 17:33:09 +01:00
Edward Welbourne
264fcd63b5 Android system locale: take script and variant into account
For now QLocale shall ignore variant, and it's probably usually empty,
but Android provides it so we may as well include it. Including script
matters in many cases, where a language can be written in more than
one.

Change-Id: I3ae392053e9e655fe89e6d3f8740a0d1d7f335af
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-11-21 17:33:09 +01:00
Jonas Karlsson
62b349c5cf BaselineProtocol: add FinalizeTesting command
Also adds a helper function QBaselineTest::finalizeAndDisconnect()
that calls the finalize command, prints the optional report URL
and disconnects to the server.

Pick-to: 6.8
Change-Id: Iabdba77f9eebad3e3f3fa67ab8977d1e49c49fb4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-11-21 16:33:09 +00:00
Tatiana Borisova
69315d6627 [QCOMPARE_3WAY] Expected and actual vars should use different formatters
- Split the orderFormatter into two parameters: actualOrderFormatter
and expectedOrderFormatter

Ammends 454f010e58b4f17df5d2683233e92448097d2dd1

Change-Id: I4ec468a0c0a4daea41c5ba2ce5ccfff0378460b8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-11-21 16:10:37 +00:00
Isak Fyksen
35022c1698 Replace QPair/qMakePair with std::pair in qtbase/opengl
Task-number: QTBUG-115841
Change-Id: Ic7a362a41fb52d39d8a168f0ba4ed6d33458dd73
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
2024-11-21 16:10:37 +00:00
Kai Köhne
abe3eed548 CMake: Disable doc_snippets feature for static builds
Now that we have a separate feature, we can fix QTBUG-99063 by disabling
the doc_snippets feature globally.

Task-number: QTBUG-99063
Change-Id: I77ba875633ed89fdd8b8481ea0fddc7e91cbb9ca
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2024-11-21 16:39:14 +01:00
Inho Lee
39bcd4287a eglfs: change the condition to destroy the openglcompositor
With an openglcompositor, only first QEglFSWindow is set
with a flag, HasNativeWindow and when it is destroyed,
the openglcompositor is destroyed, too.
For now, when using openglcompositor, Qt will not check
HasNativeWindow for its nativeWindow because it is not
possible to add a HasNativeWindow flag in an existing
window. And the openglcompositor will be destroyed after
the all the QEglFSWindows are closed.

Fixes: QTBUG-129576
Pick-to: 6.8 6.5
Change-Id: I620a904a03d29e8db1738d9392f716b3ebf5b553
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-11-21 11:35:58 +00:00
Alexandru Croitor
e54d4eabbe CMake: Fix CMP0174 warnings in Qt6CTestMacros.cmake
Invalid build dir values were passed to the WORKING_DIRECTORY option
to the qt test apis.

We shouldn't be passing the option at all, it makes no difference for
the case of calling ctest --build-and-test, because we already specify
the build dir in the command line of ctest.

Amends bc5b7e218f7259f440449e69c42518467bc5907b

Pick-to: 6.8
Change-Id: I0fe5b20a4beaefbd129849699c873c6a558d8996
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-21 12:35:15 +01:00
Inho Lee
19bce49aaa qpa eglfs: remove unreachable if statement
There is the same return-statement right before.

Pick-to: 6.8 6.5
Change-Id: I7890c386e50733aefbba57ed9f6df09763c54bc3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-11-21 12:33:58 +01:00
Stephan Bergmann
78a011b9ba Update the check for WebAssembly JSPI support
At least Chrome 130 (after explicitly enabling "Experimental WebAssembly
JavaScript Promise Integration (JSPI)" in <chrome://flags/>) no longer has
WebAssembly.Function, but has WebAssembly.Suspending.  Which appears to be in
line with what is documented in the 2024-06-04 post at
<https://v8.dev/blog/jspi-newapi> "WebAssembly JSPI has a new API".

Change-Id: I6c777801482758864438879057917e2c5faa28a8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-11-21 11:32:11 +01:00
Michał Łoś
3e1d5843f3 Fix XPASS in tst_QLineEdit on VxWorks
On VxWorks, which uses clang as its sole compiler and ARM32 as one of
its platforms, check for partial selection of text on simulated mouse
move passes in tst_QLineEdit::testQuickSelectionWithMouse test function,
in line 5053.  This causes "QEXPECT_FAIL" preceding this check to fail
the test due to XPASS.

According to message in QEXPECT_FAIL, this ifdef is intended not only
for platforms based on ARM32, but also for gcc_arm7 target. Since
VxWorks for 32 bit ARM uses clang, it might be assumed that this is the
same for any other platform that uses clang as a compiler.
Unfortunately, due to unknow actual reason for this issue, I can't make
such general assumption, so to stay on a safe side, only VxWorks should
be excluded from ARM32 platforms using this "QEXPECT_FAIL".

Exclude VxWorks from platforms that expect failure in text selection
check in tst_QLineEdit::testQuickSelectionWithMouse test function.

Task-number: QTBUG-115777
Task-number: QTBUG-131362
Change-Id: Id10f0462e5416935c01a41f173c48c17803531c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-11-21 11:32:11 +01:00
Michał Łoś
fc39077737 Blacklist QUdpSocket test functions failing on VxWorks
Test functions:
 - writeDatagramToNonExistingPeer
 - multicastTtlOption
 - multicastLoopbackOption
 - readyRead
are failing on VxWorks in its nightly COIN run. We do not know the root
causes of these failures.

We need to run tests on COIN for VxWorks as significant, and fails in
QUdpSocket test functions prevents it, to reduce growing number of
regressions and allow iterative introduction of VxWorks as a supported
platform.

Blacklist QUdpSocket test functions failing on VxWorks.

Task-number: QTBUG-115777
Task-number: QTBUG-130078
Change-Id: I47c18f6d53406d4ecacfd35fb27ef883b561951d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-11-21 11:32:11 +01:00
Liang Qi
f8aa1c423e xcb: guard crtc before usage
Task-number: QTBUG-131343
Pick-to: 6.8 6.5
Change-Id: Ibcf96340e316b6fd667895dcd5d2cd6e4b55e012
Reviewed-by: David Redondo <qt@david-redondo.de>
2024-11-21 10:53:32 +01:00
Thiago Macieira
ea3288c9b6 moc: keep the enum/class/struct C++ type tag in properties
ActiveQt dumpcpp could use this so
        Q_PROPERTY(class Accounts *Accounts READ Accounts)

can compile. moc will now generate:
    QtMocHelpers::UintData qt_properties {
        // property 'Accounts'
        QtMocHelpers::PropertyData<class Accounts*>(1, 0x80000000 | 2, QMC::DefaultPropertyFlags | QMC::EnumOrFlag),
    };

    if (_c == QMetaObject::RegisterPropertyMetaType) {
        switch (_id) {
        default: *reinterpret_cast<int*>(_a[0]) = -1; break;
        case 0:
            *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< class Accounts* >(); break;
        }
    }
    if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast<class Accounts**>(_v) = _t->Accounts(); break;
        default: break;
        }
    }

Change-Id: Ibb85c3a067054d017b05fffdbd500f302f655bd9
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-20 21:42:55 -08:00
Johannes Grunenberg
8fabcb642f QJson: Move writing from QJsonDocument to QJsonValue
JSON values are now written directly by QJsonValue instead of
QJsonDocument. Only objects and arrays are currently supported to be
written.

Change-Id: I413db14c69e8d6e9f06431051c8d716d1fb9d4eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-21 04:50:25 +01:00
David Warner
c20c7814f4 Recognize Windows Server 2025 build number
Pick-to: 6.8
Fixes: QTBUG-131395
Change-Id: If3c4d6371b21720be4cbecc1508f83c9b3526751
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-11-20 18:30:00 -08:00
Thiago Macieira
67a71d7109 QPostEventList: use qsizetype to count posted events
It's highly unlikely you're going to have more than 2 billion pending
events for a thread, but this is the right thing to do.

Pick-to: 6.8
Change-Id: Ia162b024815c3b970d71fffd3bc022621b2e07b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-11-20 18:29:59 -08:00
Michael Weghorn
363f069b0b a11y atspi: Don't redefine libatspi constants
Instead of redefining ATSPI_DBUS_* constants that
are already defined in libatspi, just use those
from libatspi's atspi/atspi-constants.h header directly.

They are available in that public header since this
libatspi 2.1.5 commit [1]:

    commit 1caa8f4613c87fec43406285a6597fd6f6408457
    Author: Mike Gorse <mgorse@linux-l2tz.site>
    Date:   Wed Jul 27 16:54:19 2011 -0500

        Move DBus interface name constants into atspi-constants.h

        Move DBus interface name constants into a public header, so that they can be
        used by application-side AT-SPI code (ie, at-spi2-atk).

Also, replace QSPI_REGISTRY_NAME and QSPI_OBJECT_PATH_ROOT
with the corresponding libatspi constants
ATSPI_DBUS_NAME_REGISTRY and ATSPI_DBUS_PATH_ROOT.

[1] 1caa8f4613

Change-Id: Idc7384fa70f36973260cb89dd1cf0fe9b5d16c73
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-11-21 02:25:13 +01:00
Dheerendra Purohit
a8c9a5617c QDebug: add streaming operators for std::unordered_set
The stream insertion operator for QDebug is not overloaded
to handle std::unordered_set

Overload the stream insertion operator for QDebug
to handle std::unordered_set

[ChangeLog][QtCOre][QDebug] Added support for std::unordered_set.

Fixes: QTBUG-130481
Change-Id: I75a1f62f9ecb6b06ba45cc00d789cd3f3886b4c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-20 22:42:38 +00:00
Johannes Grunenberg
7be9b5997d QJson: Move parsing from QJsonDocument to QJsonValue
JSON values are now parsed by QJsonValue instead of QJsonDocument. For
parsing, this removes the need for QJsonDocument entirely.

Fixes: QTBUG-109870
Change-Id: I2f9bae3a53e5d445cc9e8437c63a53a2c7b3593e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-11-20 21:45:16 +01:00
Assam Boudjelthia
d2a8a0dc29 Android: add note QPermission under private permission APIs
Link to the newer permission API and note that the private
API can still be used for permission types not covered by
QPermission.

Pick-to: 6.8
Fixes: QTBUG-130372
Change-Id: I093edd72bc50372eba3b06105087ccd4884b0bac
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2024-11-20 21:03:35 +02:00
Volker Hilsheimer
d8daec6021 QFusionStyle/CC_Slider: don't paint tickmarks antialiased
They look blurry if we do, paint only the rest antialiased.
Amends 032db29bbc8c98462494d7a4e942af7a990e43f8.

Change-Id: I480f10943214f94afa52454de43c3b7f836a6def
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-11-20 16:21:53 +01:00
Marc Mutz
27d792869b QNativeIpcKey: normalize docs for qHash()
The C++ standard forces¹ us to overload the hidden friend qHash()
implementation instead of defaulting `seed` to zero. That doesn't mean
we need to reflect that technicality in the docs, esp. if it forces us
to deviate from the standard phrasing of qHash() functions to say
something about the default value of `seed` (which would, for a
defaulted argument, be shown in the docs).

Present the qHash() function in the canonical form to QDoc. This is a
(forwards and backwards) BC way to solve the issue. Going forward, the
correct fix should be to have qHash() functions call a private
hash(seed) member function instead, to fulfill the pointless
requirement of [1].

¹ [dcl.fct.default]/4, last sentence

Amends c2310f8e03cf30222cea59b3c556d060e1710015.

Pick-to: 6.8
Task-number: QTBUG-129574
Change-Id: I7890a0df092c9780601fc4c25e23d70d92db47e1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-11-20 09:10:35 +01:00