Commit Graph

59527 Commits

Author SHA1 Message Date
Marc Mutz
7eff78e8a5 Android: checkPermission/s(): use makeReadyFuture()
... instead of manual QPromise handling.

QtFuture::makeReadyFuture() is both more efficient and more readable.

As a drive-by, replace size() > 0 checks with !isEmpty().

Change-Id: I299fbe8e6be10d8f65b8f86fcc6b586ac3cbd9d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
2023-01-04 16:55:35 +00:00
Marc Mutz
080e1b6011 QAndroidExtras: release mutex earlier in requestPermissionsInternal()
The g_pendingPermissionRequestsMutex protects only the
g_pendingPermissionRequests QHash, so we can drop it immediately after
the QHash::insert() call. In particular, we don't use reference into
the QHash afterwards, and the following runOnAndroidMainThread() call
is internally synchronized, anyway.

Change-Id: I66a0e402e9ed1edb5fd9fec14e85f9371cc4fc36
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-04 17:55:35 +01:00
Tor Arne Vestbø
7e7bae35f7 macOS: Include text in key events triggered by insertion key-bindings
In 705665957b we started relying on the
input method to decide whether a key event should include the resulting
text or not, based on the assumption that text insertion would happen
via the insertText:replacementRange: selector.

But the NSStandardKeyBindingResponding protocol includes several other
commands for inserting content, including insertTab:, insertBacktab:,
and insertNewline:.

  https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding

We explicitly handle the latter, but for any command we didn't handle,
we concluded that the input method didn't want us to insert text, and
sent the key event without text, which broke tab character insertion
in text edits.

As long as we're not handling these commands explicitly, we adjust
the logic to treat any command starting with "insert" as an unhandled
request to insert text, and forward it as a key event with the text
included, as before 705665957b.

Fixes: QTBUG-109754
Task-number: QTBUG-106393
Pick-to: 6.4 6.5
Change-Id: I4a164bc809c3606b43f267514a66ff017efeb4af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-04 17:05:19 +01:00
Ahmad Samir
96708cf161 QDateTimeParser: use a local var instead of multiple str::at()
Better readablility.

Change-Id: I936a915d50222c644cda493e01dccfe223a881bd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-04 16:49:12 +02:00
Tor Arne Vestbø
ba639edd27 Reflect QStyleHints in AA_DontShowShortcutsInContextMenus
There are two ways to override whether shortcuts (key sequences) should
be shown in menus, QStyleHints::::showShortcutsInContextMenus() and
the Qt::AA_DontShowShortcutsInContextMenus application attribute,
but only the latter is checked by our own menu implementations.

This was confusing, as overriding the style hint had no effect.

It makes sense for the QStyleHint to be based on the platform style
hint, but since we also allows overriding it, the logic in QGuiApp
that initializes Qt::AA_DontShowShortcutsInContextMenus should be
based on the QStyleHint.

Note that the inverse relationship is not maintained, as the app
attribute should not affect the style hints.

This creates a somewhat awkward situation in terms of when you need
to override the behavior, so we might consider deprecating one of
the options.

Fixes: QTBUG-109590
Task-number: QTBUG-69452
Change-Id: I366c17ff00fd8ae10553bbfb88d162ffd2c8040f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-04 15:49:11 +01:00
Yuhang Zhao
9af5a70c55 Update the documentation of QScreen::name()
Task-number: QTBUG-109569
Pick-to: 6.5 6.4
Change-Id: I24ed586e9094e7cd2277c6289ffbd4210dd6e430
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-04 21:26:25 +08:00
Alexey Edelev
f071421558 Check if "-stagingDir" is passed from the command
Check if "-stagingDir" is passed from the command line before trying
to copy files to it.

Pick-to: 6.5
Change-Id: Id39882e4e955bd54328c8e747377b9d49f977378
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-04 13:42:07 +01:00
Alexey Edelev
ad7ad62d17 Avoid breaking version script generator state
Pass every line to parseVersionScriptContent to not break the
version script generator state. The parser doesn't collect characters
from comment block, so the line containing the 'ignore-next' ELFVERSION
tag produces empty buffer for the further parsing process. Call the
parseVersionScriptContent function even on empty buffers to make sure
that 'ignore-next' counts lines correcly.

Pick-to: 6.5
Fixes: QTBUG-109790
Change-Id: I5f77893462d397f6738a5da1af6ed8dd8a2df70a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-04 13:42:06 +01:00
Volker Hilsheimer
fb8701cb8b QListView: Prevent infinite loop when wrapping text of item with null-icon
If an item in a list view has a null icon, then the decorationSize gets
calculated as -1, -1. The style would then try to wrap the text to a
lineWidth of -1, ending up in an infinite loop in viewItemTextLayout.

To prevent that, don't set the HasDecoration flag of the style option
when the icon is null, and don't fall back ot the decorationSize unless
the flag is set.

Add a test for this particular item configuration. This also fixes the
widget baseline test with styles that don't provide all standard icons.

Pick-to: 6.5
Change-Id: I691db6abede9a9b2ad300f3ee7fbfdae5fb6097f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2023-01-04 13:42:06 +01:00
Eskil Abrahamsen Blomfeldt
84a68ef75c Fix assert when resizing text table with percentage widths
Since Qt 6.3.x, qBound() has started asserting that max > min.
This caused a crash in the QTextDocumentLayout code for assigning
widths to table columns that were sized using percentages, which
depended on previous qBound() behavior of just snapping to the
minimum size if max < min.

There are some specific conditions for this to happen: First
of all, the available width in the table must be too small to
fit all minimum widths (which is calculated based on content).
In addition, the requested widths have to be given as
percentages of the table width, and these have to add to
something lower than 100%. With these conditions, you may get
a case where the calculated percentage width of a column is
larger than the minimum width, but lower than the remaining
width in the table, causing the assert in qBound().

We simply accept the minimum width as the rule in these cases,
which matches behavior without the assert and which looks
correct when resizing the window to be smaller than the table.

Fixes: QTBUG-108183
Pick-to: 6.4 6.5
Change-Id: I16d18dd9b2e7a77fe86d1a353b426075b5050b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-01-04 13:42:06 +01:00
Joni Poikelin
7584871f4d Fix a warning about extra semicolon in qstylepainter.h
Pick-to: 6.5 6.4 6.2
Change-Id: I104037ff58ade4b2ceffd73687355a5d237ab571
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-04 07:36:05 +00:00
Eirik Aavitsland
b1bb732639 Doc: note QWindow::winId() will cause platform window creation
Worth it to emphasize this, as such a side effect from a const
accessor may well be unexpected.

Change-Id: I0b70d81927e0b66799cbe736ce5d488e2ec77ce0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-01-04 00:09:50 +01:00
Eirik Aavitsland
f091026be1 Fix deletion order in QImageReader/Writer destructors
The device would be deleted before the image format handler, and hence
be a dangling pointer that could easily cause a crash if the handler
or codec would access it on destruction, e.g. for cleanup.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I51d16b1feddc5945955ac75a2e8701233dba7b82
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2023-01-04 00:09:06 +01:00
Axel Spoerl
df62cefdcb Skip tst_QWidget::optimizedResizeMove and ..._topLevel on wayland
Wayland omits optimizations tested in tst_QWidget::optimizedResizeMove()
and optimizedResize_topLevel() under certain circumstances, e.g. on
Ubuntu 22.04 / Gnome. This makes the test functions fail.

This patch skips the test functions on wayland platforms, if an
omission is detected.

This amends 2ec7a6322f.

Fixes: QTBUG-109746
Pick-to: 6.5 6.4
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-01-03 19:21:39 +00:00
Tor Arne Vestbø
3b60534ab9 macOS: Limit cursor update workaround to Monterey and below
The AppKit issue has been fixed in Ventura.

Change-Id: Ic2c0a0ed4ad52ef2d52410ec2c8ba061907cbe8e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-03 19:06:17 +01:00
Tor Arne Vestbø
a080fc9f89 macOS: Send synthetic cursorUpdate events for utility windows
In faffaa7292 we limited our cursor update
workaround to key windows, but macOS also sends cursorUpdate events
to non-key windows with the NSWindowStyleMaskUtilityWindow style mask,
so we include this in our workaround logic from ae8e96d4c2. We
include NSWindowStyleMaskTitled in this check, as macOS seems to
require a window to be titled to treat it as a utility window.

Task-number: QTBUG-96374
Change-Id: I1c54da181acbe472c2f598fec37aeadada3956bb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-03 19:06:16 +01:00
Axel Spoerl
49a8311ae5 Change parsing log output in QGtk3Json from qCDebug to qCInfo
When a palette mapping is imported from a Json file, parsing errors are
logged with qCDebug. This prevents errors from being logged in release
builds.

This patch replaces qCDebug with qCInfo for Json parsing to make errors
visible when the logging category qt.qpa.gtk is activated.

Pick-to: 6.5
Change-Id: I3f92ecc3ab51f863f62ccef9f9061902320d3c3c
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-01-03 18:25:19 +01:00
Marc Mutz
7a6016aec4 QWindowsKeyMapper: make the code locale-independent
The C toupper function is locale-dependent. Given the right locale
(Türkiye, e.g.), toupper(i) is either

- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)

The latter is clearly wrong. The former might be what is wanted, but
since most locales these days are UTF-8, Í will be unlikely to be
representable in char.

So I conclude that what's intended here is that i gets mapped to I,
even in the Türkiye locale, so use the new QMiscUtils::toAsciiUpper()
instead of <ctype.h> toupper().

Fixes: QTBUG-109520
Pick-to: 6.5 6.4
Change-Id: I6fee2fb15c2facae79f1727455180567698fed80
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-01-03 15:57:37 +00:00
Kai Köhne
8bf602518d Enforce strict standards behavior in MSVC headersclean check
The comment apparently doesn't apply anymore.

Change-Id: Ie0572341c55d60b83ff428134ba803068fa20558
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-03 13:53:47 +01:00
Kai Köhne
5de97970b8 Remove cmake output about module major/minor/patch version
I don't quite see the relevance of this. We have explicit warnings
if versions don't match a bit below.

Pick-to: 6.5
Change-Id: I08253fb99313896adb2c13d193ed3ec3954fb0b0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-03 13:53:47 +01:00
Liang Qi
3790821b22 ibus: support high dpi for cursor rectangle
on both X11/xcb and Wayland.

Following similar approach in QFcitxPlatformInputContext::cursorRectChanged()
https://github.com/fcitx/fcitx5-qt/blob/master/qt5/platforminputcontext/qfcitxplatforminputcontext.cpp#L490-L532

Tested with following configurations:
* GNOME on xorg, 100%/125%/150%/200% scale, 1 and 2 monitors
* KDE/Plasma X11, 100%/150%/200% scale, 1 monitor
* GNOME on Wayland, 100%/200% scale, 1 and 2 monitors

Enable fractional scale on GNOME:
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-103393
Change-Id: Idfd3153e4cd9f9530b4db6f089830ec47451a19e
Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
Reviewed-by: Weng Xuetian <wengxt@gmail.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-01-03 12:07:44 +01:00
Liang Qi
54002671bd ibus: add SetCursorLocationRelative in InputContext.xml
Task-number: QTBUG-103393
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I90c48a0d698636ed289d6f6c1485875e2e91fb34
Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
Reviewed-by: Weng Xuetian <wengxt@gmail.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-01-03 12:07:44 +01:00
Liang Qi
f09f516ac1 tests: skip tst_QComboBox::cancelClosesPopupNotDialog() on Wayland
QWindow::requestActivate() is not supported.

This amends c95de359b4.

Task-number: QTBUG-107153
Pick-to: 6.5 6.4
Change-Id: I45f53b5e9de85049ca41cc139a78a82450f53bed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-03 12:07:43 +01:00
Axel Spoerl
71e67dec95 Stabilize tst_QSpinBox::sizeHint()
The test function used to flake on Linux occasionally.
8e6ede7cd1 provided a fix. While it
seemed to work, further analysis has shown that the root cause is
event sequence in case of multiple paint events.

This patch re-engineers the test function:

1. Allocate test widget on the stack instead of the heap.
2. Send layout requests posted by QHBoxLayout constructor and
QLayout::addWidget() before showing the widget.
3. Remove calls to QCoreApplication::processEvents().
They are unnessecary, because
- the size hint request counter is supposed to increase (by any number)
- QTRY_VERIFY processes events anyway until the counter increases or it
times out.

Pick-to: 6.5 6.4 6.2
Change-Id: I54998483725cbdd4899ba6f5469d7dae0980ab1d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-01-03 10:57:21 +01:00
Joerg Bornemann
d756f4753e Rename the 'module_name' key in module description JSON files
...to 'name'.
It's clear from the context that this is the name of a module.

Pick-to: 6.5
Change-Id: I07700a4413ceb12695c153e16d0a2dcded615d11
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-01-03 07:30:19 +01:00
Tor Arne Vestbø
9bf42425f1 Don't use var-args for Q_DECLARE_EXPORTED_LOGGING_CATEGORY
MSVC should deal just fine with a single argument macro, and this
prevents the silent mistake of passing a single argument to
Q_DECLARE_EXPORTED_LOGGING_CATEGORY which would result in
no error or warning, but without exporting the category.

Pick-to: 6.5
Change-Id: I4190027f8914ad1ef3957759f8e8c0e6cbd8ba97
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-03 00:41:21 +01:00
Tor Arne Vestbø
76cef0f171 macOS: Ensure NSEvent processing during NSApp initialization
After 27f0854813 we are ensuring NSApp
initialization without relying on our own runloop sources. But stopping
the app only happens after it has processed an NSEvent, such as a mouse
move or key press, which in the case of an auto tests might not happen.

To ensure that the [NSApp stop] has an effect we post a synthetic event,
that has no other effect than waking up the runloop.

Change-Id: Ifa8912a80f9deff62645cbef56c1b1230542f3e4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-03 00:41:10 +01:00
Kai Köhne
25c67c608a Examples: Do not wrap custom types in Qt namespace
The Qt namespace should be used for types defined in the Qt library,
not for user types.

Pick-to: 6.5
Change-Id: I6df0ca054888f4a65b19a9cb44324321d1dcfad8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-02 23:16:30 +01:00
Alexey Edelev
947dd880cc Replace syncqt arguments with rsp file
syncqt arguments contain full paths and may exceed the supported
command line size on some platforms. Use a single rsp file to pass
all arguments to syncqt.

Added the missing end-of-line terminators for error messages.

Pick-to: 6.5
Change-Id: I60ad0f6770458d5256e67f042a63a3c16cd5ecb5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-02 23:16:30 +01:00
Alexey Edelev
0a746a30a5 Remove QT_USE_SYNCQT_CPP
Option has not effect anymore.

Pick-to: 6.5
Change-Id: I199ff15ac68b785ba1787d44494c0b2dff3b1ad0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-02 23:16:30 +01:00
Tor Arne Vestbø
ad31b5f4c7 Don't use native dialogs for tst_QApplication::closeAllWindows()
The test shows an application modal QMessageBox, but assumes that doing
so will be non-blocking, which for macOS is not the case (yet). Instead
of making the dialog window-modal, which would potentially affect the
logic of the test, we disable native dialogs. This should be fine, as
the purpose of the test is to test the is_closing logic of
closeAllWindows, which lives on a layer above the native dialogs.

Pick-to: 6.5
Change-Id: I6d627984a6ca452b876f34404b669fce41a00851
Reviewed-by: Doris Verria <doris.verria@qt.io>
2023-01-02 23:12:30 +01:00
Tor Arne Vestbø
351d3e50f9 macOS: Stop using the deprecated [NSWorkspace openFile:] API
We can use openURL instead, which also opens local files in the
associated application.

Pick-to: 6.5
Change-Id: Ieddc6fb68d6b9e64195ed261953b9fffb6b0b73e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-02 19:01:30 +01:00
Kai Köhne
7a37114af9 Doc: Fix snippet for Q_DECLARE_EXPORTED_CATEGORY
The name argument must be a C++ variable name, not a string.

Pick-to: 6.5
Change-Id: I6bc45bc9a57fd8429cf033aa118eebff0fcfc4a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-02 18:06:29 +01:00
Jonas Kvinge
314a4d121f QFileSystemEngine: URL encode path in trash info, use relative path
According to the specifications, the path in .trashinfo should be URL
encoded.

The path can be relative when possible, otherwise changing the
mountpoint will break restoring files from trash.
But don't do that for root (/) and home.

For more info, see.:
https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html

Pick-to: 6.5 5.15
Change-Id: Id8271a893a007f4cb5c10611f2b1bc71c1ff4860
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-02 17:39:37 +01:00
Andreas Eliasson
b556d6227f Doc: Fix broken link
Also, adjust line length to be < 80 columns and make link
parenthetical.

Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-107026
Change-Id: I5f7efa5d572103a6fb432d79a52a57363efd9dd7
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-01-02 13:50:52 +00:00
Tor Arne Vestbø
b0af876bed wasm: Flesh out side module and main module logic for shared builds
Task-number: QTBUG-63925
Change-Id: I9da8ca0364a4fe6c9ec4d272657e1cf726d305c4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-01-02 14:50:51 +01:00
Alexey Edelev
9c56a77027 Move '--sign' argument to the end of the androiddeployqt command
The '--sign' argument may and may not accept two follow arguments
to specify signing path and alias from the command line. This
functionality breaks the parsing of command line arguments that
follow the '--sign' argument and expect that '--sign' is used with
no follow arguments. It does make sense to check if the arguments
passed after the --sign staring with '--' to make sure that '--sign'
with no arguments is meant to be used.

Pick-to: 6.4 6.5
Fixes: QTBUG-109619
Change-Id: I4ee7fe953e5378c00760d84ec58f9e89e4348944
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-02 14:50:51 +01:00
Mikolaj Boc
644036b597 Return to the two-step destruction in compositor
The two-step destruction we used to employ is needed as destroying
a screen which contains a window crashes.

Pick-to: 6.5
Change-Id: I722828be5408a7f079d66e845eeee34ed19cbf34
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-01-02 11:17:57 +01:00
Morten Sørvig
a594e95c9a wasm: support setting Emscripten configuration
Support passing Emscripten configuration options to
the QtLoader constructor using the "moduleConfig"
key.

Previously, it was possible to set Emscripten config options
on the global Module object. However, recent versions
if Qt has switched to using the MODULARIZE=1 build setting,
in which case there is no global object.

Fixes: QTBUG-107979
Pick-to: 6.5
Change-Id: Ie99b772ddbb1d9f5464c868a43c821bae01519e0
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-01-01 23:50:42 +01:00
Ahmad Samir
9aaf258211 QStringBuilder: document issues with using "auto" keyword
Cleanup QStringBuilder API docs.

Task-number: QTBUG-104354
Change-Id: I00029c8f4bfdf35869396ac14d7d9ba0da34cdb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-01 17:47:04 +02:00
Ahmad Samir
5d76c49e9c Use more documentation snippets for QString and its siblings
Pick-to: 6.5
Change-Id: Ia569806b586923473f68b9fe1d98a3628ba46a58
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-01-01 14:13:50 +02:00
Ahmad Samir
bab660d124 QStringConverter: add QLatin1::convert{To,From}Unicode()
With the methods that use helpers from qstring.cpp defined in the
latter.

Change-Id: I11d6b0bfb95efe34e56d33d2ecbfe8f4423a9e6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-30 16:36:24 +02:00
Alexey Edelev
6a18bc8090 Revert "CMake: Expose generated resource files to IDEs"
This reverts commit 30efb24d45.

Reason for revert: Breaks resource handling in examples: QTBUG-109678. 

Change-Id: I4abfd9960cc26d9b45317f84e63ff7424982d12f
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2022-12-30 10:41:37 +00:00
Marc Mutz
f68a2316d8 Long live QPromise::addResults()!
Makes the pre-existing QFutureInterface functionality available via
the public QPromise API.

[ChangeLog][QtCore][QPromise] Added addResults() to report multiple
results at once.

Change-Id: I18e6ef2781df422020b9022d78d6c45107b01668
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-12-30 07:03:51 +01:00
Giuseppe D'Angelo
114b94c26e QTypeInfo: fix pointer detection
Although redudant, people are allowed to use Q_DECLARE_TYPEINFO on a pointer
type. There's no reason to mis-detect the isPointer trait in that case.

Change-Id: Ic116f24397c91f5a3d31f5d8ee9fa2e587823257
Pick-to: 5.15 6.2 6.4 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-12-30 01:52:11 +01:00
Giuseppe D'Angelo
227b9cd084 QTypeInfo: remove further usages of isPointer / isIntegral
In preparation to their deprecation / removal.

Change-Id: Ia073a9f7caabbc06063a1e416b23cdb12788b283
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-30 01:51:27 +01:00
Giuseppe D'Angelo
e8f5f20319 QMetaType: fix value-initialization in a corner case
If a type is trivially default constructible, QMetaType (and QVariant)
think that it can be built and value-initialized by zero-filling a
region of storage and then "blessing" that storage as an actual instance
of the type to build. This is done as an optimization.

This doesn't work for all trivially constructible types. For instance,
on the Itanium C++ ABI, pointers to data members are actually
value-initialized (= zero-initialized, = initialized to null) with the
value -1:

https://itanium-cxx-abi.github.io/cxx-abi/abi.html#data-member-pointers

This means that a type like

  struct A { int A::*ptr; };

is trivially constructible, but its value initialization is not
equivalent to zero-filling its storage.

Since C++ does not offer a type trait we can use for the detection that
we want to do here, and since we have also decided that Q_PRIMITIVE_TYPE
isn't that trait (it just means trivially copyable / destructible), I'm
rolling out a custom type trait for the purpose.

This type trait is private for the moment being (there's no
Q_DECLARE_TYPEINFO for it), and limited to the subset of scalar types
that we know can be value-initialized by memset(0) into their storage
(basically, all of them, except for pointers to data members).

The fix tries to keep the pre-existing semantics of
`QMetaType::NeedsConstruction`. Before, the flag was set for types which
were not trivially default constructible. That included types that
aren't default constructible, or types that cannot do so trivially.
I've left that meaning unchanged, and simply amended the "trivial" part
with the custom trait. A fix there (to clarify the semantics) can be
done as a separate change.

Change-Id: Id8da6acb913df83fc87e5d37e2349a4628e72e91
Pick-to: 6.5
Fixes: QTBUG-109594
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-30 01:51:08 +01:00
Thiago Macieira
41b38c802b Fix improper ELF versions of certain symbols
They got marked as Qt6_PRIVATE_API because of these private header
defining classes that don't follow Qt's naming convention ("mutex",
"condition_variable", "ControlElement"). We have an exclusion for
classes whose name start with Q.

Introduced by 5d903a64ac in the old Perl
syncqt and ported over.

Pick-to: 6.5
Fixes: QTBUG-109605
Fixes: QTBUG-109604
Change-Id: I69ecc04064514f939896fffd173369623c960bcc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-12-29 17:53:54 -03:00
Christian Ehrlicher
cb62cdbaa6 SQL: rework the connection options documentation (typos)
Fix some typos found after the initial commit for the connect options
documentation update

Change-Id: I9cf201363117a2f05e611c26a058f035fa945ddb
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-12-29 20:04:17 +01:00
Hannah von Reth
5b8d7d239c DB2: Fix typo in QMetaType
Change-Id: I6ada1fec3ce16670dd7346788db4e9c80ffae8d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2022-12-29 18:43:32 +01:00