As foreshadowed when QDateTime adapted to route all QTimeSpec use
through QTimeZone, this commit deprecates the old API in favor of the
newly more capable QTimeZone-based API.
Fixes: QTBUG-108199
Change-Id: I9a3f9f94d4a5d8cc229db72b3e4731a9e318a076
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Can be overwritten by setting the "darkmode" parameter of the QPA
platform to 0 or 1. The Windows Vista style (which is the
default on Windows) will overwrite the platform theme's palette with the
light system palette (see a2518b4140), but
styles that support rendering in dark mode will just run with the dark
palette.
More work needed in qtdeclarative to make the Qt Quick native style for
Windows also overwrite the palette, and to handle palette changes in Qt.
[ChangeLog][Windows] Qt applications that use a style that supports
dark mode rendering (such as the classic Windows or Fusion styles) will
respect the dark appearance setting on Windows. Applications that use
the Vista style, which doesn't support rendering in dark mode, will
use the light system palette. On dark mode systems, the window frame
will be dark if the palette is dark.
Task-number: QTBUG-72028
Change-Id: I416b4fd59eb3f64701b403984c7ac2359536abbe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Input events that originate from actual device interaction should reflect the
device's state, and device and events need to be kept in sync so that event
sequences (such as multi-touch events, where we have begin/update/end cycles
spanning multiple events) are working correctly.
For that reason, the event point data in pointer events is explicitly shared,
and we only detach in exceptional situations. This saves us memory allocations,
and makes sure that the event point data carried by events, and the event point
data stored persistently in the device, are kept in sync.
Cloned pointer events do not originate from device interactions, and should
therefore not sync back to the device. E.g. accepting a clone should not modify
the original event data stored in the device. There are exceptions here as
well, e.g. when cloning an event in Qt in order to deliver a translated version
of it to a different scene. Different points might even get delivered to
different scenes or windows, or at least different items in the same scene. For
that reason, we explicitly detach, and then explicitly write back the relevant
states after the cloned event has been delivered.
But in general, we should assume that cloned events do not write back to the
device. Since QEventPoint is an explicitly shared data type that never detaches
itself, we have to explicitly detach it when making copies that should not be
shared.
The ideal implementation of this would be to do the detach in the copy
constructor of QPointerEvent, which is called when cloning. However, Qt itself
makes copies of QPointerEvent without using clone, e.g. when assembling lists
of touch events for the different subscenes or windows in
QGuiApplicationPrivate::processTouchEvent, where event objects are added to a
QVarLengthArray<QMutableTouchEvent>. This makes copies, and those copies must
not detach.
So we have to implement the special cloning behavior in each override of
QPointerEvent::clone(). For this, introduce a dedicated macro for the common
member functions. This macro must be used for QPointerEvent subclasses.
Fixes: QTBUG-107560
Change-Id: I4b56f9e71c7d067ba9054a2a631e8ba5bc7b1ab9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QXmlStreamWriter is basically a fancy way to append to a
string, not saving any of them individually, so this API
is a perfect candidate for replacing all of the QStrings
with QAnyStringViews.
[ChangeLog][QtCore][QXmlStreamWriter] Ported API to
QAnyStringView (was: QString).
Fixes: QTBUG-103302
Change-Id: I9fb1f2d5793cf9f35d468c46c0127d3ebd57f3dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The UTF-8 support in Qt is still lacking, so QUtf8StringView doesn't,
yet, have the likes of contains(), endsWith(), etc that the existing
QString code uses in Q_ASSERTs.
Provide free functions that work for UTF-8 haystacks and ASCII needles
by falling back to QByteArrayView or QLatin1StringView.
Also break a replace() use into a series of indexOf() + chunked
write(). This is rather expensive for QString, so port the
writeCDATA() function that uses this to QAnyStringView already, ahead
of the bulk of the changes in Mate's follow-up patch.
Task-number: QTBUG-103302
Change-Id: Ic66261740817ede2600b78a383cf667a31df7bfc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
This is a prerequisite step of porting QXmlStreamWriter to
QAnyStringView.
Task-number: QTBUG-103302
Change-Id: Icdbe3d23bd96461b0ace497ac9995040cfcdb470
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This is a prerequisite step of porting the QXmlStreamWriter API to
QAnyStringView.
Task-number: QTBUG-103302
Change-Id: I73383c2b09a4a70bfc23bbc6c6b1d62cb878a6b1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This is a prerequisite of porting the QXmlStreamWriter API to
QAnyStringView.
Task-number: QTBUG-103302
Change-Id: I1433de66c9aefe6f3e8f7cd8e831718d2db88eb6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This is a prerequisite of porting the QXmlStreamWriter API to
QAnyStringView.
Task-number: QTBUG-103302
Change-Id: I48eca902a7b8f0e0a52202936947a2b60353f08c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Replace the const QString &s overload with a QASV
overload.
Remove the const char (&s)[N] and const XmlStringRef&
overloads, with the QASV overload they are redundant.
Leave the const char *s, qsizetype len overload for
now but make it call the QASV overload.
Task-number: QTBUG-103302
Change-Id: I4f92d76248d5b7531472056a51ca06aa25dbac01
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Replace if-statement to check compressable event types with a switch.
Replace if / else if sequence dispatching to type specific compression
code paths with a switch.
Replace iterated for loop with a ranged one.
Task-number: QTBUG-107808
Change-Id: I9054b625f1898fa793f78de1b477a2113a4e33f0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
XML does not impose any semantics based on the order of the attributes;
they're an unordered set. Quoting [1]:
> Note that the order of attribute specifications in a start-tag or empty-element tag is not significant
and [2] 2.2.5:
> An unordered set of attribute information items
Still, using a QHash-based implementation to store attributes is
annoying, because one cannot serialize the document in a stable way.
The order of attributes is going to depend on the QString hash function
(which we can change at any time) and the QHash seed (which is random
and changes at every run). In other words, saving the same DOM will
yield non deterministic outputs. That's annoying for testing,
reproducible builds, and so on.
Switching to an _ordered_ associative container for storing attributes
won't, on its own, ensure any specific ordering. That's because:
* attributes are currently kept associated using their name as the key,
ignoring an eventual namespace prefix;
* there's some convoluted logic that sometimes emits attributes in the
xmlns namespace (to qualify a prefix).
Hence, just go for the straightforward implementation and sort the
attributes before streaming them. In the main loop I could have used a
range-based for loop over the associative container used for attributes;
since it's a Qt container, it would have yielded just the values in the
map, and we are not interested into the keys. However I'm preparing for
further changes down the road, so I'm opting for key/value iteration.
I'm deliberately not offering an opt-out because:
* I don't think this is so expensive to justify an opt-out;
* I'm going to remove QHash anyways in a follow up commit.
[1] https://www.w3.org/TR/xml11/#sec-starttags
[2] https://www.w3.org/TR/xml-infoset/#infoitem.element
Task-number: QTBUG-76800
Task-number: QTBUG-25071
Change-Id: I6282ae2ccbee9c0099f138de48b94bb7c40b3680
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
With CMake versions < 3.19, we don't have a deferred call of
qt_finalize_project. In qt_add_executable we only have immediate
finalizaton call of qt_finalize_executable, but
qt_android_generate_deployment_settings still depends on the
_qt_internal_apk_dependencies target that is created by qt_finalize_project only.
Create an empty target for the cases when we need to generate
deployment setting but qt_finalize_project is never called.
Pick-to: 6.4
Fixes: QTBUG-106634
Change-Id: If0608cb527eea662e0f9dd41f2751fe49ce433db
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Disable AUTOMOC for qwineventnotifier.h on non-Windows platforms.
Add a comment to remove qwineventnotifier.h from non-Windows platforms
for Qt7.
Fixes: QTBUG-107109
Change-Id: I8f769aa764daeb634211aca7114f94b50cc0a85d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Qt Creator maintains a mapping from Qt version to Android NDK version
and other build information. It's simpler to let the Qt build write the
Android build information into modules/Core.json and have Qt Creator use
this information.
This adds the following properties to the module JSON files:
- built_with.android.api_version
- built_with.android.ndk.version
Task-number: QTBUG-108292
Change-Id: I0febda5192289c5afb1a098880b31bef6317db35
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The module description JSON files contain architecture-specific
information. Therefore they should reside below INSTALL_ARCHDATADIR
instead of INSTALL_DATADIR.
Moving these files should be unproblematic as there are no known users
of these files.
Change-Id: Ibff1f7b6ce2d1633ebce33861358ad5d1cae2beb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When handling multiple screens in Android system it is needed
to have the information about the display's Id. This patch
provides this possibility.
Task-number: QTBUG-105325
Change-Id: Id91aeaa59b17d5a098b672e220a5182b97320703
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Wasn't marked deprecated in documentation, and was needed for user
construction of QShortcutEvents.
Fixes: QTBUG-109090
Change-Id: Ibf0ad83a57de724d9b88a7e610ba04c2c662983b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
NSSave/Open panel is a shared object, that can outlive Qt's counterpart.
While its delegate is a weak property, somehow it can outlive Qt-object,
which _owns_ this delegate, as a result an attempt to emit a signal
on m_helper results in a crash. QPointer can help with such problem.
This is a speculative fix, since we don't have a realible reproducer.
Fixes: QTBUG-109287
Change-Id: Iccc4a063a24e33e0a5c0fd07b3c203d0c17317ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
On these platforms there is a platform-native plugin that can be used
instead. If, as has happened, a developer uses the OpenSSL backend
without OpenSSL being available they may be confused by the output of
OpenSSL without it being of any concern.
Leave the warning level low on other platforms since they have nothing
to fall back to.
Pick-to: 6.4.2 6.4 6.2
Change-Id: Ic36a0429a9e8eed728aa59ec9e028626d6579de1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In the process, centralize the creation of date-time values, where
doing so requires catching invalid results caused by spring-forward
gaps; this saves some repetition and extends the treatment to more
places that did need it. Also, de-inline two overrides of virtuals;
being inline does them no good.
Replace the Qt::TimeSpec member of QDTEPrivate with a QTimeZone so
that creation of values can be streamlined and to make it easier to
add support for (currently unsupported) OffsetFromUTC and TimeZone
timespecs in the public QDTE API.
This greatly simplifies a lot of the code, while preparing it for a
long-needed extension to its functionality.
Task-number: QTBUG-80417
Task-number: QTBUG-108199
Change-Id: I0ac2c78025013bf89899e3ef1a56e89392f67ce5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This saves (mostly in corelib/time/) some complications that used to
arise from needing different code-paths for different time-specs.
Task-number: QTBUG-108199
Change-Id: I5dbd09859fce7599f1ba761f8a0bfc4633d0bef9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This unifies currentDateTime(void) and currentDateTimeUtc(), adding
the missing equivalents for a time-zone or fixed offset from UTC.
In the process, make the documentation less wordy.
[ChangeLog][QtCore][QDateTime] currentDateTime() now accepts a
QTimeZone parameter to select the time representation to use for the
result.
Task-number: QTBUG-108199
Change-Id: I761c4bc050cc671c1c767d707f6d2dd85cc1ac0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For now, just addDays() and the springForward() test, as proofs of
concept for future work to be more systematic.
Change-Id: Id2c4e9ad304d3aef6fdfb48ae6328df8c638c934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add infix to "qwindows" for platform plugin search if it exists, to
account for libinfix builds
Task-number: QTBUG-105820
Pick-to: 6.4
Change-Id: I7a3c671fb6cdb4a216f6f4bffb445add4f8e0c83
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Free most APIs using QTimeZone from feature timezone and route all
APIs taking a naked QTimeSpec via these, in preparation for their
eventual deprecation. Since qtimezone.h includes qdatetime.h (and MSVC
blocks our ability to remove the need for that), qdatetime.h's
declarations can't use a default value for QTimeZone parameters; so
add overloads taking no zone (or spec) to handle that.
[ChangeLog][QtCore][QDateTime] All QDateTime APIs involving a
Qt::TimeSpec can now be routed via QTimeZone's lightweight time
description support, saving the need to have different code paths for
different time specs. In the process, QDateTime gains a
timeRepresentation() method to return a QTimeZone reporting the
(possibly lightweight) time description it uses. (The older timeZone()
method always returns a non-lightweight QTimeZone, whose timeSpec() is
Qt::TimeZone.)
Task-number: QTBUG-108199
Change-Id: I23e43401eb2dbe9b7b534ca6401389920dd96b3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][QtCore][QTimeZone] QTimeZone is now always defined;
feature timezone now controls most of its prior API and some new API
is added, most of it always present, to enable QTimeZone to package a
Qt::TimeSpec and, for Qt::OffsetFromUTC, its offset. Prior to this
change, APIs using Qt::TimeSpec had to provide a separate function
taking a QTimeZone alongside a function taking a Qt::TimeSpec and
optional offset; it will now be possible to unify these into a single
function taking a QTimeZone. Adaptation of other Qt classes to do so
shall follow.
Task-number: QTBUG-108199
Change-Id: If5ec3cc63920af882ebb333bf69cde266b1f6ad7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It also needs a mention of the ICU escape hatch from MS's borked zone
data. There were a couple more "UTC start of 1970" phrasings to update.
The difference between 01:59:59 and 03:00:00 is only a second, not a
minute, when a spring forward skips 02:*:*.
Clarify documentation of copy assignment.
Change-Id: Id177733d5702a1d104ab8cc49008c844170276d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Last two entries were the wrong way around.
Inclusion of "qplatformdefs.h" was spurious.
Change-Id: Ida445471d76ff72154d8bcd95900b5df7d32e1ac
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
At the moment when doing a non-prefix build and changing some of those
files, CMake will not update the changes to the build folder unless
done manually or a re-configure is done manually.
qt_copy_or_install() only does copy those files at configure time once,
and using CMAKE_CONFIGURE_DEPENDS would be an overkill here and even
a bit of an extra annoyance, so in this case having a custom command
seem to be suitable.
Done-with: Alexey Edelev <alexey.edelev@qt.io>
Change-Id: I55aa9e9d3eea32a4bb54c64abd4cbdcb891c44b6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
COIN_CONFIGURE_ARGS would only contain -make examples in qtbase
builds. In other repos it would use values like
NON_QTBASE_CONFIGURE_ARGS, which would not contain -make examples.
Check CONFIGURE_ARGS and TARGET_CONFIGURE_ARGS which are guaranteed to
contain -make examples when building any repo.
Amends 440438092b
Change-Id: I9bf086f8104da85ed8ece335a45c6628ea591f2a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
It looks like adding dependencies to interface libraries is either not
fixed or broken in CMake versions newer than 3.20. Remove the CMake
version check to ensure that 'lib_pri' targets are executed. This will
restore the initial behavior.
Amends cfcc4ef8ed
Pick-to: 6.2 6.4
Fixes: QTBUG-109240
Fixes: QTBUG-109239
Change-Id: I8c5b317fcdd0a715a1a668b4e955df1acfe4be8b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since adding the QUtf8StringView overloads, calling these overload
sets with const char string literals became ambiguous in
QT_RESTRICTED_CAST_FROM_ASCII builds (both QString and QUtf8StringView
are a match).
Fix by providing the same templated overloads that
QT_RESTRICTED_CAST_FROM_ASCII enables for QString construction and
assignment for append/prepend/insert/op+=, too.
Incidentally, this makes these operations much faster than when they
constructed a temporary QString.
Change-Id: Ie9b38fc80cc00e142e094dab716938c6fda41ba1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Now that C code need not include the header for qVersion() anymore,
it's no longer needed.
Partially reverts 50b05e3e2a.
Change-Id: I917fbc883c315a0878e08da6aca9aed29c29917f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... where 50b05e3e2a originally added
them.
While qtversion.h is included in qglobal.h, using qtversion.h directly
is a tiny step towards removing qglobal.h includes from our code-base,
so don't let this opportunity go to waste.
Change-Id: I28eaca1f4e250fc9e12e2ce6a6f94670a1d08dbe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This test makes use of a GCC extension-slash-defect in matching of
template template parameters. Either Clang has recently changed its
behavior not to accept them any more, or we've never compiled this test
with Clang.
Tested with Clang 15.0.6.
Pick-to: 6.4
Change-Id: I69ecc04064514f939896fffd172e98d826989ca3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Upstream commits:
db46fc981fd8c1a46d923aeaf2187dfcc8b50099
1e9e1c508e177b6466282dfad273cf6cfcdf5c76
One useful change is removing the "XINPUT from XCB is experimental"
warning, it's been around and the default for ages.
Task-number: QTBUG-109183
Change-Id: Ie66aa76c5e3ce83d5d654cfa8279a946c7486602
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
By adding a CMake option() that is OFF by default.
Change-Id: Ic66cae5bb9739ae1db3e534f671cc1e9e4b09647
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Added Quick-controls,dialogs,layouts,shapes,test,timeline,3d- modules
to the windeployqt module list
Task-number: QTBUG-105135
Pick-to: 6.4
Change-Id: Id5bbaa4b86f1ec9861ee308cec6deff50704c77f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
- inline move special member functions and swap()
- add qHash() overload (EqualityComparable types should be QtHashable)
- unexport this non-polymoprphic class, export only individual members
- don't use a heap-allocated Private just to hold a single number
- use inline storage until we actually need to use external state
- limit the max. connections to 255 to fit into an 8-bit value
- document min/max of the numberOfConnectionsPerHost() property
- use qsizetype instead of un-Qt-ish unsigned int
Task-number: QTBUG-108215
Task-number: QTBUG-25280
Change-Id: Ia9841f2dbabd13219ffd813aff3947aa0c8bdc0c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The argument allows to ignore the condition for source files if they
are used in the Qt code without corresponding guards. The header files
of this kind usually have internal guards, that suppress the error
at the location where they are used, so AUTOGEN is skipped for these
header files to suppress the warnings from CMake. If file belongs to
a module, it will display AUTHOR_WARNING which should urge Qt
maintainers to guard the use of the source file properly.
Task-number: QTBUG-103196
Change-Id: I7b4c12031a5d19ff15868d4782c0d396ef7aed8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>