Commit Graph

61408 Commits

Author SHA1 Message Date
Ulf Hermann
b83de5f9a4 moc: Record types of enumerations
This will be helpful in a number of places, in particular in order to
support enums of different sizes in QML. We record the type as string in
the JSON output and as QMetaTypeInterface in the generated C++.

Task-number: QTBUG-112180
Change-Id: I943fac67f8b25b013d3860301416cdd293c0c69e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-31 17:42:58 +02:00
Mikolaj Boc
ecd7ddcc3e Correctly update the texture in qwasmbackingstore
Both the full-width and partial-width paths in
QWasmBackingStore::updateTexture now correctly compute source and
target rects.

Task-number: QTBUG-112414
Change-Id: I30b0952609960f521119d3d628d2a8036f8b1fe5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-03-31 17:42:58 +02:00
Tor Arne Vestbø
b8f40af176 macOS: Send Qt::NonClientAreaMouseMove for NSEventTypeMouseMoved in title bar
We were missing the NSEventTypeMouseMoved in resolving the event type for
handleFrameStrutMouseEvent, resulting in passing on QEvent::None as the
event type to QWSI.

Pick-to: 6.5 6.2
Change-Id: I144b6459c5d4fda2839d25cd52ddb441dc7c3a47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-31 14:43:09 +02:00
Mikolaj Boc
00f4e5c937 Remove unused code in qwasmcompositor
Some dead code was left after transferring event support to QWasmWindow.
Remove it now.

Change-Id: I40e15bc62bcbb6fff071f53c45223c8a2d12e348
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-03-31 13:33:47 +01:00
Marc Mutz
e2b2bb7ff1 Short live q20::to_address!
An implementation of C++20 std::to_address, a prerequesite for
QSpan<>.

The test cases are inspired by libstdc++'s test suite, just to avoid
missing some cases, but the to_address implementation is white-room.

Fixes: QTBUG-108430
Change-Id: I4c092fdd7a56c0b279068e341bbf91a725ca3b1f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-31 13:10:12 +01:00
Christian Ehrlicher
a1dd9a9f77 CommonStyle/QSpinBox: fix rendering up/down symbols in high-dpi mode
Render the Up/Down and Plus/Minus images for QSpinBox in high-dpi mode.
Found during investigation of QTBUG-112019.

Pick-to: 6.5
Task-number: QTBUG-112019
Change-Id: Ie531311b657180790b0e12a36663012a5f4da6be
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-31 12:10:04 +00:00
Christian Ehrlicher
b46a914bd7 SQLite: Update SQLite to v3.41.2
[ChangeLog][Third-Party Code] Updated SQLite to v3.41.2

Pick-to: 5.15 6.2 6.5
Change-Id: I9e36e54e0d85368f505565b51f45eed8c30d140e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-03-31 13:10:04 +01:00
Tor Arne Vestbø
f037977152 QWSI: Remove handleFrameStrutMouseEvent in favor of handleMouseEvent+type
The handleMouseEvent function already takes a QEvent::Type, where clients
pass in the corresponding mouse press/release/move type. The same applies
to the handleFrameStrutMouseEvent.

To avoid the chance that clients call these functions with a conflicting
event type (handleFrameStrutMouseEvent with MouseButtonPress instead of
NonClientAreaMouseButtonPress e.g.), we remove handleFrameStrutMouseEvent
altogether and just let clients use the handleMouseEvent function directly
with the correct event type.

Change-Id: I4a0241c39aedac0d2d8d5163ba05cde72605959c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-03-31 14:10:04 +02:00
Alexey Edelev
f9594cefef Add the missing list of the generatedHeaders to syncqt_all_args
We need to pass the list of generated files to make the correct
filtering when generating the module master header. Otherwise
generated headers will endup in the module master header.

Pick-to: 6.5
Fixes: QTBUG-112458
Change-Id: Icd20fe5999db379d0eafbff7dad20765e1a96350
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-31 14:10:03 +02:00
Mårten Nordheim
c5c3a7e0db qlalr: add option to error out on warning
By erroring out we can ensure that new warnings are not
accidentally introduced and merged.

As a drive-by: fix indentation of the --qt option. "--dot" needs three
tabs, so "--qt" definitely needs it too.

Fixes: QTBUG-108119
Change-Id: I56107c0744957293338080cf37350f1e1c743093
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-03-31 14:10:03 +02:00
Andrey Butirsky
59fa008275 Revert "Revert "qxkbcommon: Treat XKB_KEY_{Super,Hyper}_{L,R} as Qt::Key_Meta by default""
This reverts commit 101e57d37c.

We have a separate change to fix Qt Wayland Compositor.

Change-Id: Ia00f73c9864921523fed205a813496ab417810a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-03-31 11:26:42 +00:00
Øystein Heskestad
29317b426b Move streambookmarks example into corelibe/serialization
The stream-based XML serialization API resides in corelib/serialization.
Move the steambookmarks example there. The Qt XML documentation is
updated to no longer refer to this example code directly and refer to
the direct location in the example documentation instead.

Task-number: QTBUG-110647
Pick-to: 6.5
Change-Id: Id36fb04a6acb7b8d1eb008f61568fe0abc221e3d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-31 13:26:42 +02:00
Axel Spoerl
a815c40e73 QListView: No-op, when a list item is dropped directly behind itself
QListView generates a move, when an item is dropped directly behind
itself. This causes unexpected behavior, e.g. item widgets getting
discarded.

This patch prevents a move from being generated in that case.

It adds an autotest to tst_QWidget, to verify item widgets and item
data do not get discarded in case of a no-op drag&drop.

Fixes: QTBUG-100128
Pick-to: 6.5 6.2
Change-Id: I02a755320a7b71dad218293c9c94c88da6507423
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-31 13:09:39 +02:00
Mitch Curtis
a94ba94695 Doc: link to QWindow::requestActivate() in more places
Make it easier to find the function that actually gives focus to
windows that need it.

Pick-to: 6.5
Change-Id: I0586b89b42a1be260e36e166c81b686e394d8b5e
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
2023-03-31 18:10:17 +08:00
Marc Mutz
b1b0f42c97 tst_qtconcurrentrun: fix UB (uninit'ed values)
While doubleFunction's body is empty, it takes its argument by value,
which means copying. Copying an uninitialized double is a gray zone
(if you follow the partially-formed paradigma, it's UB; though the std
may allow it some types, most notably std::byte and uchar; probably
not double, though). Converting an uninitialized int into double is
most certainly UB.

Fix by initializing both d and i.

Found by GCC 11's -Wmaybe-uninitialized.

Pick-to: 6.5 6.2 5.15
Change-Id: I103fb72bf4b8792a292346007f498dc6349e9c68
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-31 11:32:46 +02:00
Marc Mutz
1cc1d39f3e tst_QThreadPool: reduce the number of infinite timeouts
... by supplying a TestThreadPool that waitsForDone() with a defined
timeout in the dtor.

When tests hang, this will now print an intelligible message instead
of just the generic watchdog-killed-process one.

Also replace all QVERIFY(waitForDone()) with the same code used in
TestThreadPool's dtor and add a comment in a place we'd rather not use
these tools.

Pick-to: 6.5 6.2
Change-Id: Ifd2b3372eb7c7337a3ba77d003e45dcd77e23545
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-31 11:32:45 +02:00
Marc Mutz
eb260c132a tst_bench_QCryptographicHash: use resultView()
Don't benchmark the creation of the QByteArray from the internal
buffer, that's not interesting.

Call resultView() instead of result().

On the one hand, this skews comparisons with older benchmark data.

OTOH, result() used to be the fastest way to get the result out of
QCryptographicHash or QMessageAuthenticationCode, and now it's
resultView(), so in a way, it still is a fair comparison.

Pick-to: 6.5
Change-Id: I864b2f88f01e426c5d0967f57199e13dd7cb29f8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-31 10:32:45 +01:00
Marc Mutz
0eccfe5e39 tst_bench_QCryptographicHash: port from std::function to qxp::function_ref
Because we can, and because function_ref is never null.

Pick-to: 6.5
Change-Id: If71f98860d72eaa8cf8a93bb3c59a0260d3c7660
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-31 10:32:45 +01:00
Marc Mutz
f1b264f9ac tst_bench_QCryptographicHash: QSKIP unsupported algorithms
With the OpenSSL 3 backend, some algorithms may not be available. Skip
benchmarking them.

Pick-to: 6.5
Change-Id: I1275332993fe15c007410e25acf59f5e3ec27894
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-31 10:32:45 +01:00
Marc Mutz
3aaae083f7 tst_bench_QCryptographicHash: add benchmarks for QMessageAuthenticationCode
We could add a tst_QMessageAuthenticationCode, but it would have to
duplicate a lot of the tst_QCryptographicHash machinery, so just add
it here.

Pick-to: 6.5 6.2 5.15
Change-Id: Icc60de865c72c5e423cb3be57f58297c522791f7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-31 10:32:45 +01:00
Oliver Wolff
3cf1a10e4f windeployqt: Make determineDebugAndDependentLibs more readable
Change-Id: Ib06fb5f2bce9afe1bd799c3ff96abff5ddb063a9
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-03-31 05:16:31 +01:00
Kai Köhne
1ba89e35bd Highlight third-party modules that are security critical
Mark any modules listed as 'processing untrusted content' in
https://wiki.qt.io/Third_Party_Code_in_Qt also in the
qt_attribution.json files.

For reasoning, see also

https://lists.qt-project.org/pipermail/development/2023-February/043667.html

Pick-to: 6.5
Change-Id: Id547d4f7e77dac8c7e8e382e65169e7bd0330fcf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-31 02:10:53 +01:00
Axel Spoerl
7350088ab7 tst_QSslSocket_onDemandCertificates_member: Blacklist Windows & debug
The test function occasionally can fail on CI/Windows, when a
certificate update on www.qt.io requires installing a new root
certificate on the test VM.

This patch blacklists the test class (which has only one test function)
on Windows. It adds diagnostic output, so future failure reasons can
be established from CI artifacts.

Pick-to: 6.5
Task-number: QTBUG-63481
Change-Id: If686d006f379fe6dbfb0d11d80b8455f72fdbb09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-30 17:17:26 +00:00
Volker Hilsheimer
fc319a8f8b Fix QTimer::crossThreadSingleShotToFunctor test
Amends 4d90c4e74a, after which the test
became flaky. We need to wait for the functor to be called before
quitting the thread, otherwise we have no guarnatee that any of the
queued metacall events have been processed by the thread. Since
QThread::quit is thread-safe, we can just call it from within the
functor. This guarantees that at least one of the single-shot timers
is processed before we quit.

And since QTimer::singleShot has special code paths for 0-ms timers
(going through an explicitly queued QMetaObject::invokeMethod call
rather than through an actual QSingleShotTimer object), we need to run
the test logic with different timeouts to cover both code paths.

Task-number: QTBUG-112162
Pick-to: 6.5 6.2 5.15
Change-Id: Ide1e7b4b74dcbda72144a0d73ef5f64b0694ddbc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-30 19:17:25 +02:00
Topi Reinio
816ca43b88 Doc: Use \relates for functions in the global scope
This addresses the recent warnings introduced by a change to QDoc:

qkeysequence.h:32: (qdoc) warning: No documentation generated for
    function 'qHash' in global scope.
qmap.h:1557: (qdoc) warning: No documentation generated for function
    'operator+' in global scope.
qmap.h:1565: (qdoc) warning: No documentation generated for function
    'operator+=' in global scope.
qvariant.h:582: (qdoc) warning: No documentation generated for
    function 'operator>>' in global scope.
qvariant.h:590: (qdoc) warning: No documentation generated for
    function 'operator<<' in global scope.

Also, mark qt_win_hasPackageIdentity() declared in qfunctions_win_p.h
as \internal.

Pick-to: 6.5
Change-Id: Idc9c813370ff3133ac9dc3bf809976b0ece88811
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-03-28 21:13:07 +00:00
Volker Hilsheimer
f177a34836 Doc: Remove stray slash
Pick-to: 6.5 6.2
Change-Id: Ic5e08437e8a5a937ae4f3ea1aa6ca73fd7780c98
Reviewed-by: <safiyyah.moosa@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-03-28 21:15:59 +01:00
Edward Welbourne
496ebd8677 tst_QDateTimeEdit::stepModifierPressAndHold(): tweak start date
The test can collide with a 1960-01-01 transition in some zones, so
move it to Jan 2nd to avoid that.

Pick-to: 6.5
Change-Id: I5286cadc0de0b66283253b0ac736f23a2add0c8f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-03-28 21:40:53 +02:00
Ievgenii Meshcheriakov
7b9e7f8002 complexpingpong example: Modernize the code
Use C++ IO streams and qWarning() instead of (f)printf() for console IO.
Make user-visible strings translatable. Use invokeMethod() instead
of QTimer.

Fixes: QTBUG-111366
Pick-to: 6.5
Change-Id: I6990b964c2097267e04cd361b9cd8fc0a22a0135
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-28 19:42:01 +02:00
Timur Pocheptsov
21a6c86979 iOS: request authorization before presenting image-picker
Right now, image picker view is shown first (it does
not require access to photos, since it's essentially
Photos app getting access to photos ...). Then, we use
AssetsLibrary to get asset for an url (using ALAssetsLibrarie's
-assetForURL method). This may trigger a permission-related alert, asking to:
   a. Select more photos or ...
   b. Allow access to all photos or ...
   c. Deny access.

Showing this alert _after_ picker has selected an image  makes little sense
(and probably was never intended this way anyway). Instead, we now use
Photos.framework to check the authorization and, if needed, we request
an authorization (when the current status is 'Nondetermined'). If authorization
is 'Granted' as a result, we show picker view and proceed as normal/before.

Pick-to: 6.5
Task-number: QTBUG-109120
Change-Id: I0acfd7b0476346360d75a5e37f5845aaf2d6e3e0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-28 18:37:36 +02:00
Tor Arne Vestbø
b4afba0c34 Windows: Send synthetic mouse release after move/resize using right API
The end of a move or resize might happen with the mouse still inside
the non-client area of the window, in which case we correctly resolved
the type to QEvent::NonClientAreaMouseButtonRelease, but we sent it
via QWindowSystemInterface::handleMouseEvent, which sets nonClientArea
of the event to false. This in turn resulted in QGuiApplication sending
a synthetic QEvent::MouseMove in case the position was out of sync,
instead of the correct QEvent::NonClientAreaMouseMove.

This should really be cleaned up on the QWSI level, as there is no
reason to have a dedicated API for handleFrameStrutMouseEvent, when
handleMouseEvent already takes an event type, but for now we fix the
immediate issue in the Windows platform plugin.

Pick-to: 6.5 6.2
Change-Id: I8a831f5f19adb0625b29b50ebce9c0c6514e93f3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-03-28 16:31:18 +01:00
Mikolaj Boc
d34259d966 Stop propagation and default action on WASM window pointer event
The windows should not let events through to targets below (unless
they are Qt::WindowTransparentForInput, which is handled
independently). Therefore, stopPropagation and preventDefault are
now called regardless of whether the window has handled the event
or not. If the event is not handled explicitly, we still consume the
DOM event so that the windows/elements below don't get focus by
mistake.

Fixes: QTBUG-111706
Change-Id: Idc78ac5076e97992d9f6f13a1fa574d0df4178ac
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-03-28 16:31:17 +01:00
Tor Arne Vestbø
f3e27d3688 Pick up initial state of foreign windows instead of reflecting QWindow
A foreign window can be used both for embedding a Qt window into a
native window hierarchy, or for embedding a native window into a Qt
window hierarchy. In the former case, we should not modify the foreign
window in any way. Since the platform does not know anything about the
intended use case at the time of the foreign window creation, it should
avoid modifying the foreign window in any way, and should instead pick
up the foreign window state and reflect that through QWindow.

Pick-to: 6.5
Change-Id: Id2e39d101277ecebd656d615cea3e7f734a4b0a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-28 16:31:17 +01:00
Tor Arne Vestbø
b64b0c7947 macOS: Don't try to create or manage NSWindow of foreign windows
A foreign window is a single NSView, and unlike our QNSView, where we
in addition manage a NSWindow for top level windows we should treat
the foreign window as just an NSView. It's not our place to neither
create nor dispose of any NSWindows attached to the foreign window.

Pick-to: 6.5
Change-Id: I88aa796c679be0489abf4999829d1378ba054bdc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-28 16:31:17 +01:00
Tor Arne Vestbø
aab71c7bb8 Ensure QHighDpiScaling::set(Screen/Global)Factor() results in QScreen signals
Change-Id: I328b288b3fd83df0cc81c62bce1d946f90f1cd0d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-03-28 17:31:17 +02:00
Tor Arne Vestbø
3a2277cb63 Align QWindowSystemInterface::handleScreenAdded() and handleScreenRemoved()
Having the logic of handleScreenRemoved() inside the QScreen destructor
was making it harder to follow the flow of adding and removing screens.

As screen management should always go though the QWSI functions, we keep
the logic there.

Change-Id: I456e77eb8fc10feae7b1f9994b25c9534ea4e430
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-28 17:31:17 +02:00
Tor Arne Vestbø
2187936978 Remove indirection via QScreenPrivate::setPlatformScreen()
The QHighDpiScaling code should call the explicit updateGeometry
function instead to re-evaluate the platform screen geometry in
light of the change to the scale factor.

Change-Id: Idac975c117c431356f4fb812c245348c4722a8b5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-28 17:31:17 +02:00
Alexey Edelev
c4debab927 Introduce QTP0002 policy for android-specific target properties
The policy controls the behavior of the android-specific target
properties that specify paths.

The OLD behavior of this policy doesn't allow generator expressions
in the target properties that specify android-specific paths but
implicitly converts the specified paths to the valid JSON strings.

The NEW behavior of this policy allows using generator expressions
in the target properties that specify android-specific paths but they
must evaluate to valid JSON strings.

[ChangeLog][Android] Target properties that specify android-specific
paths now support generator expressions, but these generator
expressions must be evaluated to valid JSON strings. The behavior is
controlled by the policy QTP0002. The OLD policy behavior is deprecated
and the NEW behavior is preferred for use.

Fixes: QTBUG-107988
Change-Id: I8484c4b5d5ace25eb04f8bc8a79ddbaa9a79b19b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-03-28 16:10:40 +02:00
Friedemann Kleint
a92a2a050a Update Qt logo
Pick-to: 6.5
Change-Id: I37e75193ab0e28db03ff83c72c9493bb52c36085
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-03-28 15:45:24 +02:00
Ahmad Samir
396e6daea4 CMake: add some docs for qt_find_package
For -developer-buildS qt_find_package caches which packages were found
on the first configuration, to make the build system pick up a newly
added qt_find_package call one needs to follow one of the methods
that are now mentioned in the docs.

Hugely based on commit message from commit
6847a19e3e.

Change-Id: I4a13d3c97a6172f504a57298c4b3edee30d21250
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-03-28 15:45:24 +02:00
Mikolaj Boc
80c1406371 Remove the redundant QWasmCompositor::requestUpdateAllWindows
Now that the browser compositor is used for rendering windows, the
method has become redundant, as windows that got resized during screen
resize will schedule their updates directly with the compositor.

This also fixes an assertion in QPlatformWindow::hasPendingUpdateRequest
as no windows without pending update requests will now have update
requests delivered.

Also offers a significant speedup with multiple restored window setups.

Fixes: QTBUG-112289
Change-Id: Ie5dff69c04d66c4aef8351adef0da8530daf7ab8
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-03-28 13:45:24 +00:00
Axel Spoerl
c4b62ee501 QComboBox: reset indexBeforeChange to -1 if index is invalidated
The member variable indexBeforeChange is member-initialized with -1 and
changed to the current row, if a valid index is set.
It is used to check, if the model has been reset to an empty model
and/or the index has been invalidated. The result is used to decide, if
the currentIndexChanged signal is emitted or not.

If a combo box had a valid index and it is invalidated afterwards
(e.g. because the combobox has no more entries), indexBeforeChange is
not reset to -1. The redundant signal emission is therefore prevented
only the first time.

This patch resets indexBeforeChange if the index is invalidated or the
last item is removed from the combo box.

It also adds a no-op check to tst_QComboBox::currentIndex.
The test data sets "check that setting the index to -1 works" and
"check that current index is invalid when removing the only item" check
the respective use cases.

As a drive-by, variable names and QObect::connect syntax have been
cleaned up in tst_QComboBox::currentIndex.

Fixes: QTBUG-108614
Pick-to: 6.5 6.2
Change-Id: Ib6dfa887d9247f2c47df065039d69ba57c32fa24
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-03-28 14:45:24 +01:00
Tor Arne Vestbø
c4f59f96b9 macOS: Simplify child window parenting in recreateWindowIfNeeded()
The logic for this should ideally be handled in setParent(), but
for now let's clean up the code a tiny bit.

Pick-to: 6.5
Change-Id: Id2370d6704625038ab6b4fa246dea5d1c037371c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-28 13:22:11 +01:00
Tor Arne Vestbø
a4bd121125 macOS: Create NSView as initially hidden, to match QWindow behavior
Initially attempted in 096b56f336,
but that broke QQuickWindow::grabWindow(), which at the time was
not prepared for grabbing non-visible windows.

This is no longer an issue, as QQuickWindow::grabWindow() has fallback
logic for non-renderable windows. QWidget::grab() also works fine,
as it grabs from the backingstore directly.

For top level windows we apply the visibility state to both the
NSWindow (orderIn/Out), and to the NSView (hidden=YES/NO).

Pick-to: 6.5
Change-Id: I617b292ca6bfba66e65b55941c5b002e415da88d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-28 13:22:11 +01:00
Tor Arne Vestbø
6736118b8c Guard QTabBar against nested event processing during moving tabs
If moving tabs results in nested event processing by the user's
code in response to the tab index changing, the mouse release
event might have been processed already, and the pressed index
is reset back to -1.

Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-74478
Change-Id: I9696b10a6218456ab381ffe3a65ea471cfa42413
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-03-28 13:22:11 +01:00
Antti Määttä
5ad1ea092e CTF: Use Q_DISABLE_COPY for QCtfLib
Pick-to: 6.5
Change-Id: Ife1d0670486ac0820b53c9e015249115685e4997
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-03-28 13:05:14 +03:00
Antti Määttä
ebdf20240c CTF: Fix QTRACE_LOCATION warnings during compilation
When compiling with CTF tracing, QTRACE_LOCATION not set warnigs are
printed constantly. Fix this by changing the log to info and default
log message level to warning.

Pick-to: 6.5
Change-Id: Ib167ec1b41ff0134fa9b3eba09394bb0bef54379
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
2023-03-28 13:05:14 +03:00
Christian Ehrlicher
e9512c46da QFusionStyle: adjust painting of separator in QSpinBox
When use a very high devicePixelRatio (for testing I used 5.23) one
could see that the separator in the QSpinBox was not long enough.

Pick-to: 6.5
Change-Id: I3a86c5bb695c95051b8b9294ca8a2749a8c3f9eb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-28 10:45:01 +01:00
Joerg Bornemann
3b234eefef Doc: Clarify what's deployed by qt_deploy_runtime_dependencies
Mention that non-Qt libraries are deployed on Linux.

Pick-to: 6.5
Task-number: QTBUG-111741
Change-Id: Ia5737d7a2d53925939910b5f96933f4bb380ed05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-03-28 11:34:14 +02:00
Morten Sørvig
9a39b3c796 Apply ScaleFactorRoundingPolicy to QT_SCREEN_SCALE_FACTORS
QT_SCREEN_SCALE_FACTORS is in many cases set on behalf of the user,
instead of by the user, so we should apply the standard app
scale factor policies to it, instead of interpreting it
as a user override.

Specifically, make it subject to the rounding policy set by
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(). This
means that applications which support integer scale factors
only will see integers only, also when QT_SCREEN_SCALE_FACTORS
specifies a fractional factor.

Users who want to override can set

  QT_SCALE_FACTOR_ROUNDING_POLICY=PassThrough

to restore the default Qt rounding behavior.

[ChangeLog][QtGui] The high-DPI scale factor rounding policy (settable with
QGuiApplication::setHighDpiScaleFactorRoundingPolicy() or
QT_SCALE_FACTOR_ROUNDING_POLICY) now applies to scale factors set
with QT_SCREEN_SCALE_FACTORS.

Fixes: QTBUG-95930
Fixes: QTBUG-99546
Change-Id: I936e96671fe2a0a43c3e8129f0768875cb011103
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-28 09:14:09 +00:00
Morten Sørvig
2d76f991d0 Fix QT_WIDGETS_HIGHDPI_DOWNSCALE
The source rect scaling implemented in 79bead6c was incorrect
for child windows with an offset, and was reverted in commit
d59b2fde, after causing QTBUG-107814.

Scale the window rect by the source device pixel ratio to
get the source rect. This source DPR can be different from
the (target) DPR when HIGHDPI_DOWNSCALE is enabled and
will then be a rounded DPR value.

Pick-to: 6.5
Fixes: QTBUG-111102
Task-number: QTBUG-107814
Change-Id: I59801bc22c47fc83d63ae4d96e509ab7fffeb760
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-28 09:14:09 +00:00