Commit Graph

61039 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
be37561497 Default NVidia EGL to GLES2
Found some documentation saying NVidia provided desktop GL for
development purposes only, and recommmended against using it. Not sure
if that applied to all NVidia drivers, or only that one embedded
platform, but since we have multiple bugs about EGL not working on
NVidia, default to using GLES2 like it suggested.

Change-Id: If8ac8dd61c4ceb88162360f1eaa2a096acefa9c6
Pick-to: 6.5 6.2
Fixes: QTBUG-105921
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-04-12 18:46:33 +02:00
Volker Hilsheimer
bbd6cbd71c windows: Re-apply mask when DPI changes, to account for new scale factor
When the DPI of a window changes due to being moved to another screen,
or the current screen reconfiguring, the mask we've set earlier is no
longer correct, as the mask was set based on the original screen's
scale factor and in relation to the former platform geometry of the
window, which now has changed.

Like the geometry of a QWindow, the mask is expressed by the user in
the QtGui coordinate system, so it's the platform's job to transform
this into the platform coordinate system and update it when needed.

Add a manual test that users a QWidget and a Q(Raster)Window side by
side.

There's still an issue with the screen change being triggered to
early, via QWindow::setGeometry, instead of when the window has
actually moved to the new screen, resulting in the paint event
flushing to a window and backingstore that is in the wrong state,
but this requires further research to fix.

Task-number: QTBUG-97642
Pick-to: 6.5 6.2
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I7ab2d267fbaf6ac32b507d05a418eb025b354a0b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-12 15:41:23 +00:00
Oliver Wolff
6d9a8c30e9 windeployqt: Add option to skip plugin types during deployment
Pick-to: 6.5
Fixes: QTBUG-112317
Change-Id: Idb294105ee2006a36067d3967af1b7b55b375bd7
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-12 14:54:06 +02:00
Oliver Wolff
f8a3489bf0 windeployqt: Remove special handling of virtual keyboard plugin
virtualkeyboard is a qt module and thus covered by the "no-<module"
switch. The special handling is no longer needed with the more dynamic
approach of handling Qt modules.

Pick-to: 6.5
Change-Id: Ice6e30261e60b484669748411e019764bbdeaa55
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-12 14:54:01 +02:00
Tor Arne Vestbø
75995d8e58 macOS: Synthesize cursor updates on QCocoaWindow::setWindowCursor
The original issue for doing this was that invalidateCursorRectsForView
would not result in an updateCursor callback in certain scenarios on
macOS 11 and below.

In macOS 13, improvements to how tracking areas work now result in
also missing cursorUpdate calls when the mouse is pressed, which
makes sense for tracking areas in general (you don't want a drag
over a text field to reset the cursor to the I-bream), but not for
our specific case of setting a cursor synchronously.

To ensure the cursor is updated immediately, even if the mouse is
pressed, we synthesize a updateCursor event, just like we did for
the invalidateCursorRectsForView workaround.

It's up to clients of QWindow to manage their setCursor calls to
not happen during a drag operation, which we already manage in
Qt Widgets.

Pick-to: 6.5 6.2
Change-Id: I67d6e0f8e270b40da9879828455f4de943da7839
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-12 14:20:28 +02:00
Topi Reinio
1f5c4af500 Doc: Fix \examplecategory macro
Argument passed to the \ingroup command should not be wrapped in
braces as it's read as-is.

Pick-to: 6.5
Task-number: QTBUG-111891
Change-Id: Ic759af37e8b7e9f60651103b395fdd7e630779c6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-04-12 11:23:37 +00:00
Laszlo Agocs
9e0ebc36d6 rhi: Remove unused init flag
Change-Id: I289452f39fd161da0e0d7bf329e0922df6bbde8a
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-04-12 11:23:37 +00:00
Laszlo Agocs
9807af617d rhi: Move generic setup code out of create()
Change-Id: I5222dd5479fe5c23b20bd08a2908a85be4d25e45
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-04-12 09:14:37 +02:00
Tor Arne Vestbø
a0675562ea Remove outdated comment about macOS cusorUpdate
Pick-to: 6.5
Change-Id: Ic270e9800b56e4fa1027245bebc4cd08a58abb3f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-12 02:28:05 +02:00
Laszlo Agocs
95198e7ad5 rhi: d3d11: Check ConstantBufferOffsetting in feature data
This is an additional attempt to have more "smoke testing" in
place for systems where there is no real 11_1 level driver
present. (we already test for Shader Model 5.0 above, now
also check this 11.1 feature indicating that
VSSetConstantBuffers1 is actually implemented)

This probing is important in particular for Qt Quick, where
there is an automatic retry with the software (WARP) adapter
when the initial QRhi::create() returns false.

This may or may not help the virtual machine case in the
associated issue, but is a valid check regardless since
we absolutely require constant buffer offsetting.

Task-number: QTBUG-78648
Pick-to: 6.5 6.4 6.2
Change-Id: I4d3c7b5c6c1f2b04b16c84b42c92651a3e671617
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-04-12 02:02:09 +02:00
Marc Mutz
2f95cd8f8b Long live QPromise::emplaceResult/At()!
And implement the rvalue overload of addResult() using it.

[ChangeLog][QtCore][QPromise] Added emplaceResult() and
emplaceResultAt() member functions.

Fixes: QTBUG-112270
Change-Id: Id369542215a60c0818f1afa8d564498be84732e8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-04-12 01:57:15 +02:00
Laszlo Agocs
82112db29d rhi: Remove readback result type alias
Change-Id: I1b14d3230ab4011506892c64ea03d5431d82a90d
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-12 01:11:12 +02:00
Laszlo Agocs
33b7a3b846 rhi: gl: Reset scissor before blit
glBlitFramebuffer is affected by the scissor test.

Fixes: QTBUG-103792
Pick-to: 6.5 6.4 6.2
Change-Id: I2eccc9f3e469af8b2fdff22e9fb7c2311c25b867
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-04-12 01:11:12 +02:00
Christian Ehrlicher
ed031ed18c SQL/MySQL: properly initialize variable
Properly initialize outBinds - even it should be initialized by
mysql/mariadb client lib we should correctly initialize it with 0 to
avoid valgrind warnings about accessing uninitialized data.

Pick-to: 6.5 6.2 5.15
Change-Id: I85b99a7e639dad9f8d24f554cd96c5997a5838ae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-11 23:40:33 +02:00
Volker Hilsheimer
6b67c3e738 macOS Accessibility: flag all synthetic elements as unignored
This saves us a few more roundtrips.

For rows and columns we could check if their accessibilityFrame
instersects with the table and so ignore rows and columns that
are outside of the view, but I'm observing weird corruptions in
the list returned by NSAccessibilityUnignoredChildren when
ignoring any objects.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: Ia2d13fff463ff26abb39acfceafcfa0761171203
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-11 23:33:52 +02:00
Volker Hilsheimer
52c2b82082 macOS Accessibility: Delay creation of table cell interfaces
Since macOS requires us to return an array with elements as the children
of a table's row. And it might ask for the children of many rows. This
is very costly, and results in a lot of QAccessibleInterface instances
being created unnecessary.

Instead, use unassociated QMacAccessibleElements as place holders for
cells, and place them in the column array of the QMacAccessibleElement
that represents the respective row. Those placeholder elements have the
synthesizedRole set to AXCell, and have the same axid as the table, for
as long as there is no corresponding QAccessibleTableCell created. Until
that point, they are in practice "managedByParent" just as the row and
column elements.

Since the place holder object knows about its column, row, and table, it
can respond to many inquiries directly without needing to create the
interface.

Once the QAccessibleInterface for the cell is required for an already
existing place holder, then we need to promote the place holder to an
independent element. We reset the synthesizedRole to nil, and change the
axid to the ID of the cell interface.

However, the cell interface might have been created and assocated with
an element before the placeholders were created when navigating through
the children of a row. So when we create an element for a table cell,
then we need to make sure that the table elements' corresponding row
is also populated, with the new element in the right place.

Pick-to: 6.5
Fixes: QTBUG-34337
Change-Id: Iff78e3b8335df8cf294fffb6579605bfeb8409ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-11 23:33:52 +02:00
Volker Hilsheimer
69a8d1293a macOS Accessibility: don't create an unnecessary interface
We only need to compare elements to determine whether this element has
focus.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: Ic1388ac00381735acfbf1e5877a658f4bd534dfb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-11 23:33:52 +02:00
Volker Hilsheimer
03b7e97907 macOS Accessibility: add an elementWithInterface helper
Instead of explicitly creating an ID from an interface and then asking
for the element for the ID, ask for the element for the interface
directly.

In that helper we can also make sure that the created element is
correctly configured if the interface for which it was created was for a
table cell.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: Id0f9247b0b50195301b293dcabb8925c3fc2d2cf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-11 23:33:51 +02:00
Volker Hilsheimer
042d753495 macOS Accessibility: optimize table interface implementation
Store row and column in the QMacAccessibilityElement when creating it so
that we can avoid linearly looking for ourselves in the parent's data.

Row elements have their m_rowIndex set, Column elements the
m_columnIndex, and elements representing a cell have both set. Cells
are not managed by the table.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: I319fad1f1fda0cfa4c0b95e9e16c25c87df04351
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-11 23:33:51 +02:00
Volker Hilsheimer
11ae55e918 macOS Accessibility: code hygiene
Make getting a QAccessibleInterface from a QMacAccessibilityElement a
member function that also tests for the validity of the interface, and
replace the respective code duplication.

Remove unused member functions accessibilityMin/MaxValue.

Task-number: QTBUG-34337
Pick-to: 6.5
Change-Id: Ie15cf0b71285e63cc485d87ced050dc541967c98
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-11 23:33:51 +02:00
Mårten Nordheim
1a55c8d887 Torrent example: update usage of integer types
Some of the 'int's are purposefully 32-bit because that's what the
protocol is, but others aren't. So, be more explicit.

Task-number: QTBUG-110622
Pick-to: 6.5
Change-Id: I338abca1f13b0c95f49a6f52933712f43f147590
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-11 18:25:42 +01:00
Volker Hilsheimer
e8a711ef3b Docs: update links to renamed example
Amends 5c2245cd66.

Pick-to: 6.5
Change-Id: I3956c0f5114bb5107c41a16c46d25c4aa82f3c53
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
2023-04-11 19:25:42 +02:00
Volker Hilsheimer
d7aa6109b1 Docs: fix links to D-Bus examples
"Example" was removed from the titles.

Pick-to: 6.5
Change-Id: Ie322180fbda328cd6e3e03c7c15f6255809b619c
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2023-04-11 19:25:42 +02:00
Topi Reinio
45ca5c8585 Doc: Use the \examplecategory macro to tag examples
The '\meta category' command was used for tagging examples with a
specific category, used in Qt Creators Welcome mode.

As we want to also generate lists of examples belonging to a category
elsewhere in the documentation, replace the command with a macro that
expands to the original \meta command and also adds the example to
a group using the \ingroup command. This way, the category names can
be used as arguments to the \generatelist or \annotatedlist commands.

Pick-to: 6.5
Task-number: QTBUG-112731
Change-Id: I46762dabc5f718fecc09a3533235eaa911dda5a0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-04-11 17:25:42 +00:00
Volker Hilsheimer
f334a22eae QAccessible test: skip focusChild on wayland
The test implicitly relies on window activation as QWidget only emits
accessibility events for focus changes in the active window. So skip it
on platforms that don't support WindowActivation and remove it from
the blacklist.

Fixes: QTBUG-109763
Pick-to: 6.5
Change-Id: I67d9a95f4f36b5271fe53ae90140a28770566c83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-11 19:03:52 +02:00
Volker Hilsheimer
3c83b3c010 QImage: when saving fails, print the writer's error string
In debug builds, don't fail silently in QImage::save, but emit the error
string of the QImageWriter to the warning stream so that developers have
a chance to know what's going on.

Task-number: QTBUG-103257
Task-number: QTBUG-41043
Pick-to: 6.5
Change-Id: I29718b1445d0c99a3b35d57b58ec915a503cd5f0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-04-11 19:03:52 +02:00
Ilya Fedin
6f37399cd6 Fix build without egl_x11
Amends 49d2944045

Pick-to: 6.5
Change-Id: I5ff94135245cdb617aa5eea5a0e2782f810b36dc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-04-11 21:03:52 +04:00
Morten Sørvig
01cdda3502 Update QWindow DPR on screen DPI change
The window device pixel ratio may change when the DPI
changes. Call the DPR update function, which will poll
for the current value and update the cached value and
send DevicePixelRatioChanged events if needed.

Change-Id: I5d5ac5d24a693d06eb9b1f005a91677e703f8a58
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-11 17:13:14 +01:00
Morten Sørvig
3965d808c0 QWindow: Cache the devicePixelRatio value
Make each QWindow instance cache the current DPR value.
This will make calling QWindow::devicePixelRatio() less
costly, since it now does not have to compute the DPR
value on each call.

The cache is invalidated when the DevicePixelRatioChange
event is sent. The common logic for handling this is
implemented in QWindowPrivate::updateDevicePixelRatio().

Change-Id: I97231a230347358d8e565d2fd62e8a398adaedfc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-11 17:13:14 +01:00
Colin Snover
fc9853dcbf QMainWindow: fix potential crash when restoring tab bar state
Don't activate the mainwindow layout while it is being restored.
Otherwise we might end up in recursive calls to setGeometry.

Pick-to: 6.5
Fixes: QTBUG-111538
Change-Id: I4b6cba9e0abfbae479f71a65b1c4526d92dac081
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-11 18:13:14 +02:00
Colin Snover
5b8ffc6d2a QMainWindow: fix potential assert when restoring dock widget state
Don't append separator widgets at the end if their slot in the list is
still free.

Pick-to: 6.5
Task-number: QTBUG-111538
Change-Id: Id9ada2c083345cfd69633e506cceedc9ae6f2ae4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-11 18:13:14 +02:00
Bernhard Rosenkränzer
8f8be55c15 CMake: Fix linkage with lld 16.0
lld 16.0 is more picky about symbol versioning than previous versions
(and other linkers such as ld.bfd, gold or mold).
It now errors out if a symbol is versioned but not defined
(see 8796677de8900dc154aef45f8620c3f987a40291).

Outside of detecting support for symbol versioning (fixed by 462832),
this causes linking Qt6 libraries other than Qt6Core to fail because
their linker scripts try to add versioning to qt_version_tag, which is
defined in Qt6Core rather than the library being linked.

The obvious (and working) fix is to version qt_version_tag only where it is
defined (Qt6Core), but this is not what the original intent seems to be.

Task-number: QTBUG-111514
Change-Id: I963d417befb0f6b2260c57f059eeda1fe79200c9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-11 15:19:22 +02:00
Axel Spoerl
74a4f9cb05 Cache null icons and remove them upon system icon theme change
Since Qt 6, qIconCache does not store null icons. In case an icon name
lookup is unsuccessful, the (expensive) lookup is repeated each time.

This patch reverts 9e7c567050, which
removes a null icon from the cache once it has been found in the cache.
In fact, that could no longer happen due to
4dc7102c84, which prevented null icons
from being cached at all. Therefore, it is also reverted by this patch.

The cache will be cleared when
- the system icon theme name changes or
- QGuiApplicationPrivate::processThemeChanged is called (e.g. due to
a change of the system's color scheme)

Fixes: QTBUG-112257
Pick-to: 6.5
Change-Id: I80cd21fa39dc31c4bae60a8e66e78d9da20e9b4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-11 15:19:22 +02:00
Volker Hilsheimer
70f9158e0f Docs: don't link to removed example
Pick-to: 6.5
Change-Id: I5fcec02cd18971150eec4f119d902c695bf2ebb9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
2023-04-11 14:37:36 +02:00
Marc Mutz
9834e80833 savegame ex.: give some TLC to main()
- include what you use
- make 'args' const, so we don't detach in op[]
- make boolean variables const
- use QString::compare(lhs, rhs, Qt::CaseInsensitive) instead of
  lhs.toLower() == rhs
- use new _L1 UDL
- fix indentation of a return statement

Pick-to: 6.5
Change-Id: If9da4fbe975d9a97939ea01558b2a8cef7ad3a24
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-04-11 12:37:36 +00:00
Joerg Bornemann
26f0657fee CMake: Fix setting Android SDK/NDK from environment variables
The checks for the environment variables ANDROID_SDK_ROOT and
ANDROID_NDK_ROOT were guarded by if(DEFINED) conditions. However, these
variables are *always* defined by the code that iterates over
__qt_toolchain_used_variables earlier in the toolchain file.

Change the existence checks into emptiness checks.

Pick-to: 6.5
Change-Id: I6c87f86068817e45dd2325359827c6fa4dae6279
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-04-11 14:37:36 +02:00
Amir Masoud Abdol
db9fa4a617 Exclude sources from the Unity Build
There are patches for addressing the issues raised by these two source
files; however, it would be beneficial to exclude them temporary while
we are testing, and debugging the unity build on CI.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ie8631cf1df086b22967a8cc41874a3ef856c3ef8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-11 13:41:55 +02:00
Volker Hilsheimer
7199498fb9 QPushButton: use QMenu::popup instead of exec to show menu
QMenu::exec opens a blocking loop, which is problematic for webassembly.
Replace with QMenu::popup, and reset the down-state of the button when
the menu is about to hide. QMenu emits aboutToHide immediately before
existing the event loop in the hideEvent override, so the timing is the
same.

Change-Id: Iccb418d10fcb25f6ad1f73f9cdce6ea6581bd73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-04-11 12:58:58 +02:00
Volker Hilsheimer
cf5d9e9eb5 QWidget: add overload to set tab order as a list of widgets
The "two widgets at a time" API to set the tab order is awkward and
easily misused (as the documentation explicitly explains). Add an inline
overload that takes an initializer_list, and call the existing function
for each consecutive pair of widgets in the list.

Add documentation with snippet, and a test.

Change-Id: I8e6f14a242866e3ee7cfb8ecade4697d6bdfb4d4
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-04-11 12:58:58 +02:00
Mikolaj Boc
ce5fb1e709 Get http reply text on error in wasm's network reply
A failed response also carries response text. Read it and assign it
to the response.

Fixes: QTBUG-112474
Change-Id: I5565e3809e2c9c95bf8e0744b3ab15a62b07106c
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-04-11 08:47:20 +02:00
Volker Hilsheimer
f04974751d QFileSystemModel: don't emit invalid indexes
A subclass of QFileSystemModel might override columnCount to return a
value smalller than QFileSystemModelPrivate::NumColumns.

In that case, constructing the bottomRight index for the dataChange
signal would fail if we create it for column NumColumns - 1, and result
in undefined behavior where the topLeft and bottomRight indices do not
have the same parent.

So ask for the columnCount of the parent index explicitly to construct
the bottomRight index.

The assert can be triggered via the "filesystemexplorer" example in
qtdeclarative, which overrides columnCount to always return 1.

As a drive-by name the variables correctly, bottom and top where mixed
up.

Pick-to: 6.5
Fixes: QTBUG-110632
Change-Id: I8a635ec733348d1eda2037c156ac0f7b09a2183d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-04-11 08:46:58 +02:00
Volker Hilsheimer
41a349f004 Refactor QFileSystemModel: use named values for columns
Hardcoded 0, 1, 2, 3 make it hard to follow the logic of this code.
Replace those values with values in the already existing unnamed enum,
and use everywhere.

Pick-to: 6.5 6.2
Task-number: QTBUG-110632
Change-Id: I325ab9edb5f3f996e87c83be1ec7226d5453f2cc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-04-11 08:46:54 +02:00
Ahmad Samir
7191b8fe38 Fix some narrowing conversion warnings
ioctl call for FIONREAD takes an int arg, it won't work correctly
otherwise. Cast the return of the read() call to int, because it won't
read more than buffSize (which is an int).

Change-Id: I130202a732684257bbb0e79c9358b60a61010c46
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:24:04 +02:00
Ahmad Samir
db797d19a3 QTemporaryFile: fix narrowing conversion warnings
- Don't use unsigned to avoid negative values (if an unsigned variable
  is assigned a negative value it'll wrap around and become a huge
  positive value, which is usually not what's required)

Change-Id: I5d41280b9ca14c15727f9f2447ed50573b187931
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:23:37 +02:00
Ahmad Samir
94a01cd6ec QDate: remove an old comment
QDateTime::addMsecs does check for overflow. I don't know when this
 has changed, but it doesn't matter.

Change-Id: I44c6ba5e88cce544c0d1ef33fa38a528a96b0b7e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:23:22 +02:00
Ahmad Samir
3202ab1eb1 QXmlStream: run the test suite from a method other than initTestCase()
Only unzip the test suite in initTestCase(), but run the tests from
runTestSuite(). This is mainly useful when running specific a unittest
locally, no need to wait for the whole zipped test suite to run.

Change-Id: I518a2de716d3d07fb5a78298f1bd3ab2759e744b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:23:06 +02:00
Ahmad Samir
d1140235e2 QDate: reformat a unittest
Change-Id: I323975db23f40fe2e7fc5062fbc8102dedbaaf5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:21:51 +02:00
Ahmad Samir
595112ea50 QStorageInfo: mention bind mounts and btrfs subvolumes in API docs
Sepcifically in the subvolume() method's docs.

Change-Id: Ib14492f8366bf00a6a4ab399ff8ad20009be5886
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk@qt.io>
2023-04-08 13:21:39 +02:00
Ahmad Samir
b58606ed85 tst_qstringapisymmetry: silence a GCC warning
GCC complains:
inlined from ‘constexpr QAnyStringView::QAnyStringView(const Container&) [with Container = QVarLengthArray<QChar, 1023>; typename std::enable_if<disjunction_v<QtPrivate::IsContainerCompatibleWithQStringView<T, void>, QtPrivate::IsContainerCompatibleWithQUtf8StringView<T, void> >, bool>::type <anonymous> = true]’ at src/corelib/text/qanystringview.h:215:64,
    inlined from ‘void tst_QStringApiSymmetry::overload() [with T = QVarLengthArray<QChar, 1023>]’ at /home/ahmad/devo/qt6-git/qtbase-qglobal/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp:1178:17:
src/corelib/text/qanystringview.h:187:47: warning: ‘t’ may be used uninitialized [-Wmaybe-uninitialized]
  187 |         : m_data{str}, m_size{encodeType<Char>(str, len)}
      |                               ~~~~~~~~~~~~~~~~^~~~~~~~~~

Clang doesn't warn about this.

Change-Id: I3476236630e886b087856acd22054bfb35deb451
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-08 13:21:24 +02:00
Christian Ehrlicher
40045aeec8 SQL/Tests: use TableScope where possible
Use TableScope helper class to make sure the table used for the test is
really cleaned up before usage.

Change-Id: I45fffcd13acae6032636ae07097b14af174ede21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-07 20:38:13 +02:00