Commit Graph

54736 Commits

Author SHA1 Message Date
Thiago Macieira
6099e96d9e QJsonObject: use the UTF-8 string comparator in sorting
No change, the two functions are identical for case-sensitive
comparison. But this allows us to remove the comment that explained why
we were abusing the Latin1 comparator.

Change-Id: I0e5f6bec596a4a78bd3bfffd16c98bbcac6c9dc9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 13:49:03 -08:00
Tatiana Borisova
2cb5e4bd43 Fix tst_qcollator run time issue on INTEGRITY device
By GHS the only C locale is supported.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I3d89f1b2d9eb7f77b75e13a5ca65cebc24538890
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 21:49:02 +00:00
Thiago Macieira
8623e8ed08 QByteArray: remove left-over Q_NEVER_INLINE after we removed the tables
The comment made a reference to the case tables that used to exist in
qbytearray.cpp prior to commit 9dd8e655cd
("Limit QByteArray's 8-bit support to ASCII"). Now that the parameter is
a function pointer, not a table, inlining is actually beneficial: we
definitely don't want the compiler to emit function calls via the
function pointer.

At least GCC 11 was already doing constant-propagation of the parameter:
While it didn't inline the function, it cloned it and propagated the
constant in each of the two clones. There were 4 copies of this
function: const and non-const, upper and lower.

Change-Id: I0e5f6bec596a4a78bd3bfffd16c912a16602e20a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 21:47:07 +00:00
Timur Pocheptsov
cd446a7e25 QMacStyle: fix a regression introduced by a button type change
Since we (re)use NSButton to render tab items, the 'momentary push in'
button type breaks the tab. Temporary restore the old 'push on/push off'
type if rendering a tab.

Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-99743
Change-Id: I54b11c1a35373292ecf0bcd5cf7b4ea4203cc031
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 22:27:21 +01:00
Timur Pocheptsov
c30af31f99 QSslSocket (SecureTransport) add TLS 1.3 ciphersuites
At some point we decided to support a custom set of ciphersuites specified
by QSslConfiguration (which if you ask me was never a good idea). The law
of unforseen consequiences bit us again: since we now give a set of ciphesuites
to QSslConfiguration and set ciphesuites from the configuration a socket has,
we are limited by the ciphersuites we know about at the moment of 'coding'.
Meaning if an SDK was updated and CipherSuite.h later adds more ciphersuites,
we miss them and 'don't support them', while we ... actually do.

This patch tries to add some more ciphersuites introduced in TLS 1.3 (interesting,
SecureTransport does not support TLS 1.3, but TLS 1.3 suites can be used in TLS
1.2 session).

Pick-to: 6.2 6.3 5.15
Task-number: QTBUG-99368
Change-Id: I439b63845c4893e5621cffaf3bcaf62e2b643c74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-12 22:27:21 +01:00
Thiago Macieira
eabb3fd2f0 QVariant: fix incorrect warning about duplicated alias where there isn't
We were always matching a type name to itself because we forgot to
advance the iterator after we did match. The issue was introduced in
commit 46dc8e453a.

Fixes: QTBUG-99620
Task-number: QTBUG-96916
Pick-to: 6.3 6.2
Change-Id: Ib42b3adc93bf4d43bd55fffd16c8a5df6306e404
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
2022-01-12 11:37:32 -08:00
Kai Köhne
623200643c Doc: Replace "C:\Documents and Settings" paths
"C:\Documents and Settings" isn't a real path anymore since Windows Vista.
Replace it by C:\Users, or - in the snippet for QDesktopServices that
is for demoing a path with space - with C:\Program Files.

Pick-to: 6.2 6.3 5.15
Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 20:37:21 +01:00
Kai Köhne
23ffc22072 QStyle docs: Use since enum attribute
Use the explicit [since ...] instead of plain text to mark
when new enums were introduced.

Pick-to: 6.3
Change-Id: I13655931c91a509fa64cd545b49c517e975d4cc7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 19:37:21 +00:00
Marc Mutz
11becbe910 QTzTimeZonePrivate: fix UB (data race on m_icu)
The fallback m_icu QIcuTimeZonePrivate is lazily constructed, which
means that two threads each with their own copy of a QTimeZone with a
shared QTzTimeZonePrivate will race over who gets to set m_icu,
e.g. when concurrently calling QTimeZone::displayName().

Fix by protecting m_icu with a mutex. For simplicity, use a static
mutex, not a per-instance one (which would delete the
QTzTimeZonePrivate copy constructor, which clone() relies on). This is
sufficient for 5.15. For Qt 6, going forward, we could make this
lock-less, too.

[ChangeLog][QtCore][QTimeZone] Fixed a data race on Unix platforms when
implicitly-shared copies of QTimeZone objects were used in certain ways
(e.g. calling displayName()) from different threads and Qt was
configured with ICU support.

Pick-to: 6.3 6.2 5.15
Change-Id: I7e57aef3dd44a90289ad86d0578ece1e54920730
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-01-12 19:37:21 +00:00
Laszlo Agocs
bfc713530a rhi: Add queries for vertex input/output limits
Mainly because we do have legacy code in the Qt 5 graphical effects that
tries to dynamically determine the max number of varyings. Make it
easier to port such code.

Change-Id: I846cab2c2fe7b4cd473b5ced0146ca36f1c8169b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-01-12 20:37:20 +01:00
Joerg Bornemann
9d15854138 Fix wrong QT_HOST_* values when qt.conf is present
When a qt.conf was present, QT_HOST_* variables got a wrong default
value.  For example, QT_HOST_BINS would end with /bin/bin.

We must not provide the defaults via QSettings::value(_, defaultValue).
The assignment of the default value is done in
QMakeLibraryInfo::rawLocation() separately after retrieving the value.

This amends commit 04ec14105e.

Pick-to: 6.3
Fixes: QTBUG-99656
Change-Id: I43431664e93ab40417a5432b03e7eb38ae21bad8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-01-12 18:28:24 +01:00
Allan Sandfeld Jensen
96269ecc77 Draw extended RGB solid colors
Pass extended RGB colors through the paint engine.

Change-Id: I2e212cd4c76aaa65439746352c0da2b9db4a506d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-01-12 18:28:24 +01:00
Tor Arne Vestbø
996061a1c0 macOS: Implement QCALayerBackingStore::scroll for improved performance
The CALayer backingstore never had a scroll implementation because we
were relying on the QRasterBackingStore implementation, but as it turned
out that implementation was not applicable for the CALayer backingstore.

We now implement scroll() by determining which part of the back buffer
can be scrolled directly in-place, and then scrolling the rest by
copying from the front buffer. We have to handle both cases, as clients
may scroll multiple times before flushing, and the scrolled area may
overlap both valid back-buffer content and content that needs to be
pulled from the front-buffer.

Pick-to: 6.3 6.2
Change-Id: Icc09c9488386925116779c9024669a4329b38247
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-01-12 18:13:52 +01:00
Tor Arne Vestbø
588f956f78 Expand tst_QBackingStore auto test
Pick-to: 6.3 6.2
Change-Id: Ife6a175867cfc97c2c112d7c1bac606bc6798e98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-01-12 18:13:51 +01:00
Volker Hilsheimer
999d856bc8 Adapt SQL drivers to Qt 6 change of QVariant::isNull
In Qt 5, QVariant::isNull returned true if either the variant didn't
contain a value, or if the value was of a nullable type where the type's
isNull member function returned true.

In Qt 6, QVariant::isNull only returns true for variants that don't
contain a value; if the value contained is e.g. a null-QString or
QDateTime, then QVariant::isNull  returns false.

This change requires a follow up in the SQL drivers, which must
still treat null-values the same as null-variants, lest they write data
into the data base.

Add a static helper to QSqlResultPrivate that implements isNull-checking
of variants that contain a nullable type relevant for Sql, and add a
test case to the QSqlQuery test that exercises that code.

Pick-to: 6.2 6.3
Fixes: QTBUG-99408
Fixes: QTBUG-98471
Change-Id: I08b74a33aa3235c37d974f182da1f2bdcfd8217e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-01-12 17:41:07 +01:00
Andrey Mozzhuhin
66f0149693 QHttpNetworkConnection: Always set proxy settings to all channels
Proxy settings should always be set to all channels because after switching
from HTTP/2 to HTTP/1.1 they may all be used.

Problem was made in commit 8b9d246225. It is
introduce the QHttpNetworkConnectionPrivate::activeChannel field, which value
is 1 got HTTP/2 by default, but can later be changed to 6 if the remote host
doesn't support HTTP/2.

Pick-to: 6.3 6.2 5.15
Change-Id: Idcdeb22ec806520965f30a22045f99aa009a7362
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-01-12 16:41:07 +00:00
Dimitrios Apostolou
3acfd39653 qt-testrunner: disable JUnit XML test logs
It causes crashes because of interleaved execution of Quick tests.

Task-number: QTBUG-98350
Change-Id: I61e26f5da5617e06810db8eb7991f17eecdd3acb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 16:14:18 +01:00
Marc Mutz
716c916c40 QSinglePointEvent: port away from QMutableEventPoint::from()
Use the new static QMutableEventPoint setters, which do not depend on
undefined behavior.

Made it a separate commit, because, while straight-forward, it's a lot
of changes compared to other users.

Task-number: QTBUG-99615
Pick-to: 6.3
Change-Id: I580b6b225421a1e908f04c8e30adcdef6540ea52
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-12 15:14:18 +00:00
Marc Mutz
b17c4d0e2e QFlatMap: re-implement insert() via insert_or_assign()
Avoids code duplication.

Pick-to: 6.3 6.2
Change-Id: Ic69e46108baf97a0dc9215866d6c707136ee40b2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 16:14:18 +01:00
Marc Mutz
6891e10f97 QFlatMap: add insert_or_assign
This does exactly what insert() on Qt associative containers does, but
allows to express the intent of using the STL-incompatible Qt insert()
semantics, in an STL-compatible way, instead of leaving the reader of
the code wondering what semantics are expected.

This is part of a very-long-term goal of fixing Qt associative
container's insert() behavior, in which QFlatMap, being an affected,
but private-API type, is used for proof-of-concept purposes.

Task-number: QTBUG-99651
Pick-to: 6.3 6.2
Change-Id: I69010285438259918aef659d3235180c1b5be696
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 16:14:18 +01:00
Axel Spoerl
9f32fc97aa Remove unused testdata directory from QPushButton unit test
Pick-to: 6.3
Change-Id: I3682dad0e5024f171ac4137b32ae30bc0693aa8f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-12 14:27:59 +00:00
Mårten Nordheim
8c5e31536a QCache: fix potential crash in trim()
We use raw pointers to the Nodes in the QHash which is
inherently fine, but we are then subject to invalidation when
nodes are moved around during deletion.

In trim() we don't actually need to iterate the linked-list
since the node we are interested in is always chain.prev

Pick-to: 6.3 6.2 6.2.3
Fixes: QTBUG-99710
Task-number: QTBUG-99224
Task-number: QTBUG-99240
Change-Id: I9c2ed69b29e3cadca013113a3553deb44d7382fc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-01-12 14:27:59 +00:00
Axel Spoerl
5cc5ba8aac Remove unused legacy testdata directory from QWidget kernel unit test
Pick-to: 6.3
Change-Id: Id857c12321b72a7f35e9e7a157dc39f7fb95ecde
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-12 14:27:59 +00:00
Yuhang Zhao
831b3506fc QOperatingSystemVersion: Make implementation consistent on all platforms
Only Windows is using lambda function, change to static member
function to be consistent with other platforms.

QOperatingSystemVersionBase::current()'s implementation is exactly
the same on all platforms, so move it to the common source file
instead of implementing it three times on each platform.

Change-Id: I4099235b3b041a9a374e21d537649047ee03e62b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 21:00:45 +08:00
Volker Hilsheimer
4a4240f1bd Don't access QObject::objectName during QThread start
This is a data race, as the thread accesses QObject::objectName on the
QThread instance while the thread owning the QThread might modify the
objectName.

Instead, make a copy in the QThreadPrivate that can be accessed safely.

Task-number: QTBUG-96718
Pick-to: 6.3 6.2 5.15
Change-Id: I10701551d498993ca5055daf161636bfb648840c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 12:44:38 +01:00
Yuhang Zhao
e9fd1c6aab QScreen_win: retrieve user friendly monitor name
[ChangeLog][QtGui][QScreen] QScreen::name() now returns the user friendly name
instead of the GDI device name on Windows. This is consistent with other
platforms and also obeys the documentation.

Fixes: QTBUG-74317
Pick-to: 6.3 6.2
Change-Id: Iefbfaa1f9fd504277a0b5eb8c7a1fc13257c01f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-12 14:20:17 +08:00
Tor Arne Vestbø
11a4546ce9 Add Q_FLAG for QEventLoop::ProcessEventsFlags
Helps debugging when printing the flags.

Pick-to: 6.3 6.2
Change-Id: Icb306bb1efaf9d3c645c2ac86796d95da5afc4a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-12 04:38:14 +01:00
Tor Arne Vestbø
f3db9abebf eglfs: Unset shared raster compositing context before deletion
Change-Id: Ib0f615c76ac62f1177e44faaa733e67014f4185d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-01-12 04:38:14 +01:00
Morten Johan Sørvig
eef865cdc5 Make QCursor::setPos() use the correct screen
setPos() takes a screen argument, however this argument
indicates which cursor should be moved only and is
not usable as an argument to toNativePixels() since
the position may be on a sibling screen.

Add call to QScreen::virtualSiblingAt to get the target
screen.

Task-number: QTBUG-99009
Pick-to: 6.3 6.2 5.15
Change-Id: I8714ebc93a283c58bc67911315f787c484fb0dd8
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 03:17:47 +01:00
Zhang Hao
38a66aa53a xcb: Correctly update primary screen status with RandR 1.5
This amends d8f37d94e5 .

Fixes: QTBUG-99605
Pick-to: 6.3
Done-with: Liang Qi <liang.qi@qt.io>
Change-Id: Ia4cf67d6ebeed36596c0342302aa0b4af01769bc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-12 03:17:47 +01:00
Lorn Potter
8f7bebb611 wasm: ensure cursor reverts after window resize
This partially reverts 97be0cca17
but without the crash

We temporarily override the wasm cursor while leaving the
application/window cursor alone to mimic what desktop application
behavior is like.

Pick-to: 6.3
Fixes: QTBUG-99111
Change-Id: I23df48b2eaa82830593f1753ec23d14fe375b70c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-01-12 11:41:10 +10:00
Marc Mutz
66a183298a QPointingDevice: avoid double lookup in Private::pointById()
Use the newly-added try_emplace() function, to work around Qt's
associative container's broken insert() behavior (which is
equivalent to STL's insert_or_assign()), forcing either a double
lookup:

   auto it = c.find(key);  // lookup 1
   if (it == c.end())
      c.insert(key, ~~~);  // lookup 2

or the usual size-check trick:

    const auto oldSize = c.size();
    auto &e = c[key];
    if (c.size() != oldSize) {
        // newly inserted

onto any lookup-or-initialize-like code. try_emplace beats them
both in terms of efficiency and readability.

Pick-to: 6.3
Change-Id: I4c52d2f2d5175991db4931d29c688de125f5b032
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-12 01:03:15 +00:00
Marc Mutz
d4611ba3a5 QFlatMap: add an alias for using QVarLengthArrays
... in an attempt to foster the use of this data structure by making
it less onerous to spell.

Pick-to: 6.3 6.2
Change-Id: Ib9d17029c75278edde6ba90f65f68af179a6d230
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-01-12 02:03:15 +01:00
Bernhard Rosenkraenzer
234e0eadc8 QWizardLayoutInfo: make == and != operators const
This fixes building with clang 10.0 in C++20 mode.
http://eel.is/c++draft/diff.cpp17.over

Thanks to Ville Voutilainen <ville.voutilainen@qt.io>
for pointing out this better fix.

Task-number: QTBUG-81917
Pick-to: 6.3 6.2 5.15
Change-Id: I8ce5776ddcd061b4615239e38caa5ad07950b66d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-12 01:03:15 +00:00
Marc Mutz
f044664c68 QFlatMap: add try_emplace (w/o hint)
QFlatMap, like its public brethren, features the broken Qt-style
insert() behavior (what the STL calls insert_or_assign()), which
makes its insert() unusable for actual STL-style insert() work,
with no replacement except the size-check-and-index-operator trick:

    const auto oldSize = c.size();
    auto &e = c[key];
    if (c.size() != oldSize) {
        // inserted
    }

Even though QFlatMap::insert() appears to return the correct info,
it's useless, because the old value has been assigned over by the
time insert() returns.

Pick-to: 6.3 6.2
Change-Id: If4173c42523a128dfd22ab496dde0089ba73f41c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 02:03:15 +01:00
Marc Mutz
5327bae6f0 QEventPoint: forward-declare QMutableEventPoint before befriending it
Otherwise the friend declaration declares the name, which here is ok,
but can cause duplicate names in other situations.

Pick-to: 6.3 6.2
Change-Id: I695f9c5c116b90ba52e1b99e15f31e732e63d357
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-01-12 02:03:15 +01:00
Marc Mutz
3917838d64 QFlatMap: optimize construction from existing containers
Use {copy,move} ctors instead of default-ctor, followed by
(move|copy)-assignment.

Pick-to: 6.3 6.2
Change-Id: Id2fd53050cd353a9374fd065ac25d753d42d1be9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 02:03:15 +01:00
Marc Mutz
e809d4e3cc QFlatMap: fix pointless reallocations on repeated range-insert()s
When looping over range-insert(), the repeated shrink_to_fit() calls
would cause cause reserved (or geometrically-grown) capacity to be
shed, breaking the underlying container's growth strategy.

Fix by not shedding excess capacity.

Pick-to: 6.3 6.2
Change-Id: I10915a06fc9442039c192486a55e48083da7c839
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2022-01-12 02:03:15 +01:00
Shawn Rutledge
1abaf9d5d6 Enable markdown writer 'preformats with embedded backticks' test
It happens to pass now.

Pick-to: 6.2 6.3
Change-Id: I0f6132251c3ee4ee2fef5530f8ed6997e3c946ab
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-01-12 00:18:35 +01:00
Shawn Rutledge
8d2417ed9a Add a markdown writer test for a checklist item ending with code
Task-number: QTBUG-81583
Change-Id: I32540615be66f4e45bb1b3b19e914bea3aacf3e7
Pick-to: 6.3 6.2 5.15
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-01-12 00:18:35 +01:00
Laszlo Agocs
cdfbe70923 rhi: Improve the handling of HDR capable texture formats
Add some sort of autotest for both RGBA16F and the new RGB10A2. The
latter is introduced particularly because ideally we should have a
texture format that corresponds to the D3D/Vulkan swapchain color
buffer format with HDR10.

Change-Id: I1e1bbb7c7e32cb3db89275900811c0bcaeac39d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-01-11 22:38:35 +01:00
Laszlo Agocs
0be28d1030 rhi: Add some docs for the hdr info queries
Change-Id: I9b3b62ac83642a7d3e474c991e572877b9e46ca5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-01-11 22:38:35 +01:00
Thiago Macieira
bb35b2f64d QByteArray: fix append() with a negative length
The documentation says that if it's negative, we find the null
termination. This bug was introduced with the clean up to use
QByteArrayView in commit 8897aa071a.

Fixes: QTBUG-99640
Pick-to: 6.3 6.2
Change-Id: Ib42b3adc93bf4d43bd55fffd16c89fa4a960f3a9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-11 15:12:30 +00:00
Shawn Rutledge
17dca04a61 Use QTextCharFormat::fontFixedPitch to remember Markdown backtick spans
If the editing app (like qtbase/examples/widgets/richtext/textedit)
has controls only for setting a specific font, and someone uses it to
write markdown "from scratch", then we need to detect that they chose
Courier or some other fixed-pitch font, and write the backticks,
because Markdown has no syntax for selecting a specific font family.
If the user loads markdown into such an application, the font
is set to QFontDatabase::systemFont(QFontDatabase::FixedFont).
Round-trip editing was already working, as long as such a font exists.
QTextCharFormat::setFont() calls setFontFixedPitch(font.fixedPitch()),
but for the chosen "mono" font, font.fixedPitch() can be false.
For semantic completeness and separation of concerns, we now
set fontFixedPitch explicitly if a `backtick` span is encountered.
As a followup to f1e60de665 this
should get its autotest passing reliably.

Fixes: QTBUG-99676
Pick-to: 6.3 6.2 5.15
Change-Id: I4987a1f0f819f82ec64546bdc3ef53e7d29933de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-01-11 15:04:25 +00:00
Øystein Heskestad
2a086a9857 Replace QString with QStringView and use qsizetype in QPdfEnginePrivate
Task-number: QTBUG-98763
Change-Id: Iab09d5a4d23215fd44e4b2cf4212688cd8f27a63
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-01-11 15:39:14 +01:00
Joerg Bornemann
41f211d25f qmake: Print error and exit if a response file cannot be created
This is always an error, and we should not silently return an empty
string and pretend that everything is in order.

Drive-by change: Add a comment stating what createResponseFile()
returns.

Pick-to: 6.3
Change-Id: I4ee940cfac826c7ae5d15e977b692f1368ab29ea
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-01-08 18:08:12 +01:00
Joerg Bornemann
ae294a42f0 CMake: Add C/C++ compiler options to C/C++ sources only
When compiling CUDA sources in a user project, the Qt6::Platform target
would pull in C/C++ related compiler flags, leading to compiler errors.

Make sure that we only add those flags to C/C++ source files.

Pick-to: 6.2 6.3
Fixes: QTBUG-99548
Change-Id: Idbccd65fe8f66abd1da3fce95e563065d1ed3cc6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-01-08 18:08:10 +01:00
Joerg Bornemann
7246058dfd qmake/MinGW: Fix linking target name with whitespace
When having a TARGET value that contains whitespace, linking would fail
with MinGW.  This was, because the function createResponseFile stitched
together a file name like this:
    objectScript."Target Name".Release

The inner double quotes make the file name invalid.

Fix this by retrieving QMAKE_ORIG_TARGET with the var() method instead
of fileVar().  The latter quotes the return value if it contains
spaces.

Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-99522
Change-Id: Ieb7dcf3fbbd8a75de5a9b9a6beadb2170dddf35d
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-01-08 18:08:09 +01:00
Joerg Bornemann
4545d7d6a6 Doc: Mention how to interrupt/continue qmake loops
Fixes: QTBUG-99559
Pick-to: 6.3
Change-Id: Ib88bc0f93d7c0d6b9bf9a342410395f5a79675e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-01-08 18:08:08 +01:00
Marc Mutz
ae49252dbc QMutableEventPoint: add static overloads of setters
These overloads don't require a cast from QEventPoint to
QMutableEventPoint, thus avoiding undefined behavior.

Port easy users of QMutableEventPosition::(const)from()
to the new API.

Pick-to: 6.3
Task-number: QTBUG-99615
Change-Id: I4e9228322134ef7c712ca478ee8286466efc3585
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-01-08 09:00:10 +00:00