Google translate drops the space around the non-translatable
inline text. This should ensure that inline anchors have extra
margins.
Change-Id: I1c204a9a27d0a39256ef04aa3f03ba1b8433aa54
Done-with: Topi Reinio <topi.reinio@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Using [NSStatusItem popUpStatusItemMenu:] to manually show the menu is
deprecated, and was causing various issues when right clicking the menu,
such as not unhighlighting the menu item when dismissing the menu, or
worse, not quitting the application if a 'Quit' item was triggered from
a right click.
The reason we were using popUpStatusItemMenu instead of the menu
property of NSStatusItem was that the latter prevented us from seeing
the action message of the NSStatusItem button, which we used to emit
the system tray's activated signal, but this can be solved by listing
for the menu's tracking state starting.
Fixes: QTBUG-103515
Pick-to: 6.4
Change-Id: I686550ebac7d94d8d11b2e3c49ed16a8240cb214
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The venerable wiggly example was created before unicode support was
added to Qt. Hence, when extracting the individual characters from the
string for painting, the code was not prepared to handle that some
characters, like emojis, are composed of two QChar elements.
Fixes: QTBUG-28853
Change-Id: I9804415f92775e2b78fa9fcaf7a2d112153cdce0
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QXcbWindow::create() bound the window's size to windowMinimumSize(),
after its size had been inherited from parent().
QPlatformWindow::setGeometry() was called before that sanity check.
When a fullscreen window is re-mapped from a deactivated screen to the
remaining screen, the call to QPlatformWindow::setGeometry() assigns
an invalid QRect to QPlatformWindowPrivate::rect
The negative int values x2 and/or y2 cause
QXcbBackingStoreImage::flushPixmap to address unmapped memory and
crash.
This patch moves the call to QPlatformWindow::setGeometry() from
before to after bounding to a minimum value. That assures a valid
rectangle to be assigned in all cases.
Fixes: QTBUG-109226
Pick-to: 6.4 6.2 5.15
Change-Id: I349a0f3c721059a9013a275de5b4cb147fbdd7a1
Reviewed-by: Liang Qi <liang.qi@qt.io>
Add storage buffer memory qualifier and run time array stride information
to QShaderDescription::StorageBlock.
Memory qualifiers allow more informed selection of RHI resource buffer
binding (bufferLoad / bufferStore / bufferLoadStore) function.
Run time array stride (for last block member unsized array) allows
packing of buffer data for transfer to / from GPU. Without this
information, applications must infer or guess which packing rules
(std430 / std140) are in use.
Change-Id: I676d7e848afefd40d01cdd463c569b07022b683e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Looking at the use-cases of the already existing q_points_into_range
overload, all of them can be ported to the new one (i.e. all of them
were using range [begin, end)).
Change-Id: I4bfdd68271512b88a9800a16237ff967a367eaeb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use a stack buffer, and perform the recoding from U16 to U8 in chunks.
Since no-one so far managed to get a chunked QStringEncoder to produce
the same output as the test expected, at least not without additional
API, fall back to the raw QUtf8 functions. This also avoids the
indirect function call overhead that QStringEncoder would entail.
Fixes: QTBUG-109284
Change-Id: Icaa26c3988ac8506c9cf3fde18fd5892e5e63ef2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Now that QXmlStreamWriter's APIs take QAnyStringView, there's no need
to convert the QStringViews we get from e.g. QXmlStreamReader APIs to
QString first.
Task-number: QTBUG-103302
Change-Id: Iab33dbfb5da7b3501cae0d0ab7f7ecdb61cca784
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Q_ASSERT() already ensures its argument gets compiled even with
QT_NO_DEBUG, but then skipped as dead code.
Task-number: QTBUG-103302
Change-Id: I6614b23967e2bb506e52f1493526564a0b5955be
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
... and port the last remaining user over to the QAnyStringView
overload.
Task-number: QTBUG-103302
Change-Id: I7edd855d6c2bc16180c642191aa0d477586c1e0b
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Less code duplication, as "convert Latin-1 data to Utf16 and store in a
QVLA" is used in various places.
Change-Id: I861f5b8f988411d400db0440b0f5a56c5365e990
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commit 3cb3218797.
Reason for revert: Breaks in qtdeclarative
Change-Id: Iefe2954826bca80ebb2aecb8e8d8367290c218d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If freetype feature is not enabled we don't deliver its header
files as part of Qt. The freetype font database was used
as the generic fontdata base for unix platforms. This uses
QPlatformFontDatabase as the generic one if neither fontconfig
nor freetype features are enabled.
Fixes: QTBUG-109270
Change-Id: I9e935fd1557db417eb94d44b6a0d88818d567fbe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This mimics CMake's policy support. The policy state is stored in an
internal __QT_INTERNAL_POLICY_<policy> variable; by using normal
variables, we gain support for stacking for free.
Policies can be explicitly en- or disable via qt6_policy; that command
also has a GET mode to retrieve them again.
Furthermore, one can now pass min and max version to
qt6_standard_project_setup, to opt in to a certain set of defaults
introduced in a given Qt version.
We add support for policies in QtModuleHelpers, so that we can check for
known policies while building Qt itself.
No actual policies exist yet; but a follow up commit will introduce one
for qt_add_qml_module.
Change-Id: I57a0404c9193926dd499f94cc5f73e359355c0b3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
make QAbstractFileEngineIterator::currentFilePath() virtual
and implement it under AndroidContentFileEngine to return
current fileName because content uris shouldn't be constructed
manaully like normal file paths.
Pick-to: 6.4 6.2
Fixes: QTBUG-104776
Change-Id: I4643a73a3bd4019bedaa056c35468117bcec18dc
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
In the process actually handle all time-spec cases in various places
that only handled UTC or LocalTime, or at least note that they don't
where that's not practical. Also tidy up header ordering and ensure
QDateTime's header is included wherever it's used, while adding the
include for QTimeZone where needed.
Task-number: QTBUG-108199
Change-Id: Ic1a5cdf0aaf737bf1396aa8ac58ce2004cef7e19
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>