Don't loop over the list of event filters twice, do it once with a
combined predicate.
This code is still has a big impedance mismatch: the removeIf() will
always leave empty space at the back while prepend() needs it at the
front. We should fix this by reversing the meaning of the order of
event filters to mean back()-is-applied-first, so new filters can be
append()ed, but that is for another patch.
Done-with: Jarek Kobus <jaroslaw.kobus@qt.io>
Change-Id: I08324697229a54c8f66c6c320cf7232d707a08f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit edff6a33a1e3757b9bb4831091a3db8fa99e3219)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can't have duplicated filters installed,
so break the loop when removing event filter after we
have found the matching one.
Change-Id: Idda87f3090954e020b27bf3fab62677128607f03
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b909b8dfe808ed6bbb9f4353729c8810ee0e95c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Resulted from API-review
Change-Id: I84e880dc6edb9c62fd1ddd50d477347443fd52a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e2462b09b7dcbd52c4be0df5f01508dacf27cab5)
With ES 3.0 and up the GL_MAX_SAMPLES query is available and is
guaranteed to be at least 4.
With ES 2.0 there is no such query.
While what we report from supportedSampleCounts() has little
significance with OpenGL (for the window's color buffer it is
anyway the QSurfaceFormat that decides, not QRhi), QRhi users
such as Qt Quick may rely on supportedSampleCounts() returning
real values and may, for example, warn if the value attempted
to use is not in the supported list. (even if MSAA is fully
functional)
Avoid getting such warnings on a pure ES 2.0 implementation
with 4x at least.
Pick-to: 6.6 6.5
Fixes: QTBUG-120474
Change-Id: I8a34a8bc9ce37ce951fdf7794247e8db44435d41
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 520d755d324a32c97cb9e25b617e99d0ab93d666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The UBSan raises a division by zero in getRadialGradientValues. This can
be avoided by calculating the inverse in
qt_fetch_radial_gradient_template as a checker is done to avoid
division by zero there. (Credit to OSS-Fuzz)
Fixes: QTBUG-120332
Change-Id: I798d1efc87ee07df7ca6f401aa476013cdbffe42
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 69bed6cd3f12a3c1b0182c5a3706efa617090cfa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
File extensions with multiple parts, such as as ".tar.gz" are not natively
supported on macOS. Asking NSSavePanel to only allow file types with such
extensions confuses it severely, so we work around it by reducing the
native file name filter to the last component of the extension.
In this situation, we explicitly tell the NSSavePanel to show the full
filename, including the extension, so that the user can more easily
see what the final file name will be.
However, as part of 7f8a80ebf87cccb57da316202e5350eb5eca9d5d we ended
up changing the logic to count the number of possible extensions for
a given file type filter, not the number of parts in the extension.
The logic has now been restored, but moved to init, so that it applies
even if the initial filter is not a multi-part extension.
Task-number: QTBUG-109877
Pick-to: 6.6 6.5 6.2
Change-Id: I244cea1cc2977f8adf7e359ea7116bbfad0e1059
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit fd817c28a03f8b6743ea678c9edf3f8f047db627)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Provides the possibility to read text data as it arrives, instead
of needing to wait until the whole body is received.
Task-number: QTBUG-119002
Change-Id: I64f90148fd41a77c4ae2d5dbd6194a924a9f3a86
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 4da14a67a6157c415f8228a8bae7d6b0f895df7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test was flaky, because of qWaitForWindowActive() after show().
It is not guaranteed, that a window has focus after show().
Use qWaitForWindowExposed() instead.
Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I1eb8a73f2beafec00c4a6f6b34bfd36a8d6e4d93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 599328845c7e77bc7b4fd5b4f2de000bb463a814)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macros expand to declarations that end in a private: section, which
means everything following them is private. As Fabian said in the bug
report, this is obvious when Q_OBJECT/GADGET ...etc are used in a class,
but might be a bit surprising when used in a `struct`.
Fixes: QTBUG-120297
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Iacdfc4eb3bab3554cc1142f682b11b32c3868b8f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit eb2db79064bd6e74d0b3485a650e4025d0a39c96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Simplify wording, leave out historical baggage (which
is not really relevant for users that look into new code).
Change-Id: I9be1d42b6d75dd4bf6fccd6ecb47bc7cd6026ed3
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f23154c05ba0de300d017f1c50910da324414eef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ColorScheme is used in Qt as a name for dark/light desktop mode
properties.
The enum value was named incorrectly.
=> Fix it.
Pick-to: 6.6 6.5
Change-Id: I2aa72f81e36c0997127dd6de0e23d4773509ba40
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit c4bd6ac4e5a0782d8771af1485a3b78733180785)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Wrap the arguments to \inlineimage in curly braces so that the
describing image text doesn't show on the page.
Fixes: QTBUG-120572
Pick-to: 6.6 6.5 6.2
Change-Id: I00f4befc64c20fb6de1dd5ddcb6ca2573fa7c355
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 5358d7a5fe394a37435a947484f1efb7ce297fa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Qt 4.8 reference is not relevant. And mentioning that calling the
function more than once is safe, or why that is, is strange, as users
should still treat the object as something that will go away soon.
Change-Id: Icf24aa8ffe079e35351006dd77063df48a596fab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e02dc31fbf3ae460bea2aea068ccc969d6e852fc)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In QOpenGLCompositorBackingStore::resize it is already checked whether dstWin is valid, but dstCtx may also be nullptr at this point.
Task-number: QTBUG-120078
Change-Id: I4a6ad71dd8225b94baff05984275ad1860298dfc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 3f724466374cc34d0aba862f009a417540df81cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in API-review
Change-Id: Ia41eb91e9e62a252b76c20c67c1c599c0f6a633d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b5665f6fab40232a81a056523608c295c8167bc6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Could not connect "org.freedesktop.NetworkManager" to "stateChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMState
Could not connect "org.freedesktop.NetworkManager" to "connectivityChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMConnectivityState
Could not connect "org.freedesktop.NetworkManager" to "deviceTypeChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMDeviceType
Could not connect "org.freedesktop.NetworkManager" to "meteredChanged" : Type not registered with QtDBus in parameter list: QNetworkManagerInterface::NMMetered
These came from the fact that QDBus reimplements connectNotify() to
detect connections to a dbus interface's signals. It was triggered
also when connecting to "normal" signals from the dbus interface
subclass QNetworkManagerInterface, leading to those (new) warnings.
The fix in this commit replaces signals with direct method calls,
given that the two classes are internal and that QNetworkManagerInterface
is only used by QNetworkManagerNetworkInformationBackend (and now
vice-versa too).
Change-Id: Ifef3f65ab8e4e21a2f7fdba7fa5f0fc566153649
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cb9b46ef70f06c51aea01e83dd07d21a56627a50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(in preparation for the next commit)
Change-Id: I1a6771dc953540dfa63cb80306a48122e97eb600
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
(cherry picked from commit 9468c0e3ca4b145ffadc83170c804db5fbf0895a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As commented in header review, this will make future header reviews
less noisy.
Change-Id: Ia75e51facec100172de7dbb0854830d9981f0552
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit ab6e3c59a35e94a6740ae593b6101144fb65e089)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove a "." after the enumerator names that would end up in the docs.
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).
Change-Id: I6db1e83331552a58f77479166a67b88bb25f2d6e
Pick-to: 6.6 6.5 6.2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit e366a47d65c782055a9e361ad7e18bda6cd33780)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Browser::addConnection is not a slot/invokable, and requires arguments.
What was probably meant to happen is that the connection dialog
opens.
Pick-to: 6.6 6.5
Change-Id: I4e6bffb3e0277ca3deb7111cf4bb47ff188f6f16
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3552afe38a6ba3feebe4fd9ecd561a8c0c2b9717)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The relative path + source path can be tool long for windows
Fixes: QTBUG-120758
Pick-to: 6.6 6.5
Change-Id: I42ed4f3bbf39d31bf37a5bc76eb18f473661346b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit b4246a5c28472de3c4b6a85a3daf4a1d578894ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the painting rect is adjusted within an overloaded
QSlider::initStyleOption() there are some glitches when using the fusion
style:
- the tickmarks are not painted inside the specified rect / it is
ignored
- the glue groove bar is clipped incorrectly
Pick-to: 6.6
Fixes: QTBUG-111314
Change-Id: If140c5348031d869b527c6c4850b4a8d34b395c1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8594fe1b8dc848d8a2d61197acce67963f5fe20e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
e5d591a0d09 focused on document or tree URIs you'd get from the file
dialog, but we can also get ones via Intents from application-specific
content providers (e.g. opening an attachment from an email client).
Those need to be handled like a single document here, parsing them
like a tree URI results in a bunch of Java exceptions down the line.
Change-Id: I19cb1075fd6a3ccad927543f8bc5a63566f4877e
Pick-to: 6.6 6.5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9d4a34bbbe7ec39ef594b07aae06fc1029cc6e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A call to QWidget::destroy() will end up in QWindow::destroy(), which
calls QWindow::setVisible(false).
A call to QWindow::setVisible(false) on a widget's window will under
normal circumstances end up in QWidgetPrivate::setVisible(), which in
turn recurses back into QWindowPrivate::setVisible(), via
QWidgetPrivate::hide_helper(), ensuring that the QWindow internal
state is updated, visibleChanged emitted, and show/hide events sent.
Durin QWidget::destroy() we end up in QWindow::destroy(), which calls
QWindow::setVisible(false), but in this case the widget no longer has
Qt::WA_WState_Created, so the hide_helper() call is skipped, and the
corresponding QWindow is not kept in the loop.
To work around this we could have checked for windowHandle() instead
of Qt::WA_WState_Created before calling hide_helper(), but that had
many other side effects, so we opt for a more targeted fix.
Pick-to: 6.6 6.5
Change-Id: I68f80e5f7df9ee811afcd274a7ee4de31a110da5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 5b09d9e6d694045a6cef15f8984bab63cf86402c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
There's no final ) because there's nothing there to be delimited.
Pick-to: 6.6 6.5
Change-Id: I6e2677aad2ab45759db2fffd17a4ce4aa902e140
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 88e41fd03481d490e7fcf9429849c8fa5a5743e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 3bae65e7d61f85d2942c89e46e913c1056ba2daa.
Reason for revert: This version requires API >= 34 but we have AGP
7.4.1 which was tested against API 33 max, and updating it to version
8.x is blocked by QTBUG-106907. So, this will be re-stated AGP update
is done.
Task-number: QTBUG-106907
Change-Id: I1551ace76392a0532e1ecf431d03afbbd9d4a300
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 91b0f269ba8fc0ae16f96b18327b5aa30718b313)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 60113056bc4c328f62808d1c0fa2a1abec481f78. Calling
d->cond.notify_all();
without the mutex means that another thread could acquire the semaphore
(acquire the mutex, subtract from d->avail, return to caller) and
destroy it. That would mean this thread is now effectively dereferencing
a dangling d pointer.
Fixes: QTBUG-120762
Pick-to: 6.6 6.5
Change-Id: I196523f9addf41c2bf1ffffd17a96317f88b43dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit 763ab0e6236de80a0b589fc574c75a414d86d374)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The definition in removed_api.cpp is added within the proper #ifdef
block, only the version in the header was wrong.
Amends 8e8815b688684f5b267db1c2d8ac99c8f7f7637a
Found in 6.7 API Review
Change-Id: I0a94bfaae8b3db700c794aa83d9637ec85edffb1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a4518cc706ed9ef8ed7fd79ed3423b64c6d1fb93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The handle was drawn outside of the widget's rect when tickmarks were
enabled (TicksAbove/TicksLeft).
Pick-to: 6.6 6.5
Fixes: QTBUG-83604
Change-Id: Iff3a1a330317576a759e3fd6795d0b4849e2044b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 574692e5ac95e1f2061812a43f14d325c077b7c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIcon::availableSizes() returned duplicate sizes when there are pixmaps
with a different dpi but same size. This is not useful and therefore
filter them out. Also rearrange the conditions a little bit to bail out
on wrong mode/state early.
Task-number: QTBUG-119915
Change-Id: I9d18c78fc2a149a3a9eaaed67c6110979029705b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c53b91cc12164d779a69c2526d85e3ab9c2841e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The popup size depends on the max visible items property. But the loop
did not ignore the hidden items which results in fewer items in the
popup than allowed.
Fixes: QTBUG-120574
Pick-to: 6.6 6.5
Change-Id: Ic3c503a5272d6839aee158740e096405ca8887d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 742be5254c9919e8c743b8b489c054d778ee4850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature is needed for screen capturing Qt multimedia in order
to have better performance of getting frames
(avoid recreating fbo). In QtMM, we're going to create FBO
and use it as a hw frame (or just render it to image on the first stage)
Pick-to: 6.6 6.5
Change-Id: Id08a86b76447faa0f341c6967c2dad8f34c84959
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b96160191fc79514173b202bf6325553a798926d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_import_plugins allows to control application deployment on
non-Android platforms. This adds support for the pre-defined plugin list
that is computed using the qt_import_plugins input.
Pick-to: 6.6 6.5
Task-number: QTBUG-118829
Change-Id: Iaa9c3f600533a4b5a3079ab228fabf212d9ce5a5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 438837ce274fdc1457b66179b25df40f33b23a15)
When startOpacityAnimation is triggered and the animation doesn't
finish, it might get leaked during shutdown as shown by valgrind:
```
==133963== 600 (16 direct, 584 indirect) bytes in 1 blocks are definitely lost in loss record 2,326 of 2,356
==133963== at 0x4841FA3: operator new(unsigned long) (vg_replace_malloc.c:483)
==133963== by 0x12698E2D: QLineEditIconButton::startOpacityAnimation(double) (qlineedit_p.cpp:437)
==133963== by 0x1269900D: displayWidgets(std::vector<QLineEditPrivate::SideWidgetEntry, std::allocator<QLineEditPrivate::SideWidgetEntry> > const&, bool) (qlineedit_p.cpp:459)
==133963== by 0x126A1084: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:276)
==133963== by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963== by 0x1269AB01: QLineEdit::textChanged(QString const&) (moc_qlineedit.cpp:447)
==133963== by 0x126A0EF8: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:255)
==133963== by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963== by 0x126A1A94: QWidgetLineControl::textChanged(QString const&) (moc_qwidgetlinecontrol_p.cpp:273)
==133963== by 0x126A4C35: QWidgetLineControl::finishChange(int, bool, bool) (qwidgetlinecontrol.cpp:736)
==133963== by 0x126A4F05: QWidgetLineControl::internalSetText(QString const&, int, bool) (qwidgetlinecontrol.cpp:772)
==133963== by 0x12698AF4: setText (qwidgetlinecontrol_p.h:251)
==133963== by 0x12698AF4: QLineEditPrivate::setText(QString const&) (qlineedit_p.cpp:277)
```
Note that the line numbers above are potentially slightly off as that
backtrace was recorded on Qt 5.15.9.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ie79744d98d2783e4644e18ec51892c0bc43c1557
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76845e1d31a61735a0f0261fbc15ed7ea5ff71dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Warns MingW (or, in general, any GCC 13):
warning: converting to 'QtPrivate::NativeFloat16Type' {aka '_Float16'} from 'double' with greater conversion rank
See also a61d7529511c890aa595110b9320ea0bf53dd623.
Fix by using ints instead.
As a drive-by, make the variable constexpr.
Amends 4b755bc11a8eadd156c65b7474c11e3ce822c6f1.
Change-Id: Ie3f3c51aa7e9323c7ba96c810d2e95247d222fd2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6d005b7c570f2ad25cf2b88329a2f99ab20b8787)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>