Commit Graph

61425 Commits

Author SHA1 Message Date
Ahmad Samir
9547ef58c7 QMimeDatabase: handle glob-deleteall tags
According to the Freedesktop spec[1], a mimetype that has glob-deleteall
overwrites other glob-pattern definitions for a mimetype if it is in a
higher precedence dir, the default order is (from high to low)
~/.local/share/mime, /usr/local/share/mime, /usr/share/mime. Or if the
XDG_DATA_DIRS env var is set, then it takes precedence. The
QMime*ProviderS in m_providers are constructed/stored in that same
order, high to low).

For QMimeXMLProvider, we can just clear the glob patterns associated
with those mimetypes from the lists/maps. For the QMimeBinaryProvider
however, we can't change the binary (mmap'ed) cache file, instead check
mimetype names against the exclusion list before modifying a
QMimeGlobMatchResult.

[1] https://specifications.freedesktop.org/shared-mime-info-spec/latest/ar01s02.html

This test uses XDG_DATA_DIRS so only viable when USE_XDG_DATA_DIRS is
defined.

Fixes: QTBUG-101755
Pick-to: 6.5
Change-Id: Icadbdf1027155296377c5a6ab3be8e41b6668325
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-05-07 14:29:17 +03:00
Thiago Macieira
a2551c45d4 Move the formatting of <chrono> durations to QDebug & QtTest
[ChangeLog][QtCore][QDebug] Added pretty formatting of C++ <chrono>
durations.

[ChangeLog][QtTest] Added pretty formatting of C++ <chrono> durations
for QCOMPARE expressions.

Change-Id: I3b169860d8bd41e9be6bfffd1757cc087ba957fa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-06 17:54:23 +00:00
Yuhang Zhao
59f8da17e6 QWizard: Win: fix wrong frame size and title bar size
The frame size is resize border size + padded border size [1], so our
current calculation is not correct, and thus the title bar size is
also wrong.

[1] We also use this calculation in the Windows QPA, and it's also
widely used by many open-source repositories, including Microsoft's
own products.

Change-Id: I5a4c1f91a31a22cade6227131659a6de73bb6808
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-06 06:21:52 +00:00
Thiago Macieira
1373a20f99 QTestEventLoop: don't stop the test fails outside the main thread
This amends commit 115f828ae4
"QTestEventLoop: stop when the test fails" from Qt 6.3 to not attempt to
stop the QTestEventLoop instance if the failure happened outside the
main thread. This is to prevent the QTEL from being created outside the
main thread and thus cause warnings about QObject in addition to and
logged before the real test failure.

[ChangeLog][QtTest][QTestEventLoop] The QTestEventLoop no longer
attempts to exit its event loop if the failure was detected outside the
main thread.

 QWARN  : tst_QMutex::tryLock_non_recursive() QObject: Cannot create children for a parent that is in a different thread.
 (Parent is QCoreApplication(0x7fffffffe710), parent's thread is QThread(0x802e29000), current thread is QThread(0x7fffffffd5a8)
 FAIL!  : tst_QMutex::tryLock_non_recursive() 'timer.elapsed() >= waitTime - systemTimersResolution' returned FALSE. ()

Change-Id: Ieab617d69f3b4b54ab30fffd175b139322a1f02c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-05-05 23:21:52 -07:00
Thiago Macieira
25e13c9079 Q{Plugin,Factory}Loader: downgrade warnings to debug messages
Since we don't have different environment variables for the plugin paths,
users have to set QT_PLUGIN_PATH to where plugins for both Qt 5 and 6
(and future versions) are located. This causes Qt to print warnings that
those couldn't be loaded because the major version mismatches. So don't
print them any more.

QT_DEBUG_PLUGINS and the category logging filter can still be used to
enable them.

Fixes: QTBUG-107459
Pick-to: 6.5
Change-Id: Idd5e1bb52be047d7b4fffffd175318ca1f8017bd
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-05-05 23:21:52 -07:00
L. E. Segovia
6136b92f54 Windows: implement retrieval for missing QScreen metadata
This commit implements the manufacturer, model, and serialNumber
properties of QScreen for the Windows operating system. These were not
available previously because the Display Devices API allows piecemeal
access to the EDID fields, and the GDI API only returns the i-th device
name, e.g. "\\.\DISPLAY1".

Accessing the EDID of a given screen is possible by, given a
WindowsScreenData instance storing the device path, pivoting from
SetupDiOpenDeviceInterfaceW and then extracting the corresponding blob
from the Registry through a key handle retrieved with
SetupDiOpenDevRegKey. This blob can be parsed just like in Linux with
the QEdidParser class. The resulting metadata is applied to
the WindowsScreenData instance.

Additionally, this commit implements support for clone groups by making
getPathInfo return a list of the matching DISPLAYCONFIG_PATH_INFO
instances, and then concatenating the monitorFriendlyDeviceName
and the EDID manufacturer, model and serialNumber properties.

This commit makes the Windows and Direct2D QPA plugins dependent on
setupapi, and extends the QEdidParser class availability condition to
include these platforms.

Pick-to: 6.5
Change-Id: I56886b035a3d15e6f90aad5d797aeda21f99ff74
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-05-06 00:09:43 -03:00
Thiago Macieira
fdd0f7f8af QPrinterInfo: fix mismatching types to ternary operator
How did this ever work? Q_GLOBAL_STATIC has been a structure for a long
time, but somehow this doesn't work with my latest changes.

 qprinterinfo.cpp:73:49: error: operands to ‘?:’ have different types ‘QtGlobalStatic::GlobalImpl<{anonymous}::Q_QGS_shared_null>’
 {aka ‘const QtGlobalStatic::Impl<QtGlobalStatic::Holder<{anonymous}::Q_QGS_shared_null, {anonymous}::Q_QGS_shared_null> >’} and ‘QPrinterInfoPrivate*’

Pick-to: 6.5
Change-Id: I6f518d59e63249ddbf43fffd175a264225f0480f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-05 16:17:55 -07:00
Ahmad Samir
bde5eeecaf q20: add C++20 chrono days/weeks/months/years
Change-Id: Ie2a167cbe6672694e15b7810daf7fad3fe0656a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-05 16:17:54 -07:00
Thiago Macieira
ce5eaeea59 headerscheck: enable exceptions for MSVC
MSVC's own headers trigger the C4530 warning just by being included.

  C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.33.31629\include\chrono(2206):
  error C2220: the following warning is treated as an error
  warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

Change-Id: Ieab617d69f3b4b54ab30fffd175c02c23f677d75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-05 16:17:41 -07:00
Volker Hilsheimer
3bf5b5f894 Use QSlotObject helpers in functor-cases of QMetaObject::invoke
Add helper that allows us to determine the argument list and return type
of a functor. This triggers a compile time error if the functor has
operator()() overloads (we only support zero-argument call operators, but
there might be const/noexcept variations). Use that helper to declare a
ZeroArgFunctor type which also declares a ReturnType and Arguments alias.

Add a Callable alias that now combines FunctionPointer and ZeroArgFunctor
into a single type that we can then use to merge the specializations of
QMetaObject::invokeMethod.

[ChangeLog][Potentially source-incompatible changes] Using a functor
with several operator() overloads in QMetaObject::invokeMethod now causes
a compile time error. Qt would previously ignore const and noexcept
overloads and always call the mutable version on a copy of the functor.

Change-Id: I3eb62c1128014b729575540deab615469290daeb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-05 21:45:56 +02:00
Tobias Koenig
2162e0dfc4 Schannel: Add support for import of PKCS12/PFX files
Add the missing functionality to the Schannel backend to
make QSslCertificate::importPkcs12() work on Windows.

[ChangeLog][QtNetwork][QSslCertificate] Add support for
PKCS12 import with Schannel backend.

Change-Id: Ibb501724d0dc78b0507ac8becf4776fbba0a0623
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-05 19:58:36 +02:00
Yuhang Zhao
392b6e657c Windows QPA: remove unused function
Change-Id: I3f029dcd6e49339d3193ecf66e707d7d7afc5e2f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-05-05 17:53:00 +00:00
Tor Arne Vestbø
b5397e1976 macdeployqt: Consider debug libs when looking for module dependencies
Otherwise we will fail to add plugins such as the SQL plugins,
because we think that the Sql module is not in the list of
module dependencies.

Pick-to: 6.5
Change-Id: Ie03d2506e8d86904f51b4198641ad61a6977e592
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-05-05 19:05:09 +02:00
Tor Arne Vestbø
920bcc0946 macdeployqt: Detect debug dylibs, not just debug frameworks
A debug dylib has a binary name like libQt6Core_debug.6.dylib

Pick-to: 6.5
Change-Id: I54a7a7017b880c734777d0738acf46c19689148d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-05-05 19:05:08 +02:00
Tor Arne Vestbø
760f99bfa8 test: Don't remove macdeployqt test directory when debugging test
Pick-to: 6.5
Change-Id: If0e6f836638d8ddb6b0d6c2be6ae4dd09b76eb7a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-05-05 19:05:08 +02:00
Tor Arne Vestbø
e36082dcdc test: Pass -use-debug-libs for macdeploy test when built as debug
As this is a strong indication that Qt was also built in debug.
Otherwise the test will fail locally for a debug build.

Pick-to: 6.5
Change-Id: I5f494017f1d89f4076ccaca89aaa67738ef405a9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-05-05 19:05:08 +02:00
Tor Arne Vestbø
da7b6cb83d Add debug logging to macdeployqt test
Preparation for debugging failures in the 6.2 branch

Pick-to: 6.5 6.2
Task-number: QTBUG-112892
Change-Id: Ib6428fb86be834c84be361a848c0f1306bfc2637
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-05-05 19:05:07 +02:00
Volker Hilsheimer
61e0671681 QSlotObject helpers: add testcoverage for std::function
Change-Id: I503c627c77eaab7d2e3456f23b55fdfcdc94c0ea
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-05-05 18:07:11 +02:00
Assam Boudjelthia
ac8a39c416 Android: fix content url handling of filenames with spaces
The Android APIs expect the content url filenames to have
percent encoded spaces, so handle that internally, if missing,
under the content file engine.

Fixes: QTBUG-112663
Pick-to: 6.5 6.2 5.15
Change-Id: Ieb2ee41a2587f985b589ca54b88f1cff89992154
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-05-05 17:40:46 +03:00
Marc Mutz
b6d5d419cc QObject: simplify ImplFns of Q(Private)SlotObjects
Drag the cast out of each case to before the switch.

DRYs the code.

Pick-to: 6.5
Change-Id: I117cc5d38379a11e9852fba61794fa59dc24a30f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-05 13:53:44 +02:00
Marc Mutz
3c4743c66c Future-proof QGenericRunnableHelper
Collapse the two function pointers into a single one, taking an Op
enum. Add a possible return value (void*) and extra argument (also
void*). The intent is to allow extensions in a BC way,
e.g. cloning. We can't add new function pointers (sizeof changes), so
we need to fold everything into a single function.

Change-Id: Id0f3f74149c61e4e65622aeabfd2fcea3c6d7fb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-05 13:53:44 +02:00
Piotr Wierciński
fb2fccc534 wasm: Add DOM accessors functions through NativeInterface
Expose document and clientArea emscripten objects through
NativeInterface.
This is required by WebView implementation for wasm platform.

Task-number: QTBUG-75183
Change-Id: I6f2f084a9dbceb80d2186c7395c008f268a91e39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-05-05 12:27:36 +02:00
Kai Köhne
a1f7fb73c2 Doc: Fix links to QDomDocument::setContent()
Mark the deprecated signature as overload. Otherwise qdoc
does not know which method to link to in case of \l setContent().

Pick-to: 6.5
Change-Id: I48a4cee39cd870c960decf0bc1bb9b6dffcbbd70
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-05-05 10:55:27 +01:00
Eskil Abrahamsen Blomfeldt
2bd610ed12 Update download location for Harfbuzz as well
This amends 151287fb51.

qt_attribution.json now has the download link for the
Harfbuzz version used. It was for the wrong version
before, but now it should be correct.

Pick-to: 6.5 6.5.1
Task-number: QTBUG-113352
Change-Id: If79f6a814d909e687c8371aa0948b11b88f3d14b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-05 10:22:05 +02:00
Antti Määttä
fa67cd0334 Use boolean to indicate QTableWidgetItem is header item
QTableWidgetItem uses additional enum flag ItemIsHeaderItem which has
the same numerical value as ItemFlag ItemNeverHasChildren.
This causes conflict since the user can set the latter flag using
the setFlags, while the ItemIsHeaderItem is only used internally
to mark header items.

Remove the additional flag and use boolean instead to fix the conflict.

Pick-to: 6.2 6.5 6.5.1
Fixes: QTBUG-113209
Change-Id: Icff549c7e452d9f84575a524361719204817274e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-05 05:28:19 +00:00
Volker Hilsheimer
2434573f5e QTabBar: don't overshoot when scrolling right
Amends ca15f650a1, after which scrolling
right to fill any gap might have resulted in overshooting to a negative
scrollOffset.

When we scroll right to fit the current tab, then we never want to end
up with a negative scroll, so clamp the result accordingly.

Augment test case accordingly. Since some styles align the tab bar in
the center, replace the calculation of the scroll offset with access to
the private data member (which inverts the sign when compared to the
calculated value).

Task-number: QTBUG-113140
Fixes: QTBUG-113376
Pick-to: 6.5 6.5.1
Change-Id: Ibdc6686b9dbd41b1ae3560e2227fa121d9b20e18
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-05-04 19:58:50 +00:00
Thiago Macieira
275e0e48a9 Deprecate Q_ASSUME
No replacement provided because we didn't agree on how to do it. But the
current implementation is bad (with GCC, at least), so tell people to
stop using it.

[ChangeLog][Deprecations] The Q_ASSUME macro is now deprecated. Do not
use it in new code and consider removing it from existing code.

Change-Id: Idd5e1bb52be047d7b4fffffd175322ee3402756b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-04 16:58:49 -03:00
Thiago Macieira
c98d70ef7b QMutex: remove unused tst_QMutex forward declaration
Commit d4b206b246, which split
QRecursiveMutex from QMutex and thus rewrote a lot of the tests, removed
the friendship, but not the forward-declaration.

Pick-to: 6.5 6.2
Change-Id: I6f518d59e63249ddbf43fffd1759d28f1547ec9f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-04 19:41:48 +00:00
Volker Hilsheimer
6ef5e186a9 Simplify invokeMethod implementations using QSlotObject helpers
Remove duplication for overloads covering member function pointer
or function pointer cases, as those are now covered by the new
QtPrivate::makeSlotObject helper.

Change-Id: Ife1e05416958e40a4759ca06cf7db185031b8a86
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-04 19:40:33 +02:00
Mårten Nordheim
a443b5f2ec Update public suffix list
The removed testdata is no longer valid because their entries were
removed from the list.

Fixes: QTBUG-113339
Pick-to: 6.5 6.5.1
Change-Id: I34bd56394ab3c0ef2f930d5b21c3fe1089262dbd
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2023-05-04 17:40:33 +00:00
Marc Mutz
3fda04644a QRunnable: Extract Method warnNullCallable()
The warning doesn't depend on the template argument, so factor it into
an out-of-line Q_DECL_COLD_FUNCTION. This will automatically mark the
is_null check as [[unlikely]], too.

As a drive-by, use printf-style qWarning() (expands to less code and
doesn't require #include <qdebug.h>).

Change-Id: I9ac2d912eb1d4f3d1d9b41d77700bed6d6850b0a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-05-04 19:40:33 +02:00
Marc Mutz
f7d1dc0eee tst_qthreadpool: expect a warning, cleaning up the test run
Change-Id: Ie9944d05e7afe5740ed10eef39c2df9281985002
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-05-04 19:40:32 +02:00
Volker Hilsheimer
a43ca591c1 Fix hiding in QComboBox when there is no selection
If there is an effect on the selected item we want to show it,
but if there is no item to highligh we just close the combo.

Fixes: QTBUG-113311
Pick-to: 6.5
Change-Id: I287af75d27e6f6ff969e4706e16cc8c4812129ea
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-04 19:40:32 +02:00
Øystein Heskestad
3dd3268ded Revamp DOM Bookmarks example
Fixes: QTBUG-111974
Pick-to: 6.5
Change-Id: Ia62eaf36f616278e49112884db8aec37e2b1dcc5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2023-05-04 17:30:04 +00:00
Mårten Nordheim
4bf82909f1 Make tst_QFont::italicOblique failures easier to debug
It fails locally for me on Lucida Calligraphy.
Lucida Calligraphy only has one style though: Italic.

Change-Id: I42442cb922132a00f09084cef9c739196a9a53c2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-05-04 15:05:18 +02:00
Allan Sandfeld Jensen
0e7e1c3396 Take move-only functions for the threadpool
We never copy the function so only need it to movable. Moves the
functions to templates using the new QRunnable create version.

[ChangeLog][QtCore][QThreadPool] Methods taking callable functions,
can now take move-only lambdas.

Fixes: QTBUG-112302
Change-Id: I2cb200f0abcf7e0fdbef0457fe2a6176764ad93d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-04 15:05:18 +02:00
Ievgenii Meshcheriakov
1403b63a57 QtDBus: Convert QDBusMetaTypeId into namespace
There are no member variables in this private struct, so it can
as well be a namespace.

Change-Id: I397b9680ee70e17d780db9de33ad44a00ac7792a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 15:05:17 +02:00
Ievgenii Meshcheriakov
08a37f9cee QtDBus: Use non-textual version of QMetaObject::invokeMethod
Use type-checked version for better run-time performance and
compile-time type checking.

Change-Id: I92c97d162137770bc373e28fa8e4e115ac5533e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 15:05:17 +02:00
Ievgenii Meshcheriakov
6f05e91695 QtDBus: Replace some text-based singnal-slot connections
Use type-checked connections for better run-time
performance and compile-time type checking.

This excludes connections to private slots that are
not trivial to replace.

Change-Id: I97f591dba880f8d09c73565f2b5555524f6ab4a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 15:05:16 +02:00
Edward Welbourne
5a3784bba3 Flip string comparisons in savegame example
This follows up to commit 9834e80833,
fixing an accidental flip to the meaning of keywords on the
command-line. If the first word is "load" we should load a prior game,
not start a new one; if the second is "binary" we should use CBOR, the
binary format, not JSON.

Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: If29070777daf68f2f959bc1ec4ffd67ba90b28ba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-05-04 15:05:16 +02:00
Edward Welbourne
b1379d34dd Add a distant-future local-time-type to tst_QDateTime
It turns out glibc stops varying DST changes past where a 32-bit
signed day-count from 1970 reaches (which, all things considered, can
hardly be called a bug, for all that it's ...), at odds with QTZ's
extrapolations from the current IANA DB rules. As the last date QDT
can represent happens to be in the opposite side of everyone's DST
from the one that leaves zones in, this lead to the 2038
local-time-type not reliably being useful for predicting the max-date
behavior. So add a distant-future time-type that probes beyond glibc's
cut-off, and have relevant tests check that instead of the 2038 one.

Change-Id: If4e244d80fe2447da3bb9d5c406808c6c22c0a73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 14:06:08 +02:00
Edward Welbourne
89febde32f tst_QDateTime: rework initialization of local-time-types
There's no need to check the year or day-of-month (which involve
calendrical calculations) when we can perfectly well just check the
Julian Day number that's implied by the day-number parameters to
setType(), which could just as well return the LocalTimeType to be
assigned to the relevant parameter instead of doing the setting
itself. With that rearrangement, making it into a private static
method, the members it's used to initialize can then be const and
initialized during construction.

Change-Id: Ib7d295c3fbb9b90652952627456cdfb6176b8119
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 14:06:08 +02:00
Edward Welbourne
7d75039482 Make default local time a static const
QDateTimeParser::fromString(), when parsing a date-time, uses the
start of 1900, in local time, as its default date-time. (This is a bad
choice and steadily getting worse.) This turns out to be somewhat
expensive for some client code, so make it a static const so that we
only compute it on the first call, as for getM{in,ax}imum().

The potential downside is that a change to system time zone won't be
reflected in this value. However, any sane parse-format should require
over-writing all fields of this initial value, in any case, so the
issue is less severe for this default value than for the existing
getM{in,ax}imum() statics.

Change-Id: Iacfd827fe76c4e5fbdc5e5b6efefed13bc673af4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 14:06:08 +02:00
Edward Welbourne
4c93b9c1d0 Refactor QGregorianCalendar::julianFromParts to return std::optional
It's a private static used to optimize internal use, so we can freely
get rid of its out parameter this way.

Change-Id: Id62612987f10ecbbd9702610fd172286adbfd442
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 14:06:07 +02:00
Edward Welbourne
22909abeae Split out a helper function for QLocalTime
Packaged calls to QGregorianCalendar::julianFromParts(), to convert a
struct tm's date fields to a Julian Day number: the tmToJd() function
hopefully makes it clearer what's going on.

Change-Id: Icdbd9d4d915a053ab49dabee645582523ac826c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 14:06:07 +02:00
Alexey Edelev
4fa6cd8cea Normalize paths using std::filesystem::weakly_canonical
std::filesystem::weakly_canonical resolves symbolic links in paths.
This allows syncqt to work with paths that are symbolic links and
real paths.

Fixes: QTBUG-113295
Pick-to: 6.5
Change-Id: Ie7478b4accf279e8abf9f3849d18807cee99f085
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 12:53:23 +02:00
Amir Masoud Abdol
a0923d5d3a Resolve symbol ambiguity when building with Unity Build
In unity build, we may get `error: reference to 'detail' is ambiguous`
between the `detail` namespace defined in `qpropertyprivate.h`, and
`qflatmap_p.h`. For now, this causes an issue during the compilation of
`qcalendar.cpp` and it may occur in other places where qflatmap is
included.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ie4bbb66543d26a5db58488e924333d98ce0adebf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 12:53:23 +02:00
Marc Mutz
038c1c5978 QString/QByteArray::op>>: don't assume clear() makes the container isNull()
This is something we may want to change at some point, so be explicit
and assign a null container instead of relying on clear().

Add a comment that was present in the QString, but missing in the
QByteArray implementation.

Pick-to: 6.5
Task-number: QTBUG-31283
Task-number: QTBUG-60745
Change-Id: I10d82b8a0c67fff314af526c7b7e0f247c3405fd
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-05-04 12:53:23 +02:00
Eskil Abrahamsen Blomfeldt
151287fb51 Update harfbuzz to version 7.2.0
Pick-to: 6.2 6.5 6.5.1
Fixes: QTBUG-113352
Change-Id: I134f5b49c2ae5bef31edfc5cd87f0ff62d6c18b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-05-04 11:48:29 +02:00
Volker Hilsheimer
1af36eb230 Doc: fix warnings in QTimer
Amends recent changes that added std::chrono support by making
the duration type of QTimer::singleShot a template parameter.

Change-Id: If3b5f0ad99304cb292412bb8467ba6852e47654f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-05-04 10:33:27 +02:00