Windows with the Qt::ExpandedClientAreaHint set extends the client area
to include the native titlebar area, while keeping the functionality of
systemmenu, resizing and aero snap. Also this flag indicates, that Qt
is drawing a title bar as an overlay over the extended client area.
Additionally setting Qt::NoTitleBarBackgroundHint will make the
titlebar background transparent, so that the widgets below are visible
and interactible.
Task-number: QTBUG-127634
Change-Id: Ib267d199f42a4ee90e7a51fe60a41295b82031d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Emscripten compiler toolchain does not guarantee ABI stability.
Hence, it does not make sense to build Qt with one version of compiler,
and then build the Qt application with other one.
Treat it as an error if there is mismatch between Emscripten version
used for building Qt and version used for building application.
Change-Id: Ia720da25ecbd048a009d0bf1927ba1bc1fa85fda
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Ivan Tkachenko <me@ratijas.tk>
This function should behave similarly to
std::lexicographical_compare_three_way, but be available in C++17.
It is required at least to properly implement the
compareThreeWay() helper function for Qt container types.
The function requires that the contained types of the compared
ranges provide a compareThreeWay() helper function.
Similarly to std implementation, this patch also adds an overload
that takes a custom comparator object.
For now the functions are added in a private namespace, because
they are only required to implement relational operators on Qt
containers. We might want to expose them as public API later, if
needed.
Task-number: QTBUG-127095
Task-number: QTBUG-120305
Change-Id: I5b29129905b2e801ae7e470c96a7ef71e7b210d6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Move one AND operation out of the loop, as it is only needed in the end.
Change-Id: I48adcd18c900654830a84813f26c95eee579b49d
Pick-to: 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a GroupSizes struct and a corresponding query type to
QSystemLocale that would return a struct of form
struct { int first, higher, least; } by consulting suitable
platform-specific APIs.
Fixes: QTBUG-109955
Change-Id: I2deee814f161ac914f810080866eea1cc432acbe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
There is a very small overhead to this, so we provide a
way to manually disable it if you know you are displaying
text without any emoji sequences.
Task-number: QTBUG-111801
Change-Id: I231b3dfab368ef2cf3b17dd57cd4e3160ed38192
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Add a family of qdoc macros to document the various qHash() overloads
we have.
This patch does not change the \relates of the qHash() functions, they
remain as inconsistent as they have been. Created QTBUG-129815 to
clean things up. Since this author expects the \relates to change in
the future, there are different \qhash commands, and all except
\qhashbuiltin take the class name as an argument, for use in a
centrally-choreographed fix for QTBUG-129815.
As drive-by's, fix:
- missing documentation about Key having to support qHash() in the
associative Qt containers
- drop noexcept and default arguments from \fn lines that needed to
have their argument names changed
- move the QStringView overload from qhash.cpp to qstringview.cpp
(as it \relates to the former)
Fixes: QTBUG-129574
Pick-to: 6.8 6.5
Change-Id: I8e8c2edc27422cbe5823f56baf3a24d7f7050836
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Some fonts name their glyphs in the "post" or "cff" tables, and both
CoreText and FreeType provide high-level APIs to access those values.
Also, harfbuzz has an API for OpenType fonts, which we can use on
Windows (where we would have to load the font into FreeType, as
neither GDI nor DirectWrite provide APIs to access this data), and as
default implementation that we can fall back to if the platform APIs
don't find anything.
We need to set the harfbuzz font up with the OpenType callbacks
explicitly, so cannot just use what we get from harfbuzzFont.
With this low-level API we can now make name-based lookups of glyphs,
and eventually render those in a QIconEngine implementation.
Task-number: QTBUG-102346
Change-Id: I68cc19814fc45d63a88e063b719b46f6aa6100bc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
For some known fonts, confirm that we get the right glyph count and
glyph index for specific unicode code points.
Create QGuiApplication with a specific font engine, and test the fonts
with all engines. On Windows, that's DirectWrite, GDI, and Freetype;
on macOS CoreText and Freetype; and otherwise only Freetype.
Not all fonts will be available with all engines, so test in each test
function whether the font is a good enough match (family is enough, no
need to do a deep test).
Add a benchmark as well, using the same setup plumbing, but with
different test functions.
Change-Id: I2ed279965fc3f1dc3f283d0fe7b018fc3035c67d
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Emojis would sometimes get an outline in a seemingly
random color. This was because the color run is not
initialized to the first layer. MoveNext() should be
called on the initially to move it to the first layer, so
the first layer we rendered would end up being a
monochrome version of the glyph with a random palette index.
[ChangeLog][Windows] Fixed an issue where emojis would sometimes
get an outline.
Pick-to: 6.5 6.8
Fixes: QTBUG-131587
Change-Id: I42c2828d66c6149cdb62c2b6271dfd49ca002db0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This comes at a price and it does not really make sense for
emojis.
Pick-to: 6.8
Change-Id: I57148bff48a48bb81a03203626df25646c9acb6a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Simplying the body of the function to rely less on the exception
handling too. The implementations for Unix and Windows are now literally
identical, but duplicated because they call different static functions
Change-Id: Ia14910a1c778ff5e606afffdabb8035e4603edda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
With a direct access to the threadData's variable.
Amends commit 10c529b08de7cd55b4c3e3654464119246498273 ("Add a way for
auxiliary threads to handle events without CoreApp", Qt 5.6), which
introduced QDaemonThread, for QtDBus use. We don't need to get the
QThreadData from TLS, because we are processing events for an object
associated with that particular thread.
This removes the only use of QThreadData::current(false) in all of Qt.
Refactoring in the next commit(s).
Change-Id: Ica2bab556bd431519a1bfffd859911ea7daf062f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
When shading rate maps are used we shouldn't use the target's pixel
size to set the viewport, as the target's pixel size is likely to
different then the "output" size. Instead we get the viewport size from
Metal's screenSize function. The rendered content should then be
correctly scaled to the output size by the rate map.
Pick-to: 6.8
Task-number: QTBUG-129733
Change-Id: I1c53ded0a700eb860cd3bf08fc12a0404c2e6ffa
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
548351 changed QWindowsIntegrationPlugin and
QWindowsDirect2DIntegrationPlugin so that their CMake targets link
directly to UIAutomationCore.lib/.a instead of loading
UIAutomationCore.dll dynamically at runtime; however, it did this by
first locating the library via `find_library()` and then using the
absolute path to the DLL import library found. If Qt was built
statically, this would cause that absolute path to be added to the
INTERFACE_LINK_LIBRARIES of their export targets, breaking the build
if moved to another machine where the location of that lib differed.
Instead, simply list uiautomationcore as a library link by name only,
which shifts responsibility of locating the .lib/.a when consumers
build to the linker, as is done for all other Windows system libraries.
This ensures that the library is found correctly regardless of which
system Qt was built on.
Currently this only applies to MSVC due to limitations with
uiautomationcore.a when using MINGW, where the lib is still dynamically
loaded.
Pick-to: 6.8 6.8.1
Change-Id: I20011a51935af4093de83fff75efe2141da0655b
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
87d8ee755bfdef8e72a122789c2e3ed382881a12 changed the logging behavior
on Android to use the category as tag. But it was missed that
`formatLogMessage` only fills the fields given in the messagePattern.
Our default messagePattern includes the category but on Android it
is never filled since this change.
So we change the default messagePattern on Android to omit the category
and only use the category as tag when the category is not given in the
messagePattern.
Pick-to: 6.8 6.5
Task-number: QTBUG-94708
Change-Id: I80f65d0f7f8c0ca9c2fff2dcd63d4599848b6e2b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In the process, introduce inline helpers to avoid repetition of the
ternary that selects the options based on language C or otherwise.
Note that, if the system locale changes under our feet, the default
locale's number options may be left out of sync with it. It's
possible, though kludgy, to work round that; but doing so creates the
inverse problem where the caller has created a copy of the system
locale, set its number options to something other than the default and
set that as default locale. Auto-syncing the default with changes to
the system would then be apt to stomp the carefully set number
options. Given that the system locale (currently, at least) only
changes on program start-up and exit, take the path less kludged.
Change-Id: I23ab38b6e8a6936f85c88ca66245a89612e3c3fc
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QAction object returned by QDockWidget::toggleViewAction() is owned by
the QDockWidget. QAction object is deleted when the QDockWidget is
destroyed.
Fixes: QTBUG-70171
Pick-to: 6.8 6.5
Change-Id: I279366209228c88241e3bf70c17c117a2bf91f40
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We had input handling enabled as a precondition for setting focus.
This is wrong, we need to have the focus for toggle buttons
and other non-input things as well.
(Also toggle buttons act on spacebar).
Also selects a new active window if the window
that is active (i.e a dialog) is deleted.
Also shift + tab did not always work, fixed
to emit Key_Backtab
Fixes: QTBUG-130371
Pick-to: 6.8
Change-Id: I3b36a3e200ba9d4b0791865e75235ddfb72bcaa5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Since the USA uses cgs instead of MKSA for its metric system, we
should be clear that what we mean is SI.
Change-Id: Id35cf8cf60eec58f1f68d42fe02e4bb182884db1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Although the other parts of the locale-specific data for zone name
L10n were written using safeInTag() I'd foolishly used plain inTag()
for the exemplar city - which, of course, can also contain crazy stuff
and, it turns out, one of them (albeit this may be a CLDR "whoopsie")
does in fact end in a < (in xnr.xml in v46). So use safeInTag()
there as well and be faithful to CLDR (even if this does turn out to
be an error).
Task-number: QTBUG-130877
Change-Id: Idca22ce689cdd2409c50078498a2badfeecd4de2
Reviewed-by: Mate Barany <mate.barany@qt.io>
To work around path length limiations, Qt Creator optionally uses junction
points to shorten the build directories. This however breaks examples
that require sources outside their 'root' directory.
QUIP 13 states that examples should be self-contained. Anyhow, fixing this
is a larger effort, so for now just disable junction points in Qt Creator
for these examples.
Task-number: QTBUG-128914
Pick-to: 6.8
Change-Id: Ifb5e6944d936c82b1dba9fe3b81bebc1c8320168
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
QSaveFile can only be used with WriteOnly. Calling any read
method will print a runtime warning:
QIODevice::read (QSaveFile): WriteOnly device
Pick-to: 6.8
Change-Id: Id721e4e1cba4b81c5504e3eff66420d363436010
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Force the mentioned QIODevice flags to be links.
Use fully qualified name for the first flag mentioned,
but use the short form for the following ones for
better readability.
Mark true and false to be written in code style.
Task-number: QTBUG-131484
Pick-to: 6.8
Change-Id: I988ba66341b811c815953e5fd6d067204bdaae6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These are set later in openSUSE.
Fixes: QTBUG-131368
Change-Id: Ifd27b0b6f94c7d97cbe13acd9741624431dd9906
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The stream insertion operator for QDebug is not overloaded
to handle std::multiset
Overload the stream insertion operator for QDebug
to handle std::multiset
[ChangeLog][QtCore][QDebug] Added support for std::multiset.
Fixes: QTBUG-131428
Change-Id: I7e3b721afe88d68c99c44c0d7cc9ee7711c169c8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The flag requests that the window's title bar is drawn without a
background color. This flag is useful in combination with the
Qt::ExpandedClientAreaHint flag, to give the perception that the
window's client area seamlessly blends with the titlebar area
and controls.
Task-number: QTBUG-127634
Change-Id: I1194630d737ae03324f79d2babd7ea3d8fca3d5b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Briefly mention the new tzdb-based backend for QTimeZone.
Reference this on the AUTODETECT OFF line for the feature that controls it.
Task-number: QTBUG-128837
Change-Id: Ia13fbd08a9d62c3cd2f32bf6e5b77c69eb01e055
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Briefly sketch the new features in std::chrono and how Qt now provides
access to them.
Pick-to: 6.8
Task-number: QTBUG-128837
Change-Id: I99a94ac9d0ed292ec9e3b0057ba6a9e2092200ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
A template for C++20 overview.
Task-number: QTBUG-128837
Pick-to: 6.8
Change-Id: I7a442c3c58613587c2c75a77082f66512e97adb4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The hint requests that the window's client area is expanded to fill
parts of the window that might be (partially) covered by, or
conflicting with, other (system) UI elements, such as the window's
title bar, resize controls, or a status bar.
The safe area margins of the window will reflect any areas that
may have conflicting UI elements.
If the client area is expanded into the area previously covered
by the frame margins, the frame margins are reduced accordingly,
as the frame margins represent the non-client-area parts of the
window.
This new flag replaces, and overlaps in value, with the existing
Qt::MaximizeUsingFullscreenGeometryHint, as the latter was added
to cover this exact use-case for mobile platforms. Now that we
have the use-case on desktop platforms as well we want to use a
more generic flag, so the old flag has been deprecated.
Semantically, on iOS and Android, without the flags set, the
window can be seen as being maximized to take up the entire
screen, but with a frameMargin() that reflects the system
status bar and resize controls. That's not technically how
we implement things right now, but this is an implementation
detail that will be changed in a follow-up.
On macOS the flag maps to NSWindowStyleMaskFullSizeContentView,
and on Windows we have an implementation cooking that uses the
DwmExtendFrameIntoClientArea function.
Task-number: QTBUG-127634
Change-Id: I9b6863b1550ccc056c16bce235d87b26a7d239b9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
The margins are exposed as a simple QMargins, as this is covers the
primary use-cases sufficiently at this point.
A Q_PROPERTY is not added, as this would conflict with the explicit
Qt Quick API that will also be added.
Task-number: QTBUG-125374
Change-Id: I504c3000473de0b09272aa5a3e58ebf9a41aa942
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
We've encountered that under some circumstances DecryptMessage may
return undocumented SEC_E_DECRYPT_FAILURE status. It's probably a bug
in Schannel on Win 11, as there is no such problem on Win 10.
In such cases, since we didn't handle this specifically, we can end
up in an infinite loop in TlsCryptographSchannel::transmit() when
`intermediateBuffer` is not empty and `bytesRead` is 0.
To fix this, we just add SEC_E_DECRYPT_FAILURE status handling and
will disconnect from the host and emit the error respectively.
Pick-to: 6.8
Change-Id: I340669a967be420c74cb01296629f94c4720c958
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Verify position of the widget w, before checking the result of the
dumpObjectTree(). Remove the flakiness of this auto-test.
Add a QPoint pos of the original position of the widget and use a
QCompare to verify that it is still the correct one before checking the
output of dumpObjectTree.
Change-Id: I71938676e614fe0667c11242a08db47802fdba3b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Store the JNIEnv once and reuse it, using the static
QJniEnvironment::getJniEnv() helper where we can. We can't always, as we
rely on the QJniEnvironment destructor cleaning up pending exceptions.
In code where we anyway use getCleanJniObject, we do that already and
can avoid the temporary QJniEnvironment.
Change-Id: Ibd39e2e2d882995a98691b9c2565094af6ad697a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
If we know that the QJniObject references a jstring, then we can fast-
track the conversion to a QString. Any QJniObject that was created via
fromString references a jstring; and any object with the class name
"java/lang/String", or where the jclass is identical to the one for
jstring, holds a jstring. Implement a helper that makes fast checks (in
the worst case, a string comparison).
If we know that we have a jstring, then we don't have to call the
toString() Java method on the object to serialize it to a jstring,
we can directly operate on the referenced jobject as a jstring.
Avoid duplicating the "java/lang/String" string and instead use the
compile-time class name we get for jstring from QtJniTypes.
Change-Id: I46895b6c4fab67a9ff4f6ccfadd9daf5b4911fab
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
There were some syntax or links that javadoc doesn't
recognize and throws an error about, this fixes all of
them.
Pick-to: 6.8
Change-Id: I301ec22bc14c2e41e3253222efbb38c3c2c9eeba
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Enable all checks except 'missing' because we don't
want to get errors of missing docs for every variable
or method.
See docs of -Xdoclint at https://docs.oracle.com/en/java/javase/17/docs/specs/man/javac.html#extra-options
Change-Id: I7d7e775a1ef34dc1efacbc11cf85db99c81a4fe2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Don't look it up through JNIEnv::FindString, use our internal cache. For
that (and as we don't want to instantiate a temporary QJniEnvironment)
we need to use the QtAndroidPrivate internal symbol, which then needs to
be forward declared.
Change-Id: I4a69bf973fbdc1df6939f5ce94878588a4fcbd3d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
It takes some time to display the keyboard. For this reason, in case the
keyboard was not displayed yet - we could wrongly assume that the
keyboard is hiding. To avoid this situation, there is a new check.
In case the keyboard has just been opened and it is not displayed yet,
the execution of HideKeyboardRunnable is postponed to give time for the
keyboard to be displayed.
Fixes: QTBUG-130000
Pick-to: 6.8
Change-Id: Iee1310c777ebbb807990bf3cec39e6d07481dfad
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Move implementation for checking if keyboard is displayed on the screen
from QtInputConnection to QtInputDelegate.
The QtInputDelegate class is responsible for showing/hiding the keyboard
and handling its visibility. Moving mentioned implementation there seems
reasonable. Also, this implementation will be used internally by
QtInputDelegate in the future.
Task-number: QTBUG-130000
Pick-to: 6.8
Change-Id: I47cf8e8fb2ee9bea535b9e009dd4b43b28f19b80
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
For Android above API 30 we can directly just check if the keyboard is
visible. We do not need to calculate it size. This is useful as
floating keyboard has wrong size.
Task-number: QTBUG-130000
Pick-to: 6.8
Change-Id: Ia91d8b9ddefc97f8d65a657aa7e75bb146feb00e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
This part of code seems to be really old.
Unfortunately in newer device the Navigation Bar is bigger than 100.
So when Navigation Bar is visible - we assumed that keyboard is visible.
That is why this part of code is "dead" for devices with higer resolution.
To make this solution more flexible, we need to rely on the screen size.
Task-number: QTBUG-130000
Pick-to: 6.8
Change-Id: I387fe58b4c6d22de83394cc8f51c75e7a55e72a1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
This will produce an error when configuring Qt with Emscripten
version less than what is recommended version.
It will produce only a warning when configuring using
Emscripten version greater than recommended.
Change-Id: I62016394e8e52657a5e1d78c4288866e83af2d28
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
A lot of code passes strings through JNI calls, and we always ended up
constructing a temporary QJniObject just to convert it to a QString, or
to get the jstring out of it. This is expensive as QJniObject allocates
a private object and maintains a reference count.
For code paths that have a jstring, or only want a jstring, and already
have a JNIEnv pointer, we can shortcut this and use JNI APIs directly
rather than going through the QJniObject detour. This was already done
when accessing elements of a QJniArray<QString>.
Add internal helper methods to the QtJniTypes::Details namespace that
convert between jstring and QString directly. Use that where we can,
including the QJniObject::to/fromString implementations.
Since the new helper for converting from a QString already returns a
local reference, split the LocalFrame::newLocalRef into a helper that
pushes the local frame, and use that to explicitly do so in the case
of QString conversion. This also removes the last use of the
QJniObject overload of LocalFrame::newLocalRef, so remove that.
Change-Id: Ib3a261efd0dcca86a1a99c2a054d50e932c3fe71
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>