Commit Graph

65687 Commits (5a032f0b3fcfb7dbd63e784dedaa8e27fc34ce3d)

Author SHA1 Message Date
Christian Ehrlicher 5a032f0b3f QFusionStyle: Pass handling of FrameGroupBox to base style
The fusion style had an own handling for
PE_FrameGroupBox/SC_GroupBoxFrame but failed to handle all cases (e.g.
with checkbox, text and horizontal alignment) correct. In contrast, the
base class (QCommonStyle) is properly handling all those attributes and
returns a correct subControlRect(). Therefore remove the special
handling, let styleHint() return the correct value for
SH_GroupBox_TextLabelVerticalAlginment based on the groupBox's text
alignment and rely on QCommonStyle ability to calculate the correct
values.

Pick-to: 6.7 6.6
Fixes: QTBUG-85425
Fixes: QTBUG-95472
Change-Id: I98ccf861274026a8fd4a2ef436efc3bb009be056
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2024-02-13 00:53:25 +01:00
Marc Mutz fc23fa459c QDataStream: inline status()
The implementation is trivial, and unchanged since the beginning of
the public project history, so I'd venture that it's safe to commit to
it not changing until Qt 7 at this point.

The reason to make it inline is that a good stream operator
implementation should be checking the stream state quite often, so we
shouldn't make that an expensive DLL entry point.

Change-Id: Iba8cbfbaf02326c86ab95be17b603cd2e785f78c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-12 23:49:54 +01:00
Ivan Solovev 612b67cf13 QTimer: do not set active state when setting a negative interval
QObject::startTimer() returns 0 in case of failure, for example when
someone tries to register a timer with a negative interval.

However, QTimer internally uses -1 as an invalid timer id.
This could lead to a situation when the timer was not really started,
but QTimer::isActive() returned true.

This patch fixes it in two ways:
- check the return value of QObject::startTimer() and treat 0 as an
  error.
- do not treat 0 as a valid timer id when calculating the active state.

As a drive-by: move the `using namespace std::chrono_literals;`
declaration to the top of tst_qtimer.cpp, so that we do not need to
repeat it in each test case.

Fixes: QTBUG-122087
Pick-to: 6.7 6.6 6.5
Change-Id: I0e21152b2173ebb5fb0dada1b99a903a321ca9c4
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-02-12 23:49:54 +01:00
Ahmad Samir 9f66c9396f QAtomicScopedValueRollback: IWYU instead of including qglobal.h
Pick-to: 6.7
Change-Id: Ie2cde2a72169204cbc5cc8b981d9dfd1210abbe0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-02-13 00:00:46 +02:00
Mårten Nordheim 26bdda0032 Modern windows style: fix implicit conversion error
"implicit conversion from 'double' to 'int' changes value"

Amends a1f12273b2

Pick-to: 6.7
Change-Id: I7b26073403c8a589b5ec1d6b32e06b4bb6283946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2024-02-12 21:57:12 +01:00
Tor Arne Vestbø c6fc6cef33 tst_QWidgetRepaintManager::scrollWithOverlap(): Disable scroll bars
The scroll bars may show up in one of the grabs and not the other,
(as seen on macOS), which is interesting, and possibly a bug, but
is not what the test is checking for, so let's disable the scrollbars
to stabilize the test.

Pick-to: 6.7
Change-Id: Iad97ca5b22783bb1bee51b560957c5461b7d9923
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 21:09:18 +01:00
Tor Arne Vestbø 1308f7e0b1 QWidgetWindow: Don't meddle with WA_WState_{Hidden/ExplicitShowHide}
In ccd3bf0871 we introduced code that would
ensure that our call to QWidgetPrivate::setVisible() from QWidgetWindow
would not result in WA_WState_Hidden being set. This code was later
modified in 51300566ff to apply to
widgets that were explicitly shown/hidden.

Unfortunately, the reset of the Hidden and ExplicitShowHide attributes
would in some cases result in the widget having only ExplicitShowHide
after being hidden, which is an invalid state.

It also resulted in the widget having both Visible, Hidden, and
ExplicitShowHide, if first being hidden via QWidget, and then
shown via QWindow, which in turn prevented the widget from being
hidden via QWidget::hide().

As we no longer rely on the adjustments to Hidden/ExplicitShowHide
to fix QTBUG-73021, we can remove the entire logic. Any setVisible
call to QWidgetWindow will either come from outside, in which case
we should respect that and set Visible/Hidden via QWidgetPrivate,
or the setVisible call is a result of QWidget itself (or its parent)
showing the QWidgetWindow, in which case the QWidget visible state
is already up to date and we skip the QWidgetPrivate::setVisible
call.

Task-number: QTBUG-121398
Task-number: QTBUG-73021
Fixes: QTBUG-120316
Pick-to: 6.7
Change-Id: I3174ad66b7e10c55aa99b7cb433267632169ca8f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-12 21:09:18 +01:00
Tor Arne Vestbø 371d7ea19a Ensure QWidget::destroy() events and attributes match hiding the widget
When destroying a widget via QWidget::destroy(), we clear WA_WState_Created,
and then delete the QWidgetWindow, which in turn hides the widget. But
QWidgetPrivate::setVisible(false) skips hide_helper() if the widget has
not been created, which leaves out important events such as the hide
event, and even more important, fails to clear WA_WState_Visible. As
a result, the widget is left visible (and mapped), even if it has been
destroyed.

This is normally not a big issue for the main use of destroy(), namely
destructing the widget, but for cases where destroy() and create() is
used to recreate the widget this is important.

We now unconditionally call hide_helper() if the widget is not already
hidden. As a result, the widget will correctly be visible=false after a
destroy(). This in turn means we need to re-apply the visible state after
recreating the widget when we detect a mismatch in RHI configuration.

Due to our meddling of the Hidden and ExplicitShowHide attributes in
QWidgetWindow private, a QWidet::show() will not have any effect after
being destroy(). This is okey for now, as destroy() is internal to
a widget, and we make sure to either update WA_WState_Visible and
WA_WState_Hidden (in QWidgetPrivate::setParent_sys), or use the
QWidgetPrivate::setVisible() code path directly, which doesn't
have that issue. The root problem will be fixed in a follow up.

Pick-to: 6.7
Change-Id: I77cb88d75e57f0d9a31741161fb14d618a653291
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 21:09:18 +01:00
Tor Arne Vestbø aecedfed9a Restore window state of recreated top level widget, not closest QWindow
When we recreate a top level QWidget due to the RHI config not matching,
we need to re-apply the window state, as the state is lost on destroy().

But we should do this on the QWidget we are recreating, not on its
closest QWindow. These are usually the same, so it didn't matter in
practice for most cases (besides the more convoluted way of getting
to the QWidget's window).

But if the top level widget does not have a winId yet, the call to find
the closest QWindow via QWidgetPrivate::windowHandle() will traverse from
the top level widget to its transient parent widget, via nativeParentWidget,
which is strange and likely a bug.

As a result of that, we would store the window state of the transient
parent widget, and then, once we had created() the new top level, we
would apply the window state to the top level, which now had a winId.

We can simplify all of this by just storing and applying the window
state on the widget we are re-creating. There's no need to go via
the closest QWindow for this. We do however need to set the window
state on the widget's window, as going via QWidget will just bail
out since the window state hasn't changed.

Amends c88211d1e4

Fixes: QTBUG-119795
Pick-to: 6.7 6.6 6.5
Change-Id: I0ad6e7bbac5f29d095cc643e9a7094784e9a2122
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 21:09:18 +01:00
Ivan Solovev c5d0345c3d QVulkanWindow::setEnabledFeatures2Modifier(): pass parameter by value
The method takes an std::function as a parameter, so it makes sense to
pass it by value to avoid copying when passing lambdas.

Amends bd78047df3

Found in 6.7 API review

Pick-to: 6.7
Change-Id: Ic0608a176bfd26b5b44fae48f29d84737e81a413
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-02-12 20:09:18 +00:00
Mårten Nordheim b099988f6d QStringConverter: add a test for missing drain
Task-number: QTBUG-118834
Change-Id: I3085e6f83aa5a21f477a101a45186d0ce2133d10
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-12 19:12:25 +01:00
Mårten Nordheim 496340f33a QLocal8Bit::convertFromUnicode[win]: support more than 2Gi input
As we did for convertToUnicode. To support more than 2Gi input, we
need to handle the input in chunks because of the `int` parameter in the
Windows API. Testing also revealed some corner cases we also need to
handle, which is mostly happening when there is an incomplete surrogate
pair at the end of the current input window.

The test takes between 3 (plain MinGW) and 8 (MSVC with ASAN) seconds
to run on my machine.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-105105
Change-Id: I4fb0420b88ca41dfa8b561a35c6d96659bd81468
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-12 19:12:25 +01:00
Mårten Nordheim cba0efc270 QLocal8Bit::convertFromUnicode[win]: Pre 2Gi changes
As we did for convertToUnicode, we do some smaller changes, like
increasing indentation, and switching to using pointers and calculating
the input-size in this commit, so that the real changes in the next
commit are (hopefully) easier to read.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I3bf1a487f63a3e24efd7a945152647dd8fc0aca8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-12 19:12:25 +01:00
Mårten Nordheim a7171c6256 QLocal8Bit::convertToUnicode[win]: support more than 2Gi input
To properly support more than 2Gi input we have to support being asked
to resize more than once. Previously we would only have to resize the
one time because we went from our 4K stack buffer to the final size
heap buffer. But now, since our input size can only be specified in
int, we have to deal with looping over the input and resizing the buffer
as needed.

We also have to deal with trailing data at the end of our sliding window
potentially causing issues for the encoding. So we try to shrink our
window when it causes issues, or store the trailing data for the next
call.

The >2Gi test takes about 6-8 seconds on my machine.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I9a44b8f379bf2c2c58183f961544ed2f4c8c7215
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-12 19:12:25 +01:00
Mårten Nordheim 1090d5dd4a QLocal8Bit::convertToUnicode[win]: split out buffer growing
We will need to potentially grow the buffer before appending anything
to it, because if we pass in 0 as a size then the MultiByteToWideChar
just returns the size we would need. If we didn't intend to do so then
we would increment our output buffers even though nothing is written.

And when appending single characters (like the replacement character
for an invalid sequence) we need to grow the buffer as well.

We'll need this all in the next commit.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I94b9a0f7d18a725da01a47398163e6d0f704eefc
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-12 19:12:25 +01:00
Marc Mutz c9b967437d Add fast-path in QLibraryStore::findOrCreate() for !instance()
If there's no QLibraryStore::instance(), then there's no LibraryMap,
so no need to construct a mapName we know we'll just throw away.

We must keep locking the qt_library_mutex to check instance(), but we
can drop it immediately if we find there isn't, and construct the
QLibraryPrivate object outside the critical section (the hope is that
the compiler sees this as an opportunity to tail-call).

The final goal of this exercise is to get rid of the double-lookup in
LibraryMap.

Pick-to: 6.7 6.6 6.5
Change-Id: I181dd2657e831a37e2d6f1c5d4df7e2a25ac48cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-12 17:52:58 +01:00
Marc Mutz 7862453ba9 QTzTimeZoneCache: make findEntry() static
It doesn't need access to the members, so making it static both saves
the implicit this pointer, and communicates to the reader that this is
function doesn't access other QTzTimeZoneCache members.

In particular, it proves that it doesn't really need to be called with
m_mutex locked, cf. QTBUG-122138.

Task-number: QTBUG-122138
Pick-to: 6.7 6.6 6.5
Change-Id: I28c99be8d066c1647aaf7aa256b6400a6dd92955
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-12 17:52:58 +01:00
Tor Arne Vestbø 4e9017c1fc Un-blacklist tst_QWidget::optimizedResizeMove on macOS
It has been passing consistently in dev, 6.7, 6.6, and 6.5 for the past
6 months: http://testresults.qt.io/grafana/goto/S35hM52IR

As a drive-by, fix comment that claims the test is only run on macOS.

Pick-to: 6.7 6.6 6.5
Change-Id: I6502c40e0c39afb68a461bd530df1bacb5211dec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-12 17:52:58 +01:00
Edward Welbourne 7c502391cf Implement QTZP::isTimeZoneIdAvailable() on Android
The QTZP base implementation of the availability check was to
construct the list of all available IDs, then see whether the given ID
appears in it. This can be very inefficient. The ICU backend has
recently grown a more efficient solution than that, matching the TZ
and Darwin backends. For Android this was still very inefficient, but
its instantiation is cheaper, so simply instantiate and see if the
result is valid. For MS, the backend caches the list of available
zones, so searching the list is a reasonable solution, given the
complexity of its constructor.

Add an implementation for Android and document, in the base-class,
that the fall-back is only suitable for use if the list is cached.

Pick-to: 6.7 6.6 6.5
Change-Id: I9dc2ba4be1492ec811c8db6cff9490ac0303115d
Reviewed-by: Volker Krause <vkrause@kde.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-12 17:52:58 +01:00
Alexey Edelev 721641d38c Add the missing versioned alias for the GlobalConfigPrivate target
The build tree versioned alias is missing for the GlobalConfigPrivate
target.

Change-Id: I42e9f63363be472e661b656f665e29ea894b7e33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-12 10:29:03 +01:00
Tinja Paavoseppä 0ae95cb1f7 Android: Remove unused QtLayout.TouchListener
Now that QtWindow extends QtLayout again, the touch listener interface
is unused as QtWindow can directly handle the touch events.

Pick-to: 6.7
Change-Id: Ic58b5ab7644ffb3a60833b6507115b20db3f29de
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-12 08:51:01 +02:00
Tinja Paavoseppä 46c2d587b0 Android: Change QtWindow Runnables to lambdas
Pick-to: 6.7
Change-Id: I19a3e0a0a035a49965d7643db3ebdb72de95a3a9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-12 08:50:59 +02:00
Tinja Paavoseppä 1f2570976e Android: Make QtWindow package private
Pick-to: 6.7
Change-Id: I0231193c3118619b4d2fc9f4e7f0f85ddd0b41b8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-12 08:50:57 +02:00
Tinja Paavoseppä 3914a965cc Android: Move bringChildToFront() call to Android UI thread
Cannot change view hierarchy outside of Android UI thread.

Task-number: QTBUG-116187
Pick-to: 6.7
Change-Id: I05d36a28d16480519a6919047272be9f3cf667d0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-12 08:50:55 +02:00
Tinja Paavoseppä 3dad99a43e Revert "Android: Make QtWindow wrap the QtLayout instead of inherit it"
This reverts commit 2bc7d38bd6.
The real cause for the problems was the missing runAction() in
bringChildToFront(), creating the QtLayout could still be done
in Qt thread without problems, just as long as its hierarchy
is not changed outside of Android UI thread.

Let QtWindow extend QtLayout again - the missing runAction()
causing problems is added back in a follow up commit.

Task-number: QTBUG-116187
Pick-to: 6.7
Change-Id: Ib4211c40adf573f9f6dd6300b275cff0ce718fba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-12 08:50:53 +02:00
Tim Blechmann 84537e6dc2 qmake: use [[fallthrough]]
Since qt is on C++17, it's possible too use the [[fallthrough]]
attribute instead of a // Fallthrough comment, that may be stripped by
compiler launchers (ccache/icecc), causing -Wimplicit-fallthrough
warnings.

Pick-to: 6.7
Change-Id: Ic809cf4e95b2160fac591b3802fa123e705337cc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-02-12 03:01:48 +00:00
Thiago Macieira b911bb0d42 qsimd_p.h: move the ARM Crypto (AES) disabling on Linux
Commit 8179d7edf6 added the check in two
places. Move to a central one, disabling the bits in
qCompilerCpuFeatures.

Change-Id: I50e2158aeade4256ad1dfffd17b117afcb93c126
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-10 21:39:45 -08:00
Thiago Macieira 6ab4623cad qHash: force inlining of the hash16bytes() helper
It wasn't getting inlined in aeshash256_lt32_avx256() (used by VAES +
AVX512VL variant) due to a GCC __attribute__((target())) mismatch,
causing a major loss of performance compared to the VAES + AVX2 variant.

Comparing the throughput after this fix on an Intel Core i7-1165G7
(Tiger Lake) laptop, with qHashBits modified to statically select either
[A] aeshash256() or [B] aeshash256_avx256(), out of 5 runs:

            dictionary   numbers     paths-small  uuids      longstrings
A/B (avg)   103.7%       101.1%      103.5%       104.5%     100.3%
A/B (best)  103.4%       100.9%      103.2%       103.6%     100.8%

Considering that a string representation of a UUID is 37 characters (74
bytes), neither "uuids" nor "longstrings" are directly affected by this
change. However, the overhead does change, with the aeshash256_avx256()
needing slightly fewer instructions to reach aeshash256_ge32().

Benchmarking on an Intel Xeon Scalable 4th Generation (Sapphire Rapids),
the "uuids" data set has a 10% performance loss for some reason.

Pick-to: 6.5 6.6 6.7
Change-Id: I50e2158aeade4256ad1dfffd17b1b105d3cab482
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-10 21:39:31 -08:00
Volker Hilsheimer a8c04721af Add virtual QObjectPrivate::writeToDebugStream
QObject by default writes class- and objectName to the debug stream,
but QObject subclasses might want to write different, or additional
information. Providing class-specific debug stream operators is not a
good solution for this, as it doesn't respect runtime polymorphism.

With a virtual helper in QObjectPrivate, class authors can add an
override.

Change-Id: I382126ae5a56391d0c7e5ccb58fbbafa6aab5c77
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-10 22:07:56 +01:00
Thiago Macieira 2c51a0bb7b QDBusAdaptors/Doc: fix missing preposition "in" in documentation
Drive-by clarify a bit the text what "it" means, because it's different
from the "it" in "its" two words later.

Fixes: QTBUG-121875
Pick-to: 6.6 6.7
Change-Id: I664b9f014ffc48cbb49bfffd17b0959e7b3495fd
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2024-02-10 02:39:14 -08:00
Thiago Macieira f3832b63de QtSql: #include mocs
Pick-to: 6.7
Change-Id: I50e2158aeade4256ad1dfffd17b1f286a9001ae8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-10 02:39:14 -08:00
Giuseppe D'Angelo f221ac04c5 QPixelLayout: remove explicit array sizes
For qPixelLayouts, there's a static_assert right below it that checks
that the array has a specific size, as a guard for extending
QImage::NImageFormats without also extending the array. Giving an
explicit size to qPixelLayouts defeats the entire purpose.

For the other arrays of function pointers, drop the sizing and add the
missing static_asserts.

Use std::size as a drive-by.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: Ic791a706a8ae964e3aee482f23b7eeeedf97bdc6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-10 10:19:21 +01:00
Giuseppe D'Angelo 7dec8f74a0 QPdfWriter: doc fix
When switching the default to Auto, forgot to also fix the
corresponding method documentation.

Change-Id: I4169680b6833a2ea381d950a3a7fad005c14bc71
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-02-10 08:49:17 +01:00
Tim Blechmann 72f5793d2e qmake: make unity-buildable
msvc_objectmodel.cpp and qmakeparser.cpp have symbols that may clash.
Removing them from unity builds allows qmake to be unity-built.

Pick-to: 6.7 6.6 6.5
Change-Id: I46443ec979142ab2ebb686f9444b37e1043f0af1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-02-10 03:08:19 +00:00
Volker Hilsheimer a86321cb66 QTreeView: fix performance regression from accessibility updates
When expanding items in a tree view, the model as seen by accessibility
changes size and structure, and needs to be reset. This was done in
6a4afebc5c by emitting a ModelReset update
at the end of QTreeViewPrivate::layout when laying out the items had
changed the number of visible items.

However, QTreeViewPrivate::layout is called both recursively, and in a
loop when expanding all items, or expanding items to a certain depth,
resulting in a heavy performance hit when each recursion or iteration
causes the accessibility bridge to rebuild its representation from
scratch.

Instead, we now only store a flag that the model has to be reset in
QTreeViewPrivate::layout, and then trigger the reset in the function
that call layout, after the laying out is complete.

Fixes: QTBUG-122054
Pick-to: 6.7 6.6
Change-Id: Icb8384b56a4727c8c5050a1d501aebb55f48aafe
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-09 23:16:39 +01:00
Christian Ehrlicher 16c27a83f0 SQL/ODBC: Remove code duplication - merge SQLFetch/SQLFetchScroll
... into an own function instead doing the check if fetchScroll is
available in every function.

Pick-to: 6.7
Change-Id: I8c8a1c8693f667ddf89a660b733e31505427073a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2024-02-09 23:16:39 +01:00
Christian Ehrlicher 06039b523d SQL/ODBC: avoid code duplication
... by moving the adjustment for the table/schema/catalog name into
splitTableQualifier().

Pick-to: 6.7
Change-Id: Ia392b1c2e7f29e63ea88c21492f2116eac573b5e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2024-02-09 23:16:38 +01:00
Christian Ehrlicher 686f953bdb SQL/ODBC: remove unneeded qMakeFieldInfo(... QString *errMsg)
This function can be merged with the other overload of qMakeFieldInfo()
because no-one uses it except qMakeFieldInfo() itself.

Pick-to: 6.7
Change-Id: I7ed07ac0c673801fed9c00c9b0ce1628cfea3837
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2024-02-09 23:16:38 +01:00
Alexey Edelev d2f7015184 Introduce NO_GENERATE_CPP_EXPORTS argument for qt_internal_add_module
The argument is inverted GENERATE_CPP_EXPORTS argument. Use it
explicitly for the modules that do not require the autogenerated cpp
exports.

Task-number: QTBUG-90492
Change-Id: Ic67772ba9ed5e40f132a97e7d6844102ad023ff3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-09 23:00:04 +01:00
Marc Mutz 1a7edf3ba7 Add q20::erase_if(std::(multi)map, pred)
INTEGRITY has a pre-P1115 implementation of std::erase/erase_if that
returns void instead of the number of erased elements, so make q20's
implementation more specialized, so the compiler will pick it over
INTEGRITY's.

Same as 9b83574e83 did for std::vector.

Pick-to: 6.7
Change-Id: I65149d7c92593126696f281151309b8f02ba4038
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-02-09 20:33:05 +00:00
Marc Mutz e1f45ad818 QMap: add missing qHash() overload
Found in API review, but not deemed important enough to still get into
6.7.

Not implementing it for QMultiMap, because there we need to mod out
order of equivalent elements.

The GHS compiler acted up and tried to compile the noexcept
specification, hitting non-existing qHash(QVariant) for QVariantMap
and producing a hard error instead of SFINAE'ing out. As a
work-around, establish an artificial SFINAE-friendly context, but only
for that compiler.

[ChangeLog][QtCore][QMap/QHash] Added qHash() overload for QMap.

Change-Id: Ia7dbf488e8e5490962118e40581b7c4cc8ed95e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-09 20:33:05 +00:00
Marc Mutz 3a2d8c5828 QLoggingRegistry: disable copying
It's not copied, and copying would probably be a bad idea, so make
sure it's not done inadvertently.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia7397906c0efb07ac5e079580bdbb15f4bf4911e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-09 21:33:04 +01:00
Ahmad Samir c2f38c69fc QFileSystemMetaData: use QTRY_COMPARE*(10s)
After d4bb448cdd (thanks to Marc), now we
can use chrono literals with QTRY_* macros.

Amends 72f5b35b3d .

(Cannot be backported to older branches because the QTRY* commit is only
in the dev branch).

Change-Id: Ic31d1ee717af604dd762afa44741cf9ea9b33a8e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-02-09 22:33:04 +02:00
Shawn Rutledge 3f515fa7af QtIcoHandler::canRead(): avoid checking more than once
QtIcoHandler::canRead() calls ICOReader::canRead(), which assumes that
QIODevice::pos() is at the position where the .ico data starts (i.e.
pos() == 0 if this is a separate .ico file). But if an AnimatedImage in
Qt Quick opens an .ico file, canRead() gets called multiple times:
the first is when QQuickAnimatedImage::frameCount() eventually results
in QImageReaderPrivate::initHandler(); then ICOReader::readHeader()
is called, which moves the file position. The second time is when
QQuickAnimatedImage calls QMovie::isValid(). At that time,
QIODevice::pos() == 6: we need to avoid calling ICOReader::canRead()
because it's no longer at the start of the data.

Without this change, AnimatedImage reports "Error Reading Animated Image
File" and doesn't show anything.

The fix is to store the known-good state, the same way that
QTiffHandler::canRead() returns true if its d->tiff already exists
(TIFFClientOpen() succeeded).

The test checks that it's ok to call QMovie::frameCount() first and then
QMovie::isValid(). Calling frameCount() has the effect of moving
QIODevice::pos().

Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-117429
Change-Id: Ie3a5225f2cea9a0d76d685e83ce4d4a10cbe9188
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-09 12:17:21 -07:00
Ahmad Samir 83f7125ac8 QFileSystemIterator/Unix: use QStringDecoder
The end result is a QFileInfo constructed from the QFileSystemEntry;
QFileSystemEntry's API will at some point convert the NativePath (QBA on
Unix) to a QString, e.g. when it calls findLastSeparator().

So instead of converting the parent dir path from Utf8 to Utf16 multiple
times, store the dir path as a QString once in the constructor.

Use QStringDecoder to convert the dirent->d_name to Utf16 and check the
decoder's hasError(); which as Thiago pointed out, is more efficient
than using isValidUtf8(), throwing away the results, then converting to
unicode anyway later on in QDirIteratorPrivate::advance().

(Ironically) `QFileSystemEntry::NativePath nativePath` is still used on
Windows.

Change-Id: Icd2b130103640b502862d210d64926b99c499a01
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-09 18:44:23 +02:00
Christian Ehrlicher 74722411d3 QSqlQuery: remove unneeded friend tst_QSqlQuery
... as it is no longer needed.

Pick-to: 6.7
Change-Id: Ia60b6e53675260ef0e793ac1b44c913af1454b35
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-09 17:12:23 +01:00
Christian Ehrlicher 55d1480c99 SQL/OCI: fix QOCIDriver::formatValue()
The switch needs to be on QSqlField::metaType() instead the internal
QSqlField::typeID() which holds the db-specific type of this field.

This amends 7b391c0d2c.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Id1d1791826f08adb01cc3da45bf5a66bad288046
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2024-02-09 16:12:23 +00:00
Christian Ehrlicher 02a77600e5 QHeaderView: make sectionsMovable/sectionsClickable properties
When those two attributes were added in Qt5 they were not marked as
property for unknown reason. Therefore propagate them now.

Fixes: QTBUG-1639
Change-Id: If9f0def2eb680c9c9e8a04b101768d87885d542b
Reviewed-by: David Faure <david.faure@kdab.com>
2024-02-09 17:12:23 +01:00
Tor Arne Vestbø 41b76ffbd0 Apple: Make Qt::Key_Backspace primary sequence for StandardKey::Backspace
This will show up in menus as ⌫, instead of ^H, which is a better fit
with the native behavior.

Task-number: QTBUG-122042
Task-number: QDS-11733
Pick-to: 6.7 6.6 6.5
Change-Id: I224971421a13baec2a0f65be8ae4a5791dabafdd
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-02-09 15:26:21 +01:00
Eirik Aavitsland b0056f052d Refix invalid glTexImage2D operation in FramebufferObject
A recent change fixed the texture format parameter to be RGB instead
of RGBA for opaque internal formats. However, this broke the RGB10
case, since the pixel type is then GL_UNSIGNED_INT_2_10_10_10_REV. The
doc says:

"GL_INVALID_OPERATION is generated if type is [...]
GL_UNSIGNED_INT_2_10_10_10_REV [...] and format is neither GL_RGBA nor
GL_BGRA."
https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml

This modifies ba9e57d65f.

Pick-to: 6.7 6.6 6.5
Change-Id: I9a004331513179a3f840a007af0418d14e7f5dff
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-02-09 15:26:21 +01:00