In turn, deprecate the QJsonDocument methods that deal with JSON binary
data. You should use CBOR for data serialization these days.
[ChangeLog][Deprecation Notice] The binary JSON representation is
deprecated. The CBOR format should be used instead.
Fixes: QTBUG-47629
Change-Id: Ic8b92ea36de87815b12307a9d8b1095f07166db8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It tells us how many bytes we will need before the call succeeds. It's
not accurate but will reduce the amount of calls to their slow functions
Change-Id: I82393d5acd68b84c6e6f3377ba40bb1d5c51ca8a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This moves some repeated code into functions (namely readToBuffer and
retainExtraData) while also changing how the intermediateBuffer is
handled to avoid deallocating and reallocating repeatedly.
Change-Id: I49e6cee641f961565051a67123c56b1c8f3c0259
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Fix a typo introduced in be56db2c49 to
avoid a crash when a pixmap is given for selected on but not for
selected off.
Fixes: QTBUG-79125
Change-Id: I84072b6b4e8a4d21684be21f5bff1deeaddbba6d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Inspired by a recent Qt Quick fix. Make sure we make it
clear that QRhi-based rendering code should base output
size calculations (e.g. for setViewport() and similar)
on the pixel size reported from QRhiSwapChain, instead
of going to the QWindow.
Change-Id: I2fc22972162ccc6307ac07ceb7766c746d5f562a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Clarify that the qproperty properties will only be
evaluated once.
Fixes: QTBUG-2982
Change-Id: Ie294ced118f740c7378c62c0b5a4924d5628e118
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
The default font on Windows ("Times" is not found) does not have
a ligature for "fi", so the test would not actually be testing
what it was supposed to on this platform, and would pass even
when the code was buggy.
To enable the test on Windows, we select a standard font which
has the ligature (Calibri).
Change-Id: Ic117cd8e549aa729a0cd68006d7c180c6c89c053
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The original commit message says this is to ensure compatibility
with the old Harfbuzz, but since OpenType features such as
kerning are often matched based on the writing system of the glyphs,
it will break kerning (and other OpenType features) for text in these
languages in some fonts. Even font that were successfully kerned by
the old Harfbuzz are broken.
To avoid regressing on finding cursor positions inside ligatures,
we need to amend 9f837af945. This
would enable cursor positions inside ligatures for languages
where they are only used for cosmetic purposes, and this was
generalized to Common and Greek at the time. This now has to be
expanded to include all the writing systems that were previously
covered by "Common".
[ChangeLog][Text] Fixed kerning error with certain fonts.
Fixes: QTBUG-77908
Change-Id: Id261fef05f86841b1533b7d87207c3d17e01e96e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
'macOS' appears in the documentation frequently, and because it
resembles a variable/property name, QDoc links each occurrence
of it.
'WebChannel' appears as part of a module name, but it's also
a QML type - auto-linking each word to QML documentation is
confusing.
Likewise, there's no need to link 'OpenGL' each time.
Explicit links such as \l [QML] WebChannel continue to work.
Task-number: QTBUG-79135
Change-Id: I76cc84b0076255e260aa88c244102702a48f35a6
Reviewed-by: Martin Smith <martin.smith@qt.io>
Instead of having each platform plugin deal with application termination
in their own weird ways, we now have a QPA API to signal that the system
requested the application to terminate.
On the QGuiApplication side this results in a Quit event being sent to
the application, which triggers the default behavior of closing all app
windows, and then finally calling QCoreApplication::quit().
The quit event replaces the misuse of a close event being sent to the
application. Close events are documented as being sent to windows.
The close events that are sent to individual windows as part of the
quit process can be ignored. This will skip the final quit() of
the application, and also inform the platform that the quit was
not accepted, in case that should be propagated further.
In the future the logic for closing windows should be unified
between the various approaches in closeAllWindows, shouldQuit,
and friends.
Change-Id: I0ed7f1c0d3f0bf1a755e1dd4066e1575fc3a28e1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The logic for handling termination without any event loops has been
moved up as an early exit, and the code has been modernized.
Change-Id: I202720b9923e35732cffea656e1ce108ef11953d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The logic for preventing application termination when there are modal
windows active was a leftover from the Carbon to Cocoa port, and is no
longer needed. AppKit will deal with this on its own, by checking the
preventsApplicationTerminationWhenModal property of each NSWindow.
In some cases AppKit will also ignore this property, such as when
quitting the application from the menu entry, which means we now get
the default system behavior for this use-case.
Change-Id: Iac5d8d8e17eb0974448f7ee6f39c9b7761bf4d90
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Either by testing for platform name or window activation.
After this gets in, we can enable widget tests in the Wayland bot, which
hopefully will reduce the number of regressions in the Wayland plugin.
Fixes: QTBUG-62188
Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This avoids error prone manual mappings when having to persist such values,
as eg. done in https://cgit.kde.org/kio.git/tree/src/kssld/kssld.cpp#n49.
Change-Id: Ib279c116a10ce8edc0b686b8b80cbd848b4b410e
Reviewed-by: David Faure <david.faure@kdab.com>
There are two places where we are only interested in the mapping of
proxy to source sort column, rather than the full mapping. Creating the
full mapping is rather expensive as it iterates all rows and columns and
allocates a large number of objects. Just figuring out the n-th accepted
column can be much cheaper.
Fixes: QTBUG-41659
Change-Id: I7ea914cb695518b4d47cdc3ad67c7786380d8709
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
For some scalings, setClipRect(QRect) would produce a clip one pixel
different from setClipRect(QRectF) because of different
rounding. Ditto for setClipRegion. Fix by making sure to transform
QRectFs instead of QRects.
Fixes: QTBUG-78962
Fixes: QTBUG-78963
Change-Id: I0be721133858c30769ec6d81e978962a3d6b70cf
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Add proper version check and replace long deprecated and now removed
access to pg_attrdef.adsrc.
[ChangeLog][QtSql][QPSQL] added support for PostgreSQL 12
Fixes: QTBUG-79033
Fixes: QTBUG-79064
Change-Id: Iec1b13945c34ea017139ad1c5539ab5b7f1e03aa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Makes this consistent with the rest of the actions here, and avoids
dirty hacks like KIconTheme::assignIconsToContextMenu.
Change-Id: I749f4d5f67efdbf595a52185dd507de5f87f6487
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
CMake will complain that we have a duplicate test name otherwise.
Generally it makes a lot of sense to name the test binary the same as
the test itself.
Change-Id: I27c4b51e6a2869f025e1100f1a9dd6b54ebdaf55
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Morten Kristensen <me@mortens.dev>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Make the dialog more user-friendly by using simple terms.
Fixes: QTBUG-79100
Change-Id: Ie4fa61cd0dc2a7fe5af9fd5834abe9d0e88c55de
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Makes the tests pass on Wayland.
Task-number: QTBUG-62188
Change-Id: I5860c1ae6dd3d15632d827f4e357cb6c2cc9c5e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This makes the test pass on Wayland.
Task-number: QTBUG-62188
Change-Id: Ib67cf8913055bbe753f71791095aff035342c18d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
These libraries contain types which are exposed to QML from
qtdeclarative.
Change-Id: Ie0edaef94fcb40074b6f6b2ea1a1c3a77ed3e9a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Some of them were already there, and this way they continue to function,
even if the cborstream feature is turned off.
Change-Id: I6828d2f525ab0a1437fc940a0fe786f6fa56fd6a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is part of the migration of qtbase from QRexExp to
QRegularExpression.
[ChangeLog][QtCore][QAbstractItemModel] The match() method now
supports the new Qt::RegularExpression match flag value. This
will allow users to use either a string or a fully configured
QRegularExpression when doing searches. In the second case,
the case sensitivity flag will be ignored if passed.
Task-number: QTBUG-72587
Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The logic was a leftover from the Carbon days and is no longer needed.
Change-Id: I557b669eadea902fa439c43162218c5864077df9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
std::abs(int) is defined in cstdlib which is not included on QNX.
Fixes: QTBUG-78763
Change-Id: I14d087069369db7ab4e5db9d4f816a3fbffe95f6
Reviewed-by: Johanna Äijälä <johanna.aijala@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Remove some code which was commented out with 'NOT_READY_YET' since the
initial Qt5 import. Since the mentioned bug reports are no longer
available remove this code.
Change-Id: I98686e53d85619f01d16105d147eba79b557a104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Prefer qWaitForWindowExposed over qWaitForWindowActive whenever possible, skip
in the other cases.
Makes the test pass on Wayland.
Task-number: QTBUG-62188
Change-Id: I60b4000c72c3727a2f33b79a5038469055b0fef2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Makes the test pass on Wayland.
Task-number: QTBUG-62188
Change-Id: I53011ad623e4bdb557d79c136f06ce7ac00a08ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QUrl is not available when building qmake. Hopefully we can get rid of
this mess in Qt 6.
Change-Id: Ia234996dd4f27d7f843db227e4cf2db869c92dc1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Makes the test pass on Wayland.
Task-number: QTBUG-62188
Change-Id: I3900925e74d8d940a8c5af87ea64a6ec3c8c3293
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.
Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()
Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We only need to use the QT_MANGLE_NAMESPACE macro when declaring the
interface of the class. As long as we couple that with an alias
declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses
of the class name can be un-namespaced, including declaring
categories on the class.
The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can
only be used once per class and translation unit, so forward
declarations get hairy, but we can avoid that by just including
the headers instead.
Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add a RAII class for registry keys and use it throughout
the code base.
Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Prevent call to activateWindow() for minimized windows in
QWidget::setWindowState() by clearing the flag.
Fixes: QTBUG-46763
Change-Id: I40389d0906438ffe251fc79f18a523ecb53edb1b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When calculating the header section size based on its contents when a
stylesheet is used, the size hints from the stylesheet are used. In case
if the stylesheet specifies only one of the sizes, the other is set to
-1. Because of this the actual content size is ignored.
The solution is to calculate the size based on the application style, in
case if it's not specified in the stylesheet.
Fixes: QTBUG-75615
Change-Id: I3453fa623d75b6b32832edf753de6e3e4e7f5a22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
From macOS 10.15 and iOS 13 forward it's not possible to create font
descriptors for system fonts such as .AppleSystemUIFont based on the
family name.
This means we have to preserve the font descriptors we get from CoreText
for fallback fonts, so that we can populate them along with the family name.
Task-number: QTBUG-78821
Task-number: QTBUG-77467
Change-Id: Ifce01da65f90afb7dc2bc3005c3c5870b9c116de
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Some windowing systems (i.e. Wayland) do not allow applications to steal window
focus.
Normally, we would just replace qWaitForWindowActive with
qWaitForWindowExposed, because that is usually the intent, in this test
however, there are many occurrences of both variants right after each other.
And, as described in the commit message of 153e8b49a, this may be because
window activation may cause repaints, and we want to wait for it to reduce
the chance of receiving an extra repaint later (possibly causing tests to be
racy).
Therefore, I took the conservative approach, and kept the qWaitForWindowActive
calls, except when the capability is not available. Hopefully this will not
cause flakiness in existing platforms, while also allowing tests to pass on
platforms where activation is not supported.
Task-number: QTBUG-62188
Change-Id: I15502baa28c464a808d585a5e6d67c9b745b17ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>