Commit Graph

64539 Commits

Author SHA1 Message Date
Alexandru Croitor
1126a590f9 wasm: Fix compilation failures when not using precompiled headers
Various headers files were missing includes. Compilation only worked
because precompiled headers were used.

Pick-to: 6.5 6.6
Change-Id: Ic1b434da53f89d4b4207a22bf171bd966db856ac
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-11-22 15:42:17 +01:00
Alexey Edelev
1a4659b081 Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY in tests and benchmarks
Consider CMAKE_RUNTIME_OUTPUT_DIRECTORY when setting the default
OUTPUT_DIRECTORY for tests and benchmarks.

Change-Id: I93d85c77f30fec186e13e8cd3e902027e60c588f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-22 15:42:17 +01:00
Eskil Abrahamsen Blomfeldt
db6f7908d0 Fix cache cost on DirectWrite font engines
In Qt 6, we deferred getting the ascent/descent of the font
until requested. This was used to calculate the cache cost
of the font engine, so as an unintended result, the DirectWrite
engines were seen as extremely cheap in the font cache, and
we would accumulate thousands of them before triggering a flush.

The cache_cost is just a heuristic and does not need to be accurate.
For most engines, we should just flush when the number of cached fonts
exceed 256, so we use the basic em square of a lowercase letter as the
cost here instead.

Pick-to: 6.5 6.6
Change-Id: I73a65cab38adfd9ef56e436f311a7d1a2d7fbf41
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-11-22 14:42:17 +00:00
Laszlo Agocs
1248979968 rhi: d3d12: Try without debug layer when failed
This matches what the D3D11 backend does: if the debug device (D3D11) /
debug factory (D3D12) is not available, we retry without the flag and
if succeeded, continue without the debug layer while printing a log
message. This way create() succeeds even when the debug layer is
requested but is not available at runtime (because the necessary SDK
or Visual Studio components are not installed, which can happen
on an end-user PC not set up for development)

Pick-to: 6.6
Task-number: QTBUG-119240
Change-Id: I02e3bf45728e74b8fe196e880372f584de7aa5d2
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-11-22 15:42:17 +01:00
Tor Arne Vestbø
b232af9583 Disable tst_ForeignWindow::embedForeignWindow() null-parent check on Linux
It's flakey, so let's unbreak the build while we investigate further.

Pick-to: 6.6
Change-Id: I9f7559803dd3ebc80946e5e5c5d31292101cd36f
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-11-22 15:42:01 +01:00
Mike Chen
6a873a6edf QImageReader: Reduce code redundancy
Refactor methods to simplify the code and improve readability.
Replace calls to initHandler() and checks for handler support
with calls to the supportsOption() method directly.
Reduces code redundancy and improves the overall structure of the class.

Additionally, use supportScaledSize, supportClipRect, and supportScaledClipRect
to streamline the conditional logic and make it more understandable.

Change-Id: I77d5dab8bcdd0b0eb6d7e9edcf87751aa03b80c7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-22 17:37:46 +08:00
David Faure
6ea2a12e27 QDBusConnection: output error message from findSlot
This helps debugging why an adaptor's method fails to be called.
Example output:
QDBusConnection: couldn't handle call to LaunchCommand: Type not registered with QtDBus in parameter list: QByteArrayList

tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall shows many warnings
after this commit, since it's testing many cases of "no such slot".

Pick-to: 6.0 6.1 5.15
Change-Id: Ic4ddcd91d005555a02d531fc8960aea2c809e20b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-22 07:18:08 +01:00
Lisandro Damián Nicanor Pérez Meyer
c1415a6a6c Remove noisy and non-informative message
This has the flaw of providing very little information and happens too many
times during the configure process.

My bad, apologies for the noise.

Change-Id: I57368f514be968e7144f364f627c110ceed20dae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-22 03:18:08 -03:00
Assam Boudjelthia
869e9b927a Android: remove redundant assignement and type specifiers
that kind of code gives Android Java warnings.

Task-number: QTBUG-118077
Change-Id: I395c650aba209a84ff1b7548821444f3d1e461e3
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-22 08:18:08 +02:00
Assam Boudjelthia
c8bf35f4e4 Android: use final keyword for Java class memebers when appropriate
Task-number: QTBUG-118077
Change-Id: Id63569fc59c5d16f41aad92181ae1794cbb6fbc5
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2023-11-22 08:18:08 +02:00
Assam Boudjelthia
833e7c1629 Android: add @UsedFromNativeCode annotation for java method used in c++
To get rid of unused method warnings in Java code for methods used only
from C++ code and make it more visible which methods are used by native
code.

This annotation would need to be added to the relevant methods in this
patch or future one.

Use this annotation for all methods called from native code. And along
the way remove few methods that are not used anywhere.

Task-number: QTBUG-118077
Change-Id: Ie493fb057f4a93aff513f85e0936bc65a9bb304c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-22 08:18:08 +02:00
Volker Hilsheimer
09afa75752 macOS: Don't crash when starting a drag with empty mime data
As with all drag'n'drop code, we can't auto-test this as the test would
enter a blocking event loop.

Task-number: QTBUG-119216
Pick-to: 6.6 6.5
Change-Id: I7bab4a4fe7f5b315cdaec61636ded6186d9f75b4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-22 07:18:08 +01:00
David Faure
b7657ddccb qDebug: add support for std::optional and std::nullopt_t
[ChangeLog][QtCore][QDebug] Added support for std::optional
and std::nullopt_t

Change-Id: I1e6196adb408401cae8776cd0c60af294a39a83f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-22 05:56:25 +01:00
Friedemann Kleint
dc7eb46352 QWin32PrintEnginePrivate: Properly initialize flags and fields of DEVMODE
- Set the respective flags of dmFields in
  QWin32PrintEngine::setProperty()
- Properly initialize newly allocated structs

This is merely for completeness, the allocation code paths are
not currently hit since the DEVMODE from the current printer is
used, which also has most dmFields bits set.

Pick-to: 6.6
Task-number: QTBUG-114604
Change-Id: I880d9faef9b1d491db4accd53d0d75b718f7f244
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2023-11-22 05:56:25 +01:00
Friedemann Kleint
9f7d2fc7f9 QWin32PrintEnginePrivate: Brush up the code
- Use nullptr
- Use member initialization
- Remove C-style casts

Pick-to: 6.6
Task-number: QTBUG-114604
Change-Id: I6f9519010bfbd7c5afa07d9a8752b40c3b29673e
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-22 05:56:25 +01:00
Ahmad Samir
9cf47946fc tst_QTimer: refactor CMake code
It's used to build different variations of the unittest,
linking against QtCore-only/QtGui, with/without GLib, that's four
individual tests.

Change-Id: Iaf0f37041dbb148134631f86be99feaa881a8ce8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-22 06:34:29 +02:00
Alexandru Croitor
2dc0c01449 configure: Make sure the configure script exits with cmake's exit code
The configure script always returned exit code 0 even if the
underlying cmake call failed. Make sure to exit with the same exit
code that the cmake process does.

[ChangeLog][Build System] The configure script on UNIX systems will
now exit with the same exit code that the underlying cmake process
exited with.

Pick-to: 6.5 6.6
Change-Id: I2cb43e162bb96f4e60320522895aac9bb5c5bc9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-22 05:34:28 +01:00
Rym Bouabid
e608bc0192 QObject: port findChild/ren() to QAnyStringView
Change the object's name type in QObject::findChild/ren() to
QAnyStringView, because they are only used for comparison against
objectName property.

qt_qFindChild{,ren}_helper() functions taking an objectname as
QString have to stay in the ABI as they were exported in inline
methods before Qt 6.7.

Unlike QString, constructing a null QAnyStringView doesn't involve
any code-size overhead. So, get rid of the split in qt_qFindChildren_helper
that was introduced for QString. Remove unneeded
qt_qFindChildren_with_name helper function and qt_qFindChildren_helper
overload without a name.
findChildren(options) method used to call qt_qFindChildren_helper overload.
Instead, call findChildren overload with name argument and pass
QAnyStringView{} as the object name.

[ChangeLog][QtCore][QObject] Ported QObject::findChild/ren() and
their helper functions to QAnyStringView.

Task-number: QTBUG-103986
Change-Id: I68bda0e581f984ae48b7581ad86cc1b95008c1b0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-22 01:26:46 +01:00
Marc Mutz
bdd41f491c Rename Q*Ordering to Qt::*_ordering
Since we cannot re-use the pre-existing QPartialOrdering type due to
binary-compatibility issues (it's not BC to std::partial_ordering),
we're no longer bound to copy its API for consistency.

So copy std::*_ordering type API for consistency instead, to ease
porting for users that can already use C++20 and everyone else come
Qt 7.

This patch is another step in that direction, renaming classes and
their memmbers to std-compatible names. QPartialOrdering cannot
change, as it's pre-existing. So add a completely new type
Qt::partial_ordering.

Adding conversions from QPartialOrdering is left for a follow-up
patch.

As a drive-by, change `\c Less` to `\l Less` in the \class
documentation blocks of the new classes.

Amending c6fe64b17c, which didn't have a
ChangeLog:

[ChangeLog][QtCore] Added Qt::{partial,weak,strong}_ordering as
drop-in C++17 stand-ins for C++20's std::{partial,weak,strong}_ordering.

Task-number: QTBUG-119108
Change-Id: Ib1296de6b708571a6abca8843ba36c114f6fd34f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-21 11:46:27 +01:00
Marc Mutz
67072a70af Q*Ordering: supply is_{lt,gt,n,}eq
std::is_eq etc work fine on our Q*Ordering types when C++20 is
available. But in C++17 mode, they're absent.

Plug the hole by providing them for our own types as hidden friends,
so that users can use unqualified calls to transparently support both
std::*ordering and Q*Ordering types, just like with comparison to
literal zero.

For some reason, we running here into
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100903, even though this
wasn't seen in other commits of the chain that use comparisons to
literal zero. Suppress the warning. Then at least is_eq etc provide a
safe fall-back for compilers and users affected by this bogus warning.

Fixes: QTBUG-119100
Change-Id: Ie8519c92363401a0c9c8efba6eb0b6e030a8e235
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-21 11:46:27 +01:00
Antti Määttä
d61cee0ed8 Fix build with std::filesystem
Use cxx17_filesystem config instead of Q_OS_INTEGRITY.

Change-Id: I1d3fdae449a534dd25a32ce2820a4ebf788de2b0
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
2023-11-21 08:34:55 +02:00
Christian Ehrlicher
48080c2327 QCssUtil: use std::array instead QPolygonF
Use std::array<QPointF, 4> instead a dynamic QPolygonF since there is no
dynamic allocation needed here.

Change-Id: I45e124de7db7263c9291e169165bf74174f032a6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-20 23:19:19 +01:00
Christian Ehrlicher
7e362f76a6 QStyledItemDelegate/TreeView: fix showing lineedit editor
When the text alignment is AlignRight the opened editor is wrongly
aligned and therefore the text can not be read. There is no reason to
align the editor window on the right only because of the text alignment.
Also remove the hack to not let occupy the editor the whole cell in a
QTreeView but in a QTableView.

Fixes: QTBUG-98525
Change-Id: I6f2d88e461bcfd505adde745041b5d4fdf679201
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-21 00:19:19 +02:00
Christian Ehrlicher
b03557287f QPushButton: fix QPushButton with icon in rtl mode
In rtl mode the text was not aligned right so a gap between the text and
the icon occurred. This was due to the fact that the textFlag given to
qt_format_text() was modified based on the application wide rtl/ltr mode
and so our Qt::RightToLeft was reverted to Qt::LeftToRight. Therefore
only set the textFlag to Qt::AlignRight when the button layout direction
does not match the global one.

Pick-to: 6.6
Fixes: QTBUG-64373
Change-Id: I283a99de8f59bc3db53c4150f417ffef9ff68db7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-20 23:19:19 +01:00
Tor Arne Vestbø
778acfe122 macOS: Guard QCocoaWindow access when handling application activation change
The platform window may in some cases be gone, without its NSWindow yet
being deallocated, and if we receive an application activation event at
this point we would try to dereference a null-pointer.

Fixes: QTBUG-119219
Pick-to: 6.6 6.5 6.2
Change-Id: I72bb2482059d1a256e448705b132e4a8f22ec297
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-20 23:19:19 +01:00
Ahmad Samir
6335685a1b Fix a compiler warning (GCC 13.2.1) -Wpessimizing-move
src/testlib/qpropertytesthelper_p.h:204:38: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  204 |     if (std::unique_ptr<TestedClass> helperObj = std::move(helperConstructor())) {
      |                                      ^~~~~~~~~

Amends f5a5c59918.

Pick-to: 6.6 6.5
Change-Id: Ie050aa4294289df34347c8f6cbcdce7ff2b784a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-20 22:19:19 +00:00
Tor Arne Vestbø
87dd49f638 Make QApplicationPrivate::active_window private
The active window of QApplication overlaps largely with the focus window
of QGuiApplication. As a first step towards potentially removing the
active_window member, make it private so we control access to it.

Task-number: QTBUG-119287
Change-Id: I95785fea3ba4444db64063f4e4d3d3004465ef64
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-20 21:31:47 +01:00
Kai Köhne
68bbbe28b2 Doc: Fix highlighting of serialization converter example
Example got renamed in a9c47dde50

Pick-to: 6.5 6.6
Task-number: QTBUG-117220
Change-Id: Ia0f04332b189c163c6da38eee2aded4837512376
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-20 17:54:48 +01:00
Tor Arne Vestbø
3c9017b0e2 iOS: Use 160x160 as default normal window size, like on other platforms
For top level windows, the window size will still reflect the screen's
available geometry, as the window state will be maximized by default.

[ChangeLog][iOS] The default normalGeometry() of a window is now 160x160,
instead of following the screen geometry. Top level windows are still
maximized by default, as before.

Change-Id: Ice752f74d943bf4fbb9be9e39f07798431fc2b0c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-20 17:46:15 +01:00
Jaishree Vyas
19b17667da Improve the documentation of compare() overloads for string-like types
Also update the QCollator::compare() docs for consistency.

Task-number: QTBUG-114822
Change-Id: I5fca896cacedd93ce5a4a1a8aead1986a21f6993
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-20 16:46:15 +00:00
Axel Spoerl
d462c7b09c QMainWindowTabBar: make destructor public
Was private by mistake => make it public.

Pick-to: 6.6 6.5
Change-Id: I6b07a19687ddf84e8456aa70bc34b1cc714a299e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-20 17:46:15 +01:00
David Faure
64b6e6b85c QMimeDatabase: update freedesktop.org.xml to shared-mime-info 2.4
A severe incompatibility was detected in 2.3, which is why 2.4
is being released so soon afterwards. The mimetype for *.bz2 files
changed (from bzip to bzip2), breaking much code in KDE for instance.
This is now handled in a more compatible way. And the two last-minute
fixes in the Qt copy of 2.3 are part of 2.4, so this is now more in line
with upstream shared-mime-info.

Change-Id: Ibca358cf2ca9f341d148f54bb18044683c4a05eb
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-11-20 17:21:20 +01:00
Piotr Wierciński
969bef9454 wasm: Respect maximum window size in QWasmWindow
Currently we are only checking if windowMinimumSize is not violated,
and we dont check windowMaximumSize at all, which may results in
windows being bigger than they ought to be.
When the sizeHints are updated, call the setGeometry() function which
makes sure that size constraints are respected and will resize window
if needed.

Pick-to: 6.5 6.6
Change-Id: I703bddec85ba6e02eea74a39e06d1f70d59e1677
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-11-20 09:48:16 +01:00
Kalle Viironen
028dcbdb37 Move the remaining blacklist setting into TestMethods::invokeTest()
Move the remaining QTestResult::setBlacklistCurrentTest()
call from checkBlackLists() into TestMethods::invokeTest()

Change-Id: I6f0bb26ef612e707ad013d1e42e47b06f40482a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
2023-11-20 08:58:17 +03:00
Ahmad Samir
66345ce785 tst_qtimer: remove extra ; after Q_DISABLE_COPY
Fixes warning from sanitize-commit.

Change-Id: Ie52de4e34fce903d898619bc8e2338a15b7b7e68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-19 20:19:04 +02:00
Tor Arne Vestbø
340b972995 Stabilize tst_ForeignWindow::embedForeignWindow()
We only care about no longer being a child of the old parent window,
not what the system does when we reparent to nullptr.

Pick-to: 6.6
Change-Id: Ibd670432f0fd2595195d3951014a570dfdb7a998
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-11-19 16:08:06 +01:00
Marc Mutz
635774fc32 QProcess: work around GCC 13 -Wmaybe-uninitialized in -unity-build
When in a unity-build GCC 13 sees the implementation of
forkfd_wait4(), called dfrom forkfd_wait(), it can prove that there
are paths that do not initialize *info: Those paths are the returns
following fcntl() in system_forkfs_wait() in forkd_linux.c and read()
in forkfd_wait4().

To work around the issue and unbreak unity-builds, initialize info = {}.

Task-number: QTBUG-119081
Pick-to: 6.6 6.5
Change-Id: I1b3504e7f83c766ebccc851233d4c3e677bf2acd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-19 13:10:29 +01:00
Axel Spoerl
e6d85cf28b QDockWidget: Fix group unplugging
A floating dock widget could either be a single QDockWidget object,
or a QDockWidgetGroupWindow with a single QDockWidget child.
The former could be dropped on the latter. Dropping the latter on
the former caused a crash.

The existence of QDockWidgetGroupWindows with a single dock widget
child was accepted to be by design.
Previous fixes, such as  9ff40b59da,
attempted to wrap all single floating dock widgets in
QDockWidgetGroupWindows.

These attempts fell short, because of the manifold programmatic and
manual options to create a floating dock widget:
- drag a single dock widget out of a main window dock area
- drag a dock widget out of a tab bar on the main window
- drag a dock widget out of a floating tab
- call `QDockWidget::setFloating(true)` in any situation
- create a new QDockWidget, that floats from the beginning

Whenever a QDockWidgetGroupWindow with a single QDockWidget child
was hovered and/or dropped on a QDockWidget without a group window,
crashes or screen artifacts were observed. Previous fixes made them
occur less often.

QDockWidgetGroupWindow is not designed to hold a single QDockWidget
child. Such a state is inconsistent and may only exist, while a
QDockWidgetGroupWindow is constructed.

The reason why such invalid QDockWidgetGroupWindows started to exist,
is a bool trap: QDockWidgetPrivate::mouseMoveEvent() starts a drag
operation, when a dock widget is moved by mouse.
It called startDrag() with no argument, which defaulted to
startDrag(true) and caused a group drag.

This assumption is
*correct*, when a tabbed group of dock widgets is dragged out of the
main dock as a whole, to become floating tabs.
*wrong*, when a single dock widget is dragged out of a docked group,
to become a single floating dock widget.

In the second case, the dock widget was wrapped in a new, floating,
invisible QDockWidgetGroupWindow. Looking like a single, floating dock
widget, the group window caused a crash, when attempted to be dropped
on another dock widget.

This patch eliminates all cases, where a QDockWidgetGroupWindow with
a single QDockWidget is created:
(1) Implement QDockWidgetPrivate::isTabbed().
This enables mouseMoveEvent to determine, whether the move relates to a
group of tabbed dock widgets, or to a single dock widget.
startDrag() can therefore be called with the right argument. It will no
longer create a QDockWidgetGroupWindow with a single QDockWidget child.

(2) Change QMainWindowTabBar::mouseReleaseEvent
When a dock widget was dragged out of a tab bar and became a single,
floating dock widget, it was still parented to the group window.
That is wrong, because it has no more relationship with that group
window.
=> Reparent it to the main window, just like any other single floating
dock widget. That enables QDockWidgetGroupWindow to detect, that the
2nd last child has gone and no more group window is needed (see next
point).

(3) React to reparenting, closing and deleting
If the second last dock widget in a floating tab gets closed (manually
or programmatically), reparented or deleted, also unplug the last one
and remove the group window.

(4) Amend 9ff40b59da
Remove the code path where a QDockWidgetGroupWindow with a single
QDockWidget child was created 'just in case', to make it compatible
others, created by (1), (2) or (3).

(5) Change QMainWindowLayout::hover()
When the hover ends without a successful drop and a temporary group
window with a single dock widget child has been created, remove the
group window.

The patch fixes smaller inconsistencies, which have not become visible
due to assertions and crashes earlier in the chain.

The patch finally extends tst_QDockWidget, to cover all 4 cases.

- Creation of floating tabs
The creation of floating tabs is extracted from floatingTabs() to
the helper function createFloatingTabs(). In addition to creating
floating tabs, the helper verifies that dragging a dock widget out
of the main window doesn't accidently wrap it in a group window.
This covers case (1).

- tst_QDockWidget::floatingTabs()
The test function verifies now, that both test dock widgets have the
same path before plugging them together and after unplugging them from
the floating tab. This covers case(4).

- tst_QDockwidget::deleteFloatingTabWithSingleDockWidget()
This test function is added, to cover cases (2) and (3).

- tst_QDockWidget::hoverWithoutDrop()
This test function hovers two floating dock widgets hover each other,
and returns the moved dock widget to its origin before releasing the
mouse. This covers case(5).

This fixes a lot of long standing bugs, making the author of this patch
modestly happy :-)

Fixes: QTBUG-118223
Fixes: QTBUG-99136
Fixes: QTBUG-118578
Fixes: QTBUG-118579
Fixes: QTBUG-56799
Fixes: QTBUG-35736
Fixes: QTBUG-63448
Fixes: QTBUG-88329
Fixes: QTBUG-88157
Fixes: QTBUG-94097
Fixes: QTBUG-44540
Fixes: QTBUG-53808
Fixes: QTBUG-72915
Fixes: QTBUG-53438
Found-by: Keith Kyzivat <keith.kyzivat@qt.io>
Found-by: Frederic Lefebvre <frederic.lefebvre@qt.io>
Pick-to: 6.6 6.5
Change-Id: I51b5f9e40cb2dbe55fb14d769541067730538463
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-18 20:48:44 +01:00
Axel Spoerl
0b10b7476c Refactor tst_QDockWidget::closeAndDelete()
The test function was temporarily blacklisted on Ubuntu, but also
failing on other Linux platforms (e.g. openSuSE).

It tested, whether closing all dock widgets and the main window, would
close the application as well. It used one single shot timer, to close
the windows and later one to check, whether the application was shut
down.

While that mechanism must work in an application environment, it is not
guaranteed to work in testlib. More specifically, I could happen that
the XCB / glib event loop continued to spin and wait for events.

=> Check the signal QGuiApplication::lastWindowClosed() instead. If the
signal is fired, it is proven that all windows have been closed and
the application would quit in a production environment.

The underlying test case was: Application didn't quit with the last
dock widget closed, because there was a dangling
QDockWidgetGroupWindow.

=> finally: Clean up BLACKLIST

Pick-to: 6.6 6.5
Change-Id: Ic5fde5967fc8dde70ab64dc30cc7367c908b5c51
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-18 20:48:21 +01:00
Axel Spoerl
b6b489db69 QMainWindowTabBar: Add destructor
QMainWindowLayout re-uses tab bars. A QSet and a QList member are kept,
to track used and unused tab bars.

Corner cases upon application close down leave dangling pointers in
those containers.

=> Add a destructor to QMainWindowTabBar
=> remove the tab bar from used and unused tab bar containers, if
not directly parented to the main window.

=> No longer reparent unused tab bars of a QDockWidgetGroupWindow
to the main window. Let them be destroyed as a group window child,
and its destructor remove it from the used/unused tab bar container.

Pick-to: 6.6 6.5
Change-Id: If2388cf878553dc89583dbc8585748fad65bbab2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-18 20:47:55 +01:00
Luca Di Sera
929b5a2273 Doc: Fix template information for QAnyStringView members
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for some of the members of `QAnyStringView` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I6c37a8bf90e3de8cc254e9b1ff3077fc9ebe6636
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 15:00:40 +01:00
Luca Di Sera
a36eb055b9 Doc: Fix template information for QByteArrayView members
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for some of the members of `QByteArrayView` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I93abd3d0aaa2ae2bb3807b1aea5a938aabac848c
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 15:00:36 +01:00
Luca Di Sera
b667d19641 Doc: Fix template information for QFutureWatcher members
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for some of the members of `QFutureWatcher` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I33932d0ef693f6e045ecf4414d05dadfb66d3d09
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 15:00:31 +01:00
Luca Di Sera
ac9fdf36b0 Doc: Fix template information for QJniObject members
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for some of the members of `QJniObject` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

An additional `\fn` command was added for `jobject
QJniObject::object()`.
`object` has two overloads that are only distinguishable by their
template declaration, where the `jobject` returning overload has none
and the `T` overload has a template declaration.

The only documented overload was the templated version, but due to QDoc
not considering template information it was incorrectly being matched to
the non templated version.

Now that template information are taken into consideration, the provided
documentation correctly matches the templated version and the non
templated version was left undocumented.

The documentation block for the templated version is documented so that
both versions are covered by it.

Hence, an `\fn` command for the non templated version was added to the
documentation block for the templated version.

Task-number: QTBUG-118080
Change-Id: Ib77603bae99fdebbeec5d012a6c671246f4f2d1e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 13:02:34 +01:00
Luca Di Sera
d3001d8a35 Doc: Fix template information for a qHash overload
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for `qHash(std::nullptr_t, size_t)` was providing a
unnecessary template declaration.

Hence, the incorrect additional information was removed from the `\fn`
command.

Task-number: QTBUG-118080
Change-Id: Iea406abbeb7aabd66e5b2ab092212d56b03cf42f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 13:02:26 +01:00
Luca Di Sera
83233bc130 Doc: Fix template information for QMetaType members
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for some of the members of `QMetaType` is not in sync
with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I642bbc1ab90e3cc0d32a11592ab5ad93bd181364
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-18 13:02:19 +01:00
Topi Reinio
41c95615fc Doc: Fix \fn template arguments for Qt Widgets
Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: I3a193ca69a911ee2f62e7663aaf4c032a35ee5dd
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-11-18 13:02:13 +01:00
Topi Reinio
6d0b5051a6 Doc: Fix \fn template arguments for Qt Gui
Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: I75f8956c5fc094402837f96bd4598b60e3a7c649
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-11-18 13:02:07 +01:00
Topi Reinio
94bf53cc5f Doc: Fix \fn template arguments for Qt DBus
Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: I761e99060caa64750eecf4fde4acc7f68d029936
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-11-18 13:02:01 +01:00
Topi Reinio
f1414846ed Doc: Fix \fn template arguments for Qt Concurrent
Upcoming changes to QDoc require accurate definition for
template arguments in \fn commands.

Task-number: QTBUG-118080
Change-Id: Ia905211d2b2bc5b49e5f9b50f2407544e939779d
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-11-18 13:01:53 +01:00