Now that the latter calls the former in its fall-back, this saves that
call the need to follow up with determining DST and abbreviation. This
also lets refreshZonedDateTime() update its DST guess for timezones as
well as for local time.
Change-Id: I820b65c1d6db78619defe2af5e947cb98ae336f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QDateTime has long followed a convention of ignoring what it knows
about time-zone transitions before the epoch. This produces unhelpful
artefacts (such as an ahistorical spring-forward skipping the first
hour of 1970 in Europe/London, which was in permanent DST at the time)
and complicates the code. It documented that DST transitions were
ignored, but in fact ignored all transitions prior to 1970 and simply
assumed that the current time-zone properties (half a century later)
applied to all times before 1970.
This appears to be based on the fact that the MS APIs using time_t all
limit their range to after 1970. Given that we have to resort to
"other means" to deal with times after the end of time_t, when it's
only 32-bit (and after year 3000, on MS systems), we have the means in
place to handle times outside the range supported by the system APIs,
so have no need to mimic this restriction. (Those means are not as
robust as we might want, but they are less bad than assuming that the
present zone properites were always in effect prior to 1970.) On
macOS, the time_t functions only reach back to the start of 1900; it
reaches to the end of its time_t range and Linux covers the whole
range. Given this variety, the range is now auto-detected the first
time it is needed (based on some quick and dirty heuristics).
Various CET-specific tests now need adjustments in tests of times
before the introduction of time-zones (when they are in fact on LMT,
not CET). The systemZone() test of QTimeZone can now restore its
pre-zone test cases. Various comments on tests needed updates.
[ChangeLog][QtCore][QDateTime] Available time-zone information is now
used to its full extent, where previously QDateTime used LocalTime's
current standard time for all dates before 1970. Where we have
time-zone information, it is considered reliable, so we use it. This
changes the "best efforts" used for times outside the range supported
by the system APIs, in most cases giving less misleading results.
Fixes: QTBUG-80421
Change-Id: I7b1df7622dd9be244b0238ed9c08845fb5b32215
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Examples are intended to show how to build against an installed Qt.
Building them as part of the main build means the way the Qt targets
are defined and created are not representative of an end user's build.
By building them as separate projects using ExternalProject, we can
more closely replicate the intended audience's environment. This
should allow us to catch more problems earlier.
Having examples built as part of the main build also creates problems
with some static builds where a tool built by the main build is needed
during configure time. This happens with other repos like qtdeclarative
but not (currently) with qtbase. Converting the examples in qtbase to
be built using ExternalProject is intended as a demonstrator for how
other repos can do similar. Until other repos are converted, they will
continue to work as they did before, with examples as part of the main
build for non-static builds only.
The new build-externally behavior is only supported for non-prefix
builds with this change. Prefix builds will continue to use the old
non-external method. Support for building examples externally in
prefix builds will be a separate change.
Task-number: QTBUG-90820
Fixes: QTBUG-91068
Change-Id: I2304329940568dbdb7da18d54d5595ea7d8668bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qtbase/include/QtCore/../../../../src/qtbase/src/corelib/kernel/qcoreapplication_platform.h:58:57: error: unknown type name 'QCoreApplication'
QT_DECLARE_NATIVE_INTERFACE(QAndroidApplication, 1, QCoreApplication)
Change-Id: I0a14a2f2ab80f9cc0e7fd3b3060719a1c772bf57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Output object name and class in QCOMPARE(). This should help
to debug flaky QWidget tests that for example check on focusWidget().
[ChangeLog][QtTestLib] QCOMPARE() now reports QObject * values by class and objectName().
Task-number: QTBUG-64446
Change-Id: Ife04e89bba04fc78d077c8f0f07af17a17c9cf8c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
In some cases, if X11 is configured with CapsLock as
keyboard language switch key, and CapsLock is toggled
via Shift+CapsLock key combination,
toggled CapsLock is falsely detected as Qt::GroupSwitchModifier
for subsequent key events.
This change fixes this false detect,
but doesn't fix detection of Qt::GroupSwitchModifier
which is likely still broken.
Fixes: QTBUG-49771
Pick-to: 5.15 6.0 6.1
Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c
Reviewed-by: Liang Qi <liang.qi@qt.io>
QNetworkInterface reports as up and running an interface,
seemingly having a valid IP address which actually has
not IPv4/IPv6 configured at all (this is what getifaddrs
gives us).
Change-Id: I5808d5dfdbc54004a1e02b791917e9b2ba62905f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In hindsight, this macro is an API mistake, as it should NEVER be used
alone, but always in combination with Q_DISABLE_COPY. But in that case,
there's a better macro: Q_DISABLE_COPY_MOVE; hence this API is either
bad, or completely redundant.
A GitHub search reveals that luckily there's a handful of usages in the
wild (of which 0 in Qt/dev and KDE). Hence, I'm going for the kill, and
removing it entirely.
[ChangeLog][Source-Incompatible Changes][QtGlobal] The Q_DISABLE_MOVE
macro has been removed. Code that was using it can be ported to
Q_DISABLE_COPY_MOVE instead.
Change-Id: I7e346f7e2288f3f5a45315f4f6bfaeb2661f1de5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The trick we use by spawning lldb to print the backtrace doesn't work
for some reason, and just results in:
Process 91619 stopped
* thread #1, stop reason = signal SIGSTOP
frame #0: 0xffffffffffffffff
Target 0: (No executable module.) stopped.
Architecture set to: .
(lldb) bt all
* thread #1, stop reason = signal SIGSTOP
frame #0: 0xffffffffffffffff
thread #2
frame #0: 0xffffffffffffffff
thread #3
frame #0: 0xffffffffffffffff
thread #4
frame #0: 0xffffffffffffffff
Debugging the stopped process manually with lldb works fine.
Change-Id: If5582803a11f1c5c84c31b42d1ae52bdd245bbbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Apparently, gcc's pragma warning logic has changed from 10 -> 11. For
gcc 11, we need to place the macro directly next to the the line which
triggers the warning.
Task-number: QTBUG-93360
Pick-to: 6.1
Change-Id: Ifaa6136050fe5b887660a8a0acf6938388f4f77d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It was copy-pasted (presumably from plugin handling code)
when initially introduced but was never used.
Change-Id: I571738b9f5269ca038f5931a773aa5c2c66aafbc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Internally it uses a new _qt_internal_add_library function (similar
how we have qt_add_executable and _qt_internal_add_executable) as well
as finalizer code line the executable case.
_qt_internal_add_library forwards arguments to add_library with some
Qt specific adjustments to the selected default target type (based on
whether Qt is configured as static or shared).
The new _qt_internal_add_library is now used in qt_add_plugin as well
as some internal library creating functions like
qt_internal_add_module.
This reduces some duplication of file name adjustments across
functions and creates a central point for creation of Qt-like
libraries (for some definition of Qt-like).
Change-Id: Id9a31fe6bf278c8c3bb1e61e00a9febf7f1a2664
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When a weak pointer calls getAndRef and there is no strong reference
yet, getAndRef creates a new ExternalRefCountData. Normally,
ExternalRefCountData is never constructed directly, only its subclasses
are constructed via placement new into a memory buffer.
To that end, ExternalRefCountData has a custom operator delete, which
calls the global operator delete (do deallocate the memory buffer
correctly).
When using operator new directly in getAndRef, gcc notices a new/delete
mismatch with the delete in the same function: global operator new
matched with class operator delete. This isn't actually an issue in
practice, as the class operator delete simply calls the global delete.
But to avoid the warning, we can simply call the global operators
explicitly.
To make it clear that allocation of ExternalRefCountData requires some
care, we additionally delete the class operator new, and only allow
placement new (or usage of global operator new, as in getAndRef).
Pick-to: 6.1
Task-number: QTBUG-93360
Change-Id: I132d1e4e07520eadc5b8f3f955c06aecec80c646
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Super/Hyper keys are detected during a direct mapping phase, but the
function returned before the translation to Meta could take place.
Task-number: QTBUG-62102
Pick-to: 5.15 6.0 6.1
Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
It should be possible to use them with promotion.
Task-number: PYSIDE-1404
Change-Id: Idea0ab076c66d2842958eabf66e5dc4f8e1bad3f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Extract base class WriteIncludesBase from WriteIncludes which
basically adds the dependent classes.
Move the classlibmap there as well.
Task-number: PYSIDE-1404
Change-Id: I899c7818cb96dd3b1af5f328cd20d64fbaf7755b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Upper-casing a Latin1 character might move it out of Latin1 range,
for example U+00B5 MICRO SIGN, which upper-case equivalent is
U+039C GREEK CAPITAL LETTER MU. If that's the case, then map the
original lower-case character.
Fixes: QTBUG-93858
Pick-to: 5.15 6.0 6.1
Change-Id: Ibd86fbb7c70d620c0884015ec1c40aa6351e6320
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
Fixup a bunch of QFlags usage that ended up triggering implicit
conversions. These conversions happen because QDateTime tries to save
some space and shove a QFlags value in a bitfield, so there's
no way around them; use explicit conversions instead.
In other places: fix QFlags->bool conversions by using testAnyFlag.
Change-Id: I50e8d92ed829b64ac46097c09e547e1c89cc2e35
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangleof anchorRectangle
of the selected word/text.
Task-number: QTBUG-90799
Change-Id: I4fed19a1d3bb2247656b052306307e6980074405
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Initial version of the conanfile.py to support builds with Conan
package manager. Tested with Linux, macOS and Windows desktop
builds first.
Use 'scm' revision_mode so that the revision matches with the git
commit id.
The recipe uses Qt's configure(.bat) and cmake directly,
'conans.CMake' utility tool is not used.
Load options dynamically based on configure(.bat) features:
- configure(.bat) -write-options-for-conan <output file>
- Expose all usable configure(.bat) options as Conan options
- We want to query configure(.bat) for available options and
features to avoid duplicating these in multiple places
- The available configure(.bat) option names are formatted to
suit as dictionary keys in Conan 'options'
The recipe writes 'configure_options.json' and
'configure_features.txt' which are exported as part of the
conan package. This is done only once during the 'conan export'
i.e. when the initial Conan package is being created.
The recipe will reference these files in later phases when needed.
The recipe translates the Qt configure options and features as
Conan options and default_options. When the build is invoked
('conan install') the recipe translates the Conan options back
to suitable Qt configure options which are then passed to
configure(.bat).
Additional cmake flags can be passed via 'extra_cmake_args' option:
$conan install ... -o extra_cmake_args="-DFOO=bar -DFOO2=bar2"
Remove those options from 'package_id' that point to local environment
like installation paths. These are most probably different on end user
machines making it impossible to re-use the pre-built binaries by Qt CI
as the path values would become of the 'package_id' checksum.
Task-number: QTBUG-92031
Change-Id: I4e47d116fdef6a5daa23aba22bac2b2d74d12c6e
Reviewed-by: Toni Saario <toni.saario@qt.io>
In preparation for blocking QFlags->int conversions. The existing
casts to uint are wrong, in the general case, as the enumeration
might actually be backed by signed integers; that makes them
fail to compile. Port them to toInt(). For symmetry, also use
qToUnderlying.
Change-Id: I851544f6ba05295fa5f6c5cc355b9de0f1362e2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There were two problems here: first, qHash(std::pair) must be declared
before qHashMulti that might call back to qHash(std::pair) (i.e., a pair
with one element that is also a pair). But moving the declaration above
causes the second problem: the noexcept expression can't refer to qHash
functions that aren't declared yet. So we forward-declare a constexpr
function for that result, but implement it far below.
Fixes: QTBUG-92910
Change-Id: Ia8e48103a54446509e3bfffd16767ed2e29b026c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's how much there is in Linux's AT_RANDOM block.
I've also removed the check for validity. It's highly unlikely that 128
bits are bad.
Change-Id: Id2983978ad544ff79911fffd16723161ea7ec315
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Instead of initializing the whole QRandomGenerator::system(), which in
turn gets to checking CPUID and whether the HWRNG works, trust the
operating system functions for an initial value. On Linux, we'll use 4
or 8 of the 16 bytes of random data that the kernel populates for us on
AT_RANDOM.
This should make Qt applications not stall on an early system launch
without an RNG daemon, if compiled without getentropy() support. And
avoids silly mistakes causing recursion, like QTBUG-78007 found.
Additionally, qt_random_initial_value() will most likely not throw
either. It's marked noexcept, even though SystemGenerator::fillBuffer
could throw on Linux, if the current thread is canceled, but Linux also
has AT_RANDOM. That leaves the other Unix systems without getentropy()
(read: macOS, since the BSDs have getentropy()).
Fixes: QTBUG-69555
Change-Id: Id2983978ad544ff79911fffd1671fca1a9f9044d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
That's two years from when the replacements were added (6.2).
Change-Id: Id2983978ad544ff79911fffd1671f7dd38fede02
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It is noexcept, except when initializing. When initializing, let's just
use qEnvironmentVariableIntValue (which we should have used anyway),
which avoids the memory allocation and is noexcept. The QRandomGenerator
functions are not marked noexcept, but are mostly so: they can't throw
regular exceptions, but some implementations do call POSIX Thread
Cancellation Points, which may cause forced stack unwinding. That's
unlikely to happen at the moment of the QHash initialization.
This is also mitigated in the next commit.
Change-Id: Id2983978ad544ff79911fffd1671fd16f8d6378d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Commit 37e0953613 added a to-do, but we
can actually change the type, since we've documented since Qt 5.10 that
setting a non-zero value (aside from -1) with qSetGlobalQHashSeed was
not allowed. Storing a value to be reset later is simply not supported.
Change-Id: Id2983978ad544ff79911fffd1671f7b5de284bab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Since we add 3rdparty libraries to the set of the Qt modules, they are
treated as the Qt modules by the depenedcy helper as well. So give them
_qt_module_interface_name to fix dependency helper.
Amends 425ff34aa1
Change-Id: I5898c1c90156de1878aeeef5a0924349b44c50fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
qprocess_unix.cpp:633:55: error: ‘i’ was not declared in this scope
Change-Id: I152fbd9df6e9d3f31e2c2c8b23a3c1ab87aa237a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's only meant for bootstrap builds.
Considering that SHA1 is deprecated by NIST we should not artificially
limit ourselves to using only that.
Task-number: QTBUG-93838
Change-Id: Ib779ad4e4349cfdc71d797eb3ba5ccfb7747e933
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The list persists events, which reference objects. Those objects might
get deleted by the time we investigate the objects. We cannot change the
event to store a QPointer for BIC reasons, and for normal usage of the
events, that doesn't make sense either.
Instead, connect the objects destroyed signal to a lambda which clears
the events' object member.
In order to access the private member, we befriend the test class.
Change-Id: I036be7053dccde4bdf862173789564e89d729ee1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
To avoid build error with no exceptions:
qtbase/src/corelib/serialization/qcborstreamreader.cpp:1586:9: error: cannot use 'try' with exceptions disabled
try {
^
qtbase/src/corelib/serialization/qcborstreamreader.cpp:1629:9: error: cannot use 'try' with exceptions disabled
try {
^
2 errors generated.
Used compiler: https://github.com/mstorsjo/llvm-mingw
It's not a supported configuration, but the change is simple.
Change-Id: I263ce23b458f114b2330e832c5f4fd2a99cbb973
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When building qtbase with CMake 3.20, only release tools will be built
by default in a multi-config build, so it is possible to skip building
debug bootstrap lib.
Task-number: QTBUG-88414
Change-Id: I266ac458ae3c89c593656e4ebdc788ae5797b788
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
After 1ed8a7bff5,
volatile needs to be specified for toString(), else it is not
used by compare_ptr_helper(). Add an overload.
Pick-to: 6.1 5.15
Change-Id: I3c335f324df346233623272d1014c8360ca33160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is now possible to call qt_add_big_resources with multiple .qrc files
that are in different directories but have the same file name.
Before, this resulted in target name conflict errors.
Pick-to: 6.1
Fixes: QTBUG-93230
Change-Id: Ic3d9d6974a107163aeb7ada0b6f1fa113fb18de0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We need to export the Private targets of the internal modules to keep
compatibility with existing internal module users across repositories.
Amends 425ff34aa1
Fixes: QTBUG-93943
Change-Id: I10234cec1eb618b69d041f80fbe29620a4e307b9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Get rid of a reduntant initialization; a data member gets default
initialized anyways.
Change-Id: I85ad4c9a00b3066ccd993dfc2652a3f0164a860e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
In random order:
* QFutureInterfaceBase has a d-pointer, and copy semantics. So,
"naturally" extend it to support move semantics as well. (These get
used by QPromise/QFuture, as they both hold a QFutureInterface*
as a data member). The only addition needed is a check for a null
d-pointer in the destructor.
Drive by, reorganize the code for the copies, and use copy-and-swap
instead of the hand-rolled solution. Also, add a free swap()
overload, and mark the existing one as candidate for inlining
in Qt 7 (doesn't need to be an exported function).
* QFutureInterface inherits QFutureInterfaceBase, again with value
semantics. To be honest, I'm not sure why QFutureInterfaceBase is
polymorphic -- could be a design mistake, as polymorphic classes
don't mix with value semantics. Anyways, reorganize the code for
copies, apply copy-and-swap, and add move semantics. This requires
adding a check into derefT().
* Finally, QPromise was already move-only, but had broken move
semantics: the move constructor was not noexcept (!) and it actually
allocated memory (!!!). Fix that one (can be defaulted now), and
streamline the move assignment via the proper macro.
Drive by, fix the signature of the constructor from QFutureInterface
(take const-ref, not plain ref -- it's eventually copied, so it
can keep the const), and add another internal constructor from
rvalue QFutureInterface that moves from it.
Change-Id: I9d61a9dd4d45f34942d8f34416baa118c0307390
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
When tool tip was trying to show its window became activated causing
tool tip to hide instantly due to a redundant window activation bug on
show/hide/raise/lower.
Fixes: QTBUG-91095
Change-Id: Id215400a79cdc4ed1961731949ca139b575eec88
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
If rcc cannot open the file passed with --temp, display the path of the
temporary file, not the one of the output file.
Pick-to: 6.1
Change-Id: I58f8ab2f68ac2f1a19feb6b02974dff9fc8b7ec1
Reviewed-by: hjk <hjk@qt.io>