Commit Graph

55550 Commits

Author SHA1 Message Date
Laszlo Agocs
68a4c5da9a Compose render-to-texture widgets through QRhi
QPlatformTextureList holds a QRhiTexture instead of GLuint. A
QPlatformBackingStore now optionally can own a QRhi and a
QRhiSwapChain for the associated window.  Non-GL rendering must use
this QRhi everywhere, whereas GL (QOpenGLWidget) can choose to still
rely on resource sharing between contexts. A widget tells that it
wants QRhi and the desired configuration in a new virtual function in
QWidgetPrivate returning a QPlatformBackingStoreRhiConfig. This is
evaluated (among a top-level's all children) upon create() before
creating the repaint manager and the QWidgetWindow.

In QOpenGLWidget what do request is obvious: it will request an
OpenGL-based QRhi. QQuickWidget (or a potential future QRhiWidget)
will be more interesting: it needs to honor the standard Qt Quick
env.vars. and QQuickWindow APIs (or, in whatever way the user
configured the QRhiWidget), and so will set up the config struct
accordingly.

In addition, the rhiconfig and surface type is (re)evaluated when
(re)parenting a widget to a new tlw. If needed, this will now trigger
a destroy - create on the tlw. This should be be safe to do in
setParent. When multiple child widgets report an enabled rhiconfig,
the first one (the first child encountered) wins. So e.g. attempting
to have a QOpenGLWidget and a Vulkan-based QQuickWidget in the same
top-level window will fail one of the widgets (it likely won't
render).

RasterGLSurface is no longer used by widgets. Rather, the appropriate
surface type is chosen.

The rhi support in the backingstore is usable without widgets as well.
To make rhiFlush() functional, one needs to call setRhiConfig() after
creating the QBackingStore. (like QWidget does to top-level windows)

Most of the QT_NO_OPENGL ifdefs are eliminated all over the place.
Everything with QRhi is unconditional code at compile time, except the
actual initialization.

Having to plumb the widget tlw's shareContext (or, now, the QRhi)
through QWindowPrivate is no longer needed.  The old approach does not
scale: to implement composeAndFlush (now rhiFlush) we need more than
just a QRhi object, and this way we no longer pollute everything
starting from the widget level (QWidget's topextra -> QWidgetWindow ->
QWindowPrivate) just to send data around.

The BackingStoreOpenGLSupport interface and the QtGui - QtOpenGL split
is all gone. Instead, there is a QBackingStoreDefaultCompositor in
QtGui which is what the default implementations of composeAndFlush and
toTexture call. (overriding composeAndFlush and co. f.ex. in eglfs
should continue working mostly as-is, apart from adapting to the
texture list changes and getting the native OpenGL texture id out of
the QRhiTexture)

As QQuickWidget is way too complicated to just port as-is, an rhi
manual test (rhiwidget) is introduced as a first step, in ordewr to
exercise a simple, custom render-to-texture widget that does something
using a (not necessarily OpenGL-backed) QRhi and acts as fully
functional QWidget (modeled after QOpenGLWidget). This can also form
the foundation of a potential future QRhiWidget.

It is also possible to force the QRhi-based flushing always,
regardless of the presence of render-to-texture widgets. To exercise
this, set the env.var. QT_WIDGETS_RHI=1. This picks a
platform-specific default, and can be overridden with
QT_WIDGETS_RHI_BACKEND. (in sync with Qt Quick) This can eventually be
extended to query the platform plugin as well to check if the platform
plugin prefers to always do flushes with a 3D API.

QOpenGLWidget should work like before from the user's perspective, while
internally it has to do some things differently to play nice and prevent
regressions with the new rendering architecture. To exercise this
better, the qopenglwidget example gets a new tab-based view (that could
perhaps replace the example's main window later on?). The openglwidget
manual test is made compatible with Qt 6, and gets a counterpart in form
of the dockedopenglwidget manual test, which is a modified version of
the cube example that features dock widgets. This is relevant in
particular because render-to-texture widgets within a QDockWidget has
its own specific quirks, with logic taking this into account, hence
testing is essential.

For existing applications there are two important consequences with
this patch in place:

- Once the rhi-based composition is enabled, it stays active for the
lifetime of the top-level window.

- Dynamically creating and parenting the first render-to-texture
widget to an already created tlw will destroy and recreate the tlw
(and the underlying window). The visible effects of this depend on the
platform.  (e.g. the window may disappear and reappear on some,
whereas with other windowing systems it is not noticeable at all -
this is not really different from similar situtions with reparenting
or when moving windows between screens, so should be acceptable in
practice)

- On iOS raster windows are flushed with Metal (and rhi) from now on
(previously this was through OpenGL by making flush() call
composeAndFlush().

Change-Id: Id05bd0f7a26fa845f8b7ad8eedda3b0e78ab7a4e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-11 21:25:00 +01:00
Tor Arne Vestbø
8ccf1080fc tst_QLocalSocket: Clean up leftover local sockets before listening
If a test crashes it might leave local sockets, causing test failures
on subsequent runs due to the socket already being "in use".

Pick-to: 6.3
Change-Id: Ie1107c414f4819026907071c7b8281b2e27b8541
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-11 20:32:08 +01:00
Tor Arne Vestbø
d5b3238def tst_QLocalSocket: Output error when listening fails
Pick-to: 6.3
Change-Id: I742de5f522e4a28794abdee863eea2758536d392
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-11 20:32:08 +01:00
Morten Johan Sørvig
851dc581cf Revert "QScreen_win: retrieve user friendly monitor name"
This made the screen names be non-unique (in my case
“28E850”), which causes the code in handleScreenChanges()
to think they are the same screen.

This reverts commit e9fd1c6aab.

Pick-to: 6.3 6.2
Change-Id: I97fb76aeb66857b4bf9b3c5b4bd6db6024446798
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
2022-03-11 19:32:08 +00:00
Fabian Kosmale
57c1e8d533 build system: support module local definitions
This introduces a new helper function,
qt_internal_add_repo_local_defines and makes use of it in
qt_internal_add_{module,test,executable,benchmark,plugin}. That function
checks whether QT_EXTRA_INTERNAL_TARGET_DEFINES is set. If it is, the
defines listed in there will be aded to all targets passed to the
functions mentioned above.

The intended usage is that QT_EXTRA_INTERNAL_TARGET_DEFINES gets set
in the repository local .cmake.conf. This allows e.g. opting in to
source incompatible changes in leaf modules (as long as those are
guarded by some define).

Pick-to: 6.2 6.3
Fixes: QTBUG-101640
Change-Id: I06c3693ee69f46e95a48de724621f0c97e7cc3a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-11 20:32:08 +01:00
Marc Mutz
d743fd0d0a qDecodeDataUrl(): treat ";base64" marker as case-insensitive
RFC2397 doesn't explicitly mention it, but references RFC2045, which,
in Section 2, states:

> All media type values, subtype values, and parameter names as
> defined are case-insensitive.

and goes on, in 6.1:

>   mechanism := "7bit" / "8bit" / "binary" /
>                  "quoted-printable" / "base64" /
>                  ietf-token / x-token
>
>   These values are not case sensitive

So regardless of whether "base64" is a parameter name, or a mechanism,
we need to treat it case-insensitively.

Use QLatin1String::endsWith() instead of QByteArray::endsWith(),
because the former takes Qt::CaseInsensitive while the latter would
need a toLower().

Add a test.

As a drive-by, use the same trick for the existing case-insensitive
comparison with "charset".

As a further drive-by, fix inappropriate uses of QLatin1String (=
where they don't prevent allocations).

[ChangeLog][QtCore][QUrl] Now recognizes the ";base64" marker in
"data:" URLs case-insensitively.

Pick-to: 6.3 6.2
Change-Id: Ife6ba771553aaad3b7c119c1fa631f41ffa8f590
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-11 19:15:49 +00:00
Marc Mutz
cfa4879b41 De-inline dtors of QTextureFileHandler hierarchy
Destructors of polymorphic classes should be out-of-line to pin vtable
and type_info objects to a single TU.

Pick-to: 6.3
Task-number: QTBUG-45582
Change-Id: I541437a3ff53852527f6278355f7b549e62e17f7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-11 19:15:49 +00:00
Marc Mutz
61e3fe7fd9 Do not assume implicit string-ish → QColor conversion
We want to mark the corresponding QColor ctor(s) explicit.
Use Qt::GlobalColor or the new QColor::fromString() instead.

Change-Id: I68bf75a094e6821b97682de5a0ffd975834d22d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-11 20:15:49 +01:00
Marc Mutz
abe3b4c9b9 Extract Header qstringfwd.h
... from qstringalgorithms.h and qutf8stringview.h, in order to
centralize the declaration of the string classes, much like
qcontainerfwd.h does for Qt containers.

[ChangeLog][QtCore] Added header qstringfwd.h containing
forward-declarations of all Qt string classes.

Task-number: QTBUG-98434
Change-Id: I4cf1ede9fe6c286230f4c7e7abe379da28ce5d15
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-11 20:15:49 +01:00
Marc Mutz
52092802b7 Rewrite tst_qdataurl as a data-driven test
... to make adding new test cases simpler.

Pick-to: 6.3 6.2 5.15
Change-Id: I54d08cebc7ae4bea9f0397ba3eec1ef6308a5161
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-11 20:15:49 +01:00
Marc Mutz
d15222fbaf QFlatMap: fix warning -Wunused-but-set-variable (GCC) in remove_if()
Amends 6f5c78fe3d.

Change-Id: I01a474f8ccb9de7d7b76a33a950542e38edc78e4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-11 20:15:49 +01:00
Marc Mutz
eded55cfbb tst_qflatmap: fix -Wunused-local-typedef (Clang)
False Positive, of course, since it's used in dependent callee
transparent_impl().

Amends 58e8ae5605.

Pick-to: 6.3
Change-Id: I7520fb7cf6bce28a5fd9381783ba349119309132
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-11 19:15:49 +00:00
Marc Mutz
91fbe3fe78 HTTP2: port to QByteArrayView where it's trivial
Nothing serious, just was curious and played around a bit, so might as
well merge it.

There's much more here that could be done, but I lack the time to do
it.

Change-Id: Idd4ea09a7a413ed5911ffe16841f3d5c944ec1a5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-11 20:15:48 +01:00
Marc Mutz
5295043908 HPack: make padding_is_valid static constexpr
... because we can.

Change-Id: I3a813fa9c33e47d20a00e6a331cbbcf6f85e63e7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-11 19:15:48 +00:00
Marc Mutz
fa0764bbd2 QItemSelectionModel: avoid 24 relocations
Use qOffsetStringArray() instead of an array of pairs of pointers.

This unearthed a problem with SIGNAL and SLOT calling qFlagLocation()
(meaning in debug mode, the array was runtime-initialized, not just
relocated), which we work around by using the new QT_STRINGIFY_
{SIGNAL,SLOT} macros now.

Saves 24 relocations, but, interestingly, saves only 4b in text size
on GCC 11.2 Linux AMD64 -O2 C++20 builds (TEXT and DATA combined)
while saving 760b on the equivalent Clang 10 libc++ build (expected,
in both cases: 24 * (sizeof(void*) - sizeof(quint16))):

Clang:

  $ size qtbase/lib/libQt6Core.so.6.4.0
     text    data     bss     dec     hex filename
  5476156   90520   16185 5582861  55300d qtbase/lib/libQt6Core.so.6.4.0
  $ ~/bin/relinfo.pl qtbase/lib/libQt6Core.so.6.4.0
  qtbase/lib/libQt6Core.so.6.4.0: 6528 relocations, 3598 relative (55%), 2540 PLT entries, 2227 for local syms (87%), 0 users
  $ ninja libQt6Core.so
  [6/6] Creating library symlink qtbase/lib/libQt6Core.so.6 qtbase/lib/libQt6Core.so
  $ size qtbase/lib/libQt6Core.so.6.4.0
     text    data     bss     dec     hex filename
  5475604   90312   16185 5582101  552d15 qtbase/lib/libQt6Core.so.6.4.0
  $ ~/bin/relinfo.pl qtbase/lib/libQt6Core.so.6.4.0
  qtbase/lib/libQt6Core.so.6.4.0: 6504 relocations, 3574 relative (54%), 2540 PLT entries, 2227 for local syms (87%), 0 users

GCC:

  $ ~/bin/relinfo.pl qtbase/lib/libQt6Core.so.6.4.0
  qtbase/lib/libQt6Core.so.6.4.0: 6300 relocations, 5343 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users
  $ size qtbase/lib/libQt6Core.so.6.4.0
     text    data     bss     dec     hex filename
  6019871   75896   16952 6112719  5d45cf qtbase/lib/libQt6Core.so.6.4.0
  $ ninja libQt6Core.so
  [6/6] Creating library symlink qtbase/lib/libQt6Core.so.6 qtbase/lib/libQt6Core.so
  $ ~/bin/relinfo.pl qtbase/lib/libQt6Core.so.6.4.0
  qtbase/lib/libQt6Core.so.6.4.0: 6276 relocations, 5319 relative (84%), 318 PLT entries, 1 for local syms (0%), 0 users
  $ size qtbase/lib/libQt6Core.so.6.4.0
     text    data     bss     dec     hex filename
  6020091   75672   16952 6112715  5d45cb qtbase/lib/libQt6Core.so.6.4.0

Pick-to: 6.3
Change-Id: I60749953f1a63d23d696a5a547cd924ec259ead3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-11 20:15:48 +01:00
Marc Mutz
efe411b8b7 qobjectdefs.h: DRY the SIGNAL/SLOT macros
Factor common code into a separate macro to DRY.

The immediate paractical consequence is that we now have a way to
reliably get a const char[] from the SIGNAL or SLOT macros, e.g. for
storing in a QOffsetStringArray, without causing compile errors in
debug mode or running the danger of causing runtime initialization via
qFlagLocation, which is of limited value in this circumstance, anyway,
because qFlagLocation only stores the last two strings.

Pick-to: 6.3
Change-Id: I67401858e94eedc1200fdd08e695fd56d10f8560
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-11 20:15:48 +01:00
Topi Reinio
b0d106267c Doc: Fix erraneous auto-link on Qt D-Bus landing page
QDoc interprets a sequence of special characters as something to auto-
link to; Escape the underscore character to prevent this.

Fixes: QTBUG-100562
Pick-to: 6.3
Change-Id: I61a10d7ea6878ef93197b0d329e16b8867d8ad30
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-03-11 20:15:48 +01:00
Assam Boudjelthia
db2f47337b CMake:Android: Use ANDROID_PLATFORM instead of ANDROID_NATIVE_API_LEVEL
ANDROID_NATIVE_API_LEVEL is an alias for ANDROID_PLATFORM and the
Android's CMake docs [1] uses directly ANDROID_PLATFORM so let's use
that as well. Also, NDK r23b seems to have removed the part of code from
android.toolchain.cmake that handles ANDROID_NATIVE_API_LEVEL to set
the correct value to ANDROID_PLATFORM.

With this change, CMake will pass the value from the configure argument
-android-ndk-platform as -DANDROID_PLATFORM instead of
-DANDROID_NATIVE_API_LEVEL. Otherwise, if if  -DANDROID_NATIVE_API_LEVEL
is passed directly to CMake, it should work as before.

[1] https://developer.android.com/ndk/guides/cmake#build-command

Pick-to: 6.3
Task-number: QTQAINFRA-4837
Change-Id: I5c21af53ac91e11a27c4b033313d22d1115c1abc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-11 18:30:32 +02:00
Laszlo Agocs
888b75aa12 vulkan: Try loading libvulkan.so.1 first
Change-Id: I876899fbfc126136f2842e9361e21ac10af8f14b
Pick-to: 6.3
Fixes: QTBUG-101592
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-03-11 11:14:35 +01:00
Axel Spoerl
dfe5f99120 Fix QDockWidget's dock area permissions after hovering
When a QDockWidget's dock areas are restricted by setAllowedAreas(...)
and a second QDockWidget is hovered over it, the first QDockWidget can
be docked to any dock area of the main window. Area restrictions will
be ignored.
That is due to the first QDockWidget being implicitely mutated into a
QDockWidgetGroupWindow upon hovering. By definition, the latter has no
docking restricitons.
This fix adds a check if a QDockWidgetGroupWindow has a single QDockWidget child.
In that case, the single child's area permissions will restrict docking.

Fixes: QTBUG-100670
Pick-to: 6.3 6.2 5.15
Change-Id: I903b074739953791634f482c9cf4b9a95a1d93d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-11 09:57:07 +00:00
Assam Boudjelthia
7d77deb281 Android: rephrase default value statement use in manifest doc page
Use "The default value is \c xxx" instead of "Default \c xxx".

Pick-to: 6.2 6.3
Change-Id: Id75b45499c7fc0e9d42e66fa2b8b3515c863c61c
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2022-03-11 05:25:46 +02:00
Assam Boudjelthia
c099502622 CMake: add space between ABI name and "(default)" string
Pick-to: 6.3
Change-Id: Ie47d48fd2da4edc1377211e9b8b425f11b44314a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-11 05:25:46 +02:00
Thiago Macieira
30e90841bc QProcess/Doc: update the information on how the program is found
Pick-to: 5.15 6.2 6.3
Change-Id: I54f205f6b7314351b078fffd16d05b1eecb24544
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-03-10 18:20:13 -08:00
Alexandru Croitor
7cc5fbe424 configure: Don't escape backslashes in passed configure arguments
It broke drive-less (no C:\ prefix) paths passed to configure.

Invoking configure on Windows with the following args
  qtbase/configure --
 -DCMAKE_INSTALL_PREFIX=\Users\qt\work\install

called CMake with
 -DCMAKE_INSTALL_PREFIX=\\Users\\qt\\work\\install

saying
 Qt will be installed into '//Users/qt/work/install'

and while the build succeeded, installation would fail with

  CMake Error at cmake_install.cmake:41 (file):
    file cannot create directory:
    //Users/qt/work/install/lib/cmake/Qt6BuildInternals.  Maybe need
    administrative privileges.

Note the double slash in the beginning is likely interpreted as a
Windows share URI / UNC path.

The same would happen when passing -prefix '\Users\qt\work\install'

As a reminder, we want to support drive-less prefix paths because
that's what Qt's Coin CI uses passes to ensure DESTDIR installation
works correctly.

Amends cb7f4030bc

Pick-to: 6.2 6.3
Fixes: QTBUG-94366
Change-Id: I9267b6f784babfbdaeafc65267ba96c75fa24112
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-11 02:43:46 +01:00
Alexandru Croitor
b0824ad931 coin: Preserve quoted arguments when calling cmake / configure
Previously we used sh $* for passing parameters of various calls like
cmake / configure. This did not properly preserve quoted arguments,
leading to potential issues.

For example when configuring qtbase with

 cmake -DQT_QMAKE_DEVICE_OPTIONS="DISTRO_OPTS=hard-float boot2qt"

the 'boot2qt' option would be passed as a separate argument to cmake,
leading to the QT_QMAKE_DEVICE_OPTIONS cache var containing only
'DISTRO_OPTS=hard-float'.

Use "$@" to preserve the quotes.

Inspired by
https://wiki.bash-hackers.org/scripting/posparams#all_positional_parameters

Amends e9b8837c31

Pick-to: 6.2 6.3
Change-Id: Ib67d4bc138c65f7430457cb2a2baa55bff72e549
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-03-11 02:43:46 +01:00
Thiago Macieira
19b7f854a2 Enable -mno-direct-extern-access and ELF protected visibility
The -mno-direct-extern-access tells the compiler and linker that
references to symbols outside this ELF module mustn't be direct and must
instead always go through the GOT or PLT (the PLT can additionally be
disabled with -fno-plt). The ELF protected visibility tells the compiler
and linker that this symbol is present in the dynamic symbol table as an
export, but it cannot be interposed by another ELF module.

This option is required for user code to link properly to Qt, otherwise
they will get linker errors (assuming GNU binutils >= 2.39) or runtime
failures (glibc >= 2.35). Both versions of glibc and binutils are older
than GCC 12, so it's a safe assumption they are in use and downgrading
the toolchain or libc is not supported. Adding this option to the
compilation is assured for CMake and qmake-based projects.

For example, all accessess to QCoreApplication::self in QtCore, after
this change and with GCC 12 are relocation-free and direct:

000000000013ebf0 <QCoreApplicationPrivate::checkInstance(char const*)>:
  13ebf0:       cmpq   $0x0,0x4f73d0(%rip)        # 635fc8 <QCoreApplication::self>
  13ebf8:       setne  %al
  13ebfb:       je     a90fe <QCoreApplicationPrivate::checkInstance(char const*) [clone .cold]>
  13ec01:       ret

Meanwhile, accesses to the same variable in other modules are indirect
via the GOT:

   66650:       mov    0x876e1(%rip),%rax        # edd38 <QCoreApplication::self@Qt_6>
   66657:       cmpq   $0x0,(%rax)

This replaces the -Bsymbolic and -Bsymbolic-functions (broken)
functionality that Qt has been using or attempting to use since ~2006.

See https://gitlab.com/x86-psABIs/x86-64-ABI/-/issues/8#note_606975128

Change-Id: Iad4b0a3e5c06570b9f5f571b26ed564aa0811e47
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-03-10 17:10:57 -08:00
Kai Köhne
1818d6682d Doc: List third-party attributions on Qt Network landing page
Change-Id: I167ef5088f522aad33518cabe5a9287168294f3e
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-10 22:05:04 +01:00
Robert Löhning
0031c5cb79 QStyle: Fix cases when logicalValue is outside range
Change-Id: I410c40425d6677612dbe3a40cbaa1debba998064
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-10 12:39:11 +01:00
Timur Pocheptsov
bd6d6d92b5 secure UDP server: do not use deprecated protocol (DTLS 1.0)
And also remove check for DtlsV1_2OrGreater for negotiated
session protocol, since it must have been resolved to a specific
protocol by this point.

Fixes: QTBUG-100154
Pick-to: 6.3 6.2
Change-Id: I3aec31faed8b9cb22be0062da057c62864eba34f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-10 08:23:00 +00:00
CI Insignificant Platforms Monitor Bot
797a6ca7e6 Blacklist: test cases blacklisted in tst_QSystemSemaphore:
- initialValue on qnx

Pick-to: 6.2
Pick-to: 6.3
Task-number: QTBUG-101618
Change-Id: Iea5a45690aa2e1225297c3b652d88864cf5f3ddb
Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io>
2022-03-10 08:18:42 +00:00
Lorn Potter
279b0ba6c4 wasm: fix issue with passing username/password to network request
The data scope was wrong, it needs to live beyond the attribute strut

Change-Id: If1ceb4967fc1755d4968a69bcd9d82b234bd871d
Done-with:  Vincent Rouillé
Fixes: QTBUG-101551
Pick-to: 6.3 6.2 5.15
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2022-03-10 17:57:19 +10:00
Fabian Kosmale
e441985534 QMetaProperty: use early return
This improves readability.

Change-Id: I6552463b5f14d79b99efd3c0633695401bdb7f78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-10 07:21:11 +01:00
Fabian Kosmale
ba6c1d2785 QProperty: fix threading issues
QObject's cache the binding status pointer to avoid TLS lookups.
However, when an object is moved to a different thread, we need to
update the cached pointer (as the original thread might stop and thus no
longer exist, and to correctly allow setting up bindings in the object's
thread).
Fix this by also storing the binding status in QThreadPrivate and
updating the object's binding status when moved. This does only work
when the thread is already running, though. If it is not running, we
instead treat the QThreadPrivate's status pointer as a pointer to a
vector of pending objects. Once the QThread has been started, we check
if there are pending objects, and update them at this point.

Pick-to: 6.2 6.3
Fixes: QTBUG-101177
Change-Id: I0490bbbdc1a17cb5f85044ad6eb2e1a8c759d4b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-03-10 07:21:11 +01:00
Noah Davis
64ffe0aacb Widgets: use QPlatformTheme::ButtonPressKeys for pressing buttons
QComboBox is included because it works like a button when it is not
editable. QGroupBox is included because it has a checkbox and QCheckBox
is a subclass of QAbstractButton.

Change-Id: Iad89259314e77f78c915dce83ec601df94c88941
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-03-09 19:13:41 -05:00
Michal Klocek
2de667a6ff Install also config headers for 3rdparty libjpeg
Amends be2745e478

Pick-to: 6.3
Change-Id: I9dd1a6858e9e9c9c3749dd33eeda3b1c509b69b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-10 01:06:21 +01:00
Edward Welbourne
9ff44989ec Remove two unused functions from qbytearray.cpp
The q_toPercentEncoding() overload without percent parameter and the
q_normalizePercentEncoding() function are nowhere used. Although they
were extern symbols, they were not declared in a header. Thei names
mark them as Qt-internal. So removal should be safe.

Change-Id: If6cece20796a80d98a9af4e764443f3ab8c555c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-09 23:29:25 +01:00
Robert Löhning
4b49c2006f QStyle: Fix overflows and crash when converting slider positions
Qt Creator crashes when max is INT_MAX and min is -1, see bugreport.

Change-Id: I441e76c0ff87052083ed3d77e6085b186402e5d8
Fixes: QTBUG-101581
Pick-to: 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-09 20:38:16 +00:00
Pasi Petäjäjärvi
a6a480ddcb CI: Increase timeout for waiting QNX qemu to start
There seems to be lot of timeouts on testing where qemu is not able to
start at current 60 seconds period.

Pick-to: 6.2 6.3
Change-Id: Icbc47b75a8288e672237789cb273ef5a644c08ba
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
2022-03-09 22:38:16 +02:00
Sona Kurazyan
e77dfcf843 Fix the ambiguity when calling QLatin1String(0)
This amends 736213bf66

Change-Id: I2fc16eba31898eb621866f8612bb7d26c95b5435
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-09 20:37:10 +00:00
Giuseppe D'Angelo
f875ff5180 QMutexLocker: code tidies
Rename isLocked in preparation for a future commit. Rename m
as well for consistency.

Change-Id: I1c8d040bca6825a698ec804ea142d208abacd5cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-09 21:37:10 +01:00
Thiago Macieira
77e4177d16 QGlobalStatic: fix Clang warning about expression in unevaluated context
From Clang 13:

qlocale.cpp:854:161: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression]

Pick-to: 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d6c75ef1e04262
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-09 12:37:10 -08:00
Marc Mutz
e3cc3900cd qutf8stringview.h: don't rely on transitive include of qbytearrayview.h
Amends fe46cd59ce.

Pick-to: 6.3
Change-Id: I9cc07367e1674c93610b8376a03f749c844159ec
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-09 18:46:17 +01:00
Sona Kurazyan
82e12c79b2 Add an overload of QStringView::count() for QLatin1String
Required for the API symmetry between QStringView and QLatin1String.

[ChangeLog][QtCore][QStringView] Added an overload of
QStringView::count() for QLatin1String.

Change-Id: Ic49a4b31e8f6f0969eff0f792654d23a60e06c49
Task-numer: QTBUG-98431
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-09 15:58:47 +01:00
Sona Kurazyan
30d28810ee Add QLatin1String::count(needle)
[ChangeLog][QtCore][QLatin1String] Added QLatin1String::count(needle).

Task-number: QTBUG-98433
Change-Id: I31c9fdf14fd81500722ff9f5998eadf0e6cedc5c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-09 15:58:47 +01:00
Mårten Nordheim
567c31e8ee QHostInfo/Unix: Fix resolv never unloading
Due to some unfortunate shadowing

Pick-to: 6.3 6.2 5.15
Change-Id: Ib2660516f9ba9974c84a043bd2677b7890fc76f9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-03-09 14:31:17 +01:00
Pasi Petäjäjärvi
f5f6487e80 QNX: Fix compiler warning by adding default return value
In static member function 'static QQnxAbstractVirtualKeyboard::EnterKeyType
QQnxAbstractVirtualKeyboard::qtEnterKeyTypeToQnx(Qt::EnterKeyType)':
warning: control reaches end of non-void function [-Wreturn-type]

Pick-to: 6.2 6.3
Task-number: QTBUG-101382
Change-Id: If3b0eda5d36257b0fbed54fb0a032c3b9d7ff989
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-09 14:03:21 +02:00
Pasi Petäjäjärvi
b680ae3442 QNX: Fix compiler warnings by using correct format specifiers
Also change qt_safe_read to use correct return value.

warning: format '%d' expects argument of type 'int',
but argument 3 has type 'size_t' {aka 'long unsigned int'} [-Wformat=]

warning: format '%u' expects argument of type 'unsigned int',
but argument 3 has type 'ssize_t' {aka 'long int'} [-Wformat=]

Pick-to: 6.2 6.3
Task-number: QTBUG-101382
Change-Id: I1ee42b84a477451a98838c8cea3cca7c73f7cbaa
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2022-03-09 14:03:21 +02:00
Samuel Mira
2edc0025fa Fix quick file dialog on android
Patch 13399bd54d084ed837ec061ca9315dbd173f3b48 removed the accept
handler on QQuickFileDialog, which was triggering setSelectFiles on
android.
So changed qandroidplatformfiledialoghelper to also emit currentChanged
which will trigger the QQuickFileDialog to setSelectFiles since there
is a connect to that signal. Emitting currentChanged signal is also the
signal used in others QPlatformFileDialogHelpers.

Fixes: QTBUG-101013
Pick-to: 6.3
Change-Id: I22f2d583f4be26a83e1c19190458fb5011e40095
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-03-09 13:17:28 +02:00
Eirik Aavitsland
31d401dec6 Fix compilation for wasm
libjpeg's internal putenv() function uses system setenv(), but that is
not found when building for webassembly. Just disable the entire
putenv function, since it is not used anyway.

Pick-to: 6.3 6.2 5.15
Change-Id: I1eb60f31562ef4e33c656ff3b3752bef6f88fcb8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-09 08:51:14 +01:00
Thiago Macieira
c4d78703e0 forkfd: don't attempt to guess EWOULDBLOCK when WNOHANG is active
Reading the kernel sources, I was sure we'd get an ECHILD if the child
hadn't exited yet, but that's not the case. We only get ECHILD if the
current process has no child processes. But if we do have one and the
one we're waiting for hasn't exited, waitid() returns 0.

So let's not attempt to correct it with forkfd_wait() or forkfd_wait4().
Those have "wait" in the name, so they should behave exactly the same
way. The man pages say:

 waitpid(): if WNOHANG was specified and one or more child(ren)
       specified by pid exist, but have not yet changed state, then 0 is
       returned.
 waitid(): returns 0 on success or if WNOHANG was specified and no
       child(ren) specified by id has yet changed state

This was found while studying QTBUG-100174.

QProcess does not use this code path (blocking mode forkfd only).
Matching OpenDCDiag PR:
https://github.com/opendcdiag/opendcdiag/pull/62

Pick-to: 6.2 6.3
Change-Id: Ibf4acec0f166495998f7fffd16d6de6853a6e5a8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-08 09:18:40 -08:00