Commit Graph

61325 Commits

Author SHA1 Message Date
Marc Mutz
fdc29b9714 Move handling of helper from create() to QGenericRunnable
Keeps the helper contained in QGenericRunnable.

Change-Id: I52d075efc55c5eb78fe97ade261b58fc75e2a6c1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-11 12:47:53 +02:00
Marc Mutz
e3442c05bd QStyleSheetStyle: avoid #define ceil()
There's only one user of this function-like macro and already broke
unity-build, so make it a lambda instead and scope it close.

Remove the previous work-around (#undef at end of TU).

Pick-to: 6.5
Change-Id: I0bd7cd41b89a6f32144d2040ff2b4a18d0045d21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-05-11 12:47:53 +02:00
Bartlomiej Moskal
64db65ae90 Android: fix problem with release package for cmake based builds
After 9efaf8bae9 commit there is no
possibility to create release package for cmake based builds.

Added a new cmake variable (QT_ANDROID_DEPLOY_RELEASE) to allow turning
on release build manually.

Task-number: QTBUG-112921
Task-number: QTBUG-108132
Task-number: COIN-882
Pick-to: 6.5
Change-Id: Idf015b4ad3f8cba792aab75a01e1c81225cad4f0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-05-11 12:47:52 +02:00
Marc Mutz
3c3de181ef QCallableObject: use QtPrivate::CompactStorage
... optimizing the storage of empty function objects.

I thought we had applied this a long time ago, but it turns out that
QPrivateSlotObject (c61d9873e5) is only
for QObjectPrivate::connect()...

This adds the same optimization for regular QObject::connect(). This
is BC, since we don't touch the base class (QSlotObjectBase), and the
QCallableObject subclasses are all-inline or explicitly Q_DECL_HIDDEN.

Amends c61d9873e5.

Change-Id: I63fd1b6f882b58f9f98eae67c636c3615248ad79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-11 10:38:33 +00:00
Eirik Aavitsland
aaccd50224 Add QBezier methods for computing a quadratic curves approximation
Useful for operating on QPainterPaths with algorithms designed for
quadratic, and not cubic, curves.

Change-Id: I1af2d6e4f2b66ce675cde863f67d65fbf9db7d39
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-05-11 12:38:33 +02:00
Assam Boudjelthia
f1778f34e0 Android: fix QDir::entryInfoList() with content URIs
Correctly return only the fileName portion from
AndroidContentFileEngineIterator::currentFileName(); which
QDirIteratorPrivate::matchesFilters() expects when looking for matches
of the file pattern provided to the QDirIterator.

Fixes: QTBUG-112738
Pick-to: 6.5 6.2 5.15
Change-Id: I98dba2df014b27f33cd7e54fab3ad2de8c7c1750
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-05-11 13:38:32 +03:00
Jan Grulich
4710fb3528 QIconLoader: use system fallback theme as the first fallback option
When searching for an icon, we either use the system theme or the theme
set as a fallback through QPlatformTheme, it's only one or the other.
It can easily happen that the fallback theme we pick as a parent theme
will not fit into the application style (color-wise). For example using
KDE apps on GNOME, where we use "Adwaita" icon theme, we would always
fallback to "Breeze", however, using dark theming, we want to fallback
to "Breeze-dark" and this can be easily set through QPlatformTheme
integration, but it's not going to be used when the system icon theme
is valid and in such case the fallback theme will be ignored.

This change makes the system fallback theme used as the default fallback
by putting it to the list of parent themes.

Pick-to: 6.5 6.2 5.15
Change-Id: I966cd8ddd0e5576e3593d349fe7ee7139136bfdf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-05-11 10:46:58 +02:00
Joerg Bornemann
adbfdacacc Doc: Don't advertise qt_add_big_resources on qt_add_resources page
Don't refer to qt_add_big_resources as the preferred way of adding big
resources. The qt_add_resources command has support for big resources
these days.

Move the link to add_big_resources to the "see also" part of the page.

Pick-to: 6.5
Change-Id: I030ef079db8ac41417049e58e98eb7aa6fd809e9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-05-11 10:10:16 +02:00
Antti Määttä
3962a27bd8 Tracepointgen: Fix debug print warnings
Pick-to: 6.5
Change-Id: Id6386fd4226024b6bd919b20adc4a5b02c53bc80
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-05-11 11:10:16 +03:00
Marc Mutz
d026fad3d9 QPointer: also make conversion to pointer-to-const work
The QWeakPointer conversion SMFs cannot actually be used for QObject
payloads, as, for unknown reasons (some comment about vtable this
author doesn't understand), conversion goes through QSharedPointer,
the creation of which throws the checkQObjectShared() warning and
yields a nullptr.

We need to continue to use the QWeakPointer(T*, bool) constructor the
QPointer(T*) ctor also uses.

It's high time we dissociated QPointer from QWeakPointer...

Amends 5f28d367d9.

Fixes: QTBUG-112464
Change-Id: I2f93843af3daf02323d77a4259eaa3745d8de3a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-11 08:10:16 +00:00
Thiago Macieira
8a873c2d6d QDeadlineTimer: avoid a system call for timeout == 0
The constructor's documentation already had the note saying that we
could apply this optimization, but it wasn't there and looks like it
never was. This only applies to the default constructor, which sets t1
to zero, which is the epoch. This could be a problem for an OS whose
monotonic clock starts with negative values, but I don't know such an OS
exists and this hasn't been a problem so far.

This commit doesn't change the behavior of the old-style, non-
std::chrono getters, because we always transform any negative remaining
time to 0. It is only possible to observe it by asking the remaining
time or the deadline using the std::chrono API.

Change-Id: I6f518d59e63249ddbf43fffd175a3fc2911e91fb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-11 00:28:50 -07:00
Thiago Macieira
ec0e0d1e81 QDeadlineTimer: make it so any negative millisecond count is "forever"
We have quite a few Qt API that assumes this, so making this change
helps transitioning them to QDeadlineTimer.

[ChangeLog][Important Behavior Changes] QDeadlineTimer will now
interpret negative millisecond remaining times as "forever", instead of
only the value -1. This brings the API closer in line with other API
like QMutex. This change does not apply to the nanosecond counts in the
API, nor to the API based on std::chrono.

Change-Id: I6f518d59e63249ddbf43fffd175a3e5bead564ae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-11 00:28:49 -07:00
Thiago Macieira
d848e6d87d QDeadlineTimer: use std::chrono::ceil() in setRemainingTime()
In case the time is of less than 1 ns, we want to make sure it remains
non-zero.

Change-Id: I3e3bfef633af4130a03afffd175d9c4903271f80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-05-11 00:28:49 -07:00
Thiago Macieira
285f92bd54 tst_QDeadlineTimer: remove the testing of the different timer types
Commit b498e1ae3a removed the last
distinction. And since there was no distinction, the code that was
previously under a conditional for CoarseTimer must work for precise
too.

Change-Id: I6f518d59e63249ddbf43fffd175a3eddbd41611a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-11 00:28:49 -07:00
Ievgenii Meshcheriakov
e5ecebef4f QtDBus: Remove unused extern declaration of qDBusInitThreads()
Change-Id: I318ca15d9da9fe9f9a0d68494d0f55061d88987e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-11 09:23:43 +02:00
Tim Blechmann
1269f33d3b animation: use Q_EMIT in private header
qabstractanimation_p.h is pulled in from qmltc generated code, that
users may decide to build with `QT_NO_KEYWORDS`

Change-Id: I6ce1e82b3c68f6b7e1e349b40945a6f398d8baf5
Pick-to: 6.5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-05-11 15:23:07 +08:00
Qt CI Bot
9da69c7969 Merge integration refs/builds/qtci/dev/1683731304 2023-05-11 07:23:05 +00:00
Tor Arne Vestbø
d3ede38edd Darwin: Cache system locale's zero digit and invalidate on locale changes
As part of ed2b110b6a the implicit caching
of some of the system locale queries was removed, resulting in a
three orders of magnitude performance regression on converting
dates to strings via QLocale::system() on macOS and iOS.

We now cache the most critical of these, the zero digit, in the Darwin
backend, and clear the cache in response to the system locale changing,
restoring the performance two orders of a magnitude closer to that of Qt 5.

We're still one order of magnitude off, which seems to stem from the
auto release pool in QSystemLocale::query().

Fixes: QTBUG-104785
Pick-to: 6.5 6.2
Change-Id: I26f96147d430f08a721c55a1048d586a4af3a76c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-05-11 09:23:04 +02:00
Edward Welbourne
74b377313e Test QLocale's parsing of small fractions with big exponents
Add some tests inspired by the initial form of a bug report (before we
found out what the real issue was), that a small fraction with a large
exponent is correctly handled. This should work as long as the result
is representable, even if the fraction itself is too small to be
represented by the floating-point type.

Pick-to: 6.5
Task-number: QTBUG-113443
Change-Id: Ie004197961fc7b603e5024a6ebc5928261a0e2bb
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-10 17:30:45 +02:00
Mårten Nordheim
36e59db1bb Unblacklist tst_QDnsQuery::lookup
It was blacklisted some years ago, the bug was closed as
cannot reproduce, and no one unblacklisted it.

Pick-to: 6.5 6.2
Change-Id: I51f1fe4d819e0f90bf18c19b67fa0dca198914d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-10 17:16:25 +02:00
Mårten Nordheim
86a0e70d65 QDataBuffer: decrease size on shrink()
Having the size potentially be larger than the capacity can't
be considered anything other than a bug.

Pick-to: 6.5
Change-Id: Id059c0f2c7320f992d897011d7aa944c5cb86058
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-05-10 16:53:13 +02:00
Tor Arne Vestbø
311f8157ae iOS: Don't add Qt libraries to PRE_TARGETDEPS of xcodebuild Makefile
Support for PRE_TARGETDEPS was added for iOS applications in
53ac8094b1, even if the Xcode
generator doesn't support PRE_TARGETDEPS, by taking advantage
of the glue Makefile we use to run xcodebuild.

And we add our own Qt libraries to PRE_TARGETDEPS in qt.prf,
as you would expect. But since Xcode supports both debug and
release, we always set debug_and_release for this glue Makefile.

The result is that when computing the Qt library PRE_TARGETDEPS,
we fail to apply a _debug suffix from qtPlatformTargetSuffix(),
since we've enabled debug_and_release.

In a debug only build, this means that 'make' of the glue Makefile
will fail to find the release versions of our Qt libraries.

To work around this we skip adding Qt to the target deps when
generating the xcodebuild Makefile, as we know these libraries
are added to the target in the Xcode project.

Pick-to: 6.5 6.2
Change-Id: Icafc103e34a6f83240fa8187181d885fb0172a86
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-10 16:37:47 +02:00
Marc Mutz
278acae611 tst_QFont: fix printf-format mismatch
Use qUtf16Printable() to convert QString to somthing consumable by
%ls. Fixes the format/argument mismatch on non-Windows platforms:

    tst_qfont.cpp: In member function ‘void tst_QFont::italicOblique()’:
    tst_qfont.cpp:153:67: warning: format ‘%ls’ expects argument of type ‘wchar_t*’, but argument 2 has type ‘const ushort*’ {aka ‘const short unsigned int*’} [-Wformat=]
      153 |                 QVERIFY2(f.italic(), qPrintable(QString::asprintf("Failed for font \"%ls\"", f.family().utf16())));
          |                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
          |                                                                                                              |
          |                                                                                                              const ushort* {aka const short unsigned int*}

Amends 4bf82909f1.

Change-Id: I0c7e2dca91a093835d7dba8bff2e5ea78d3a926e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-10 12:00:29 +02:00
Marc Mutz
ad398b2df6 QStyleSheetStyle: fix unity-build with chunk-size 13
The definition of ceil() as a function-style preprocessor macro
appears to clash with the definiton of QFixed::ceil(), included
later. That's an educated guess, though, because the error is
completely different:

    qstylesheetstyle.cpp:141:19: error: expected unqualified-id before ‘int’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                   ^~~
    qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                   ^~~
    qstylesheetstyle.cpp:141:19: error: expected ‘)’ before ‘int’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                  ~^~~
    qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                   ^~~
    qstylesheetstyle.cpp:141:19: error: expected ‘)’ before ‘int’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                 ~ ^~~
    qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’
      141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x)))
          |                   ^~~

Fix by #undef'ing at the end of the TU. This is a minimal fix,
suitable for backporting to older branches. A more modern fix will be
forthcoming as a follow-up patch.

Pick-to: 6.5 6.2
Change-Id: I8c1b6c7834e55b2bf28044a78ddf5bb544b23c65
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-10 12:00:28 +02:00
Thiago Macieira
3efefcceba QSlotObjectBase: move the m_ref after m_impl for Qt 7
This moves the padding that exists on 64-bit architectures from between
the two fields to the end of the the structure. In turns, this allows
certain ABIs to reuse the tail padding space of the base class to store
some information. It can only be used if the functor has alignment of 4
or less, but the interesting case is when it's an empty but final
functor.

The pahole report goes from:
struct CallableObject : QSlotObjectBase {
        /* class QSlotObjectBase     <ancestor>; */      /*     0    16 */
        struct FinalFunctor        func;                 /*    16     0 */
        /* XXX last struct has 1 byte of padding */
        /* size: 24, cachelines: 1, members: 2 */
        /* padding: 8 */
        /* paddings: 1, sum paddings: 1 */
} __attribute__((__aligned__(8)));

to (pahole gets very confused by this trick):
struct CallableObject : QSlotObjectBase {
        /* class QSlotObjectBase     <ancestor>; */      /*     0    16 */
        /* XXX last struct has 4 bytes of padding */
        /* XXX 65532 bytes hole, try to pack */
        struct FinalFunctor        func;                 /*    12     0 */
        /* size: 16, cachelines: 1, members: 2 */
        /* padding: 4 */
        /* paddings: 2, sum paddings: 5 */
        /* BRAIN FART ALERT! 16 bytes != 0 (member bytes) + 0 (member bits) + 65532 (byte holes) + 0 (bit holes), diff = -524160 bits */
} __attribute__((__aligned__(8)));

Change-Id: I3e3bfef633af4130a03afffd175d3be98511bae5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-10 01:30:54 -07:00
Volker Hilsheimer
ccd3b28aab Rename QFunctorSlotObject to QCallableObject
After the recent changes we only have a single implementation of
QSlotObjectBase, which can handle free functions, member functions,
functors, and lambdas. Rename it to callable, and explicitly hide
the static implementation function so that it doesn't become a symbol
of static libraries using Qt.

Also rename makeSlotObject to makeCallableObject, and polish coding
style and comments in the qobjectdefs_impl header a bit.

Change-Id: Id19107cedfe9c624f807cd8089beb80e9eb99f50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-10 10:30:54 +02:00
Volker Hilsheimer
0306247f5a Remove Java iterator APIs for moving back if operator-- is not available
QSet's iterator doesn't have operator--, but the
Q_DECLARE_SEQUENTIAL_ITERATOR macro declared and implemented functions
hasPrevious/previous/peekPrevious/findPrevious for the QSetIterator
anyway, depending on that operator. The resulting code couldn't compile.

Use SFINAE to remove the various "previous" functions from Java-style
iterators if operator--() is not present.

This removes the hasPrevious() API as well, even though it could compile
(as we only check whether the iterator points at constBegin). But since
nothing useful can be done with that information, it's best to remove
that member function as well.

[ChangeLog][Potentially source-incompatible changes] QSetIterator no
longer has a hasPrevious() member function. The underlying iterator
doesn't implement operator--(), so couldn't be moved backwards anyway.

Fixes: QTBUG-113379
Change-Id: I47b0ba384d8fcd127123d8fa509cd89e10ea8c99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-10 09:49:24 +02:00
Topi Reinio
041e10e64f Doc: Add CSS styling and icon for 'technical preview' items
QDoc adds a 'Status' field to the table on top of type reference pages.
One common status for Qt modules/types is 'Technical preview'. Add
an icon that is displayed next to the status description, highlighting
the fact that the type is in tech. preview and therefore subject to
change.

Pick-to: 6.5
Task-number: QTBUG-113026
Change-Id: Ibe6ca2a562cc7810fe27e7dcf514c711cd022894
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-10 04:40:38 +00:00
Thorbjørn Lund Martsum
8c0153a526 Fix QMenu (+other theme) sizes on Windows multiscreen systems
The reason this worked before is unclear. It could be suspected
that we have made a dpi awareness change or Microsoft changed
the behavior of the OpenThemeData function.

Regardless, we expect the result to match the primary display which
OpenThemeData doesn't do (anymore). Instead it returns a value based on
the hwnd screen (which btw didn't always match the widget) and the cache
system would then re-use that theme also for hwnds on other screens.

The most obvious solution is to use OpenThemeDataForDpi to make sure
we get a theme result matching the primary sceen. Then our correction
of the result by with multiplying
QWindowsStylePrivate::nativeMetricScaleFactor(widget)
works again.

This fix does not only fix QMenu sizes. It fixes the size for all
widgets that use this theme function, which could return near
random results before.

We load this library dynamically since MinGW 11.2.0 won't link with it.

[ChangeLog][QWidgets][QMenu] Fixed menu sizes on Windows systems
with more screens.

Fixes: QTBUG-112911
Pick-to: 6.5
Change-Id: I8fdfde2ef5b2aa407cbc74c85afe2c0b74026cff
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2023-05-10 05:36:09 +02:00
Tor Arne Vestbø
dcff882f30 macOS: Clear event dispatcher interrupt before running NSAlert modal session
If the event dispatcher is interrupted we propagate the interrupt to
lower event loop levels, in case they too need to be interrupted. And
we defer the actual interrupt of the NSApplication to the next time we
process Qt events, to avoid AppKit dropping queued events on the floor.

This logic relies on QCocoaEventDispatcher::processEvents() setting the
interrupt flag to false, which signals that we should not continue to
tear down any further event loops.

Unfortunately, native run loops such as running application modal
sessions, are not driven by QCocoaEventDispatcher::processEvents(),
so we never reset the interrupt, and end up ending the session
immediately.

To work around this we need to explicitly clear the interrupt flag
before starting native modal sessions. This also fixes the issue
seen in QTBUG-111524 with showing native alerts from nested event
loops.

Fixes: QTBUG-112697
Task-number: QTBUG-111524
Pick-to: 6.5 6.5.1
Change-Id: I6aaec97011fd18c4a513c1dde3173b1cc4d50112
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-10 00:20:18 +00:00
Tor Arne Vestbø
e51ff5c493 a11y: Don't add scrollbar container as a11y child if scroll bar is re-parented
If someone has, for unknown reasons, re-parented the scroll bar of a
scroll area to outside the scroll area, we should not blindly add the
parent widget of the scroll bar as an a11y child of the scroll area.

We don't need to explicitly add the scroll bar itself as a child either,
as that will be handled by whoever is the new parent widget, as a normal
scroll bar would.

Fixes: QTBUG-93768
Pick-to: 6.5 6.2
Change-Id: Ib26f31674602e2221311e864ad31bbf141cad8f6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-05-10 02:20:18 +02:00
Jaishree Vyas
8f6ec8cea2 Clarify module changes in Qt6
Changed Briefs for better understanding

Fixes: QTBUG-109324
Pick-to: 6.5
Change-Id: I15b0c0dc12b1bf96626fb8ea4ad16d04b2b118ca
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-05-09 22:36:06 +00:00
Nicholas Bennett
dbfc472225 Docs: Update OpenGl example docs
Updated hellogle3 and cube docs.
Made brief statements more brief, rearranged to reference examples were
suitable, added snippets.

Fixes: QTBUG-108416
Pick-to: 6.5
Change-Id: Ia86f9dc8eaa53d9f9654afe099caf3ee8c7fccee
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-05-09 22:02:25 +00:00
Eskil Abrahamsen Blomfeldt
6160ea45b6 Implement API for enabling / disabling OpenType features
Similar to the font-features-settings in CSS, this is a low-level
API that allows you to pass the information to the shaper in order
to enable or disable specific font features by name.

[ChangeLog][QtGui][Text] Added an API to QFont which makes it
possible to enable and disable specific typographic features
in OpenType fonts.

Change-Id: Ib48c678f3b97a5a562b08ae34dc895800c8885c0
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-05-09 23:39:41 +02:00
Edward Welbourne
b1d59d6dd9 rsslisting example: don't leak the RSSListing object
It was new'd and unparented, so its destructor was never getting called.
A stack instance will do just fine.

Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: If362b0e1e5b50d711a8fe8e01a8830034edf5363
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
2023-05-09 23:39:41 +02:00
Edward Welbourne
179b61c85f Update cbordump image to a higher-resolution one
Incidentally using reversed video, too, as that's what came naturally
to the terminal I was using. File is smaller, but text in the new
image is considerably more readable and the image is bigger.

The examples guideline calls for an image giving some idea what the
example is about, with a 4:3 or 5:4 aspect ratio. An image shorter
than its width wasn't practical, and getting a useful amount of
information in a height less than 3/2 of the width would have required
widening into blank space purely to satisfy the aspect ratio.  The
prior image's ratio was about 12:7, the new one's is roughly 2:3.

The old image showed the start of cbordump -a output, which is rather
less illuminating than the default output of formatted data; it's also
rather verbose, so was cut off part way through. It does, however,
illustrate how the annotated form might be useful for debug
purposes. The image also had a lot of blank space to the right of the
text of interest, wasting roughly half of its width; it could easily
have been cropped to 1:1 without loss of information. As example
data-set, it used ../savegame/save.dat, but without any hint to how to
generate that.

I decided to include a hint to how to generate a CBOR data file to
dump, then show the standard output and only the beginnings of the
annotated output, as the latter (even on its own) would make the
aspect ratio considerably taller. In the context of the standard
display, the preamble of the annotated one gives a reasonable feel for
what's going on, without belabouring the point.

Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: Ic54893c483607e95627a50db76a0d9918744c07e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-09 23:39:41 +02:00
Mårten Nordheim
0400f2ebe0 configure: Make -ccache work for msvc
Without enabling FEATURE_msvc_obj_debug_info ccache does not work
for me with msvc.
So, enable it along with -ccache to make things easier.

Change-Id: Ic6cf6ebddb4a5dce6a04987fba1a1f437b286e90
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-09 23:21:13 +02:00
Marc Mutz
3327fccfd5 QGenericRunnable: use CompactStorage
...optimizing the storage of empty function objects.

Change-Id: I6db7384e1ebb87249d5b93922a6c92f0767cc401
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-09 22:54:06 +02:00
Marc Mutz
b7780b5e5d Long live QtPrivate::CompactStorage<>
This is a generalization of QPrivateSlotObject's FunctionStorage.

Changes from the old API:
- uses a more neutral API (s/func/object/)
- preserves cv-qualifiers and value categories
- preserves constexpr'ness
- adds a disambiguation tag (e.g. for use in a compressed_pair).

The main feature is that it transparently uses the empty base-class
optimization to stow away empty classes without allocating separate
bytes for them.

To be used for the public QSlotObject and QGenericRunnable, at least,
so finally pulled the trigger and made it a separate component.

Change-Id: I9a13bbdd1dcf64aaf5fc7b2d40a60050d61800b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-09 22:54:05 +02:00
Eike Ziller
9f0b4e18cd QTextMarkdownImporter: Fix performance for non-trivial documents
While parsing the markdown document, each addition of text and
formats was triggering a relayout of the so far existing document,
leading to quadratic behavior and very bad performance for any
non-trivial markdown document.

Guard the changes while parsing with a begin/endEditBlock to
avoid these intermediate updates.

The performance impact can for example be observed with the
markdown editor in Qt Creator (11+).

Pick-to: 6.5
Change-Id: I5f89441ea41bc3c6281b616f0c5528b49b48e432
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-05-09 22:30:29 +02:00
Kai Köhne
e21c4be5d6 Unconditionally use Q_NORETURN for qAbort()
The exception for MSVC was probably added due to similar logic in
qlogging.h, but in this case, qAbort never returns also with MSVC.

Change-Id: Ica2155c34d4b32b20af5b1fcb5af35bb3ff6f668
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-05-09 22:30:29 +02:00
Kai Köhne
0de3a17394 Doc: Add XML, Json, CBOR examples to IO category
Pick-to: 6.5 6.5.1
Task-number: QTBUG-112372
Change-Id: I867bd33ff08629e03b35eccd4b7418573abe7c68
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2023-05-09 20:30:28 +00:00
Marc Mutz
6f1e53943d savegame ex.: revamp the way print() works
Basically, instead of re-creating QTextStreams all the time, create it
once, in main(), and then pass it to print() alongside the int
indentation.

Also fix a hard-coded indentation value that should have been relative
to the caller's indentation level.

Pick-to: 6.5 6.2
Task-number: QTBUG-108857
Change-Id: I811447295c9c3fdef23f61aff31ebe82941eb3b4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-09 08:21:10 +02:00
Allan Sandfeld Jensen
7b7a01c266 Fix specific overflow in qtextlayout
Adds qAddOverflow and qMulOverflow definitions to QFixed

Fixes: QTBUG-113337
Pick-to: 6.5 6.5.1 6.2 5.15
Change-Id: I13579306defceaccdc0fbb1ec0e9b77c6f8d1af9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-08 18:29:22 +00:00
Mårten Nordheim
1b736a815b Hsts: match header names case insensitively
Header field names are always considered to be case-insensitive.

Pick-to: 6.5 6.5.1 6.2 5.15
Fixes: QTBUG-113392
Change-Id: Ifb4def4bb7f2ac070416cdc76581a769f1e52b43
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-08 20:28:46 +02:00
Ahmad Samir
5f6600fa26 QMimeProvider: fix a clazy warning
Polymorphic class QMimeXMLProvider is copyable. Potential slicing.
[-Wclazy-copyable-polymorphic].

Change-Id: I1eff1389140ce9426db32a37df89935a7b3db3a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-05-07 14:30:23 +03:00
Ahmad Samir
8d46cff650 QMimeProvider: de-duplicate some code
Drive-by change: use range-for with a QHash::asKeyValueRange().

Change-Id: I173d28d759bef8f23330338127eeff3018af4a55
Reviewed-by: David Faure <david.faure@kdab.com>
2023-05-07 14:30:11 +03:00
Ahmad Samir
5083900ce3 QMimeProvider: use non-const stack variable for better move semantics
Change-Id: I8e539f9c2a9dc4a8aa388c5640b379326c38f817
Reviewed-by: David Faure <david.faure@kdab.com>
2023-05-07 14:30:02 +03:00
Ahmad Samir
329722a322 QMimeBinaryProvider: manage m_cacheFile with a std::unique_ptr
Change-Id: Ic68772a75c255a3a2880fa49b2456c34e3153493
Reviewed-by: David Faure <david.faure@kdab.com>
2023-05-07 14:29:48 +03:00
Ahmad Samir
9d9bbf687f QMimeDatabase: de-duplicate some code in the unittests
Change-Id: I7452a61b4c6e1f6b6b0f285aa3391fcd79a3e36d
Reviewed-by: David Faure <david.faure@kdab.com>
2023-05-07 14:29:28 +03:00