We must not try to escape a driver string, the user has to make sure
that everything is correctly escaped when passing a complete driver
string. This fixes a regression from QTBUG-122642.
Pick-to: 6.7
Fixes: QTBUG-123444
Change-Id: I43316c7a09060f5c8117fdc3c464d239e37d9cdf
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
... but use QStringView instead in setConnectionOptions() and the
dependent functions.
Also remove the (undocumented) ability to pass the connection options in
non-uppercase - this was never supported and all other plugins don't
support this either.
[ChangeLog][SQL][ODBC] All options must now be upper-cased as documented. Lower-cased options are no longer supported.
Change-Id: I822db1ddf205c22fe939299c4ab741bbe9b56d65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When a QWidget with an associated RHI swapchain (via its QWindow) is
moved to a different top level window, that top level window has its
own backing store, and QBackingStoreRhiSupport, which doesn't know
anything about the fact that the window already has an associated
swap chain in the original top level window's QBackingStoreRhiSupport.
As having multiple swap chains for the same window is not supported
on all RHI backends (Vulkan and DX in particular), we need to throw
away the swap chain when detecting that the window is moved to a new
top level.
We do this by hooking into the existing WindowAboutToChangeInternal
event delivery to renderToTexture children, which now delivers the
event both to renderToTexture QWidget children as well as QWindows
in the hierarchy. The condition of when to deliver the event has
been updated to reflect whether the top level uses RHI for flushing,
instead of only including renderToTexture children, as the former
also includes setting QT_WIDGETS_RHI=1 explicitly.
The event is then caught by QBackingStoreRhiSupportWindowWatcher,
and handled the same way as for SurfaceAboutToBeDestroyed.
Renaming qSendWindowChangeToTextureChildrenRecursively would make
sense at this point, but to make cherry-picks easier we keep the
current name for now.
Fixes: QTBUG-120276
Pick-to: 6.7 6.5
Change-Id: Ic4c60e89be985f12a84e9f893c299e602b70851a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
returning early if the object is null will not clear pending exceptions
from the previous failed JNI call, and that will crash the app on the
next jni call if an explicit exception clearing is not done, wish mostly
the case. Checking and clearing for exceptions has to always be done
under this call.
Pick-to: 6.7
Fixes: QTBUG-122135
Change-Id: I0d42d012a4d1305fa07147fd22860d7c005f9b83
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The example breaks building 6.7 with examples on Android, due to
QObject::connect() to a lambda without context object.
Add context object.
Fixes: QTBUG-123989
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Id3994e577a8a676220ac8d9f95d01c054839c143
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Unexport the class (it's fully defined inline)
* Use QFlags instead of "manual" math on an enum class.
The latter requires some extra minor syntax adjustements (making
the enumeration public, so that the operators can pick it up; and
explicitly wrap a couple of usages of the enumerators as
the operators on them are defined *after* the class itself).
Change-Id: I176558de2d5e75697d62790d8783c417997206a9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
It has move assign, so should have move-construct. This turns out to
need QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT() and
QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QCollatorSortKeyPrivate).
In the process, make the move assignment and constructor docs in
qcollator.cpp conform to the usual pattern.
Fixes: QTBUG-123326
Change-Id: I6fc9ed254dc396ff6130df09826b993e98dcf101
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
With the introduction of CMYK32 the old logic of assuming depth
meant compatible alpha version no longer works. So change the logic
to more explicitly return compatible opaque or alpha versions and
remove the now invalid qt_maybeAlphaVersionWithSameDepth.
Change-Id: Ib1f7b76b0ce0eae7d49a0dfe369918a746bbe2b4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Follow the established convention that byte-oriented image formats
have the "8888" suffix, not "32". The old enum name is temporarily
left to help port other submodules.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I4b6f10cb22312b614cb9cf4b0ac439907276c538
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This header uses std::is_trivial_v, which requires including
the <type_traits> header.
When building with PCH enabled (which is the default), this
dependency does get satisfied via the PCH, so no issue is
visible.
This fixes building with recent version of libc++ when configured
with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES (which removes unnecessary
transitive dependencies between the libc++ headers, a configuration
which may become the default in the future), with PCH disabled.
Pick-to: 6.7 6.5 6.2
Change-Id: I5e3ae20e366ed3028b1156cee05bcf2908d6e845
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The focus chain in widgets is implemented as a double-linked list,
using QWidgetPrivate::focus_next and focus_prev as pointers to the
next/previous widget in the focus chain.
These pointers are manipulated directly at many places, which is error
prone and difficult to read.
Build an abstraction layer and remove direct usage of focus_next and
focus_prev. Provide functions to insert and remove widgets to/from the
focus chain.
Add a test function to tst_QWidget.
Task-number: QTBUG-121478
Change-Id: Ide6379c0197137e420352a2976912f2de8a8b338
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Wait 2x double click interval, to make sure a double click is safely
avoided.
Use QTRY_COMPARE at the end of the function, to cover cases where a
synchronously delivered mouse click causes posted events.
Wrap the test implementation in #ifndef QT_NO_STYLE_FUSION, as is the
declaration.
Skip the test on QNX.
Fixes: QTBUG-123798
Pick-to: 6.7 6.6 6.5
Change-Id: I73f4acb241a8c77a542152288c65f3d07582e075
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Since any window resize events originating from Qt side are ran in the
Qt thread, having the one originating from Android run in the Android
thread can lead to race conditions especially during orientation changes.
Pick-to: 6.7
Change-Id: Iebebec2fffdaf9181b01fc1e8f539c7bc232996d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Previously, we have set the size of the QWindow to match the QtView.
Also set its x and y coordinate to match, just to keep the window and
the view in sync.
Pick-to: 6.7
Change-Id: I0ea89a11e4526a0a996e7b62ac126808358b6bc7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The parent window created from the QtView had an
empty size. Also set its size when creating the window,
and when resizing the QtView. Replace parent window show()
call with showNormal() to avoid switching it to a fullscreen
window.
As a drive-by, use setGeometry() instead of setting the width
and height separately to trigger only one geometry update
for the platform window.
Pick-to: 6.7
Change-Id: I91e350c1748a9e76879faa8bfcab7575f6155f02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
QtView should only have one child, the QtWindow, and that should always
match the QtView's size, so the handling for absolute layout is
unnecessary.
Task-number: QTBUG-121516
Task-number: QTBUG-123306
Pick-to: 6.7
Change-Id: I77024ab9619e68ab98357518ad07535a2ff9614c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
QtLayout did not properly handle resizing child views to the parent's
size when their layout params width or height were MATCH_PARENT. This
was mostly visible when embedding QML to a normal Android app, as
there the Android view hierarchy is responsible for setting the size,
instead of Qt setting it every time the QWindow size changes.
Task-number: QTBUG-123306
Pick-to: 6.7
Change-Id: I08cbfa8e352d0cb2ca5b6e5aa40e891a62b82eb4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In case creation of the QTemporaryFile fails, keep the data in memory.
Change-Id: I9933571259a26ee990609010763a1ef57877338a
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
... not a QColorVector.
While cccda0e62d, successfully worked
around the problem that QColorVector does not fulfill the
_mm_store_ps() function's alignment requirement (by using the
unaligned version, _mm_storeu_ps()), it failed to address the problem
that the code writes into a QColorVector object's member variable
(float, a 32-bit storage location) when the function is asking for a
128-bit storage:
/// Stores a 128-bit vector of [4 x float] into an aligned memory
/// location.
///
/// \headerfile <x86intrin.h>
///
/// This intrinsic corresponds to the <c> VMOVAPS / MOVAPS </c> instruction.
///
/// \param __p
/// A pointer to a 128-bit memory location. The address of the memory
/// location has to be 16-byte aligned.
/// \param __a
/// A 128-bit vector of [4 x float] containing the values to be stored.
The treatment of a struct { float x, y, z, w; } as a float[4] is not
allowed by C++, and even if it was, we'd have to pass the address of
the struct object, not that of its first member variable.
It seems like Coverity has recently learned about this kind of thing,
at least there are tons of such new issues listed in the March scan
and while I can't find a report about this particular instance in the
current build, that probably just means that the Coverity build simply
doesn't see this code path due to the #ifdef'ery.
To fix, replace the QColorVector with an over-aligned float[4].
Because we're over-aligning the float[4], we can go back to the
original _mm_store_ps(), which is, presumably, faster then the -u
variant. We don't lose any expressiveness here, either, because the old
code never used any of the member functions of the QColorVector object
used as a store target.
Amends f944651e3d.
Amends cccda0e62d.
Change-Id: Ia0f8202bf4266b8b19b3de897a897de58b7a6d94
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the user gives us a CMYK image, save it as such.
[ChangeLog][QtGui][QPdfWriter] QPdfWriter can now save images in CMYK
format directly.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I4e5ba93970a545987e38d9a3b2e15b0d64bb72b6
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
These are files under our control, but still, may get moved/renamed/...
by accident. Assert that we can open them.
Change-Id: I46987f2f12e04a8d7292652eb6440fa0f345175a
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
I'm not familiar with CUPS APIs, so missing better judgment or a
code comment, handle the possibility for a failure.
Change-Id: I6f9afa9fdccaadbe199ce307f79e1d6050aa2939
Reviewed-by: Albert Astals Cid <aacid@kde.org>
As discussed in QTQAINFRA-6146, there were two potential approaches to
enabling backtraces in Qt Quick tests:
- Either via a thorough refactoring of quicktest.cpp so that each
testcase is a Slot in a programmatically-created QObject-derived class,
which will be executed via QTest::qExec() similar to the documented
QTest way. This way the pre-existing code in QTest::qRun() will setup
the fatal signal handler.
- Or as a quick fix, modify quick_test_main_with_setup() to setup a
FatalSignalHandler class and invoke prepareStackTrace() like it's
already done in QTest::qRun(). This would require exporting these
symbols in the private header.
This patch enables the implementation of the latter, as it has a
fairly light footprint, is easily revertable (should we need to),
and allows us to immediately gain insight into crashes in CI.
Task-number: QTQAINFRA-6146
Change-Id: Iedffc968acb3e570214df34884ab0afcb6b30850
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
In preparation for reusing it in Qt Quick, which currently doesn't
print backtraces upon crashes.
Task-number: QTQAINFRA-6146
Change-Id: Ib0384f514b348a398f53529ff3bcc7d4ac2daba7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Because we can't support it on 32 bit operating systems.
Task-number: QTBUG-69558
Change-Id: I406ecccdf039d7d4f4c24268c92c91e367655cba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
f1bb9cfbf6 added this value, but it was
only when a test in qtdeclarative tried to use it that it was
discovered that it couldn't be set on 32 bit operating systems (armv7,
AKA imx7) due to overflow as a result of the bit shifting that is done.
Fix it by using an old, deprecated value. If any old codebase using
that older flag tries to build against a newer Qt with this change, it
shouldn't affect it, as setting the flag does nothing in Widgets, and
native menus didn't exist in earlier versions.
Task-number: QTBUG-69558
Change-Id: I520154d02e9ccf007ebd73807685212a19fbee1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Draw the glyph directly in the paint() override, and use that
from the scaledPixmap implementation. This avoids a pixmap
creation just for drawing an icon with an existing painter.
Pick-to: 6.7
Change-Id: Iece0083a3a9f3625d843bc6e9d836baf9b5d84f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Instead of implementing scaledPixmap() to rasterize the
vector image we get from App/UIKit, and calling that from
paint, implement paint() to draw the vector image directly
through the painter, and use that in scaledPixmap.
Pick-to: 6.7
Change-Id: I2c62826f29406543bc8d8c7fa71199e91586d83b
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Although the output of these functions is premultiplied ARGB, we know
the alpha is always going to be full (1.0) because the source is CMYK 32
bit (without alpha). We can therefore avoid calling qPremultiply.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I129b601f5c93a1c444ab06c3325f946d2bcc6efc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
As part of eacd58d4e7, a mechanism was
added to prevent posting redundant UpdateRequest events to the top
level widget, managed by QWidgetRepaintManager. The mechanism relied
on a boolean that was set when posting an update request event, and
reset when processing the event for the top level widget, as part
of QWidgetRepaintManager::sync().
However, for paint-on-screen widgets, we don't post an update request
to the top level, we post it to the paint-on-screen widget directly.
And when processing that event, we don't paint the widget though the
normal QWidgetRepaintManager machinery, but instead call the paint
event via QWidgetPrivate::paintOnScreen().
As a result, an update() on a paint-on-screen widget would result
in never receiving updates for non-paint-on-screen widgets, as
we assumed there was no reason to send further update requests.
We could fix this by clearing the updateRequestSent flag as part
of the paintOnScreen() code path, but that's incorrect as the flag
represents whether the top level QWidgetRepaintManager needs an
update request event or not, and would lead to missed updates
to normal widgets until the paint-on-screen widget finishes its
update.
Instead, we only set updateRequestSent if we're posting update
requests for non-paint-on-screen widgets, which in practice
means the top level widget.
The paint on screen logic in QWidgetRepaintManager::markDirty
still takes care of rate-limiting the update requests to the
paint-on-screen widget, by comparing the dirty area of the
widget.
There is definite room for improvement here, especially in the
direction of handling update requests via QWindow::requestUpdate
instead of manually posted events, but for now this will have to
do.
Fixes: QTBUG-80167
Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ib5685de7ca2fd7cd7883a25bb7bc0255ea242d30
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We can't make the choice of whether to enable no_warn_duplicate_libraries
or not based on the Xcode version Qt was built with, as the target flags
will propagate to our cmake integration tests, which we run on platforms
where we don't have Xcode 15.
Pick-to: 6.7
Change-Id: I241a950a3d2e70652a3a6386e5dd86c681d1c13f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
It was introduced in December 2018, which is apparently too recent for
some Linux distributions. So remove the dependency that was there only
to give us MS_RDONLY and revert to the old statfs.h / sys/vfs.h flag.
We still don't include <sys/vfs.h> because it is absent on some old
Android versions.
Amends ea6abe583f.
Pick-to: 6.7
Fixes: QTBUG-123932
Change-Id: If1bf59ecbe014b569ba1fffd17c29cc448d16358
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
We can't fix the underlying reported problem, but we can warn that the
user has made a mistake.
[ChangeLog][QtCore][QObject] The class template parameter passed to
QObject::findChild() or findChildren() is now required to have the
Q_OBJECT macro. Forgetting to add it could result in finding children of
the nearest ancestor class that has the macro.
Pick-to: 6.7
Fixes: QTBUG-105023
Change-Id: I5f663c2f9f4149af84fefffd17c008f027241b56
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We don't use that in the XCB library or plugin anywhere.
Pick-to: 6.7
Change-Id: I5f663c2f9f4149af84fefffd17be8c7f3bd7bd14
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
On systems without the RTLD_NODELETE flag, simply don't call dlclose()
and leak the handle. Amends ef5ab6e006.
Pick-to: 6.7
Change-Id: I01ec3c774d9943adb903fffd17b76673562daa8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Remove unused code.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I3db7705b3963d7a7669f8c9b284d3d35a2a7da92
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>