summaryrefslogtreecommitdiff
path: root/dev-qt/qtbase/files
diff options
context:
space:
mode:
Diffstat (limited to 'dev-qt/qtbase/files')
-rw-r--r--dev-qt/qtbase/files/qtbase-6.6.3-pkgconf-deps.patch35
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.1-qeventlooplocker.patch159
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-CVE-2024-39936.patch200
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch43
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-gcc15-odr.patch32
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-qcontiguouscache.patch8
-rw-r--r--dev-qt/qtbase/files/qtbase-6.7.2-qwindowprivate-crash.patch28
-rw-r--r--dev-qt/qtbase/files/qtbase-6.8.0-qcontiguouscache.patch14
8 files changed, 325 insertions, 194 deletions
diff --git a/dev-qt/qtbase/files/qtbase-6.6.3-pkgconf-deps.patch b/dev-qt/qtbase/files/qtbase-6.6.3-pkgconf-deps.patch
deleted file mode 100644
index 965dade1c133..000000000000
--- a/dev-qt/qtbase/files/qtbase-6.6.3-pkgconf-deps.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-https://bugs.gentoo.org/928299
-https://bugreports.qt.io/browse/QTBUG-124135
-https://codereview.qt-project.org/c/qt/qtbase/+/553372
-From: Alexey Edelev <alexey.edelev@qt.io>
-Date: Fri, 05 Apr 2024 14:50:37 +0200
-Subject: [PATCH] Prefer the versioned targets over the namespaceless one when collecting deps
-
-Change the way we collect dependencies in __qt_internal_walk_libs.
-Prefer the versioned Qt targets over the namespaceless. This fixes the
-generating of the pkg-config configs.
-
-Pick-to: 6.5 6.6 6.7
-Task-number: QTBUG-124135
-Change-Id: I660376e122a99b5bc0874f2bc6ccd4d80c9ad453
---- a/cmake/QtPublicWalkLibsHelpers.cmake
-+++ b/cmake/QtPublicWalkLibsHelpers.cmake
-@@ -184,13 +184,13 @@
- if(lib_target MATCHES "^::@")
- continue()
- elseif(TARGET ${lib_target})
-- if ("${lib_target}" MATCHES "^Qt::(.*)")
-- # If both, Qt::Foo and Foo targets exist, prefer the target name without
-+ if(NOT "${lib_target}" MATCHES "^(Qt|${QT_CMAKE_EXPORT_NAMESPACE})::.+")
-+ # If both, Qt::Foo and Foo targets exist, prefer the target name with versioned
- # namespace. Which one is preferred doesn't really matter. This code exists to
- # avoid ending up with both, Qt::Foo and Foo in our dependencies.
-- set(namespaceless_lib_target "${CMAKE_MATCH_1}")
-- if(TARGET "${namespaceless_lib_target}")
-- set(lib_target ${namespaceless_lib_target})
-+ set(versioned_qt_target "${QT_CMAKE_EXPORT_NAMESPACE}::${lib_target}")
-+ if(TARGET "${versioned_qt_target}")
-+ set(lib_target ${versioned_qt_target})
- endif()
- endif()
- get_target_property(lib_target_type ${lib_target} TYPE)
diff --git a/dev-qt/qtbase/files/qtbase-6.7.1-qeventlooplocker.patch b/dev-qt/qtbase/files/qtbase-6.7.1-qeventlooplocker.patch
deleted file mode 100644
index ff2bf194f07d..000000000000
--- a/dev-qt/qtbase/files/qtbase-6.7.1-qeventlooplocker.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-https://bugs.kde.org/show_bug.cgi?id=484405
-https://bugreports.qt.io/browse/QTBUG-124386
-https://codereview.qt-project.org/c/qt/qtbase/+/556573
-https://github.com/qt/qtbase/commit/a8ef8ea55014546e0e835cd0eacf694919702a11
-From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= <tor.arne.vestbo@qt.io>
-Date: Wed, 24 Apr 2024 22:33:42 +0200
-Subject: [PATCH] Don't quit automatically via QEventLoopLocker if there are
- open windows
-
-As part of df359bcb703db5a8adbf14e88ba4ae0d54f0cfcd the semantics and
-interaction between QEventLoopLocker and QGuiApplication was changed,
-based on the assumption that these two mechanisms were independent
-and should not affect each other.
-
-This had a surprising regression where the use of QEventLoopLocker in
-combination with the QCoreApplication::isQuitLockEnabled() automatic
-quit would end up quitting the app, even if it had open windows, for
-example when the last job of some internal job queue finished.
-
-It could be argued that if the app has open windows that should not
-be closed, they should ignore the Close event, and that an application
-with running QEventLoopLocker jobs should maintain an active window
-showing the progress of those jobs, but still, this is regression
-that we want to fix.
-
-We now bail out if !lastWindowClosed() in QGuiApplication's
-canQuitAutomatically, which is triggered from QEventLoopLocker's
-isQuitLockEnabled() behavior. And we do so regardless of whether
-quitOnLastWindowClosed is set or not, as the latter property
-determines the behavior when closing a window, not the behavior
-when a QEventLoopLocker goes out of scope.
-
-Similarly, we now block quitting of the application when triggered
-by quitOnLastWindowClosed() if a QEventLoop is active, regardless of
-the isQuitLockEnabled(), as the latter property is determining
-whether we should trigger a quit, not whether we should block them.
-
-[ChangeLog][Important behavior changes] Fixed a regression where
-the last QEventLoopLocker going out of scope would quit the app,
-even if there were open windows, if quitOnLastWindowClosed was
-false.
-
-[ChangeLog][Important behavior changes] Fixed a regression where
-closing the last window would quit the app, even if there were
-active QEventLoopLockers, if isQuitLockEnabled was false.
---- a/src/corelib/kernel/qcoreapplication.cpp
-+++ b/src/corelib/kernel/qcoreapplication.cpp
-@@ -1081,2 +1081,10 @@
-
-+ When this property is \c true the release of the last remaining
-+ QEventLoopLocker operating on the application will attempt to
-+ quit the application.
-+
-+ Note that attempting a quit may not necessarily result in the
-+ application quitting, for example if there still are open windows,
-+ or the QEvent::Quit event is ignored.
-+
- The default is \c true.
-@@ -2083,3 +2091,9 @@
-
-- if (quitLockEnabled && quitLockRef.loadRelaxed())
-+ // The automatic quit functionality is triggered by
-+ // both QEventLoopLocker and maybeLastWindowClosed.
-+ // In either case, we don't want to quit if there
-+ // are active QEventLoopLockers, even if quitLockEnabled
-+ // is not enabled, as the property signals whether to
-+ // trigger the automatic quit, not whether to block it.
-+ if (quitLockRef.loadRelaxed())
- return false;
---- a/src/corelib/kernel/qeventloop.cpp
-+++ b/src/corelib/kernel/qeventloop.cpp
-@@ -339,3 +339,7 @@
-
-- The application will quit when there are no more QEventLoopLockers operating on it.
-+ The application will attempt to quit when there are no more QEventLoopLockers
-+ operating on it, as long as QCoreApplication::isQuitLockEnabled() is \c true.
-+
-+ Note that attempting a quit may not necessarily result in the application quitting,
-+ if there for example are open windows, or the QEvent::Quit event is ignored.
-
---- a/src/gui/kernel/qguiapplication.cpp
-+++ b/src/gui/kernel/qguiapplication.cpp
-@@ -3677,5 +3677,9 @@
-
-- If this property is \c true, the applications quits when the last visible
-- \l{Primary and Secondary Windows}{primary window} (i.e. top level window
-- with no transient parent) is closed.
-+ If this property is \c true, the application will attempt to
-+ quit when the last visible \l{Primary and Secondary Windows}{primary window}
-+ (i.e. top level window with no transient parent) is closed.
-+
-+ Note that attempting a quit may not necessarily result in the
-+ application quitting, for example if there still are active
-+ QEventLoopLocker instances, or the QEvent::Quit event is ignored.
-
-@@ -3735,3 +3739,9 @@
- {
-- if (quitOnLastWindowClosed && !lastWindowClosed())
-+ // The automatic quit functionality is triggered by
-+ // both QEventLoopLocker and maybeLastWindowClosed.
-+ // Although the former is a QCoreApplication feature
-+ // we don't want to quit the application when there
-+ // are open windows, regardless of whether the app
-+ // also quits automatically on maybeLastWindowClosed.
-+ if (!lastWindowClosed())
- return false;
---- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
-+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
-@@ -1010,4 +1010,4 @@
- {
-- // Disabling QEventLoopLocker support should not affect
-- // quitting when last window is closed.
-+ // Disabling QEventLoopLocker automatic quit should not affect
-+ // quitting when last window is closed if there are no lockers.
- app.setQuitLockEnabled(false);
-@@ -1025,4 +1025,36 @@
- {
-- // Disabling quitOnLastWindowClosed support should not affect
-- // quitting when last QEventLoopLocker goes out of scope.
-+ // Disabling QEventLoopLocker automatic quit should still block
-+ // quitting when last window is closed if there is a locker alive.
-+ app.setQuitLockEnabled(false);
-+
-+ QScopedPointer<QEventLoopLocker> locker(new QEventLoopLocker);
-+
-+ QuitSpy quitSpy;
-+ QWindow window;
-+ window.show();
-+ QVERIFY(QTest::qWaitForWindowExposed(&window));
-+ QTimer::singleShot(0, &window, &QWindow::close);
-+ QTimer::singleShot(200, &app, []{ QCoreApplication::exit(0); });
-+ app.exec();
-+ QCOMPARE(quitSpy.quits, 0);
-+ }
-+
-+ {
-+ // Disabling quitOnLastWindowClosed automatic quit should not affect
-+ // quitting when last QEventLoopLocker goes out of scope if
-+ // there are no windows.
-+ app.setQuitLockEnabled(true);
-+ app.setQuitOnLastWindowClosed(false);
-+
-+ QuitSpy quitSpy;
-+ QScopedPointer<QEventLoopLocker> locker(new QEventLoopLocker);
-+ QTimer::singleShot(0, [&]{ locker.reset(nullptr); });
-+ QTimer::singleShot(200, &app, []{ QCoreApplication::exit(0); });
-+ app.exec();
-+ QCOMPARE(quitSpy.quits, 1);
-+ }
-+
-+ {
-+ // Disabling quitOnLastWindowClosed automatic quit should still block
-+ // quitting via QEventLoopLocker if there's a window alive.
- app.setQuitLockEnabled(true);
-@@ -1038,3 +1070,3 @@
- app.exec();
-- QCOMPARE(quitSpy.quits, 1);
-+ QCOMPARE(quitSpy.quits, 0);
- }
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-CVE-2024-39936.patch b/dev-qt/qtbase/files/qtbase-6.7.2-CVE-2024-39936.patch
new file mode 100644
index 000000000000..cc6238a55f1b
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-CVE-2024-39936.patch
@@ -0,0 +1,200 @@
+https://bugs.gentoo.org/935869
+https://github.com/qt/qtbase/commit/2b1e36e183ce75c224305c7a94457b92f7a5cf58
+From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= <marten.nordheim@qt.io>
+Date: Tue, 25 Jun 2024 17:09:35 +0200
+Subject: [PATCH] HTTP2: Delay any communication until encrypted() can be
+ responded to
+
+We have the encrypted() signal that lets users do extra checks on the
+established connection. It is emitted as BlockingQueued, so the HTTP
+thread stalls until it is done emitting. Users can potentially call
+abort() on the QNetworkReply at that point, which is passed as a Queued
+call back to the HTTP thread. That means that any currently queued
+signal emission will be processed before the abort() call is processed.
+
+In the case of HTTP2 it is a little special since it is multiplexed and
+the code is built to start requests as they are available. This means
+that, while the code worked fine for HTTP1, since one connection only
+has one request, it is not working for HTTP2, since we try to send more
+requests in-between the encrypted() signal and the abort() call.
+
+This patch changes the code to delay any communication until the
+encrypted() signal has been emitted and processed, for HTTP2 only.
+It's done by adding a few booleans, both to know that we have to return
+early and so we can keep track of what events arose and what we need to
+resume once enough time has passed that any abort() call must have been
+processed.
+
+Fixes: QTBUG-126610
+--- a/src/network/access/qhttp2protocolhandler.cpp
++++ b/src/network/access/qhttp2protocolhandler.cpp
+@@ -304,10 +304,10 @@
+ }
+
+- if (!prefaceSent && !sendClientPreface())
+- return false;
+-
+ if (!requests.size())
+ return true;
+
++ if (!prefaceSent && !sendClientPreface())
++ return false;
++
+ m_channel->state = QHttpNetworkConnectionChannel::WritingState;
+ // Check what was promised/pushed, maybe we do not have to send a request
+--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
++++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
+@@ -210,4 +210,8 @@
+ {
+ Q_ASSERT(protocolHandler);
++ if (waitingForPotentialAbort) {
++ needInvokeSendRequest = true;
++ return false; // this return value is unused
++ }
+ return protocolHandler->sendRequest();
+ }
+@@ -222,7 +226,6 @@
+ {
+ QMetaObject::invokeMethod(this, [this] {
+- Q_ASSERT(protocolHandler);
+ if (reply)
+- protocolHandler->sendRequest();
++ sendRequest();
+ }, Qt::ConnectionType::QueuedConnection);
+ }
+@@ -231,4 +234,8 @@
+ {
+ Q_ASSERT(protocolHandler);
++ if (waitingForPotentialAbort) {
++ needInvokeReceiveReply = true;
++ return;
++ }
+ protocolHandler->_q_receiveReply();
+ }
+@@ -237,4 +244,8 @@
+ {
+ Q_ASSERT(protocolHandler);
++ if (waitingForPotentialAbort) {
++ needInvokeReadyRead = true;
++ return;
++ }
+ protocolHandler->_q_readyRead();
+ }
+@@ -1240,5 +1251,16 @@
+ // Similar to HTTP/1.1 counterpart below:
+ const auto &pair = std::as_const(h2RequestsToSend).first();
++ waitingForPotentialAbort = true;
+ emit pair.second->encrypted();
++
++ // We don't send or handle any received data until any effects from
++ // emitting encrypted() have been processed. This is necessary
++ // because the user may have called abort(). We may also abort the
++ // whole connection if the request has been aborted and there is
++ // no more requests to send.
++ QMetaObject::invokeMethod(this,
++ &QHttpNetworkConnectionChannel::checkAndResumeCommunication,
++ Qt::QueuedConnection);
++
+ // In case our peer has sent us its settings (window size, max concurrent streams etc.)
+ // let's give _q_receiveReply a chance to read them first ('invokeMethod', QueuedConnection).
+@@ -1258,4 +1280,26 @@
+ }
+
++
++void QHttpNetworkConnectionChannel::checkAndResumeCommunication()
++{
++ Q_ASSERT(connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2
++ || connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP2Direct);
++
++ // Because HTTP/2 requires that we send a SETTINGS frame as the first thing we do, and respond
++ // to a SETTINGS frame with an ACK, we need to delay any handling until we can ensure that any
++ // effects from emitting encrypted() have been processed.
++ // This function is called after encrypted() was emitted, so check for changes.
++
++ if (!reply && h2RequestsToSend.isEmpty())
++ abort();
++ waitingForPotentialAbort = false;
++ if (needInvokeReadyRead)
++ _q_readyRead();
++ if (needInvokeReceiveReply)
++ _q_receiveReply();
++ if (needInvokeSendRequest)
++ sendRequest();
++}
++
+ void QHttpNetworkConnectionChannel::requeueHttp2Requests()
+ {
+--- a/src/network/access/qhttpnetworkconnectionchannel_p.h
++++ b/src/network/access/qhttpnetworkconnectionchannel_p.h
+@@ -75,4 +75,8 @@
+ bool ssl;
+ bool isInitialized;
++ bool waitingForPotentialAbort = false;
++ bool needInvokeReceiveReply = false;
++ bool needInvokeReadyRead = false;
++ bool needInvokeSendRequest = false;
+ ChannelState state;
+ QHttpNetworkRequest request; // current request, only used for HTTP
+@@ -147,4 +151,6 @@
+ void resendCurrentRequest();
+
++ void checkAndResumeCommunication();
++
+ bool isSocketBusy() const;
+ bool isSocketWriting() const;
+--- a/tests/auto/network/access/http2/tst_http2.cpp
++++ b/tests/auto/network/access/http2/tst_http2.cpp
+@@ -107,4 +107,6 @@
+ void duplicateRequestsWithAborts();
+
++ void abortOnEncrypted();
++
+ protected slots:
+ // Slots to listen to our in-process server:
+@@ -1480,4 +1482,46 @@
+ }
+
++void tst_Http2::abortOnEncrypted()
++{
++#if !QT_CONFIG(ssl)
++ QSKIP("TLS support is needed for this test");
++#else
++ clearHTTP2State();
++ serverPort = 0;
++
++ ServerPtr targetServer(newServer(defaultServerSettings, H2Type::h2Direct));
++
++ QMetaObject::invokeMethod(targetServer.data(), "startServer", Qt::QueuedConnection);
++ runEventLoop();
++
++ nRequests = 1;
++ nSentRequests = 0;
++
++ const auto url = requestUrl(H2Type::h2Direct);
++ QNetworkRequest request(url);
++ request.setAttribute(QNetworkRequest::Http2DirectAttribute, true);
++
++ std::unique_ptr<QNetworkReply> reply{manager->get(request)};
++ reply->ignoreSslErrors();
++ connect(reply.get(), &QNetworkReply::encrypted, reply.get(), [reply = reply.get()](){
++ reply->abort();
++ });
++ connect(reply.get(), &QNetworkReply::errorOccurred, this, &tst_Http2::replyFinishedWithError);
++
++ runEventLoop();
++ STOP_ON_FAILURE
++
++ QCOMPARE(nRequests, 0);
++ QCOMPARE(reply->error(), QNetworkReply::OperationCanceledError);
++
++ const bool res = QTest::qWaitFor(
++ [this, server = targetServer.get()]() {
++ return serverGotSettingsACK || prefaceOK || nSentRequests > 0;
++ },
++ 500);
++ QVERIFY(!res);
++#endif // QT_CONFIG(ssl)
++}
++
+ void tst_Http2::serverStarted(quint16 port)
+ {
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch b/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch
new file mode 100644
index 000000000000..a54c9daa42b9
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-float16-sse2.patch
@@ -0,0 +1,43 @@
+Backport from 6.7.3 as it may cause major problems for x86 sse2-less
+systems using gcc14.
+
+https://github.com/qt/qtbase/commit/39fa7e7bef90be2940c5f736935f963e3969e0bd
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Sat, 27 Jul 2024 23:03:07 +0300
+Subject: [PATCH] Use _Float16 only when SSE2 is enabled
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The GCC documentation [1] says: “On x86 targets with SSE2 enabled, GCC
+supports half-precision (16-bit) floating point via the _Float16 type”.
+
+On non-SSE2 x86 (such as Debian i386 baseline [2]), __FLT16_MAX__ is
+defined starting with GCC 14 [3], however any non-trivial use of the
+_Float16 type results in an error:
+
+error: operation not permitted on type ‘_Float16’ without option ‘-msse2’
+
+which makes some packages fail to build on i386 architecture [4].
+
+[1]: https://gcc.gnu.org/onlinedocs/gcc/Half-Precision.html
+[2]: https://wiki.debian.org/ArchitectureSpecificsMemo#i386-1
+[3]: https://gcc.gnu.org/g:9a19fa8b616f83474c35cc5b34a3865073ced829
+[4]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076986
+--- a/src/corelib/global/qtypes.h
++++ b/src/corelib/global/qtypes.h
+@@ -264,11 +264,10 @@
+ # define QFLOAT16_IS_NATIVE 1
+ using NativeFloat16Type = decltype(__FLT16_MAX__);
+-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__)
++#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__ARM_FP16_FORMAT_IEEE)
+ # define QFLOAT16_IS_NATIVE 1
+-# ifdef __ARM_FP16_FORMAT_IEEE
+ using NativeFloat16Type = __fp16;
+-# else
++#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__SSE2__)
++# define QFLOAT16_IS_NATIVE 1
+ using NativeFloat16Type = _Float16;
+-# endif
+ #else
+ # define QFLOAT16_IS_NATIVE 0
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-gcc15-odr.patch b/dev-qt/qtbase/files/qtbase-6.7.2-gcc15-odr.patch
new file mode 100644
index 000000000000..64cedb14662a
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-gcc15-odr.patch
@@ -0,0 +1,32 @@
+https://codereview.qt-project.org/c/qt/qtbase/+/582403
+From: Sam James <sam@gentoo.org>
+Date: Sat, 10 Aug 2024 16:43:05 +0100
+Subject: [PATCH] Fix ODR violation for IsFloatType_v
+
+With recent GCC 15 trunk, I started to see:
+```
+ld: .../kwalletentry.cc.o:(.rodata+0x0): multiple definition of `QtPrivate::IsFloatType_v<_Float16>';
+ src/runtime/kwalletd/backend/CMakeFiles/KF6WalletBackend.dir/cbc.cc.o:(.rodata+0x0): first defined here
+```
+
+The issue is that constexpr is only implicitly inline for functions or
+static data members [0], so the two constexpr IsFloatType_v definitions
+here cause an ODR violation.
+
+Explicitly mark them as inline constexpr.
+
+[0] http://eel.is/c++draft/dcl.constexpr#1.sentence-3
+--- a/src/corelib/global/qcomparehelpers.h
++++ b/src/corelib/global/qcomparehelpers.h
+@@ -348,9 +348,9 @@
+
+ template <typename T>
+-constexpr bool IsFloatType_v = std::is_floating_point_v<T>;
++inline constexpr bool IsFloatType_v = std::is_floating_point_v<T>;
+
+ #if QFLOAT16_IS_NATIVE
+ template <>
+-constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
++inline constexpr bool IsFloatType_v<QtPrivate::NativeFloat16Type> = true;
+ #endif
+
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-qcontiguouscache.patch b/dev-qt/qtbase/files/qtbase-6.7.2-qcontiguouscache.patch
new file mode 100644
index 000000000000..02219feaf681
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-qcontiguouscache.patch
@@ -0,0 +1,8 @@
+https://bugs.gentoo.org/938475
+Older version of https://codereview.qt-project.org/c/qt/qtbase/+/585668 for 6.7
+--- a/src/corelib/tools/qcontiguouscache.h
++++ b/src/corelib/tools/qcontiguouscache.h
+@@ -10,2 +10,3 @@
+ #include <QtCore/qtcoreexports.h>
++#include <QtCore/qglobal.h>
+ #include <QtCore/qtypeinfo.h>
diff --git a/dev-qt/qtbase/files/qtbase-6.7.2-qwindowprivate-crash.patch b/dev-qt/qtbase/files/qtbase-6.7.2-qwindowprivate-crash.patch
new file mode 100644
index 000000000000..353383921b7f
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.7.2-qwindowprivate-crash.patch
@@ -0,0 +1,28 @@
+https://bugs.kde.org/show_bug.cgi?id=490791
+https://codereview.qt-project.org/c/qt/qtbase/+/584636
+From: David Edmundson <davidedmundson@kde.org>
+Date: Wed, 31 Jul 2024 11:59:14 +0100
+Subject: [PATCH] QWidget: Store initialScreen as QPointer
+
+A Toplevel QWidget can hold a pointer to the screen where it will
+eventually show contents, before a QWidgetWindow is created which then
+takes precedence.
+
+The screen member of QWindows is always kept up-to-date when a screen is
+removed, but not the contents of a toplevel window. If a widget has
+setScreen called but is never shown, it has potentially dangling pointer
+which can cause issues in the future.
+
+Pick-to: 6.5
+Change-Id: Ia7c80549e8b3c90a75cdde745487e87ecddaca63
+Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
+(cherry picked from commit d67acf94afffde6a71498be6e30447f3acf7558e)
+Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
+(cherry picked from commit 6af4e5f604fff40cdb3be40099b8884362806ef4)
+--- a/src/widgets/kernel/qwidget_p.h
++++ b/src/widgets/kernel/qwidget_p.h
+@@ -110,3 +110,3 @@
+ Qt::WindowFlags savedFlags; // Save widget flags while showing fullscreen
+- QScreen *initialScreen; // Screen when passing a QDesktop[Screen]Widget as parent.
++ QPointer<QScreen> initialScreen; // Screen when passing a QDesktop[Screen]Widget as parent.
+
diff --git a/dev-qt/qtbase/files/qtbase-6.8.0-qcontiguouscache.patch b/dev-qt/qtbase/files/qtbase-6.8.0-qcontiguouscache.patch
new file mode 100644
index 000000000000..e5f14e0a1c73
--- /dev/null
+++ b/dev-qt/qtbase/files/qtbase-6.8.0-qcontiguouscache.patch
@@ -0,0 +1,14 @@
+https://bugs.gentoo.org/938475
+https://codereview.qt-project.org/c/qt/qtbase/+/585668
+From: Sam James <sam@gentoo.org>
+Date: Sun, 25 Aug 2024 17:34:22 +0100
+Subject: [PATCH] QContiguousCache: fix include for qMin
+
+Include `<QtCore/qminmax.h>` for `qMin`. This came up downstream
+in Gentoo at https://bugs.gentoo.org/938475.
+--- a/src/corelib/tools/qcontiguouscache.h
++++ b/src/corelib/tools/qcontiguouscache.h
+@@ -10,2 +10,3 @@
+ #include <QtCore/qtcoreexports.h>
++#include <QtCore/qminmax.h>
+ #include <QtCore/qttypetraits.h>