Commit Graph

57084 Commits

Author SHA1 Message Date
Fabian Kosmale
2c81ba2df9 QThread: Clean up bindingStatusOrList if object gets deleted
Deal with the case that the object gets deleted between a call to
moveToThread and the start of the thread by removing the object from the
list in that case.

Fixes: QTBUG-104014
Pick-to: 6.4
Change-Id: Ib249b6e8e8dfbc4d1332bb99a57fa9d3cff16465
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 19:34:46 +02:00
Ivan Solovev
6db91c0df1 GroupBox example: port away from using deprecated QAction::setMenu()
We can achieve the same UI by using QMenu::addMenu() directly

Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I627f21bc93646943cf6dfbd3b388352b84f73f0f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 16:28:49 +02:00
Volker Hilsheimer
a2c7428e4d QGraphicsWidget: skip test if graphics view fails to show
We set Qt::X11BypassWindowManagerHint on the view, which regularly makes
the test fail on X11 systems in the

QVERIFY(QTest::qWaitForWindowActive(dummyView.data()))

check.

If the view fails to show, skip the test instead of failing, we are not
testing anything X11 specific here, running this test on other platforms
will be good enough.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-98921
Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-14 15:55:30 +02:00
Tor Arne Vestbø
845ea89211 Revert "Windows QPA: Add MSWindowsNoRedirectionBitmap flag"
This reverts commit 417bb46352.

The API addition was premature, as it can potentially be handled
by the platform plugin automatically, and if not, should possibly
live in QSurfaceFormat instead.

Change-Id: I5c7050ce9c50b6c6a93ddfa6d2e842db0b9eed0d
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-07-14 13:24:43 +00:00
Volker Hilsheimer
a61bf508e3 QGraphicsProxyWidget: make tolerance for errors depend on DPI
The test already accepts an error margin for coordinate mapping. It is
still flaky, so make that margin larger if the DPI of the widget >1.

Pick-to: 6.4 6.3 6.2
Change-Id: I0a598e5e94ac82c551cbeb935e2fa08cad048f84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 15:24:43 +02:00
Umair Raihan
55dd943996 Add new mkspecs device for Raspberry Pi 4 (64-bit)
The existing mkspecs for Raspberry Pi 4 (devices/linux-rasp-pi4-v3d-g++) was intended to compile Qt application for the 32-bit version of Raspberry Pi, thus it used compiler flags that are incompatible when compiling Qt application for the ARM 64-bit architecture. According to ARM compiler documentation, -mfpu flag is rejected by AArch64 state while its alternative, -mcpu, has to be avoided when -march flag is already defined. -mfloat-abi flag is not valid with AArch64 targets.

To support both 64-bit and 32-bit architectures, I proposed to add this new mkspecs.

See:
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfpu
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfloat-abi

Pick-to: 6.3 6.4
Change-Id: I36574875e798281688601edd0f166922592d9830
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-07-14 15:09:34 +03:00
Tor Arne Vestbø
6767ac20c9 macOS: Distinguish between return and enter when inserting newlines
In most situations the originating key event contains the information
we need, but during confirmation of input method composition the text
of the event might be "~\r", in which case the logic we have on macOS
for generating key events will interpret the key press as a tilde,
and we end up inserting "~~" and fail to deliver the return key.

We should probably treat NSEvents with characters > 1 as a special
case and go via the virtual key map in QAppleKeyMapper, but for now
we manually distinguish enter and return by looking at the modifiers.
This works for enter key presses both via the key itself, and via
Fn+Return.

Fixes: QTBUG-104774
Fixes: QTBUG-103473
Pick-to: 6.2 6.3 6.4
Change-Id: I86d30b154867e8e2b6964967ede2bd0dadb83ef8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 14:09:34 +02:00
Tor Arne Vestbø
3ad0f755f5 cmake: Don't reference global data in qt_internal_get_title_case
The only place the function was used was to generate the title case of
a target, so the issue wasn't spotted until now.

Pick-to: 6.2 6.3 6.4
Change-Id: Iee66ecea569e7411c6b5a5e5312cde910a48fa01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 14:09:33 +02:00
Eskil Abrahamsen Blomfeldt
ade2df4c4b Relayout QStaticText when dpi changes
If the cached font has a different DPI than the one used in
QPainter, we need to treat this the same as if other font
properties have changed and redo the layout.

This happened when running the QStaticText test on Wayland,
because the default dpi was 100 and the QPixmap we ended up
drawing to was 96. This caused the pixel size of the font to
be calculated differently when doing drawText() (using 96 dpi)
and drawStaticText() (using the cached 100 dpi).

Pick-to: 6.4
Fixes: QTBUG-100982
Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 14:09:33 +02:00
Tor Arne Vestbø
fef9e0e216 cmake: Work around bug in CMake's Xcode generator setting INSTALL_PATH
CMake will set the INSTALL_PATH for applications to an empty string,
which confuses Xcode and results in application archives that can't
be distributed on the App Store.

https://gitlab.kitware.com/cmake/cmake/-/issues/15183

Pick-to: 6.2 6.3 6.4
Change-Id: Ie19f41c20fdca1e98b368e3ce4cc524c8df0b23b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 10:49:58 +02:00
Tor Arne Vestbø
1d6ce38a82 Explicitly disable bitcode for iOS applications
We disabled building Qt with bitcode in e27a0d5a0f,
but the default in Xcode 13 is still to build applications with bitcode,
leading to build issues when built against a non-bitcode-enabled Qt.

For qmake we already explicitly disable bitcode, so do the same for
CMake.

Pick-to: 6.2 6.3 6.4
Change-Id: I3fd542373c3e1326eb1088a173e70955e61ff608
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 10:49:47 +02:00
Eskil Abrahamsen Blomfeldt
9a45a01a2c Try re-enabling test on Wayland
Running this test on Wayland passes for me, so maybe something
has magically improved.

Change-Id: I161b697c5be96af48938228267cb405048c78852
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-07-14 07:35:33 +02:00
Yuhang Zhao
417bb46352 Windows QPA: Add MSWindowsNoRedirectionBitmap flag
This flag will be useful for windows that only use
3D graphics API to do the rendering, such as Qt Quick
applications.

As a drive-by, fix a typo in the above line.

Pick-to: 6.4
Change-Id: Ic6edcb7610055693734a5d5aff5e906991d4b911
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-07-14 13:00:11 +08:00
Laszlo Papp
331fa5e8d6 CustomStyle doc: fix code indentation
Change-Id: I8ef0ff5a499f796ebf76447caab27ff6b2556570
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 03:16:26 +01:00
Morten Johan Sørvig
5548b940fb wasm: add echo_client_mainthread example
This example connects an echo server running behind
WebSockify, on localhost.

For example, start websockify with

    websockify 1515 localhost:1516

to accept a webscoket connection on 1515 and forward
to echo_server at 1516.

Pick-to: 6.4
Change-Id: Id71364e4ab8c46d3482b515fcd1b991b61d7404b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-14 01:10:56 +02:00
Volker Hilsheimer
d609b20842 QCompleter: make filesystem test robust against slow I/O
Use a signal spy to watch for the relevant signal from the file system
model and wait for that before checking whether the completer responded
to that signal by showing (or not showing) the popup.

If the file system model doesn't fire within the default timeout of 5
seconds, skip the rest of the test.

Fixes: QTBUG-46113
Pick-to: 6.4 6.3 6.2
Change-Id: I9becfe19a220bdb178ed8275c327d55ea19aa342
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-13 22:41:43 +02:00
Volker Hilsheimer
826a98cff1 QProcess: skip processesInMultipleThreads test on emulators
The test has timed out when run on ARM in qemu. We start more threads
than the ideal count, which is likely too much for the emulator when not
running the native architecture.

Pick-to: 6.4
Change-Id: I42e11945070646551e77c10618df762a4bffc8ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 21:02:01 +02:00
Ivan Solovev
4ae85ae441 QSystemTrayIcon: remove unused deprecated call to QAction::associatedWidgets()
This call was added in bcaff2b06f but
does not seem to be necessary. So just remove it.

Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I2068bd10c6de211dd31f09ff978e8b8ba9cb70db
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-13 18:18:30 +02:00
Marc Mutz
12f8b583cf QOpenGLContext: de-inline virtual dtors of private classes
... pinning the vtables to a single TU instead of duplicating them for
every user.

Pick-to: 6.4
Task-number: QTBUG-45582
Change-Id: I728a5c47edaafe7ef4fdca1db8d0247ed4be9713
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-13 18:18:30 +02:00
Axel Spoerl
b36d7076e4 Fix wrong debug output upon creation of floating dockwidget tabs
When a floating dock is created, a qCDebug message is logged to
indicate the hovered dock widget. By mistake, the target pointer to
the floating tab is dumped, which is nullptr at that moment.
This patch corrects the debugging output.

Pick-to: 6.4 6.3 6.2
Change-Id: I317f057ef4b2d8fe508be687152bcede61c22f46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 17:17:01 +02:00
Ivan Solovev
12262adeba Do not use QExposedEvent::region() in internal code
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I5ee41802ecc4d6291aaaa1f0efddd20027c1c1e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 16:45:00 +02:00
Fabian Kosmale
00b46bf4f8 Unicode conversion: Skip superfluous check for QT_COMPILER_SUPPORTS_SSE2
We already check for __SSE2__, which gets undefined when __SSE2__ is not
set.
Moreover, we want to use the intrinsics without a runtime check there,
so checking for __SSE2__ is the correct thing to do.

Change-Id: I7f8610e2927650b439c3697585234b843e345e4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 16:12:15 +02:00
Volker Hilsheimer
92e696b4ba Use debug stream in QTest::toString's default fallback if possible
For built-in types, this is a compile-time assert - we should not have
any types in Qt for which we have neither debug streaming nor a
QTest::toString specialization implemented. A build of most of Qt
submodules passes with this change, after minor modifications to some
tests. We cannot declare QSizeHint::Policy as a metatype after the
QMetaType has already been instantiated for it, and the QDebug stream
operator for QElaspedTimer needs to be correctly declared within the
namespace.

Add a self-test function for a custom type, and update reference files
of the self-test.

Task-number: QTBUG-104867
Pick-to: 6.4
Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-13 15:14:35 +02:00
Eskil Abrahamsen Blomfeldt
3fee97c4ab Skip test which depends on window activations on Wayland
Wayland does not support window activation, so rather than skipping
tests based on platform name, we can use the platform capability
(which will also cover future platforms with the same issue)

Pick-to: 6.4
Task-number: QTBUG-104241
Change-Id: Ibf5f8968f3979b789ef68f92768419bef4500fb3
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-07-13 14:35:03 +02:00
Shawn Rutledge
8d9301b413 Add QInputDevice::name() to output in device_information manual test
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104878
Change-Id: I4299228c90777d71f01c3e2607f8ad4af6e081ed
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Shawn Rutledge
6749d69a15 QXcbConnection::xi2ReportTabletEvent(): get device, check capabilities
In Qt 5, RotationStylus was a device type; in Qt 6, we have the
Rotation capability flag instead. The event does not tell us whether
rotation is valid or not, so to distinguish a valid zero value from
a zero that means it's absent, we need to check device capabilities.
Anyway it's better to get the QPointingDevice instance earlier and
call the newer version of QWindowSystemInterface::handleTabletEvent().

Fixes: QTBUG-104877
Change-Id: I896c02727d586381489f79fd4ebea3451adfa403
Pick-to: 6.2 6.3 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Shawn Rutledge
03a691cecb Change "delivering touch to same window" warnings to debug messages
When you touch-tap a QPushButton, and that opens a popup, it's normal
that the touch release is delivered to the main window rather than the
popup: in fact QWidgetWindow::handleMouseEvent() expects to see a
synth-mouse release. No warning is needed. Amends
efc02f9cc3

There may be other cases when it should have remained a warning (it's
been there since 2692237bb1), but that's
hypothetical at this point.

Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-103706
Change-Id: Ie8cc62af4d173ada5138fd099d9f02bd41f4cff4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Ivan Solovev
593b0a01c5 Remove QStringView metatype declaration
It was required back in Qt 5 times, so that we could use
qvariant_cast<> or QVariant.value() on it. Not required in Qt 6
anymore.

As a drive-by: cleanup some unneeded includes in qstringview.cpp

Task-number: QTBUG-102350
Pick-to: 6.4
Change-Id: Idbcdc5cfe62cf4a55b86e227106d7a997997e0ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 12:52:00 +02:00
Joerg Bornemann
8b5cce6911 CMake: Fix prefix propagation for relocated Qt installations
Consider qtbase built with CMAKE_STAGING_PREFIX=/foo on Windows.
If /foo was moved to /bar, non-qtbase repositories did get a staging
prefix with drive letter assigned.  This is undesirable when DESTDIR is
used on installation.

Change the implementation of qt_internal_new_prefix to remove the drive
letter from the "new prefix" if the "old prefix" did not have a drive
letter.

Change-Id: I6fb17e690b264920b0dd4204e3b3c30794c7e76e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-13 12:52:00 +02:00
Kai Köhne
f71aeea932 Doc: Hide weak overload template magic from documentation
Hide the 'template magic' to implement Q_WEAK_OVERLOAD from the
documentation. So far Q_WEAK_OVERLOAD void foo() lead to

  template <typename> void foo()

in the generated documentation, which is arguably confusing to the
uninitiated. And people interested in implementation details & exact
overload resolution will arguably just read the .h files themselves.

Fixes: QTBUG-104851
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I5e0b1b337b28e621e6a627241aa8037da0a879a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-13 10:51:59 +00:00
Fabian Kosmale
268ff00ef5 QThread: Initialize bindingStatus for adopted threads
If we create a QThread from QThread::current(), we want it to have a
correct value for its bindingStatus. Thus, initialize bindingStatus in
the ctor of QAdoptedThread.

Task-number: QTBUG-101177
Task-number: QTBUG-102403
Pick-to: 6.4 6.3
Change-Id: I3ef27ed62c5dc25eed05d551c72743a1b8528318
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 12:51:59 +02:00
Morten Johan Sørvig
7e0711e0c0 wasm: secondary thread blocking sockets example
Connects to echo_server via websockify, like the async version.

Pick-to: 6.4
Change-Id: I9ed560cd388cfddbd0d284d8d40fb7ddf964ba96
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-13 09:29:28 +02:00
Volker Hilsheimer
43ef22045c Windows: Turn on dark mode support by default
The implementation was already there, and handles theme changes at
runtime as well. However, it was disabled unless the QPA parameter
"darkmode" was set to either 1 (supporting only the frame) or 2 (the
Windows theme also supports dark mode when reading the palette).

With both Windows 10 and Windows 11 now having dark mode as a fully
supported feature that is easily accessible to end-users, we should
respect that setting by default.

So change the default: support both dark window frames and palette, and
let users turn this partially off by setting darkmode=1 or darkmode=0.

This does not mean accent colors etc are fully supported by the Windows
styles.

[ChangeLog][QtGui][Windows] Dark mode, both for the window frames and
for the palette, is now supported by default. It can be turned
off (partially or entirely) by setting the QPA parameter "darkmode=0"
(no dark mode support) or "darkmode=1" (darkmode support only for the
window frames).

Pick-to: 6.4
Fixes: QTBUG-72028
Change-Id: Ia55af101896c106cde21340b306aa81390e608a2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-07-12 23:57:20 +02:00
Christian Ehrlicher
78a574f028 Doc: Adjust widget printing example to not use removed functions
QPrinter::pageRect() and paperRect() were deprecated in Qt5 and removed
in Qt6 without adjusting the snippet.

Change-Id: I7787283ccfeeb94bccf464bfee2bcf82f5d3d930
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-12 23:14:42 +02:00
Laszlo Papp
1d947bf6a4 QKeySequence: Update the doc to KeyboardModifiers
Change-Id: I38411d0240f13488bc37bf4c17964ec9cb07d5d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-12 22:14:41 +01:00
Allan Sandfeld Jensen
4a4a0b6d1f Use QT_CONFIG feature checks for sharedmemory and systemsemaphores
Change-Id: I86d0e4c5f279486f5fd6ef086dd913e813d0186d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-12 22:47:16 +02:00
Mate Barany
dbb3fdafac qdbusxml2cpp: Finish migration to qsizetype
Inspect and change int types to qsizetypes where necessary.

As a drive-by, port from in-the-process-of-being-deprecated count()
to size().

Fixes: QTBUG-103549
Change-Id: Id51d7065eb681d61be517689f89ae488f72edb88
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-12 20:03:54 +00:00
Ivan Solovev
4262e3b6ef QMimeData: fix the usage of a deprecated function
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I85b4aced4db2f1a77e6d0734e082f129b8a263bf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-12 20:43:03 +02:00
Ivan Solovev
12535b0c03 QtBase: #ifdef out definitions of deprecated methods
Some of the deprecated methods didn't have their definitions guarded by
 if QT_DEPRECATED_SINCE(MAJ, MIN)

This patch fixes such cases over all QtBase.

Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I0106128f3a35a30c9f2949819f39076e773559e7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-12 20:43:03 +02:00
Robert Loehning
c0a5f17679 Fix building with "-sanitize fuzzer-no-link"
This partially reverts commit c25a5b4e1f.

We need qtemporaryfile.cpp in the bootstrap library, because qfile.cpp
uses QTemporaryFileName - even if QTemporaryFile has been disabled.

Re-adding qtemporaryfile.cpp does not increase the bootstrap library's
size significantly, because since c25a5b4e1f we have
     #define QT_NO_TEMPORARYFILE
in qconfig-bootstrapped.h, and that disables compilation of
QTemporaryFile but leaves QTemporaryFileName intact.

Pick-to: 6.4
Fixes: QTBUG-103805
Change-Id: I6947ca303edb36fc359bd5d07c1cbd88098905fb
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-12 16:32:38 +00:00
Volker Hilsheimer
0dadb951b5 qobjectrace test: Don't hardcode the number of threads
Use QThread::idealThreadCount instead. This requires that we use
QVarLengthArray, as MSVC doesn't allow us to allocate arrays with a
non-constexpr size on the stack.

By using as many threads as the system has cores, we are more likely
to detect race conditions reliably. On systems with fewer cores (in
particular on qemu platforms like QNX, where this test has been
failing a lot), we'll less likely end up with false negatives due
to timeouts.

Pick-to: 6.4 6.3 6.2
Change-Id: Ie8631aef544ca7b53c06a0729d05459016745486
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-12 17:16:37 +02:00
Laszlo Agocs
7de0f3e9cc rhi: Clean up some inconsistencies
Some of the offsets are already quint32 in the API (vertex input
attributes, dynamic offsets, offsets in draw calls), matching the
reality of the underlying 3D APIs, but many buffer-related functions
use int as of now, simply because that used to be the default choice,
and the same goes for sizes (such as buffer or range sizes). This is
not quite consistent and should be cleaned up if for nothing else then
just to make the classes consistent, but also because no 3D API use a
signed type for offsets, sizes, and strides. (except OpenGL for some)

When it comes to strides (for vertex inputs and raw image texture
uploads), those are already all quint32s. This is straightforward
because most of the 3D APIs use 32-bit uints for these regardless of
the architecture.

Sizes and offsets are often architecture-dependent (Vulkan, Metal),
but there is at least one API where they are always 32-bit even on
64-bit Windows (UINT == unsigned int, D3D11). In addition, we do not
really care about buffer or texture data larger than 4 GB, at least
not without realistic use cases and real world testing, which are
quite unlikely to materialize for now (esp. since we still have the
width/height of 2D textures limited to 16 or 32K in many cases even on
desktops, whereas 2GB+ buffers are not guaranteed in practice even
when an API seemingly allows it).

In any case, the important change here is the signed->unsigned
switch. A number of casts can now be removed here and there in the
backends, because the offsets and sizes are now unsigned as well,
matching the underlying API reality. The size can be potentially
increased later on with minimal effort, if that becomes necessary for
some reason.

Change-Id: I404dbc365ac397eaeeb3bd2da9ce7eb98916da5f
Reviewed-by: Inho Lee <inho.lee@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-07-12 17:16:37 +02:00
Volker Hilsheimer
7b6350fa77 QJniObject: Add template overloads for get/setStaticField
Allow specifying the Java class on which to set/get the field via its
corresponding C++ type, removing the need to explicitly provide the
Java type string.

Those were missing from a085a14d76, which
was noticed when porting QtConnectivity over to the new template APIs.

Pick-to: 6.4
Change-Id: I8f324c9fcc486b4c6c2f2b9051f7eca0cbec0e91
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-07-12 13:25:04 +02:00
Øystein Heskestad
1c563035c7 Disable unit testing setting up QTcpServer on special Apple interfaces
The iBridge interface is used for the keyboard touch bar, and the Apple
Wireless Direct Link interfaces are used by Apple for various purposes.
Setting up a server on these interfaces does not work.
Only the tst_QTcpServer::linkLocal unit test on macOS is affected by
this change.

Fixes: QTBUG-103892
Change-Id: I29701ce51d5e40dff6c59547a8639c1fba330d36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-12 13:24:57 +02:00
Mikolaj Boc
fd45278eaa Specialize MetaObjectForType for non-pointer QObject-derived types
QMetaTypeInterfaceWrapper tries to find the metaObjectFunction using
the MetaObjectForType template. Using SFINAE, for a QObject, it should
resolve to a suitable specialization.

Such a specialization doesn't yet exist. It had to be created.

The following path returns nullptr for registered meta types:

  auto metatype = QMetaType(typeId);
  requestedTestType.metaObject() -> returns nullptr since a bad template
  argument is fed to MetaObjectForType<T> in
  QMetaTypeInterfaceWrapper<IneritingFromQObject>::metaType's static initializer.

Change-Id: I8b31c51e12cb19c333e00480b0177354b910ce1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-12 13:24:57 +02:00
Sona Kurazyan
5e8cc498a1 QDomDocument: add a missing full-stop to a warning message
Change-Id: I3c44afa466cbcb12fc0b44ad8bd1b52ded5f4ddd
Pick-to: 6.4 6.3 6.2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-12 13:24:57 +02:00
Sona Kurazyan
13ca1727f4 QDomDocument: fix the formatting of setContent() declarations
Change-Id: I4f6c29b2c6b8887aaf380b0c7963be2cd0b877e9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-12 13:24:57 +02:00
Sona Kurazyan
6bc227a06a Port QXmlStremReader to QAnyStringView
Port the constructor and addData() method to QAnyStringView, but keep
the overloads taking a QByteArray to avoid extra copies when actual
QByteArray is passed. These overlaods need to be Q_WEAK_OVERLOADs, to
avoid ambiguities (e.g. for const char * arguments).

Additionally, add a test to make sure the patch doesn't break parsing
from a QLatin1StringView input.

[ChangeLog][QtCore][QXmlStremReader] Added constructor and addData()
overloads taking QAnyStringView.

Change-Id: I0efaab82a2123271c88407e380f3c67d1099a4a6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-12 13:24:56 +02:00
Eirik Aavitsland
c78ec50529 Improve widget painting under dpr>1 by enabling smooth pixmap scaling
Smooth scaling of icons etc. give far better visual results,
particularly with fractional dpr scaling. So enable this generally in
QStylePainter, and make more of the relevant widgets use QStylePainter
instead of QPainter directly.

Differences can be seen in the widgets examples, e.g. textedit,
gallery, stylesheet (Pagefold), mdi.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-96223
Fixes: QTBUG-101058
Change-Id: I3c34a455d097e5f6a6a09d3b020528b4fbda4d85
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-12 13:24:56 +02:00
Eirik Aavitsland
9e453dacc3 Fix printing of dpr>1 images on Windows
The win32 printing paint engine copies tiles of the source image into
temporary target images for printing. It does that using QPainter
painting. If there is a difference in DPR between source and target,
the painting will be scaled, leading to distorted results.

Fixes: QTBUG-99990
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie7368655ef3abeece49fb1a6421e2d6ea7ed5e95
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-07-12 09:02:38 +02:00