Commit Graph

56932 Commits

Author SHA1 Message Date
hjk
903a883044 QSettings: Fix reading of the [%General] section
The currentSection key was accidentally using the whole remaining
section contents.

Pick-to: 6.4
Change-Id: Iec6e38636e519170eef136401ede4b626e12754a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-16 08:25:23 +02:00
Ulf Hermann
4912903e37 Endian: Remove old special integer bitfields
The only way to use them was to put them in a union and then write all
the members of the union to set the various bit ranges. As only one
member of a union can be active at any time, the compiler is free to
optimize those writes away, though. This has started happening in the
wild now.

As we have a replacement, we can remove the old and broken code now.

Task-number: QTBUG-99545
Change-Id: I90718ec06662258d1c15220f54da9eed2186c5a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-16 06:12:27 +00:00
Thiago Macieira
bc144312c1 qHash: pass QByteArrayView to qHash() by value
The QBAV one should pass the parameter by value, like QStringView. And
now that we have it, the non-View one should call the View one in an
inline function, like we already do for QString.

The extra, defaulted parameter is there only so we get a different
signature in the new inline function compared to the removed one.

Pick-to: 6.4
Change-Id: If05aeeb7176e4f13af9afffd16e7f08062b1dc86
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-15 23:25:00 +00:00
Thiago Macieira
2a1122f465 QStringConverter: fix use-after-free in the stack in the test
Detected by ASan. Introduced by aef27c5aa2

Pick-to: 6.3 6.4
Fixes: QTBUG-104261
Change-Id: Id0fb9ab0089845ee8843fffd16f88bdeb4f42c7c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-06-15 15:43:32 -07:00
Dimitrios Apostolou
1eb2d4d0da Try to consolidate Unix/Windows libexec directory in coin configs
Change-Id: Ie381cb062fc78fe5c291b8d0b49fca5f752c7c30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-15 23:58:16 +02:00
Dimitrios Apostolou
fe0e87c9a6 Add ASAN build for qtbase
The test run is wrapped with a special TESTRUNNER script that ignores
failing tests (there are several tests failing when built with ASAN) and
also ignores LSAN errors (memory leaks - but still visible in the
output).

The test run only fails if a test reports ASAN errors or if it
crashes (or times out, which is like a crash caused by qtestlib's
watchdog timer).

Fixes: QTQAINFRA-5025
Change-Id: I861756ab49388ac4a52409d3a780684244e469b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-15 23:58:16 +02:00
Dimitrios Apostolou
96001cb812 Increase timeout of slow test for ASAN-enabled build
Change-Id: I47b6e7e1462c1af7d41677bfe7bb0f78430f72d1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-15 23:58:16 +02:00
Dimitrios Apostolou
f0c0ec59df Fix memory leaks
This renders these simple tests ASAN and LSAN (Address Sanitizer
and Leak Sanitizer) clean.

Change-Id: Ibe5b7054a20c1575a1a7939b0bed4101afeeee56
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-15 23:58:16 +02:00
Dimitrios Apostolou
741fc8b752 Increase timeout of slow test for ASAN-enabled build
Change-Id: Iea0802220701501f18822a5eb1f1b0c22f62e705
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-15 23:58:16 +02:00
Maximilian Goldstein
64f86ca03e qwasmtheme: Enable hover effects by default
Previously hover effects had to be enabled manually due to not being
enabled in the platform style. This change enables them by default.

Pick-to: 6.4
Fixes: QTBUG-88799
Change-Id: I014e1f5dfcd9b15656f11e12ab75a77d42f4815c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-15 21:08:30 +00:00
Kai Köhne
9d2cc4dd76 Fix typos in docs and comments
Found by codespell

Pick-to: 6.4
Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-15 21:31:02 +02:00
Edward Welbourne
37bad1f43b Don't exit(1) on unrecognised test function name, just report a failure
This way, if you name several test functions on the command-line,
you'll at least get the ones that do exist run (and you'll be told all
of the ones that don't exist, rather than only the first).

Pick-to: 6.4 6.3 6.2
Change-Id: I14a515fcfacb6ca49e0470b236c05475b25db4f2
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
2022-06-15 20:23:06 +02:00
Louis du Verdier
edd983071e Android: Improve loading speed of individual assets
This change improves the loading speed of files stored in Android assets
folder by caching the information about files already opened.

Prior to the change, when creating a QFile or QFileInfo to an asset
file, the engine would first scan all the file's directory and parent
directories in order to cache all this in FolderIterator::m_assetsCache.
Due to the nature of Android assets, it might be very slow, depending on
the number of images in this tree.

In this patch, individual file accesses will stop using FolderIterator
and will simply open what is asked, caching the information about the
resource in order to avoid to have to call the expensive
AAssetManager_open if the file is accessed again (e.g. by QFileInfo).

Fixes: QTBUG-101161
Change-Id: Iaedf4cdf83d5116053b51895a6795d43bc60f942
Pick-to: 6.4 6.3 6.2 5.15
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-06-15 18:23:12 +02:00
Allan Sandfeld Jensen
f53f709504 Replace QT_NO_ACCESSIBILITY with QT_CONFIG(accessibility)
Pick-to: 6.4
Change-Id: Iee4bd8970810be1b23bdba65a74de912401dca65
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-15 18:03:30 +02:00
Guineng Ni
6dbe45c96a macdeployqt: macdeployqt process some libraries(e.g. ffmpeg) incorrect
ffmpeg and nettle are different from other libraries, they use symbol
link as their inner module dependencies. Calling one more
install_name_tool can handle this case.

Fixes: QTBUG-100093
Pick-to: 6.2 6.3 6.4
Change-Id: I12cdd53bd5aa3120910070ba283178686deb3eb0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-15 07:11:10 +00:00
Edward Welbourne
12eac545b6 Make two QDT benchmarks data-driven and add more rows
The QDateTime benchmark's toMSecsSinceEpoch() and
toMSecsSinceEpochTz() each iterated the 2010s and had 1950 and 2050
variants for two other decades. I want to also test some earlier
decades and do similar for create(), so combine the existing triplets
as three rows of a data-driven test for each triplet, add the new rows
and apply the same to create().

In the process, turn an enum used for qint64 constants into a set of
constexpr qint64 declarations.

Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-104012
Change-Id: I2657346b65d96a7ef7503cd33c870b688ea5dbff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-15 08:57:20 +02:00
Morten Sørvig
79bead6c3b Add support for painting at integer DPR with downscale
Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1.

This will make the backing store and painter operate at the next
highest integer DPR in cases where QWindow::devicePixelRatio() returns
a fractional value. The backing store image will then be downscaled
to the target DPR at flush time, using the RHI flush pipeline.

[ChangeLog][QWidgets] Added experimental support for always
painting at an integer device pixel ratio (rounding the DPR up if
necessary), followed by a downscale to the target DPR.Enable by setting
QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1.

Pick-to: 6.4
Task-number: QTBUG-86344
Change-Id: Id5b834a0e3499818b0b656161f5e0c38a6caa340
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-06-14 19:16:35 +00:00
Morten Sørvig
d38118c808 Make rhiFlush() support custom source DPR
The rhiFlush() implementation currently assumes that
QWindow->devicePixelRatio() is the correct scale factor for
transforming device independent window geometry to source geometry.

However, this assumption does not hold if/when we add support
for drawing to a rounded-up DPR, with a downscale later in
the rhiFlush implementation.

Fix this by adding a sourceDevicePixelRatio argument to rhiFlush(),
which is set to either QWindow::devicePixelRatio() or
QWidget::devicePixelRatio(), depending on from where it is used.

Change deviceRect() and friends in qbackingstoredefualtcompositor.cpp
to be scale*() functions instead which take a scale factor instead
of a QWindow. Update call sites to use srouceDevicePixelRatio
where that makes sense.

Pick-to: 6.4
Change-Id: Idb7b1e2f36816a201e00f0defe100d2dc079cb17
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-06-14 21:16:35 +02:00
Axel Spoerl
373392eeb4 xcb: Replace qCWarning by qCDebug in QXcbConnection::printXcbError()
Example:
Error "BadWindow" (3) is raised by the XCB backend when a mouse event
is processed on a resource that disappears between posting and
processing of the event.
That constellation is harmless and can occur in async environments.

As XCB errors point to coding issues, this patch changes their logging
behavior from qCWarning to qCDebug.

Fixes: QTBUG-56893
Pick-to: 6.4 6.3 5.15
Change-Id: Idee5ee80efaf9cd6686448779f76c68d5e4c9b63
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-06-14 13:45:06 +00:00
Alexandru Croitor
94207621ee qmake: Document Xcode behavior when bundling translation files
Xcode's legacy and new build system modes have different behavior
in how they bundle resource paths that start with lang_code.lproj.

Document how to bundle translation files for both legacy
and new build systems.

Pick-to: 5.15 6.2 6.3 6.4
Fixes: QTBUG-98417
Change-Id: I857ec76577f8244a751d4bf38fbe305fef614734
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-06-14 15:45:06 +02:00
Laszlo Agocs
9dced35b41 Use consistent ordering in QShader
Fixes: QTBUG-101923
Change-Id: I62df3eba773350e47ed650acb00bc42b3ce6a899
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-06-14 14:58:09 +02:00
Eskil Abrahamsen Blomfeldt
992a318d39 CoreText: Fix fonts with synthetic stretch
If a font is synthetically condensed / expanded, we need to scale
the advances as well as the bounding boxes for the glyph cache.
The logic is adapted from DirectWrite font engine, where the same
scaling is already in place.

[ChangeLog][macOS] Fixed a bug where synthetically stretched fonts
would get the wrong advances and sometimes glyphs would be clipped.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-103838
Change-Id: I09fc87b245d1f2de980c10ad9253b9a83571f714
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-14 14:58:09 +02:00
Eskil Abrahamsen Blomfeldt
81fdfcfc4a Fix font rendering when Qt is configured with -no-harfbuzz
When Qt was configured with -no-harfbuzz, we would get overlapping
glyphs, because we skipped the shaping step but did not set up things
correctly before that. Instead, we force the PreferNoShaping code path
when there is no shaper available.

[ChangeLog][Text] Fixed font layouts when Qt was configured without
Harfbuzz.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-100361
Change-Id: I1c54dbc457dbb235548b9d70324d607a0ee6d501
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-06-14 14:58:09 +02:00
Shawn Rutledge
8a5fa635ca Trace QImage::Format as int in QImageData::create()
Traces can contain only a few types; for now, enums have to be converted
to int. Amends 6d323c0b22

Task-number: QTBUG-102862
Change-Id: If129d03b13e723350bac987c6e35d471aa6c17e2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
2022-06-14 14:11:35 +02:00
Kai Köhne
3a5334e5be Doc: Remove \target Transformations
The section is already called Transformations. Making
it a target just causes issues in other contexts.

Pick-to: 6.4
Change-Id: I8dc65bd3254238e51a649f926cd066dfcbe9500d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-06-14 08:15:47 +02:00
Marc Mutz
fa4d18b86c Revert "qxp::function_ref: drop use of q23::invoke_r"
This reverts commit b9cce12e76, which
broke

    function_ref<void(int)> f = [](int i) { return i; };

ie. swallowing of return types.

We could maybe implement the same without invoke_r, with the same
manual if-constexpr that invoke_r has, but it would be a pointless
duplication across the two thunks we have, so just use invoke_r.

Add tests.

Pick-to: 6.4
Task-number: QTBUG-103739
Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-14 01:30:48 +00:00
Marc Mutz
6345929115 tst_QResourceManager: extend the test to cover open files
... when unregistering.

Task-number: QTBUG-86088
Change-Id: I11112142ef1d8c4b269089a0a82ca06a5e434f7e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-06-14 03:30:48 +02:00
Marc Mutz
ecbe56825a modulecppexports.h.in: re-indent nested preprocessor directives
Amends 0d9f4e7526.

Task-number: QTBUG-100452
Pick-to: 6.4 6.3 6.2
Change-Id: Iaa6626853a4241f750a6929fc9f604a149c874eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-14 03:30:48 +02:00
Marc Mutz
4e66c69bad QLibrary: fix use of deprecated QByteArrayMatcher::indexIn(p, n)
Use the QByteArrayView overload instead.

Deprecated since 6.3, so backporting:

Pick-to: 6.4 6.3
Change-Id: I529104cad59260eed371cedb1ae84a7e9086bbf6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-06-14 01:30:48 +00:00
Marc Mutz
1b8b802455 tst_QAnyStringView: explicitly check the spaceship operator
We implicitly checked it, because, in C++20 builds, the non-equality
relational operators are synthesized from it by the compiler, and we
test those, but we didn't check that <=> returns strong_ordering.

We now do.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104108
Change-Id: Ieb19a2d4cb2d600d884f4e2e89e98c6187e23872
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-14 01:30:48 +00:00
Marc Mutz
de005e7976 QByteArray: more GCC 12 -Werror=array-bound whack-a-mole
This one came up on a tsan build, but not on an asan/ubsan one!?!:

    qbytearray.cpp: In member function ‘QByteArray QByteArray::toBase64(Base64Options) const’:
    qbytearray.cpp:3884:42: error: array subscript 1 is outside array bounds of ‘const char [1]’ [-Werror=array-bounds]
     3884 |             chunk |= int(uchar(data()[i++])) << 8;
          |                                ~~~~~~~~~~^
    qbytearray.cpp:37:24: note: at offset 1 into object ‘QByteArray::_empty’ of size 1
       37 | Q_CONSTINIT const char QByteArray::_empty = '\0';
          |                        ^~~~~~~~~~
    cc1plus: all warnings being treated as errors

Fix, as so often, by caching the size().

The code in 5.15 is different, but similar, so picking all the way.

Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-103923
Change-Id: Iac30e964c8d7d367620d16db65ceeaade33ee6b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-06-14 01:30:48 +00:00
Thiago Macieira
246f17d470 QApplication: Remove QApplicationPrivateBase porting macro
This was last used in 2011, before Qt 5.0 release, when QPA was yet
another windowing system, not the only option.

Change-Id: Ia4a094014ddb48cc9f6dfffd16f83aad1b7109e7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-06-13 17:58:22 -07:00
Thiago Macieira
fb1e0eee07 Q*ApplicationPrivate: remove unused "flags" arguments
They weren't flags. They were the version of Qt that was used in
compiling the application itself. The protection against rollback isn't
necessary any more, since qversiontagging.h, which applies to everything
and not just the main application binary. And using them to make
decisions on functionality or behavior is misguided (see previous
commit).

This commit does not deprecate the front-end classes' argument. In the
future, we may find some need for them.

Pick-to: 6.4
Change-Id: Ia4a094014ddb48cc9f6dfffd16f83a7b58ff95d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-14 00:58:22 +00:00
Thiago Macieira
c4af4dcb5d QCoreApplication: Remove app_compile_version
It's not used for anything, so remove the temptation of trying to use it
to make decisions at runtime about a behavior. It's the wrong tool for
the job: it might tell you the version of Qt the *application* was
compiled against, but not the version any of the Qt-using libraries
were.

Pick-to: 6.4
Change-Id: I175efddd75f24ae59057fffd16f70b77dd87faf4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-13 17:58:22 -07:00
Edward Welbourne
6ae2bfad41 Fix doc and example of QLoggingCategory::installCategory()
Snippet [22] was unused and the example using snippet [21] neglected
to show how its oldCategoryFilter got initialized, which is what [22]
does. But it turns out the example code was crashy in any case, as it
left the oldCategoryFilter uninitialized (albeit probably null) until
the call to installFilter() had returned, and installFilter() calls
the new filter, so the new filter needs to check oldCategoryFilter
before calling it. The doc also failed to explain why it's OK to not
defer to the prior filter in these calls during installFilter(), so
revise the doc and example so that the latter behaves sensibly and
readers of the former are likely to use the function safely.

This amends commit 8f0654ceb8 which
added the snippets and the use of one of them, but not the other.

Fixes: QTBUG-49704
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Iddb8d97b0bef417d8f16e7910730cfa59ea3e715
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-06-13 22:46:02 +00:00
Tor Arne Vestbø
1480588f44 Print QScreen geometry debug state using the underlying types
A QRect is unambiguous, and easier to parse than a custom rect format.

Change-Id: If8c197a5e522744b9629d5d89536df5c0da7308c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-13 21:17:53 +02:00
Tor Arne Vestbø
f7a56b32cc macOS: Resolve screen name via NSScreen on macOS 10.15+
Apple Silicon Macs no longer expose display information through IOKit.
Luckily we can use the 10.15 localizedName property on NSString to
resolve the name.

Pick-to: 6.2 6.3 6.4
Change-Id: Ie75430df1a80808cb7b23d97d1e440d1f3bf75d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-13 21:17:53 +02:00
Tor Arne Vestbø
5909e33d1d macOS: Ignore update requests for offline displays
Accessing a display that's offline may cause crashes,
so to be on the safe side we skip update requests in
this situation.

Task-number: QTBUG-102021
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I6b48b6722bccde628e510c538943d14f2b0271e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-13 19:17:53 +00:00
Volker Hilsheimer
e6da018c86 Add "We mean it" warning to new private header
Amends 5e48a51608, fixing warning
from syncqt.

Change-Id: I15d22a1bba865777c17180438b6e89ee9e1ae78b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-13 18:34:27 +02:00
Friedemann Kleint
539815569f Fusion style: Fix menu item text being elided when mnemonic and && appear in the text
Pass the text flags to fontMetrics.elidedText().
Amends 0c0892a3e2.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-94481
Fixes: QTBUG-103836
Change-Id: I21a9b96ef69e5a5e612a0bdbdf44e5a20931eb59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-13 18:34:27 +02:00
Thiago Macieira
1227af2635 Revert "qglobal.h: include <stdalign.h> in C mode"
This reverts commit 69e8a89358.

Reason for revert: the header is not present in all MSVC installations.

Change-Id: Ib809e59291ef30b9cbf6b4d61e27ea162e5d40b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-13 13:37:37 +00:00
Kai Köhne
04cc705947 CMake: Fix typos
Found by codespell

Pick-to: 6.4
Change-Id: I4907e423b6b345acf82f2d7e0ed62479719d694e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-13 15:37:36 +02:00
Samuel Mira
e07fea6fb4 Android 13: Fix warnings on starting an application
On Android 13, currently in beta, android triggers a warning because it
is using a deprecated getDrawable function.
The patch changes it to use the non-deprecated alternative as suggested
in the warning.

Fixes: QTBUG-103568
Pick-to: 5.15 6.2 6.3
Change-Id: I3e629e7b75044bfb51874256895be0ec7e1088f8
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-06-13 13:37:36 +00:00
Volker Hilsheimer
ac80cee846 Don't crash when removing the last visible tab
The code incorrectly tried to ensure that the firstVisible tab was a
valid index, even though there might not be any visible tab left after
removing the last visible tab.

The same logic didn't exist of the lastVisible tab, so we tripped the
assert in qBound, as max (being -1) ended up smaller than min (0).

Fix this by removing the wrong correcting of firstVisible to be always
valid. Make sure we emit currentChanged with -1 when no visible tab is
left after removing the current tab.

Add a test.

Fixes: QTBUG-104003
Pick-to: 6.3 6.2
Change-Id: I27e6438a02d0a0f1ac4d0e0160cee4f33b3f3766
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-13 14:04:31 +02:00
Jan Arve Sæther
e7477e8934 Update window geometry when QWindow::m{in|ax}imumSize is updated
More specifically, if either minimum or maximum size are updated, make
sure that the current window geometry is updated so that it is within
the minimum and maximum sizes.

Previously, these constraints was only respected by the window manager
when the user resized the window.

For widgets this already worked, because a top-level widget will take
care of respecting these constraints if they are changed.

Since QWindow::setMinimumSize and QWindow::setMaximumSize started to
share so many common things, a new function (setMinOrMaxSize_helper())
is added.

Task-number: QTBUG-102771
Change-Id: Ia4b2680dcf865f84a3cf6424187f9a6036b76386
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-13 09:19:17 +02:00
Wang Fei
e57ab1b454 QMenu: Adjust the position of the submenu
When the submenu is about to exceed the screen,
set the position of the submenu to the left border of the main menu

Fixes: QTBUG-104050
Change-Id: I8935f1bfceb93cfa1097391689f4233991394978
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-13 02:58:04 +00:00
Laszlo Papp
e35fc908fd QSettings: fix a typo in the doc
Pick-to: 6.4 6.3 6.2
Change-Id: I059f603f3cc66a40e84179ac3f2a07de3bf31761
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-11 17:49:43 +00:00
Shawn Rutledge
eee9d25202 Use CSS classes on html list items for checkbox support
If we replace the bullet character with a UC checkbox character, it
looks ok in a browser, and the HTML parser can recover the BlockMarker
attribute from the css class.

[ChangeLog][QtGui][Text] Checkbox list items can now be read and written
in both HTML and Markdown, including conversions.

Task-number: QTBUG-103714
Change-Id: Ic6b74512075cd4ac16d6f80fdf55b221447491a9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-06-11 14:18:35 +00:00
Thiago Macieira
88f5955cb7 CMake: up the minimum C version to C11
We're in 2022. A 11-year-old C standard probably suffices, especially
since we require C++17 anyway.

Pick-to: 6.4
Change-Id: Ibcde9b9795ad42ac9978fffd16f3555327097ded
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-11 10:58:43 +00:00
Alexey Edelev
8a665ba9a6 Remove deprecated qgl.h from sync.profile
The file no longer exists, so the entry is redundant.

Amends f08038fca7

Change-Id: I366a6bd34c7dee57bdd151ee6ecdb76c6c5c095a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-11 00:42:13 +02:00