Commit Graph

68865 Commits (be2e37f85a7844d5b3d7f3bb33fe4f14b1675ab0)

Author SHA1 Message Date
Alexandru Croitor be2e37f85a coin: Remove dead code that used to build host Qt in a cross-build
We don't build a host Qt during a cross-compilation build for a few
years now. Instead we reuse the prebuilt host from the platform
dependencies. This was left over to allow gradual porting to the new
way of using platform dependencies, which is now long done.

Remove the code to ease maintenance.

Amends 684fea1314

Change-Id: I9988da6f33f9d9b98d304316317d39c3dfb7c633
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bb3ce6989eb90c0a8142c158a05eb237dfa8f032)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-08 16:46:35 +00:00
Simo Fält 2822db26be CI: Set SBOM_PYTHON_APPS_PATH env variable only if not set already
Change-Id: Ie8849721ff576079d708412c441cdf4830dbe427
Reviewed-by: Toni Saario <toni.saario@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit cfa106c7d48167c1ae36dd56391de801758a0383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 18:50:13 +00:00
Santhosh Kumar be974c4855 Avoid referring to invalidated observer during binding evaluation
The property observer reference used during binding evaluation can
become invalidated as the container used to maintain the
the observer would invalidate the existing observers during its
resize, leading to referring to invalid memory.

Recognize that we do not need to store the observer, but only its
binding - the observer itself is not used later.

Therefore, change the PendingBindingObserverList to become a list of
QPropertyBindingPrivatePtr to avoid the issue.

Fixes: QTBUG-127596
Original-patch-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Pick-to: 6.5 6.2
Change-Id: I8c97721ca563083d6280194175f8a915dac2ff04
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 275202215376238bf414d5008d3c727085e58a4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 17:26:50 +00:00
Laszlo Agocs c60505140d Fix typo in rhi doc snippet
Change-Id: I51ca55edf328a56154ab6420674755db94da5b7d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 9b9b3cdf36ad61c835059f0bf3cb47b8909ffe86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 14:49:00 +00:00
David Faure 9f11db1855 QTableWidget: assume column 0 when dropping a row below another one
When dropping at a column > 0, the deserialized data wrapped around,
leading to multiple rows being inserted instead of just one (and
column 0 remained empty). Very weird behavior from the user's point of
view.

Drive-by whitespace changes due to clang-format.

Fixes: QTBUG-1387
Change-Id: I8d1dc14c124e468454e98ea6a14f33e3bef6e41a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ff8068deb45e45eb683745486956d3c6c795a708)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 12:30:28 +00:00
Jøger Hansegård ac81827ed8 Add WS_CLIPCHILDREN style to native window in embeddedwindows test
When a native/foreign window is used as a parent, its WS_CLIPSCHILDREN
style should be enabled. If it is not, the parent will paint on top of
the children and cause flickering. It is not Qt's responsiblity to
adjust the styles of foreign windows, so instead we document this in the
manual test.

Change-Id: I84bc25668d702c3475dfbd75a94dd3ed43a1695c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a645128c296756ea6c7e70259958a0d000d029e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 12:30:27 +00:00
Alexey Edelev 839695567f Trigger reconfiguring of android ABI projects when CMake files changed
Remove the stamp files of 'configure' step to ensure that we re-run
cmake for android ABI projects, otherwise the per-ABI projects do not
consider the changes in CMake files when re-running the build.

Task-number: QTBUG-129358
Change-Id: I5b5c682358052044a9e550587ed0457694857e09
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 87930bb568018cc40ccd30babb42c8701e1d030c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 12:03:32 +00:00
David Faure 52c908fdb5 QAbstractItemView: implement full-row drop indicator
When the selection behavior is SelectRows, we're dragging full rows,
so it was very weird that the drop indicator was showing a single
column. Instead, expand the drop indicator over all columns.

This is typically for QTreeView but it also works for a QTableView where
a single row represents a single underlying object (otherwise, why use
SelectRows?).

Since we're testing the selection behavior of the drop side, not
the drag side, only do this when inserting rows, or (for OnItem) when
they're the same widget.
There's a use case for dropping single properties (from a different widget)
onto specific columns of full-row objects (there's also a use case for
overwriting the whole object but we can't know which one it will be...).

Fixes: QTBUG-1656
Change-Id: Idde0f4f8592970339f19dcc11ba667cf12677438
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a818326985295ba1cf1b31043b24e9f089b1d834)
2024-10-07 11:52:41 +02:00
Even Oscar Andersen 4bda9b977e wasm: Handle theme colors
Changing color themes did not work since the results from
qt_fusionPalette is cached by default.

The solution is to track changes and call qt_fusionPalette
when necessary.

Fixes: QTBUG-129399
Change-Id: I77824098349be5e5264fa9e230a949e3ccd6f14f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ff645479e7489de5a88c71c0215748d84be3de9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 09:52:41 +00:00
Assam Boudjelthia ca304ec1bf Android: delete androidContentFileEngineHandler in terminateQt()
Similar to other Android file engine handlers.

Change-Id: I63591e09312e439eee1e7bdd71a65d3df4cefbae
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit cd5d30fa3368ab9cf995ed934ea737f3e569e9ce)
2024-10-07 07:25:34 +00:00
Bartlomiej Moskal 258d90222d Android: Catch nullPointerExcetion for parentLayout
Add exception handling for non-existent parent for m_editText in
EditPopupMenu

Pick-to: 6.7
Change-Id: Ie01e1346185b494c1ac646ccfa9ed4a96c4ed85e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e39ea199167270971f45ab6c4b9c2c6c66b4b2ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 20:21:29 +00:00
Bartlomiej Moskal 5ee47a970a Android: Override new methods in InputConnection
InputConnection interface got new method like [0]replaceText and some
overloaded (setComposingText, setComposingRegion and commitText) that
need to be override by QtInputConnection

[0]https://developer.android.com/reference/android/view/inputmethod/InputConnection#replaceText(int,%20int,%20java.lang.CharSequence,%20int,%20android.view.inputmethod.TextAttribute)

Task-number: QTBUG-120238
Pick-to: 6.7
Change-Id: I72a35ff6bf8cdc10d782b24efb6c99b92b33926d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dbd5af6231c9182ef370eca2e06c485591d715b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 20:21:25 +00:00
Christian Ehrlicher dc124f2069 QCommonStyle: pass orientation to PE_IndicatorProgressChunk
When drawing the chunks for the progress bar, we now have to pass at
least the State_Horizontal bit because the orientation member of
QStyleOptionProgressBar was replaced with this state bit.

Pick-to: 6.7 6.5
Fixes: QTBUG-129386
Change-Id: Ibc8b6b315609cdd1a6f949ae2116728b7c6bded8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d399bdddc6e71617e045fc77e70abef3ed2ee006)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 19:54:48 +00:00
Christian Ehrlicher 5e8feb69df CMake/sql find modules: read foo_ROOT env var if available
Even though we set foo_ROOT in the provisioning scripts and CMake is
picking it up as the base dir, we should also use it as CMake variable
so we can look in other directories below foo_ROOT.

Change-Id: I193d8ff1c216a669162569d71891c3eb7b9b030f
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c68277c41b99d6791e3c1a5998b70c6cbbf6dc15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 19:54:43 +00:00
Christian Ehrlicher 85af817469 QButtonGroup: make sure to always auto-assign negative ids
QButtonGroup::addButton() automatically assigns a negative id when no id
is given. This logic did not work out when a button with a positive id
was added beforehand.
Add a check to make sure to always return an auto-assigned negative id.

Pick-to: 6.7 6.5
Fixes: QTBUG-129398
Change-Id: Ieadfa44c4b145184a5473713591f4c111a5dafa4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 772d374ce715de9caaae4f026594d49f6da28dec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 19:54:41 +00:00
Thiago Macieira 20bf08f012 QStorageInfo/Unix: reset the valid state when doStat()ing again
If the user calls setPath() or refresh(), we are going to stat the
storage again. But neither retrieveVolumeInfo() nor initRootPath() unset
the flag if the storage became invalid.

This can't be tested automatically.

Fixes: QTBUG-129689
Pick-to: 6.5 6.2 5.15
Change-Id: I8d4c5b4ed563e89f5723fffd2f550b169bb20884
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit e55d7fa1e09efc86e797efdf00656891f640d81d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 19:24:36 +00:00
Christian Ehrlicher 8058a77340 Windows11Style: cleanup CC_ScrollBar
Cleanup CC_Scrollbar:
 - call subControlRect() only when it's really needed
 - use QStringLiteral to create static strings
 - calc rects only when really needed and then directly in one step

Change-Id: Ibe7944feb813ef3e7f6aea976579d192bafbcce9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ffa0e9c19c3cdf3b299357dd263e7413010a62a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:43 +00:00
Christian Ehrlicher 55a8806e22 Windows11Style: cleanup CC_SpinBox
Cleanup CC_SpinBox a little bit
 - avoid unneeded QPainter::translate()
 - avoid uneeded QPainter::save/restore()
 - don't modify frameRect when not needed
 - merge up and down drawing to avoid code duplication
 - use QStringLiteral to create a static string

Change-Id: Id8bc8d5085b6681b48ea3388941d21a11c0345ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5cd4434389870d43baa1325ba97c5776baff65f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:37 +00:00
Allan Sandfeld Jensen cfeb85e877 Correct BGR888 tests
Was accidently using RGB888

Change-Id: I4afaf7a96e6fb7a696f0ce4f35a94babd79d3d07
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit fc0d9b2033d4914c35fa9350dde641d76e581903)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 14:16:24 +00:00
Thiago Macieira 30d40a8890 Remove dead code in checkRdrndWorks() if __RDRND__ is defined
The only place where we call qRandomCpu() in qrandom.cpp is guarded by a
check using qCpuHasFeature():

    if (qHasHwrng() && (uint(qt_randomdevice_control.loadAcquire()) & SkipHWRNG) == 0)
        filled += qRandomCpu(buffer, count);

static inline bool qHasHwrng()
{
    return qCpuHasFeature(RDRND);
}

Since qCpuHasFeature() also checks if __RDRND__ was defined, we ignore
the result of checkRdrndWorks().

Users of CPUs without RNG must compile with an -march= flag that doesn't
enable it or must pass -mno-rdrnd to keep the runtime detection code.

Task-number: QTBUG-69423
Task-number: QTBUG-129193
Change-Id: Ib7819f80041fe330d033fffda7e7c160141d7dd8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6543f50536f3547b43a27b32af59d68f28a60247)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 20:42:51 +00:00
Richard Moe Gustavsen f0758fb113 QMenu: don't trigger a menu item if the mouse didn't move
If you right-click to open a context menu, followed by another
click to close it again, without moving the mouse, it can
happen that the menu item under the mouse will trigger.
This is especially prone to happen if Qt has a large scale
factor and the number of menu items is high, since then the
menu has to move a bit up to make room for as menu items as
possible on the screen.

This patch will reuse the already existing hasMouseMoved()
function to avoid triggering a menu item if the mouse hasn't
moved. This will make sure that the user won't trigger a menu
item by accident when instead trying to close it.

Fixes: QTBUG-128359
Pick-to: 6.7 6.5 6.2
Change-Id: Ie4d73ee2031d1159dd6c003124869004b4928d18
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit dc1d3abd7e852829b9bc81c1ba9565f40147402d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 16:01:44 +00:00
Bartlomiej Moskal e3bea87ee3 Android: When setting new parent for childView remove old one
A view cannot have two parents. If the view already has a parent, you
must first call removeView() on the child's parent.

Fixes: QTBUG-129524
Pick-to: 6.7
Change-Id: I6a8340ed8db58a77626be17366d5c71bdfc8c762
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit ecd4623f05abf419db6f0c3bdad406c1883b6509)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 16:01:43 +00:00
Allan Sandfeld Jensen 68c22bd7d3 Avoid -Wstringop-overread by using a view with encoded length
For some reason the suppression stopped working for me, but using the
viewAt function is better in general as it doesn't depend on null
termination.

Amends da84941375 (viewAt() was added by
2c2c6de85a for 6.3, so we can use it in
all affected branches).

Pick-to: 6.7 6.5
Change-Id: Ic71bd559929a2cd0cdea4ed1cc1edcfc583865ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cec64aaf2a8e110421d61478b9ad0cb177ee0d1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 15:28:19 +00:00
Alexey Edelev 348d56cca4 Reestablish the dependency chain between Android ABI-specific targets
Actual dependency chain doesn't consider the changes in Android
ABI-specific targets. To make sure we rebuild per-ABI targets this
changes the dependency chain, which looks as following now:

 - <target>_make_<apk|aar|aab>
 - <target>_copy_apk_dependencies (new proxy order-only target)
 - qt_internal_android_<abi>_<target>_copy_apk_dependencies
 - qt_internal_android_<abi>_<target>_copy_apk_dependencies_stamp
 - qt_internal_android_<abi>_<target>_build_stamp
 - <target>

So the <target> dependency on the per-ABI build targets is reversed,
to guarantee that per-ABI targets react on source changes.

Fixes: QTBUG-129358
Change-Id: Id4d5fb0d45a213cd49c8a6aefa72c5db6609d714
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
(cherry picked from commit 44149f9d8b62b5343a5d06628b0c9588f035ccc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 13:12:18 +00:00
Tuomas Vaarala 305b461157 Enable platforminputcontext in QNX QPA without PPS
Platforminputcontext is needed for Qt Virtual Keyboard to work thus it
needs to be enabled without to condition to PPS. PPS is removed in
QNX 8.0 and the condition would never be met. It is safe to enable
platforminputcontext without condition for QNX 7.x as well since it is
needed for Qt VKB anyways.

Fixes: QTBUG-129436
Change-Id: I82230d1411e54713a2dabadf5a8dff3ca5455fbb
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 4d908a3b5e305462bf7e234db0fe1e42e866e8ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 11:03:34 +00:00
Doris Verria 3b1951cd1b QWidgetWindow::setFocusToTarget: Respect focus policies and proxies
When calling QWidgetWindowPrivate::setFocusToTarget with Prev or Next
target parameter, we were just setting focus to the
next/prevInFocusChain() of the window's focusWidget(). This will bypass
focus proxies and focus policies of the widget, which is wrong as it
can end up giving eg: tab focus to a widget that does not have such
focus policy.
To fix, we should instead call QWidget::focusNextPrevChild which
determines the right next/prev in the TAB focus chain. As this is a
protected member of QWidget, implement a "wrapper" for it in
QWidgetWindow which is a friend class of QWidget.

Task-number: QTBUG-121789
Change-Id: I1f4f5d85e7552926580906fdef6f0a456fe7486c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
(cherry picked from commit 926d3287aba9fe2b67c25d0c0c5b606f3f41803e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 11:03:34 +00:00
Tuomas Vaarala 5e090d4b9b Ignore screen create events for other than window object type
Previously the screen create event was only handled for window.
With QNX 8.0 there seems to be also screen create events for display
and device. The property query returns ENOTSUP (Not supported) so we
simply ignore other than window create event.

Fixes: QTBUG-129213
Change-Id: Ia7da693f06f6590d349595ecde6b303fab145bc0
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 11d5792774e921a7d6e296b1238f9e9c96ddfd96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 11:03:33 +00:00
Liang Qi a506d6bd88 tests: blacklist tst_QSizeGrip::hideAndShowOnWindowStateChange()
on Ubuntu 24.04 GNOME Wayland

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-129361
Change-Id: I5291439dd9e1ba78cf403a0272ecbd8c83d2f94f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 649794fddf9c1d1c96b271de3b29b3b67593dff6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:07 +00:00
Liang Qi 8719c2f784 tests: use qWaitForWindowFocused() instead of qWaitForWindowActive()
This depends on 9eb06a2848 .

This follows bc7821764b4d50fbb4e0ca1b84f85980ce15eeb0 and
5709baea2c261f77f955ab76c074a39c9c3993aa.

There are lots of work to remove QApplicationPrivate::setActiveWindow()
in test code, see also QTBUG-121488. We need to adapt them for Wayland.

Task-number: QTBUG-125446
Task-number: QTBUG-121488
Change-Id: I093568c1d89de31c3893d3c7b139f1db33579633
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f42979cf6937c78c412fcfa25ec011fb66b48132)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:05 +00:00
Liang Qi faff79d59e tests: blacklist tst_QWindowContainer::testFocus() on Wayland
Task-number: QTBUG-129292
Change-Id: I1b0dfae10b7b0f5348605121da1903d9c7247dba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7039232c2e4c623b341461526a22f775b1196882)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:04 +00:00
Liang Qi d10181d37c tests: blacklist a few tests on Ubuntu 24.04 GNOME Wayland
* tst_QListView::styleOptionViewItem()
* tst_QTreeView::styleOptionViewItem()

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I4136a97441870a769814a483c0f91aeacd830651
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5d71f4680df30674b8615b9b9a6b418f0a1c0864)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:02 +00:00
Liang Qi d3780f2444 Revert "xcb: handle XI2 input button and motion events from slave devices"
This reverts commit b71be292780b858f2c55ce92601452e2ea946de2, which causes a regression when using mouse wheel and moving cursor together
on scroll bar for some qt applications, like qutebrowser and
qbittorrent.

Fixes: QTBUG-129509
Fixes: QTBUG-129514
Task-number: QTBUG-110841
Pick-to: 6.8.0 6.7 6.5 6.2 5.15
Change-Id: I703158874413a1306ea99217bced4ba38382f543
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5875da6d70303468eab85030a80f54c268f80b79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:01 +00:00
Liang Qi 18a24eabbe tests: skip tst_QWidget_window::tst_dnd_events() on u2404 x11
Task-number: QTBUG-129567
Change-Id: I108a468033a9579b07a379470a43aa94d5cf9ec0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit c851602020cd564d42c9721eb19888471a11107c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:36:59 +00:00
Liang Qi 8b21bf2ae2 tests: blacklist tst_QWidget_window::mouseMoveWithPopup() on u2404 x11
Task-number: QTBUG-129568
Change-Id: Ie1d9fc7e32c0766d55324aae0dbd07218ac8599f
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c5ee1f68c02ca3942c94f246fba56ef4ffe7f229)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:36:57 +00:00
Thiago Macieira 4374f3ce41 tst_QDnsLookup: don't add duplicate 'nameserver' lines
I don't know why systemd-resolved did have those for me, but it did, so
QtTest complains.

QWARN  : tst_QDnsLookup::setNameserver() Duplicate data tag "..." - please rename.

Change-Id: I8df70eb429682b529ecefffd0aca735f94d77225
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1420ee85165c03bac2aa1678b295f7b1ebe44f51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:03 +00:00
Thiago Macieira c2df419edf tst_QDnsLookup: add the ability to specify an alternate default server
For people running this test who are burdened with a broken DNS server
and for whom the check added in the previous commit fails, skipping the
test.

Incidentally, this is useful for developing QDnsLookup itself, because
some otherwise-reasonable servers are known to fail for some queries.
For example, dnsmasq doesn't like queries of type ANY:

SKIP   : tst_QDnsLookup::lookup(any-a-single) Server refused or was unable to answer query; a-single type ANY: Server failure
SKIP   : tst_QDnsLookup::lookup(any-a-plus-aaaa) Server refused or was unable to answer query; a-plus-aaaa type ANY: Server failure
SKIP   : tst_QDnsLookup::lookup(any-multi) Server refused or was unable to answer query; multi type ANY: Server failure

Now I can get it to pass with QTEST_DNS_SERVER='[2001:4860:4860::8888]':

PASS   : tst_QDnsLookup::lookup(any-a-single)
PASS   : tst_QDnsLookup::lookup(any-a-plus-aaaa)
PASS   : tst_QDnsLookup::lookup(any-multi)

Note for the future: setting a non-default server may exercise different
code paths inside QDnsLookup, so this is not a replacement for having
proper DNS servers in the CI.

Fixes: QTBUG-129335
Change-Id: I81dcd4834972efa84c9ffffdd8aaafb68f20560b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 10fea78bdcad2086c980fa1c1bbcd5bb543e4366)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:01 +00:00
Thiago Macieira 5ce4677f2e tst_QDnsLookup: check for DNS server sanity
Instead of failing tst_QDnsLookup and blaming the class for problems,
let's first verify that the resolver can resolve an address. If it can't
and we're not in the CI, then just skip the test.

I chose "a-multi" because a) it required the least variability in the
command-line and b) it has more than one RR in the RR set so it may find
more problems than "a-single".

Output when I forced a domain that doesn't exist:

QWARN  : tst_QDnsLookup::initTestCase() Default DNS server in this
system cannot correctly resolve "a-multix.test.qt-project.org"
QWARN  : tst_QDnsLookup::initTestCase() Please check if you are
connected to the Internet.
QDEBUG : tst_QDnsLookup::initTestCase() Output was:
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find a-multix.test.qt-project.org: NXDOMAIN

SKIP   : tst_QDnsLookup::initTestCase() DNS server does not appear to
work

Task-number: QTBUG-129335
Change-Id: Id2dcc2ce7cfdd83c556ffffddb88a1f1b4339606
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 40986460e3f372cdb42ad80377455dc43b7cdb42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:00 +00:00
Thiago Macieira ea871ee2e2 tst_QDnsLookup: don't require "localhost" to resolve
It must for QHostInfo, but DNS servers are not required to have that
label. It appears to be a good practice the majority of admins follow,
but it's not universal, so we cannot require it.

But if it does resolve, then RFC 2606 requires it resolve to 127.0.0.1.

Task-number: QTBUG-129335
Change-Id: Ib3b11de6616665658a20fffd754f2fbd78780b1c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 252bd7c67ce7a0ed3c41059f551f87f0f77b5606)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:42:59 +00:00
Thiago Macieira cff3026140 QMetaProperty: fix type-punning of QFlags in write() from QString
Amends commit 46f407126e ("MetaObject:
store the QMetaType of the properties"), from 6.0 cycle, which made
QMetaProperty::{read,write}() use the actual enum type in the
QVariant. But it missed the case where the input QVariant contained a
string with the enum's values.

Note this is *not* a type-punning in all cases: if the type of the
property was marked as a Q_FLAG, moc generates code to access it as
int. That is fixed in the next commit.

Drive-by compare QMetaTypes instead of their IDs, which avoids
generating a call to register them.

Pick-to: 6.5
See-also: https://lists.qt-project.org/pipermail/development/2024-September/045636.html
Change-Id: I1cfce869090c96bb41b6fffdc20855cfa7cb2a18
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 1f9ab3767ed625a090af45f26dffd10dcd05eef5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:42:30 +00:00
Liang Qi 228dfd5b31 tests: blacklist tst_QAIV:testDialogAsEditor() on u2404 x11
Task-number: QTBUG-129516
Change-Id: Id36c8b6b4f5444b7bd3e982bdcf4d2b45b64a4cd
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit c35e6fffd6ccc4230f31b6a5610f466782ef5f75)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 00:14:08 +00:00
Tim Blechmann 29983de830 Core: add some commonly used QUniqueHandle types
QUniqueHandle allows us to write RAII types for non-trivial classes. We
can add some specialisations for 2 types of win32 handles, file
descriptors and FILE*

Change-Id: I4d6af274bcc7f84ae009d0cb3a2f3aec1b6bcaf9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0563862e23eda4a7b8def8c8afacf732b9a992ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 00:14:08 +00:00
Tor Arne Vestbø 42439087eb Darwin: Teach QFileSystemEngine how to resolve case-sensitivity
Both APFS and HFS+ can be both case-sensitive and case-insensitive
(the default), and the mounted file system may be any other file
system than these two as well, so hard-coding to case-sensitive
is not sufficient.

Task-number: QTBUG-28246
Task-number: QTBUG-31103
Change-Id: Ibdb902df3f169b016a519f67ad5a79e6afb6aae3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3d08816f4c4245f08a53307775fe3c4ed31a7a32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 21:36:48 +00:00
Inho Lee 1befc288c0 widgets: Send Window{AboutToChange}Internal when top level used RHI
When calling setParent for a top-level widget that used RHI it's
not enough to check if the widget's parent used RHI, as that's
always going to be false.

Missing this results in not sending textureChildren events for the
reparented widget.

Amends eb4cb71925

Fixes: QTBUG-129299
Pick-to: 6.8.0
Change-Id: I632d8d63ec56243cd6da2b196ad9651c28128f0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0704eff5617a100634c58177c83ed0d90b6f5525)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 18:19:58 +00:00
David Faure 65a48e7ab8 QAIV drop indicator: don't draw a single pixel when the rect is null
Drive-by change: fix a trivial typo
Also, clang-format changed some indentation

Fixes: QTBUG-36831
Change-Id: Icb259cc8a1fc83aca3d4cd581fa0e88e7907602b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 39e7016e8a0cc749d9be83e88ef94b3df40d7cc1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 12:43:38 +00:00
Tor Arne Vestbø fb69c5a354 tst_QDnsLookup::lookupReuse(): Rewrite using lookupCommon helper
Task-number: QTBUG-129335
Change-Id: I8417ff9e76076d0b1a40270edc1b2692a122657f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 41768db300b70dda36344ab1cafb6b99937da435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 12:43:37 +00:00
Petri Virkkunen 9cd561f355 Android: Add support for multiple embedded views in Android Service
To enable adding and managing multiple QtQuickViews,
QtServiceEmbeddedDelegate now hosts a set of QtViews instead of a
single one.

To avoid crashing if the QML view has a TextField, do not allow
QtWindow to create a QtEditText if the service usecase is detected.

Fixes: QTBUG-129412
Task-number: QTBUG-127422
Task-number: QTBUG-128563
Change-Id: I70784657ed6cb2aa853160605f4663e517f0e6db
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1656a2f58c759c25e6a89435a65c1d0fceba8a09)
2024-10-02 15:43:37 +03:00
Tinja Paavoseppä 46dbb74249 Android: Add support for multiple QtViews in same Context
This patch makes it possible to have multiple QtViews
in an Android app, provided they are in the same Context.

Task-number: QTBUG-127422
Task-number: QTBUG-124116
Change-Id: I3d5bef3f789f23c8495c3b7209bbd3e430d439ac
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0af53d3e87464a0638e4fdb8b68287912281a2a6)
2024-10-02 12:43:37 +00:00
Tinja Paavoseppä a228a3e7b6 Android: Add an enum for QtLoader results
Returning an enum instead of a boolean lets us discern between
differences such as libraries have been loaded successfully, or
they have already been loaded successfully in a previous call.
Later, we could add more values to discern between the different
error cases, instead of relying on logging.

Task-number: QTBUG-127422
Task-number: QTBUG-124114
Change-Id: I66bd95e66772db8b6f940b30a7b121b35ff4390a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1afb82c41c54d6bbe3cd09cffc679fbfa86f75d3)
2024-10-02 12:43:37 +00:00
Antti Määttä cf92f38bb1 Use toStdU16String when converting string to std::filesystem::path
qUtf16Printable causes a crash in linux.

Pick-to: 6.8.0 6.7
Fixes: QTBUG-129375
Change-Id: Icb0aed74e0a2af762aee464d52a63e0f847b85a9
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit a599838f7a23df53d6d5f5f252ba820762f239af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 09:19:55 +00:00
Petri Virkkunen 1215f61a1f Android: Add destruction guard in QAndroidPlatformWindow
To avoid calling functions in QAndroidPlatformWindow during/after
destruction of the object, create a mutex and use lock_guard to
synchronize the destruction of the object and native function calls
originating from Android events.

Task-number: QTBUG-118231
Change-Id: I29818386456c6969ca507d74574b722bf8a19019
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0f20feea2112c2391e274dc4e81aa38a738b7023)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 09:15:20 +00:00