If extract_android_style meta data is set to none currently the app
still tries to extract full stlye and crashes. If this option is set
no style data should be extracted after this patch.
Pick-to: 6.7
Fixes: QTBUG-121667
Change-Id: I764e1eb6a582073196f991ca930d245d17a1f7e5
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
It is possible for a QRhiD3D12 instance to be created and destroyed
before the cmdAllocators list is initialized. This change simply
guards the cmdAllocators so that Release is only called if the
element is not nullptr.
For an example of how this can happen see QRhi::create. The
QRhiD3D12 is created but may be released immediately if
QRhiD3D12::create fails. One way this may happen is if the
ID3D12Device is removed but in practice many different errors may
cause create to fail.
Pick-to: 6.7 6.6
Change-Id: I395d247a952f9584122be083ac5ca6a3caddf300
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
isTimeZoneIdAvailable() is significantly slower than just trying to
initialize the timezone and see if that worked.
Even in the x86 emulator the difference for this is from 2+ms to no
longer measurable here, on less powerful ARM devices it's even more
extreme. This matters in particular for code creating many QTimeZone
instances, e.g. for calendaring.
Pick-to: 6.7 6.6 6.5
Change-Id: I5f175137b8b71816347a8debb492214427a51104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Some unix-like concepts are supported by VxWorks VSB layer - UTILS_UNIX.
One of such methods is getgrgid(). Include it in
`qfilesystemengine_unix.cpp`, so that we don't need to exclude VxWorks from code that uses it anymore.
Task-number: QTBUG-115777
Change-Id: I72b301647bfdb208cb6859bb0f9994e3537fc345
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Third-Party Code] Updated Valgrind header used by QtTest.
The change only affects portability of s390 inline assembler.
Task-number: QTBUG-121346
Pick-to: 6.7 6.6 6.5
Change-Id: I7eca3b13d4f5475693c548b85b837d5d4b4b090f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Neither win_outputDebugString_helper() nor OutputDebugString() add a
newline at the end of the message, so one needs to be added before being
passed to the output handler.
A newline was previously present but removed when deduplicating calls to
qFormatLogMessage().
Fixes: QTBUG-121947
Pick-to: 6.7
Change-Id: I9f1c1d8726e4234f24999f47c52340140d5a4614
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The GDI font backend is missing support for certain modern features,
and has a lot of work arounds for missing APIs. DirectWrite is the
modern way to handle fonts on Windows, so we make this the default
now, but keep the old backend as a fail safe.
Fixes: QTBUG-119420
Change-Id: I0ea5cdfdcd759ccc894efb01b2410826c44aa1ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
The Android TextureView class wants to know whether the view is
opaque, while the condition has been evaluating whether it should be
transparent. Invert the condition to let Android know correctly whether
the TextureView should have transparency.
Pick-to: 6.7
Change-Id: Ic636f78dd3c691e85456c579e4559b8bc7a077a2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
CarbonCore defines `DEBUG`, which can nameclash with the `DEBUG` define
in the json parser when using unity builds
Change-Id: Ic9f666a1da98aaebe30836abf877228f2f83004c
Pick-to: 6.7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When linking Qt statically, QtCore and QtGui are not separated into
different DSOs.
when both statically linked versions of QtCore and QtGui are linked into
the same binary with LTO, gcc emits:
```
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:105:
warning: type ‘Tag’ violates the C++ One Definition Rule [-Wodr]
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: an enum with different value name is defined in another
translation unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/gui/painting/qicc.cpp:106: note:
name ‘acsp’ differs from name ‘Tag_End’ defined in another translation
unit
/usr/src/debug/qtbase/6.3.0-r0/git/src/corelib/kernel/qtranslator.cpp:78:
note: mismatching definition
```
we therefore define the `struct Tag` in an anonymous namespace or the
QIcc namespace
Change-Id: Ib4edeede35c51322ab1959d70fb87359b196e59b
Pick-to: 6.5 6.6 6.7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The docs say "This example illustrates function calling with 0, 1 and 2
parameters" because it was copied from the synchronous call()
documentation. But the snippet didn't do that, because back in Qt 4 when
this was created, it was too difficult to exemplify that for
asynchronous use. It now no longer is, with lambdas.
Drive-by update the docs for both functions to refer to each other.
Fixes: QTBUG-121873
Pick-to: 6.6 6.7
Change-Id: I664b9f014ffc48cbb49bfffd17b089b7f77c1cde
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
readdir_r() has been deprecated since glibc-2.24; all usage of
QT_READDIR_R in qtbase has been ported to readdir() since 2016
4b6784b49c6dcf0add9ec0cbb4ad97cd191c2aa3 (which explains in details the
reasons behind the deprecation).
What's left is the QT_READDIR_R, user code that still uses it, can
switch to readdir_r() (which is not advisable).
[ChangeLog][QtCore] Removed QT_READDIR_R macro; readdir_r() has been
deprecated since glibc-2.24 and it's recommended to use readdir()
instead. For more details see:
https://man7.org/linux/man-pages/man3/readdir_r.3.html
Change-Id: Icca2dca7e696533dcb983a82ba97a13baadcf015
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Also use C locale for this, rather than QLocale().
This makes the ICU backend's override redundant.
Change-Id: I3d668dd3a784b48d0a5fff7d11cc25a6e1423c84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The two differed only in one selecting UNIX, the other WIN32; not sure
we have any platforms for which neither of those conditions is true
but, in any case, if such a platform has ICU and enables feature
timezone, I guess we should be using ICU for its timezone backend.
Change-Id: I3a7812c143f18732bf4dae7e8de8e42a662f0f39
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of clearing a list repeatedly to then repopulate it by
appending entries.
Change-Id: I82594d69c1cb145defff43d84f92f8410d8997aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... and use it in QCborContainerPrivate::replaceAt_complex() to avoid
unconstrained memory growth in certain scenarios.
Remove the `reserved` parameter, because it was referring to the
elements array, not to the byte data, so it cannot really be used
in the implementation.
Fixes: QTBUG-109073
Pick-to: 6.7
Change-Id: I2e8fe7e4a4bf7a0ce06c87ca657f2bc01bae0341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
During shutdown we may get traitCollectionDidChange for our QUIWindow,
as it may outlive the QGuiApplication and the QWindows due to hanging
around in an auto-release pool.
Pick-to: 6.7 6.6 6.5
Change-Id: Ifc6471b933fb1b4d1e83e9b734aac31044dce03e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
During shutdown the UIView might outlive its QIOSWindow platform
window. If we receive displayLayer calls, we need to bail out,
to avoid crashing when trying to send the expose event.
Pick-to: 6.7 6.6 6.5
Change-Id: I2f36a4dd825e91b348bc57a06e6aa6b1a12fd249
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Add Q_PROPERTY to follow the current Qt style and simplify the
documentation.
Task-number: QTBUG-120566
Change-Id: I23103a921cd391f24ce0ffd915a4ae2f98686d21
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Unlike on macOS, our UIViews are children of a QIOSDesktopManagerView
that we use to do window management, so we need to remove the view
from its superview, even if represents a top level QWindow.
The only exception is top level foreign windows, which are used to
represent a native UIView for the purpose of containing a Qt view
hierarchy within. As we don't know anything about the foreign view's
superview hiearchy we shouldn't touch it.
Pick-to: 6.7 6.6
Fixes: QTBUG-120369
Change-Id: I6a43bb0a4e72d0d1525a7cc33d572ea7477215b3
Reviewed-by: Doris Verria <doris.verria@qt.io>
Don't rely on timer precision and use int counter instead.
Amends 1fe88bf4cd919d4b5cadb4be2cf0193525c54673
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I057b4dd51014784ec9b244301b43583f3de6ddd1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
As a baseline for subsequent commits.
Change-Id: Ifac026848e92817b08a75ceafee6d06e0a8f399d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Commit c0791ac76ec7cfdc3945efa67a6f72ee3623413c didn't explain why it
was #ifdef'ed out. It's just an alias for double. Maybe compilers at the
time used to complain if you used it, but I can't make Apple's clang
produce a warning now.
Pick-to: 6.7
Change-Id: I664b9f014ffc48cbb49bfffd17b02293403e9571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Use the same technique the constructor already uses: Q_ASSERT followed
by selecting the no-op branch in case assertions are compiled out.
Pick-to: 6.7
Change-Id: I24cbcfd686f67e060134baecfb21044948b6eb98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
When the main font is a fixed-width font, QTextMarkdownWriter generates
backticks around plain text; so QEXPECT_FAIL if we detect that.
tst_QTextMarkdownWriter::frontMatter() Compared values are not the same
Actual (output) : "---\nfoo\n---\n`bar`\n\n"
Expected ("---\nfoo\n---\nbar\n\n")
Also, include all test data as resources for platforms that need it
(such as Android).
Task-number: QTBUG-103484
Change-Id: If18ca493c402b128cdc0fb1910b2e822512af6e8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
It's increasingly common for YAML to be used as metadata in front of
markdown documents. md4c does not handle this, so we need to remove
it ahead of time, lest md4c misinterpret it as heading text or so.
The --- fences are expected to be consistent regardless of the format of
what's between them, and the yaml (or whatever) parser does not need to
see them. So we remove them while reading, and QTextMarkdownWriter
writes them around the front matter if there is any.
If your application needs to parse this "front matter", just call
qtd->metaInformation(QTextDocument::FrontMatter).toUtf8() and feed that
to some parser that you've linked in, such as yaml-cpp.
Since YAML is used with GitHub Docs, we consider this feature to be part
of the GitHub dialect:
https://docs.github.com/en/contributing/writing-for-github-docs/using-yaml-frontmatter
[ChangeLog][QtGui][Text] Markdown "front matter" (usually YAML) is now
extracted during parsing (GitHub dialect) and can be retrieved from
QTextDocument::metaInformation(FrontMatter). QTextMarkdownWriter also
writes front matter (if any) to the output.
Fixes: QTBUG-120722
Change-Id: I220ddcd2b94c99453853643516ca7a36bb2bcd6f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Declare an IfUntypedPropertyData alias and use that consistently.
Amends 311f8896322bcd39d33369c8311a8c89ccdad449.
Pick-to: 6.7
Change-Id: If36ef8e2f9ce25e0ffe7b4b448c31ea5866acfc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QObjects are usually passed by pointer, so we leave the override
taking a pointer.
This amends bbeff2a3350dd3396400865525d509b784c2d93e, and reverts
the previous revert in b148a362c36a9b34b0c21c60530353d6bf6b92cb.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.
Task-number: QTBUG-119952
Pick-to: 6.7
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When printing in PDF, QPrintEngine used to convert every color to
RGB. Stop doing that -- if the user paints with a CMYK color, emit
it in CMYK.
Change-Id: I2714d243103501e4602dec9f225f5379ed8f7dec
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
QPdfWriter has "always" supported a grayscale mode in order to
support grayscale printing from QPrinter. When in this mode,
colors were still emitted as RGB, just with equal quantities for
each channel.
But the PDF format itself supports grayscale colors, so
avoid the conversions and emit colors directly in that.
Change-Id: Id5ec3bc42b710909f32986c59d8fbd6f748e02f9
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
If a user specifies a color in CMYK, save it in CMYK by default
(instead of converting it to RGB).
[ChangeLog][QtGui][QPdfWriter] QPdfWriter by default will now
save CMYK colors in CMYK, instead of converting them to RGB.
You can use the setColorModel() function to restore the previous
behavior.
Change-Id: I2a699f99d44c106d59bf0e32c11f9cf9999d16e8
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
QLineEdit activates the blinking cursor timer when it's shown,
but never deactivates it, resulting in constant wakeups even for
hidden line edits.
Note that this is a workaround. Qt is supposed to send a focus out
event to line edits that get hidden. In some corner cases, it
doesn't, and only a hide event is sent.
Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b
Task-number: QTBUG-52021
Pick-to: 6.7 6.6 6.5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Neither implementation (Unix and Windows) uses the QStringList
or the QDir::Filters args.
Change-Id: I6a552e41eb37e4b76246e35d43ac4d34a4ae9d12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
So that errno can be used to distinguish between "reached end of dir
stream" state and an error.
Set errno to something more useful (EILSEQ) when we fail to decode an
entry's name, requested by Thiago in code review.
Change-Id: I8091144d25e5e5aa875cf40eaf6ee13c9e409ee7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Less manual resource clean-ups.
Drive-by changes, initialize members in-class. Also remove an unused
include.
Change-Id: I03cd12e1c6c12338d09daba916cd34cb36f04260
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add right side indent to the title if groupbox alignment is set to
Qt::AlignRight | Qt::AlignVCenter.
Fixes: QTBUG-121049
Pick-to: 6.7 6.6
Change-Id: I9aac295c824ad774410efd679f59075e4251b611
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The DirectWrite font backend is an optional backend which
is planned to take over as the default on Windows. In order
to do this, though, a few gaps need to be filled in order
for it to pass all autotests.
The following things are covered by this:
1. Bitmap fonts are unsupported in DirectWrite. We enumerate
these using GDI and fall back to the GDI font engine when
loading them. As part of this, we introduce a new handle
type for fonts on Windows which can represent both
the DirectWrite and GDI engines.
2. "Legacy font names" where sub-family is embedded in the
family name is now enumerated together with the
typographic font name.
3. The DirectWrite font engine was not loading kerning pairs
from the font, like the other engines (omission which was
detected by the test)
4. Turning off antialiasing does not work with DirectWrite, so
we fall back to GDI for this.
5. Loading supported writing systems from application fonts
was not supported.
Task-number: QTBUG-119420
Change-Id: Icf6c351afb0d7487b2f4634199088d701a324aae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since 3f4d6279c4b0d04422efff478a5e2fb36259dbaa (khansen 2005) QMovie
calls QImageReader::read() until QImageReader::canRead() returns false.
That's apparently to support animated image formats in which the
frame count is not known at the beginnning (i.e. not specified in
the image format's metadata). But non-animated multi-frame formats
are expected to return valid values from QImageReader::imageCount();
and those also tend to keep returning true from canRead() regardless
of how many frames have been read (the interpretation of canRead()
is "does the file have the expected format?" rather than "are we
about to read too many frames?"). So, when a multi-frame image is abused
as an animation, QMovie was able to keep reading the same frame
repeatedly and pretend that the frame sequence goes on forever.
It also tended to read frames as fast as they could be decoded,
because nextImageDelay() is not usually provided, because multi-frame
image formats don't specify a frame rate in their metadata.
So now we change QMovie's behavior for image formats where
QImageIOHandler::supportsOption(Animation) returns false:
trust imageCount(), but not do not trust nextImageDelay().
But to actually jump to the next frame in this case, we also need to
call QImageReader::jumpToNextImage().
Altogether, this makes QMovie support "flipbook" animation for
multi-frame image formats, such as tiff and pdf.
Added "read frame x of c" logging in qt.gui.imageio category.
For testing, we use a pre-existing multi-frame Obj_N2_Internal_Mem.ico
file, to avoid depending on the tiff plugin.
[ChangeLog][QtGui][QMovie] QMovie now handles non-animated multi-frame
image formats (such as tiff): QImageIOHandler::imageCount() is observed,
and the default frame rate is 1 FPS.
Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-117429
Change-Id: I6dad2a684e12c78a68288402e223a59427bf649e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>