By default, mobile browsers create a (layout) viewport
much wider than the visual viewport in order to be
compatible with web pages created with desktop browsers
in mind.
This means that the default view is zoomed out. This
zoom is not reflected in window.devicePixelRatio, and
Qt ends up setting the canvas render size to be larger
than actually needed.
The window.visualViewport.scale property reflects this
“mobile” zoom level: add it as a devicePixelRatio factor.
(The value will be less than 1 when zoomed out). User
pinch-to-zoom may change the zoom level and resize
the visual viewport; install a resize handler as well.
For now we limit the devicePixelRatio value in order
to avoid creating gigantic backing store images - this
is something we can revisit later on.
Pick-to: 5.15
Task-number: QTBUG-85662
Change-Id: I96db6121fe17a6c213216e04e4724efc93a9b66a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This is a good default, and also works around a couple
of current bugs in the Qt implementation. (Applications
can change the default values in the .html file as
needed.)
Change body height to 100% of the visual viewport (“100vh”)
to make the html body cover 100% of the viewport after
landscape -> portrait transitions on iOS.
Pick-to: 5.15
Task-number: QTBUG-85536
Task-number: QTBUG-85662
Change-Id: Iced1aee03940361c96f1fe3c104f3e6eb983cb90
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Install XSettings property change callback on the “Xft/DPI”
property. Update QxcbVirtualDesktop::m_forcedDpi and QScreen
logicalDPI on change.
Pick-to: 5.15
Change-Id: I578ebe9017fee58acd7a5c432cbd614fd35f2f55
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
After enabling Qt::AA_UseHighDpiPixmaps, QIcon::pixmap()
now returns pixmaps larger than the requested size on
devicePixelRatio > 1 screens.
Adapt tests to account for this changed behavior.
Skip tests where it’s unclear what the the expected
behavior is, or where the test logic does not apply
to dpr > 1.
This gives a clearer indication of where we are
(39 passed, 0 failed, 9 skipped), and enables using
the qicon test to catch regressions also when running
at dpr > 1.
Remove the "lowdpi" testcase flags from the qmake and
cmake project files.
Change-Id: Ia7ce722ae356fc496a91b54e9f5d590d13b9df62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Old data was held in buffers which caused OpenGL paint engine to
re-render previous shape again with current settings if the current path
was completely clipped.
Pick-to: 5.15
Fixes: QTBUG-35513
Change-Id: I0cd448e0b18d199af11e82d79b1ab72d0f89c79e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The logic is a bit involved in qmake.
The Qt internal qt_common.prf adds CONFIG += strict_c++ which applies
to qt modules, qt plugins, qml plugins, qt helper libs, winmain and
qt_apps, qt_tools, but NOT tests (which is important because the tests
on Windows MinGW fail to build without the GNU extensions).
Then default_post.prf checks for the strict_c++ value and either uses
the strict or non-strict C++ standard flags. default_post.prf is
loaded for all qmake projects, not just the Qt internal ones.
Now CMake doesn't provide a transitive based option to disable C++
GNU extensions with a mechanism similar to target_compile_features.
It only provides the CXX_EXTENSIONS property and it's associated
CMAKE_CXX_EXTENSIONS variable. We can't set the variable at a
directory scope, because that is too coarse grained.
So we rely on setting the property via a function in every relevant
qt_add_<target> function.
Now the naming of the function is weird.
We name the function as qt_internal_<...>, because it's not meant to be
used by Qt users.
We prepend an underscore to the name because we need to place it in
Qt6CoreMacros, so that the function can be called by
qt_add_qml_module which IS a public function.
That's because in Qt5 load(qml_plugin) was private API, but in Qt 6 +
CMake we decided to make qt_add_qml_module() as public API.
Change-Id: Id014626b087d590e25cb46843f93d0c67fc36e44
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Eliminate some needless parentheses, tidy up some spacing and
indentation and split some long lines. Change first += after
declaration to initializer.
Change-Id: I05ff2a6337b7ed14e0a2dc9c03fc784c92b63515
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Adding these method definitions because QtApplication might fail
to find them.
Change 80f7494e8a added few exceptions
printStackTace(), the line
src/android/java/src/org/qtproject/qt5/android/bindings/QtApplication.java#106
prints error of java.lang.NoSuchMethodException for these methods.
Pick-to: 5.15
Change-Id: I63b1f0d3abd5a7fe7d9e87bbff252c437300722f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
To support streaming decompression in QNAM.
Will also be used to refactor existing decompression code in QNAM.
Task-number: QTBUG-83269
Change-Id: Iecf3e359734163f15686c949f75d41fa4794a00e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the new event APIs and split the single mouse event into
three separate events (move, press, release). QNX events only
give us current state, deduce the pressed and released buttons
by comparing to the previous state.
Change-Id: I9e647922679ddb792b10cb5e6ceee7ede4878444
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Avoids the conversion from UTF-8 for uses that are not dumping a string.
Mass conversion of Qt sources left for future opportunity.
Fixes: QTBUG-85811
Change-Id: I4ca4a35b687b46c39030fffd1626ae6c3294cacf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The operators were declared as friend function templates (so, free
functions in the Qt namespace). Unfortunately, the template argument
of the operators was also defaulted -- causing MSVC trying to
instantiate those functions at all times, causing interesting
recursive template instantiation errors (C2968). It's extremely
likely that we're facing a MSVC bug, but work around it by not
defaulting the template argument. This in turn requires to move
the function definition outside QList's definition, otherwise
an extern template definition (like the ones we have for QList<QPoint>)
would cause a template redefinition error...
Change-Id: If03477ac1fa0a72aa252bb9e08e2a19c2b517b1b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
After adding QByteArrayView overloads of QByteArray methods that used
to take char*, the way of determining the length of passed fixed-sized
array data has changed, due to the QByteArraiyView's optimization to deduce
the length at compile time for arrays. Document the behavior and add a
changelog item.
[ChangeLog][QtCore][QByteArray] When passing fixed size C arrays to
QByteArray methods, the length of the data on which the method will operate
is determined by array size, and not by scanning for the first '\0'
terminator, as it was in Qt 5.
Task-number: QTBUG-85815
Change-Id: I11cba17d428791e06c9bd4c7a727b7bd6b6aec3c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QByteArrayView's comparison operators are declared in the global
namespace, which can collide with the ones declared for other types that
are implicitly convertible to QByteArrayView (see the example attached to
the bugreport). Changing them to be hidden friends will make them visible
only when at least one of the operands is a QByteArrayView, so the
ambiguity will be avoided.
Fixes: QTBUG-85880
Change-Id: Ic3582269d9bda9a2105336ef0f044ea619af37ba
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We have several classes inheriting QObject (directly or not) and disabling
copy (thus non-movable implicitly). Let's make them non-movable explicitly
now.
Change-Id: I509a066e9977480b30842afef26319b8afec6001
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Windows shared library prl files should not have a
QMAKE_PRL_LIBS section. Such information is not useful because it's
not used by the linker as per 523c7e3fd5
Amends 46d7abc9172f82756ccd3641a314dcc066353c3f
Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: Ic40491a568f72c507a16322f6f0c61f98d3a5913
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Qt6 makes sizes qsizetype; and one of these was already sizeof()-sized.
While qsizetype might not be ssize_t, it's at least no bigger, so we
can safely use its format specifier, with a suitable cast.
Change-Id: I433f654f6b139d74b4d5358b804b44ab1f0ada15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Removed three warnings, rather than fixing them, as Konstantin Ritt
tells me they've been redundant since Unicode 6 or so.
Change-Id: I4507e852bceb08a0252c77a8b383aceac212aad9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Don't include a QString::number() in a sum of QByteArray and C strings.
Change-Id: I7544e835fcf5625b1fe1ee2055a48600200daafd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We can end up in a situation where a (soon to be destroyed) observer is
owned by a binding which is about to be deleted. If in that situation
the binding is destroyed first, we end up with a dangling pointer
and ensuing memory corruption. Instead, we now first transfer the
ownership of the observer and only destroy the binding afterwards.
Fixes: QTBUG-85824
Change-Id: I721c0319281ada981ae7896bd2e02e9a0cc901b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The subsurface sync/desync functions were unimplemented on the
qtwayland side, so this is all dead code. We will introduce the
platform interfaces if an actual use-case with an implementation
comes up.
Task-number: QTBUG-84220
Change-Id: I921ee7262e5f0a7171058aaf0ff2102d9e6f438e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Fixes warning by Clang:
warning: 'const volatile' type qualifiers on return type have no effect
[-Wignored-qualifiers]
const volatile unsigned long long * const volatile func_KVPKVull() {...}
^~~~~~~~~~~~~~~
Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We need them to implement qHash for QQuickPixmapKey.
Change-Id: Ia67de25ec0068b9e1b889bc9c6ee077e24eb71a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Made QPromise::swap public, added free standing swap() for
QFutureInterface and QPromise. Updated QPromise special member
functions. Extended tests
Task-number: QTBUG-84977
Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Pick-to: 5.15
Fixes: QTBUG-85749
Change-Id: Ie77145e851ff64d4c88fce7211135d66e9b94a84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This amends 0ef46b41d8 to ensure the
new configuration is styled correctly for qmake.
Task-number: QTBUG-80938
Change-Id: Iebfff3ff0570d2e92d01d4eb1178c0d6261468f9
Pick-to: 5.15
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Just T makes qdoc's clang parsing fail, it needs template<typename T>.
Also, the return type is T*, not T.
Change-Id: I210676aff3122b432888c3d79d9967e249ac88e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add dummy typedefs just for qdoc, this way the types show up in
the generated docs.
Change-Id: I408eeb5c4c1cbbb8cd7df8ca3c9c6b7c64b0ca88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Trying to be clever seems to cause issues on some systems, for example
AMD (RADV) on Ubuntu 20.04 gives totally garbled output by default.
Remove the undocumented ALWAYS_SET_MODE env.var. as well, it won't have
much of a purpose since we'll in effect hit the SetCrtc path always now
once on startup.
Change-Id: Ibaa463ff913eb0c1251d6d3435aa4799fe5c8a29
Fixes: QTBUG-85797
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Attempting to reflect reality with the value of AA_ShareOpenGLContexts
was a valiant attempt, but it is not possible to do setAttribute without
getting a warning now once QGuiApplication is constructed. So just leave
the attribute as is, changing its value is not strictly required.
Fixes: QTBUG-85796
Pick-to: 5.15
Change-Id: I0f0f981bb4883856b216b2a9aad3b5bf2d7da01a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
We already had append(const QList &) and now there's an overload
taking an rvalue reference.
Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't appear to have implicit fallthroughs in our code anymore. The
last deprecated copies and redundant moves are also gone.
The other warning never had an explanation and doesn't show up when
building full Qt anyway.
Change-Id: Iad959315ad374ef288f5fffd15d683599a1a11b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Commit daaa557259 changed the enum to
bool, but the warning is still happening.
Pick-To: 5.15
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f332a356c788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I don't know why std::shared_ptr allows this, but why not.
[ChangeLog][Important Behavior Changes] QSharedPointer objects will now
call custom deleters even when the pointer being tracked was null. This
behavior is the same as std::shared_ptr.
Fixes: QTBUG-85285
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c260df0313b55
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
‘t’
Specifies that the argument is a ‘ptrdiff_t’.
This modifier was introduced in ISO C99.
We use qsizetype, which is the same width as ptrdiff_t, so it makes no
difference in va_arg().
Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Deprecated in 5.15 in favor of CBOR.
Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
keys() and values() can be slower for large containers.
I ran into this recently when profiling, and was surprised that keys()
had to build the list of keys (by appending in a loop).
Pick-to: 5.15 5.12
Change-Id: I73215f5a917790236704ad7ef78cefc4a049cd89
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>