This amends fccd419dd6.
If Harfbuzz failed on one of the items in a string and returned
zero glyphs, then we would exit the shaping loop. The mentioned
change fixed a crash related to this when the ignored character
was the only character in the string, but it occurred in a
subitem of a longer string, then we would return and fail to
lay out the rest of the string.
This popped up recently because an update to Harfbuzz has caused
it to return zero glyphs when applying the Apple emoji font to
an isolated variant character (see bug report). When we matched
the symbol to the main font and only the variant character to
the emoji font, we would get in this situation, and end up
exiting the shaping early.
[ChangeLog][QtGui][Text] Fixed a regression which would
sometimes cause text to disappear if the string contained
an unmatched variation selector character.
Pick-to: 6.4
Fixes: QTBUG-108799
Change-Id: I616ab1b2d33c2df731419c5ce06fbc578a625a32
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The last (or only) QGlyphRun would be ignored if it did not contain
any glyphs, but we did not have the same conditions for substrings
represented by different font engines. This was an oversight and
we should be consistent.
Pick-to: 6.4
Task-number: QTBUG-108799
Change-Id: Idfa187f6198247d5cc94804a4e55d5de3ccd739e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When Harfbuzz returns zero glyphs, this will typically be because
the character is ignored. We currently have no way to differentiate
this from actual error cases, so to avoid return the error glyph
for cases which are not really errors, we set the dontPrint flag
for this.
When we add a way to differentiate between error cases and non-error
cases later, we should revert this for the actual errors.
Pick-to: 6.4
Task-number: QTBUG-108799
Change-Id: I2a910d951b71c705fb4dd761fcfe3a942b3afa7c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There is no technical reason why qFatal shouldn't support categorized
logging, nor have a streaming version.
There is perhaps an API issue, that is, a streaming syntax may encourage
users to do "too much":
qFatal() << gatherLogs() << saveDatabase() << ...;
and that sounds like a bad idea in case the application is in an
unrecoverable state that requires immedate terminatation (indeed,
through qFatal). I'd err on the side of providing the extra convenience.
This commits adds overloads of QMessageLogger::fatal to support
categorized logging (note that fatal messages cannot be disabled),
the relative qCFatal macro, as well as overloads for streaming.
[ChangeLog][QtCore][QMessageLogger] QMessageLogger::fatal now supports
categorized logging, for instance using the qCFatal(category) macro.
Moreover, qFatal() and qCFatal() now support streaming of values
to be printed in the fatal message.
Change-Id: Ia57f25f5c85fca97e5fcf27eaa760dbde09cba0e
Fixes: QTBUG-8298
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ucstrncmp() exists because memcmp() can't be used to sort UTF-16 code
units in little-endian platforms. But it can be used in big endian
platforms and when sorting isn't necessary.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c908c46cc9af2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Perform a pair of overlapped loads & stores, so we can perform the
contracting and inserting of question marks in vector code.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c2f5e479b0f6fa
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
For both the [4, 7] and [8,15] length cases, we can perform the same
technique: perform two overlapped loads, zero-extend, then perform two
overlapped stores. The 8-character case could be done in a single
load/store pair, but is not worth the extra conditionals. And it should
have the exact same performance numbers whether we use non-overlapping
4-character operations or completely-overlapping 8-character ones (I
*think* the full overlap is actually better).
The 4-character operation is new in this commit. That reduces the
non-vectorized, unrolled to at most 3 characters.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c257ada774236a
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
If the string length is larger than the number of characters we can
operate on with a single vector loop, we can transform the tail using a
vector too, just overlapping up to 15 characters with the last iteration
o the loop.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c2dcab115e50f7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Just move the test of Checked into the lambda, so we can call it
unconditionally.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c9b84ff4a31bb9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Instead of updating the pointer that we're reading, update the offset
(which is the length). The number of variables we're operating on is the
same (2), but this simplifies the calculation at the end.
BEFORE | AFTER
tzcntl %edx, %edx | tzcntl %edx, %eax
subq %rdi, %rax |
sarq %rax |
shrl %edx | shrq %rax
addq %rdx, %rax | leaq (%rax,%rcx), %rax
ret | ret
We remove one subtraction and one shift. I don't know why it decided to
use LEA instead of ADD... The shift changed from 32- to 64-bit because
we cleaned up the constant 2 (an int) in the file with sizeof(char16_t)
(a size_t), but that has no effect in performance.
Change-Id: I0e5f6bec596a4a78bd3bfffd16c9650a60289f4c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
GCC 7 is not supported in Qt 6, and I really don't expect
anyone would be using it in 2023 with ASan anyway.
Change-Id: I76216ced393445a4ae2dfffd1729a7b82a8776cc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
I'm going to need add a couple more, so move the block up.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c1942ca56a395b
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Because it looks like it works in all our compilers and gets us at least
basic syntax checking. This is important for me because I usually
compile with a very high -march= flag (currently, tigerlake) and would
not see any syntax errors I may introduce.
Whenever possible, this uses a return inside the if constexpr and then
has the fallback code simply eliminated, but still fully compiled.
Almost all changes are basic reindentation, except for a few variables
that must be declared above the block in question, plus some shenanigans
with the variables in qt_to_latin1_internal(): we want to avoid emitting
multiple loads for the same constants, so we force the compiler to reuse
the shrunk version of the 256-bit registers.
The non-AVX2 code will receive a few minor face-lifts in the next few
commits. Those don't intend to actually improve performance by much. The
real work will happen in the AVX2 code later. I dropped the -Os code
because I don't have the spare time to test it and maintain it; if
there's interest, we can simply disable the entire set vector
optimization set.
Change-Id: Ib42b3adc93bf4d43bd55fffd16c1128c1a4d4875
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Add handling for MYSQL_TYPE_JSON by treating it the same as
MYSQL_TYPE_BLOB (which is used by current MariaDB Server for a json
column)
Pick-to: 5.15 6.2 6.4
Fixes: QTBUG-101680
Change-Id: I4d4b0cdad73cd12e0db4df4021fddbd6a649c8ed
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Amends 040aef5b2f which removed the MSVC
condition.
By testing for WIN32 all compilers are taken into consideration.
Change-Id: I8323fa8e866fe04063cfe30875e563524beae6c2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
And implement for macOS. The default modality of the QErrorMessage
on macOS now depends on whether the dialog has a parent or not.
The QErrorMessage must be hidden and re-shown again after each message,
so that the native dialog has a chance to recreate itself.
Change-Id: I474ed35d6271118834fac8e97f6f540a6fb89b8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
On macOS we observe strange CA certificates that are coming from
Security framework and which it cannot later parse from the DER
format we feed it in. Add some more debugging in order to understand,
which certificate gives such result.
Pick-to: 6.4 6.2
Task-number: QTBUG-109135
Change-Id: I75cf4591e33c85db6fe80d37d84ede1456c56231
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
- detect the LoongArch architecture, define Q_PROCESSOR_LOONGARCH and
Q_PROCESSOR_LOONGARCH_{32,64} appropriately
- document the macros as being available starting from 6.5
- add LoongArch ELF support in QElfParser
Change-Id: I438146af49ec3adacacec84c27c9f4abaa542830
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
At https://github.com/mstorsjo/llvm-mingw/issues/307 we can see that
LLVM-MinGW is able to build qtbase with winrt headers and cxx20 feature.
Change-Id: Ib4b5df7481f684ebdb26cbc4246bdf86ff3dd648
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
pcre2-16 is not the target name provided by the upstream Config file. It is PCRE2::16BIT.
2410fbe386/cmake/pcre2-config.cmake.in (L122)
Pick-to: 6.2 6.4
Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add brief descriptions of the pages that are shown in
https://doc.qt.io/qt-6/overviews.html
Pick-to: 6.4
Change-Id: I177e4ba82cd7b8e264122375bf9a595509918fdd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
When we use MSVC to build static libraries, enabling LTCG will
generate very large output, for example, Qt's bundled 3rd party
libraries can be greater than 100MB per file (some of them even >200MB!).
This is not good if we are building a shared version of Qt and
enabling LTCG at the same time. On Windows Qt's bundled 3rd party
dependencies will be built as static libraries and they will make
the final Qt package way too large. From my side, if I only build
a release version, the package size is usually around 500MB but
when LTCG is enabled, it become over 2GB. The exe and dlls' size
don't vary much, but there are many large static libraries.
Fixes: QTBUG-108719
Change-Id: Ic521f500b9c24389524e96a8cdc2e7b3427b51a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Replaced the ullong with Modulebitsets for when the number of modules
exceeds 64
Pick-to: 6.4
Change-Id: I489d35bc53d6aacf7907f75957bd8c6d21fbeb60
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Both clang-cl and clang-mingw supports WinRT facilities now, so
there's no need to limit WinRT usages to MSVC only.
Change-Id: Ib3019db62a038f0ebb5f20210c0a12ee296e7f71
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
QWidgetWindow dispatched only tablet presses to the toplevel widget if
no child was found at the position; other events, such as hover events,
were discarded. The tabletTracking test case even documented that
shortcoming in a comment.
Fix that by falling back to the toplevel widget for any event. As
before, only press events initialize the tablet grabbing target widget.
Remove the now unneeded parent widget from the test case, and move the
test class into the only test function that uses it.
Amends ea615b421b and
8fd6cef372.
Pick-to: 6.4
Fixes: QTBUG-108747
Change-Id: I79050f1e063931e439945f64b50712dcc1ecb18c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Make the code snippets consistent, update the comparison table
and fix some sentences.
Pick-to: 6.4 6.2
Change-Id: Ic8baaa56805392855736164efa03d065330309fa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For QSet, the key_type is const, so can't test assiging to it.
Pick-to: 6.4
Change-Id: I9d363ef3fe52646b937d6a422227b19c48fdaf1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Because they are too convenient to leave out.
Change-Id: I844cfb794ce0f575c2c65075d9051b0b878a434f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure that touching any file that is part of a qrc resource
actually rebuilds the resource and the target that depends on the
resource.
Pick-to: 6.4
Task-number: QTBUG-107687
Task-number: QTBUG-108113
Change-Id: I1153dc13fee44ffe59d2685a8cb33303538b026c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
There seems to be some confusion from back when the example were
mass-ported to the QOpenGL stuff in Qt 5 times.
Pick-to: 6.4 6.2
Fixes: QTBUG-109119
Change-Id: Ic4bcd010df3fcf82e16385ce241b379f0c351788
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Overloading insert is a bit tricky since the size might change after
the conversion so either the tail has to be moved twice or a temporary
buffer is needed. For now, add an ineffective but simple overload as in
the case of the const char *s overload, and do the performance
optimization in a follow-up task (QTBUG-108546).
[ChangeLog][QtCore][QString] Added insert(QUtf8StringView) overload.
Task-number: QTBUG-103302
Change-Id: If01c216ff626da29abb43eb68d4de82824f3bfba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The += operator is already overloaded to handle QStringView and
QLatin1String - add the missing QUtf8StringView overload.
[ChangeLog][QtCore][QString] Added operator+=(QUtf8StringView)
overload.
Task-number: QTBUG-103302
Change-Id: Iec6940bad7866310c826a130b98accebc3c82aa8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Add the missing overload, among other things it is needed to
implement QTBUG-103302.
[ChangeLog][QtCore][QString] Added append(QUtf8StringView)
overload.
Task-number: QTBUG-103302
Change-Id: I576f73c1919e3a1f1a315d0f82c708e835686eb1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
For the case of static builds. Also, remove somewhat funny comment
from the shared tlshelpers.h file.
Fixes: QTBUG-105046
Pick-to: 6.4 6.2
Change-Id: I2fd677a11b64df89c0ad0237e1014f5e80144c24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
To prevent validation errors with VUID-VkMappedMemoryRange-memory-00684
although I cannot actually trigger this on Windows. Based on the spec
however the right thing seems to be to flush before unmap.
Pick-to: 6.4 6.2
Fixes: QTBUG-109123
Change-Id: I34fedea22a6e6e2a14f9b95fea49af05985ec4cb
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The convenience of having a QErrorMessage pop up a dialog when a log
message is emitted should not prevent the existing message handler
(typically the default handler, logging to console e.g.) from getting
a stab at the messages.
Change-Id: I45ba9128f509e85cd60f4e678cf8ec50bb0f93f1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The class was not written to handle categorized logging, which was
added after its inception. Processing categorized logging can quickly
lead to issues, as showing the QErrorMessage may trigger categorized
logging in itself.
Change-Id: Id1d3a75acc1e6d1a69493fa722a733ae2f1f5f63
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The API is supported on macOS, iOS, and Windows. On Android no official
API exists for badging the application icon, and we don't want to take
on dependencies like ShortcutBadger [1].
The macOS and iOS implementations are trivial. The same goes for
the WinRT based implementation on Windows, but this API is only
available for applications that have a so called "package identity",
and does not seem to be stable for Windows 10.
To cover the cases where this API is not available we fall back to
drawing the badge manually, and set it as an overlay icon on the task
bar using ITaskbarList3. The look of this badge has been tweaked to
match the Windows 11/10 styles, and will pick up the user's choice of
dark/light mode and accent color if available.
[1] https://github.com/leolin310148/ShortcutBadger/
[ChangeLog][QtGui] Added QGuiApplication::setBadgeNumber() to inform
the user about e.g. the number of unread e-mail or queued tasks.
The badge will be overlaid on the application's icon in the Dock
on macOS, the home screen icon on iOS, or the task bar on Windows.
Task-number: QTBUG-94009
Change-Id: I6447d55177f9987b0dfcd93caf63c6167f7224c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The test functions tst_QWidget::optimizedResizeMove and
tst_QWidget::optimizedResize_topLevel use a custom widget to record
paint events in a boolean.
Using QTRY_* or qWait() to wait for the boolean to become true stops
event processing upon consumption of the first paint event.
In case of multiple paint events, the next paint event will be recorded
in the next check and may lead to a wrong result.
This leads to flakiness on platforms generating multiple paint events,
openSuSE Leap 15.4 / XCB being one of them.
This patch replaces the boolean with a counter. It adds a
waitForPaintEvents method to the custom class, which processes events,
until the counter stops increasing. It returns true when paint events
have been recorded and false otherwise. It resets the counter after
each call.
It also removes the QSKIP on wayland, as the failure results from the
same reason.
Fixes: QTBUG-109093
Pick-to: 6.4
Change-Id: I59ee8bb4efeaf5417d5749d21e384bee89301ae0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
[ChangeLog][iOS] Added native font dialog support for iOS.
Task-number: QTBUG-109059
Change-Id: If38e990e1c5e9fc1a303fce3e79c09c2d45daaa0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We need to redirect the console output to the parent process
for GUI applications on Windows, otherwise we won't get any
output if we start the application from the console, because
the SUBSYSTEM of GUI applications is not CONSOLE by default.
But we don't want to change the default behavior of Qt, so
we control this feature through an environment variable
"QT_WIN_DEBUG_CONSOLE". It accepts two string values:
(1) "new": the application will try to create a separate
console window and redirect everything (cin/cout/clog/cerr)
to it. If you are running the application in an IDE, you
won't be able to get anything from the IDE's console anymore.
(2) "attach": the application will try to attach to the parent
process's console, if there is one. When we attached to it
successfully, we'll redirect everything to it.
Change-Id: I3ef98f6c0603f64fcc4e8e974411c5ed83c5d36f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>