The function didn't take any of the arguments into account, and was
just initializing the font database, which all but one of the call
sites were already doing.
Change-Id: I83cab0059014dd256ec4b453e15fc2fe4bebcbdf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Instead of having multiple code paths call initializeDb(), we use the
already existing ensureFontDatabase() to provide the central point of
ensuring an initialized font database.
A couple of locks for the fontDatabaseMutex was added since the
ensureFontDatabase() function documents that as a requirement for
calling the function, but these locks were presumably already needed
as the original code paths accessed the database in the same way.
Change-Id: I5e29a069c4c7f68902dbe0c6c949a168d54f5f0e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The use of both a global static and a dedicated instance() function made
it harder to know how and where the singleton font database was managed.
As Q_GLOBAL_STATIC is no longer needed (as of C++11) for ensuring thread
safe access we can contain the QFontDatabasePrivate singleton within
the instance() accessor.
Change-Id: Ia3d83ff2d83d326504243258a44d8ae8352d290d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Because of a bug in QDoc there was never a warning reported for the
missing qualifiers.
Pick-to: 6.3
Task-number: QTBUG-101461
Change-Id: Ibb9114bc5d29e75158d2ac254169ba2a73043f0d
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Support specifying that Qt should use a div element
as the root container, in which case canvas management
is moved to Qt C++ code.
This enables us to take ownership of the canvas and its
configuration. In addition, it allows creating child
elements for the Qt container (canvas element children
have a special role are as fallback elements displayed
in case the browser can’t show the canvas)
Remove support for reading Module.canvas, which was
deprecated in Qt 5.
Add support for reading Module.qtContainerElements,
which can be either a canvas element (legacy) or a
div element (preferred).
Deprecate qtCanvasElements and print warning on usage.
Change QWasmScreen to accept either a canvas or any
html element. In the latter case, create the canvas
and configure it as required by Qt.
Change-Id: I57df8fb5772b2bfbba081af3f572b8b0e7d51897
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Two members are only used in code that's conditioned on pseudo-feature
fslibs, which was defined in qfilesystemengine_win.cpp; move that
definition to qfiledevice_p.h so that the members's existence can be
conditioned on the same #if-ery as their use. The bootstrap build was
broken by the warning.
In the code that uses them, a lambda captured this but didn't use it,
causing the non-bootstrap build to get a warning (hence error) and
fail. So remove the unnecessary capture. Also suppressed warnings on
an unused function.
This amends commit 174af05400
Pick-to: 6.3
Task-number: QTBUG-79750
Change-Id: Ib29f3200b7736bc07df68aeec4fc6f568c8f4ddb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
When trying to match a font request to fonts in the database we might
end up with a mismatch due to the style not being available, but the
font family itself was.
If that's the case there's no point in trying to populate font aliases.
Fixes: QTBUG-98369
Fixes: QTBUG-99216
Pick-to: 6.3 6.2 5.15
Change-Id: I8776e5b89588a13749c9c7e414c5bfac86feab58
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The accessibility code for notifying focus changes related to a
table/tree view was iterating over all items to find the focused one,
which for a very large number of items could cause a major slowdown
and UI freeze. This patch avoids the issue by removing the loop and
implementing the focusChild() method in the table/tree accessibility
classes.
Fixes: QTBUG-100997
Pick-to: 6.2 6.3 5.15
Change-Id: I04c847a5e65223b7a93ab82363feb32e1ebab9f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
When accessibility was activated after the application startup, it would
send state update notifications for every accessible object, which for a
large number of objects could result in a flood of UI Automation
notifications and UI slowdown. This patch ignores these notifications
until QAccessible is activated, which should avoid the slowdown and
seems to cause no side effects with accessibility tools.
Fixes: QTBUG-95114
Pick-to: 6.2 6.3 5.15
Change-Id: If1495d0aa846d7810b3d297b7e156563a7e5f6e6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
A previous fix for QTBUG-70621, which allowed changes in the state of a
Quick combo box control to be detected by accessibility clients has
reportedly caused significant slowdowns under some difficult to reproduce
circumstances, probably associated with a large number of accessible
objects. This patch restricts the name change notification to combo
boxes, which seem to be the only kind of control requiring them for
accessibility, instead of sending it for all control types.
Fixes: QTBUG-97103
Pick-to: 6.2 6.3 5.15
Change-Id: I18c0067478df5a80f7365195d3559b3f04faa815
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
IGY doesn't provide tslib backend. QT_FEATURE_tslib should be OFF.
Task-number: QTBUG-102121
Pick-to: 6.2 6.3
Change-Id: Id6417b92864312f6437c773a472aff8517b6e5dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And replace them with more descriptive versions
Change-Id: I3d5256072a5bbe0919a08b800877aa9b6a305a0b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The remaining diff to clean 1.2.12 is archived in the qtpatches.diff file.
Also this fixes CVE-2018-25032.
[ChangeLog][Third-Party Code] zlib was updated to version 1.2.12.
Change-Id: Ifab5d57acdc90ace61f2fd22c6dbb7ec6b4ad319
Pick-to: 6.2 6.3 6.3.0 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Android internally cannot handle versioned shared libraries.
There is no explicit rule for that, but indirect signs point to this.
This adds an explicit error to androiddeployqt to give the clear
understanding of the error nature to user. Error is also thrown if
versioned library was used when linking Qt libraries.
E.g. when linking Qt with liba.so it might be symlink to liba.so.1.0
This means that liba.so.1.0 Qt will require liba.so.1.0 at runtime.
But since Android doesn't handle versioned shared libraries,
liba.so.1.0 will never be packaged correctly. Most build systems
support generating of versionless shared libraries, and this should
be used when building 3rdparty libraries for Android.
Task-number: QTBUG-101346
Change-Id: Ic49d1a0d7d3a4c5c0dc308a570e98e8a0a223053
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Not always possible, but avoid the noise where we can.
Change-Id: I4a37cc3e806b1b9d696647aca7303b30e36b471b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Can't change the public API, but we can at least change the internals
to use the right type, ready for when we do. Also changed some C-style
casts to function-style, even when the type remains int; renamed an
inner loop variable to avoid shadowing an outer; and changed a use of
count() to size().
Change-Id: Id52ce0a2f0177bf1d6dfbd45a592a45afcddf9b4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Two methods of the private class used to take a QByteArray with from
and to indices into it, for where to start and stop a scan. Now that
they take a QByteArrayView, those parameters can be used by the caller
to shorten the view to the desired portion.
Change-Id: Id1586afb87a9e8a189b69e485278375ff504fb7b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Avoid allocating QBA methods when the QBAV methods can do just as
well, especially where the QBA was already being QBAV-wrapped to avoid
such allocations.
Change-Id: I180c2316362685ffda613bab2c761e72c4483fce
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The newer methods bypass checking and make it clearer what's
happening. They're also available on QBAV, unlike mid().
Change-Id: Ie0375888b889e393b91814ba80529d1a7227eb7f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The user may tweak the appearance of text rendering on iOS to aid a11y,
by making the text larger or smaller, or bold. This feature, known as
Dynamic Type, will be reflected in the preferred content size category
of the application.
When we detect changes in this preferred content size category we respond
by invalidating the font database, which will trigger the application
to re-evaluate the sizes and weights of the theme fonts.
Unfortunately we do not currently pick up or propagate the scaled font
metrics when an explicit point or pixel size has been set on a QFont,
but this problem exists regardless of whether we dynamically handle
changes to dynamic types or only pick them up after an application
restart.
Change-Id: I8c722d0bfb4b76eade47ebfb6512e6676a910d6a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The user may use the Font Book application to add or remove fonts,
which affects the fonts that are available to Qt applications.
As the cross platform QFontDatabase implementation currently doesn't
support granular management (removal) of fonts, we need to invalidate
the entire font database.
Since the theme fonts on macOS (and iOS) are managed by the font
database we also need to invalidate the theme fonts, and report this
back to the application.
Change-Id: I1f6a7900f76e0b6a1f059bd43638a04bc0808e20
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We populate the various QPlatformTheme::Fonts by asking the system for
the preferred font for each use-case, but that just gives us a single
font descriptor with a single style and weight. If the user then tweaks
the font by e.g. making it bold or italic, our font database will not
have any knowledge of these variants, and will fall back to another
font.
To fix this we ask CoreText for all variants of each of the theme fonts,
so that each of the theme font families are fully populated.
The preferred way to do this on macOS 10.15/iOS 13 and above is by using
the font's UI design trait. This avoids asking CoreText for private
fonts by family name directly, which is not supported and may result
in giving us Times or another fallback font instead.
Pick-to: 6.2 6.3
Change-Id: I4aa21624df62ac09a92d7ae0bc2cdde4f6ad6e5f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
qtbase\src\corelib\global\qglobal.cpp(3510,21): error: call to member function 'endsWith' is ambiguous
Change-Id: I2b20077584a33ca5f40efdf397b5913afd6e7fae
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This reverts commit 69d525a6fa.
The change introduced behavior changes on Windows, where family
aliases are used to build a full set of styles for a family.
Change-Id: I64ca1cf5febf0a6277cbe0a0041ccdb76da72196
Pick-to: 6.3 6.2 5.15
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It had some repetition that could be refactored out, some long lines
and a bool it worked out the hard way, when it had previously
determined the answer in passing without recording it.
Change-Id: I9e53ed087dfbe8067686b27b6cf9ac32040fbf19
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Previously, only the first B?XFAIL would be reported, all others would
be discarded. Furthermore, if a B?XFAIL had happened, B?PASS was also
not reported, since the B?XFAIL served as test line. However, if the
B?XFAIL was followed by a SKIP, B?XPASS or B?FAIL, these were reported
as normal, producing exactly the kind of duplicated test line that the
skipping of B?PASS was meant to supply.
So change B?XFAIL to be reported among the messages, but retain the
TODO annotation of the first on the test line of a subsequent B?PASS,
if nothing more drastic happens in the mean time. So now more than one
B?XFAIL can be reported, the test is still marked as a TODO and we
don't get duplicate test lines for a subsequent non-passing result.
This replaces the bool m_wasExpectedFail member with a QTestCharBuffer
m_firstExpectedFail that records the first XFAIL's TODO line (so its
isEmpty() fully replaces m_wasExpectedFail).
Previously, the at/file/line information for a B?XFail would be
supplied as top-level keys in the YAML block for a "Pass" reported as
not ok due to the XFail, as this location information is now part of
the B?XFail's message in the extensions/messages block. Duplicating
the first B?XFail's location at top level would add complexity and is
arguably misleading, as the test result is really a pass (after
ignoring known issues), and the location of the pass is indeterminate
(nominally the end of the test function, but actually also after the
cleanup() call for this test, when relevant), which is why a Pass has
no location information.
Task-number: QTBUG-96844
Change-Id: Ib3f24f56266ff49bf3bc9759ac8263ac69a62130
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In the process, split it from its comments block and don't bother with
a YAML block if it would only have contained comments.
Task-number: QTBUG-96844
Change-Id: I08c20f796252bb270ba9caa4c055cdcc0843a88b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The ASN.1 parser for a date-time had to check the date-time string was
all digits to catch the case of a sign in the month field, which used
to be accepted when it should not be. That bug has now been fixed, so
remove the work-around and add a second date-time test-case, renaming
(and modernising) the existing one for consistency.
Task-number: QTBUG-84349
Change-Id: I649c5129312b6865af08b22ba6893cb4e29243f8
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Implement support for detecting Light/Dark mode on iOS. This is needed
by the QQuickIOSStyle in order to display the proper image assets
according to the theme.
A further improvement would be to react to theme changes dynamically.
Change-Id: I95e11c4a4b647614bdd78d734941d2b11546687a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The deprecation note for one of the operator* is wrong: Using
mapVector() is never the right choice given the deprecated operator*
itself is implemented by calling map(). It could be that in some cases
the results are identical so one can get away with migrating to
mapVector(), but this is incorrect in other cases and causes
regressions all over the place. Thus we should only recommend using
map() instead, never mapVector(). As shown by recent experiences, the
current docs are insufficient/wrong and caused a number of regressions
in the Qt code base as well.
Also enhance some related docs. It could be that the wording is not
always academically correct, however having some additional notes in
there help make it obvious to the reader (or at least raise some
alarms) that there are important differences between map and
mapVector.
Also improve the note for the other deprecated operator*. There is
only one way to convert to a vec4, given the existing implementation
of the operator, and that is by using 1 for w. Make this clear to the
reader.
Pick-to: 6.3 6.2
Change-Id: I1d8dbca44fdc103ab62d49bfc1d4ce37a9bc130b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The original using is outside QT_NAMESPACE, so it is
not correctly picked up by various parts of the code.
Simply moving it inside QT_(BEGIN|END)_NAMESPACE revealed
that the namespace (and thus scope) is closed and re-opened.
in the file, so fix that too.
Change-Id: I704f164b5705b539dbdf25b7743f5e339c016600
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
We can not trust __clang_major__ and __clang_minor__ for Apple Clang,
but we still want a single Q_CC_CLANG define that can be used to check
the Clang version.
Pick-to: 6.3 6.2
Fixes: QTBUG-99020
Change-Id: I5128c1ff40d1ef1afeaab3c7fa4988a5bb170742
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Commit a35a7fcb5a introduced the usage
of insets to correctly take into account the default Android status bars
and other reserved regions.
However in practice that does not work as expected - the bottom inset
is always reported to be non-zero, even when fullscreen mode is enabled.
To fix the issue, FLAG_FULLSCREEN is explicitly checked before applying
the insets.
Fixes: QTBUG-99624
Pick-to: 6.3 6.2
Change-Id: I8b25f0b06447cd452c42ef072493e3137e25f38b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This function should be used in QWidget-related test cases instead of
QWidget::show() when you need to move or resize the widget and then
compare its position or geometry with the expected value.
The reason for introducing it is that on Android QWidget::show() is
showing the widget maximized by default, so its position and size
can't be changed.
Task-number: QTBUG-87668
Pick-to: 6.3 6.2
Change-Id: I8ec5c07b73968b98d924a41e5d41ddb4d7be1ced
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Fix bug where QScreen::geometry() returns incorrect
(unscaled) geometry.
We maintain state:
- QHighDpiScaling::m_active, which is set to true
if any screen in QGuiApplication::screens() has a
scale factor > 1, in updateHighDpiScaling()
- QScreen::m_geometry, which is assigned the scaled
screen size in QScreenPrivate::updateHighDpi()
Now the problem is that updateHighDpiScaling() requires
an up-to date screens list, and that updateHighDpi()
requires an up-to date m_active, and that currently
updateHighDpi() is called when constructing the QScreen
only.
This is all a bit unsatisfactory, but for now fix this
in the simplest way by adding a second call to
updateHighDpi() in handleScreenAdded(), after the call
to updateHighDpiScaling().
Pick-to: 6.2 6.3
Fixes-number: QTBUG-101601
Change-Id: I5f442ceb966c77d6746ee885203b67da96612587
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Still not complete. Just grepping for static and thread_local.
Task-number: QTBUG-100486
Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When producing a diagnostics block, include the file and line
information, if we have it, to describe it. This presently only adds
this information for skip, but could in principle do the same for a
B?XPass.
Task-number: QTBUG-96844
Change-Id: I6cc375d98e2369eba262010f9c2dfbcba931a6f1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Our TAP output was delivering messages as comments before the test
line, where TAP clearly expects the details of a test to follow its
test line. Version 13 provides a YAML block to deliver diagnostics and
encourages use of this, so accumulate our messages in a
QTestCharBuffer instead of emitting them one by one.
However, messages produced after a test has produced its test line
belong to that test, but are too late to be included in its
diagnostics block, so should be emitted immediately as before, albeit
now with a type prefix. This at least separates such messages, from
the end of one test, from messages produced early in the next.
In the process, add a type-prefix to each, to make clear what type of
message it was. Since the Yamlish supported by TAP consumers doesn't
support a way to have many messages, use the extensions: top-level
hash tag with a messages: sub-tag to gather our messages as a list.
(This expands at least one expected output file significantly and
substantially rewrites some others.)
Add methods to QTestCharBuffer, and a helper function, to support this.
Task-number: QTBUG-96844
Change-Id: If44a33da5879ed1670ef0980042599afd516f9d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Prevent children from invisible parents from showing up in the a11y
hierarchy. This fixes a problem on iOS which e.g. always adds hyperlink
children of QML Text items, even if the Item itself is invisible.
Pick-to: 6.3 6.2
Change-Id: I88a6f08956b5fe78cb789a08f2078f96d7aa263c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
These are non-default options which the user needs to manually set when
applying a custom QHeaderView.
Task-number: QTBUG-102034
Pick-to: 6.3 6.2 5.15
Change-Id: Ib3396f0a82c358c71a8501fc2d71158f725bc228
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>