summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qdebug.cpp18
-rw-r--r--src/corelib/io/qdirlisting.cpp18
-rw-r--r--src/corelib/io/qfilesystemengine.cpp1
-rw-r--r--src/corelib/io/qfilesystemengine_mac.mm1
-rw-r--r--src/corelib/io/qfilesystemengine_p.h1
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp1
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp1
-rw-r--r--src/corelib/kernel/qmetaobject.cpp9
-rw-r--r--src/corelib/serialization/qtextstream.cpp6
-rw-r--r--src/corelib/serialization/qtextstream_p.h2
-rw-r--r--src/corelib/tools/qarraydata.h10
-rw-r--r--src/corelib/tools/qarraydataops.h4
-rw-r--r--src/corelib/tools/qduplicatetracker_p.h6
-rw-r--r--src/dbus/qdbusargument.h6
-rw-r--r--src/gui/kernel/qsurfaceformat.cpp37
-rw-r--r--src/gui/kernel/qsurfaceformat.h9
-rw-r--r--src/gui/painting/qpainterpath.cpp24
-rw-r--r--src/gui/painting/qpainterpath.h5
-rw-r--r--src/gui/painting/qpainterpath_p.h1
-rw-r--r--src/network/kernel/qnetworkproxy_android.cpp3
-rw-r--r--src/plugins/platforms/android/androidcontentfileengine.cpp2
-rw-r--r--src/plugins/platforms/android/extract.cpp1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaclipboard.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoacursor.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.h12
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoahelpers.mm2
-rw-r--r--src/plugins/platforms/cocoa/qmacclipboard.h2
-rw-r--r--src/plugins/platforms/cocoa/qmacclipboard.mm1
-rw-r--r--src/plugins/platforms/cocoa/qmultitouch_mac_p.h9
-rw-r--r--src/plugins/platforms/cocoa/qnsview_dragging.mm2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp6
32 files changed, 102 insertions, 111 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 645f27798c4..5d6b5e06be6 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -200,7 +200,7 @@ template <typename Char>
static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, size_t length, bool isUnicode = true)
{
QChar quote(u'"');
- d->write(&quote, 1);
+ d->write(quote);
bool lastWasHexEscape = false;
const Char *end = begin + length;
@@ -227,8 +227,7 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si
continue;
}
} else if (isPrintable(*p) && *p != '\\' && *p != '"') {
- QChar c = QLatin1Char(*p);
- d->write(&c, 1);
+ d->write(char16_t{uchar(*p)});
continue;
}
@@ -302,7 +301,7 @@ static inline void putEscapedString(QTextStreamPrivate *d, const Char *begin, si
d->write(reinterpret_cast<QChar *>(buf), buflen);
}
- d->write(&quote, 1);
+ d->write(quote);
}
/*!
@@ -332,9 +331,14 @@ void QDebug::putByteArray(const char *begin, size_t length, Latin1Content conten
if (stream->noQuotes) {
// no quotes, write the string directly too (no pretty-printing)
// this respects the QTextStream state, though
- QString string = content == ContainsLatin1 ? QString::fromLatin1(begin, qsizetype(length))
- : QString::fromUtf8(begin, qsizetype(length));
- stream->ts.d_ptr->putString(string);
+ switch (content) {
+ case Latin1Content::ContainsLatin1:
+ stream->ts.d_ptr->putString(QLatin1StringView{begin, qsizetype(length)});
+ break;
+ case Latin1Content::ContainsBinary:
+ stream->ts.d_ptr->putString(QUtf8StringView{begin, qsizetype(length)});
+ break;
+ }
} else {
// we'll reset the QTextStream formatting mechanisms, so save the state
QDebugStateSaver saver(*this);
diff --git a/src/corelib/io/qdirlisting.cpp b/src/corelib/io/qdirlisting.cpp
index c626033dcdb..1fec92a01e2 100644
--- a/src/corelib/io/qdirlisting.cpp
+++ b/src/corelib/io/qdirlisting.cpp
@@ -510,16 +510,14 @@ bool QDirListingPrivate::matchesFilters(QDirEntryInfo &entryInfo) const
if (!iteratorFlags.testAnyFlag(F::IncludeHidden) && entryInfo.isHidden())
return false;
- if (entryInfo.isSymLink()) {
- // With ResolveSymlinks, we look at the type of the link's target,
- // and exclude broken symlinks (where the target doesn't exist).
- if (iteratorFlags.testAnyFlag(F::ResolveSymlinks)) {
- if (!entryInfo.exists())
- return false;
- } else if (iteratorFlags.testAnyFlags(F::FilesOnly)
- || iteratorFlags.testAnyFlags(F::DirsOnly)) {
- return false; // symlink is not a file or dir
- }
+ // With ResolveSymlinks, we look at the type of the link's target,
+ // and exclude broken symlinks (where the target doesn't exist).
+ if (iteratorFlags.testAnyFlag(F::ResolveSymlinks)) {
+ if (entryInfo.isSymLink() && !entryInfo.exists())
+ return false;
+ } else if ((iteratorFlags.testAnyFlags(F::FilesOnly)
+ || iteratorFlags.testAnyFlags(F::DirsOnly)) && entryInfo.isSymLink()) {
+ return false; // symlink is not a file or dir
}
if (iteratorFlags.testAnyFlag(F::ExcludeOther)
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index c69ac381020..03da2331e05 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -1,5 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:critical reason:data-parser
#include "qfilesystemengine_p.h"
#include <QtCore/qdir.h>
diff --git a/src/corelib/io/qfilesystemengine_mac.mm b/src/corelib/io/qfilesystemengine_mac.mm
index a0dc83321e4..08fe2afc81c 100644
--- a/src/corelib/io/qfilesystemengine_mac.mm
+++ b/src/corelib/io/qfilesystemengine_mac.mm
@@ -1,5 +1,6 @@
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:significant reason:default
#include "qplatformdefs.h"
#include "qfilesystemengine_p.h"
diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h
index 773c1d34f87..ee70ccc1e1b 100644
--- a/src/corelib/io/qfilesystemengine_p.h
+++ b/src/corelib/io/qfilesystemengine_p.h
@@ -1,5 +1,6 @@
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:critical reason:data-parser
#ifndef QFILESYSTEMENGINE_P_H
#define QFILESYSTEMENGINE_P_H
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index c22a5684b74..b7f5286ae43 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -2,6 +2,7 @@
// Copyright (C) 2016 The Qt Company Ltd.
// Copyright (C) 2013 Samuel Gaist <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:critical reason:data-parser
#include "qplatformdefs.h"
#include "qfilesystemengine_p.h"
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index f8b5806cb35..1ad90f16996 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -1,5 +1,6 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// Qt-Security score:critical reason:data-parser
#include "qfilesystemengine_p.h"
#include "qoperatingsystemversion.h"
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 5487167e59b..1e6e8318446 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -808,8 +808,7 @@ static int indexOfMethod_helper(const QMetaObject *m, const char *method)
int QMetaObject::indexOfMethod(const char *method) const
{
- const QMetaObject *m = this;
- int i = indexOfMethod_helper(m, method);
+ int i = indexOfMethod_helper(this, method);
INDEXOF_COMPAT(Method, method);
return i;
}
@@ -882,8 +881,7 @@ static int indexOfSignal_helper(const QMetaObject *m, const char *signal)
int QMetaObject::indexOfSignal(const char *signal) const
{
- const QMetaObject *m = this;
- int i = indexOfSignal_helper(m, signal);
+ int i = indexOfSignal_helper(this, signal);
INDEXOF_COMPAT(Signal, signal);
return i;
}
@@ -939,8 +937,7 @@ static int indexOfSlot_helper(const QMetaObject *m, const char *slot)
int QMetaObject::indexOfSlot(const char *slot) const
{
- const QMetaObject *m = this;
- int i = indexOfSlot_helper(m, slot);
+ int i = indexOfSlot_helper(this, slot);
INDEXOF_COMPAT(Slot, slot);
return i;
}
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp
index 5e0eff698f9..e4dc98af98b 100644
--- a/src/corelib/serialization/qtextstream.cpp
+++ b/src/corelib/serialization/qtextstream.cpp
@@ -711,7 +711,7 @@ void QTextStreamPrivate::write(const QChar *data, qsizetype len)
/*!
\internal
*/
-inline void QTextStreamPrivate::write(QChar ch)
+void QTextStreamPrivate::write(QChar ch)
{
if (string) {
// ### What about seek()??
@@ -845,7 +845,7 @@ void QTextStreamPrivate::putString(const QChar *data, qsizetype len, bool number
const QChar sign = len > 0 ? data[0] : QChar();
if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
// write the sign before the padding, then skip it later
- write(&sign, 1);
+ write(sign);
++data;
--len;
}
@@ -874,7 +874,7 @@ void QTextStreamPrivate::putString(QLatin1StringView data, bool number)
const QChar sign = data.size() > 0 ? QLatin1Char(*data.data()) : QChar();
if (sign == locale.negativeSign() || sign == locale.positiveSign()) {
// write the sign before the padding, then skip it later
- write(&sign, 1);
+ write(sign);
data = QLatin1StringView(data.data() + 1, data.size() - 1);
}
}
diff --git a/src/corelib/serialization/qtextstream_p.h b/src/corelib/serialization/qtextstream_p.h
index 7227c29c8fe..bf3ce7b2ef7 100644
--- a/src/corelib/serialization/qtextstream_p.h
+++ b/src/corelib/serialization/qtextstream_p.h
@@ -145,7 +145,7 @@ public:
bool getReal(double *f);
inline void write(QStringView data) { write(data.begin(), data.size()); }
- inline void write(QChar ch);
+ void write(QChar ch);
void write(const QChar *data, qsizetype len);
void write(QLatin1StringView data);
void writePadding(qsizetype len);
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index 71e183e646e..38d1091ac1f 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -39,7 +39,7 @@ struct QArrayData
};
Q_DECLARE_FLAGS(ArrayOptions, ArrayOption)
- QBasicAtomicInt m_ref;
+ QBasicAtomicInt ref_;
ArrayOptions flags;
qsizetype alloc;
@@ -56,19 +56,19 @@ struct QArrayData
/// Returns true if sharing took place
bool ref() noexcept
{
- m_ref.ref();
+ ref_.ref();
return true;
}
/// Returns false if deallocation is necessary
bool deref() noexcept
{
- return m_ref.deref();
+ return ref_.deref();
}
bool isShared() const noexcept
{
- return m_ref.loadRelaxed() != 1;
+ return ref_.loadRelaxed() != 1;
}
// Returns true if a detach is necessary before modifying the data
@@ -76,7 +76,7 @@ struct QArrayData
// detaching is necessary, you should be in a non-const function already
bool needsDetach() noexcept
{
- return m_ref.loadRelaxed() > 1;
+ return ref_.loadRelaxed() > 1;
}
qsizetype detachCapacity(qsizetype newSize) const noexcept
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index 419585b0260..c20abd12c23 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -82,7 +82,7 @@ public:
void destroyAll() noexcept // Call from destructors, ONLY!
{
Q_ASSERT(this->d);
- Q_ASSERT(this->d->m_ref.loadRelaxed() == 0);
+ Q_ASSERT(this->d->ref_.loadRelaxed() == 0);
// As this is to be called only from destructor, it doesn't need to be
// exception safe; size not updated.
@@ -345,7 +345,7 @@ public:
// As this is to be called only from destructor, it doesn't need to be
// exception safe; size not updated.
- Q_ASSERT(this->d->m_ref.loadRelaxed() == 0);
+ Q_ASSERT(this->d->ref_.loadRelaxed() == 0);
std::destroy(this->begin(), this->end());
}
diff --git a/src/corelib/tools/qduplicatetracker_p.h b/src/corelib/tools/qduplicatetracker_p.h
index 4740047356b..f2bcaf7065d 100644
--- a/src/corelib/tools/qduplicatetracker_p.h
+++ b/src/corelib/tools/qduplicatetracker_p.h
@@ -136,6 +136,12 @@ public:
set.clear();
#endif // __cpp_lib_memory_resource
}
+
+ using const_iterator = typename Set::const_iterator;
+ const_iterator begin() const { return set.cbegin(); }
+ const_iterator end() const { return set.cend(); }
+ const_iterator cbegin() const { return begin(); }
+ const_iterator cend() const { return end(); }
};
QT_END_NAMESPACE
diff --git a/src/dbus/qdbusargument.h b/src/dbus/qdbusargument.h
index 8370de74bb6..f04cbc1ed43 100644
--- a/src/dbus/qdbusargument.h
+++ b/src/dbus/qdbusargument.h
@@ -15,6 +15,8 @@
#include <QtCore/qvariant.h>
#include <QtDBus/qdbusextratypes.h>
+#include <tuple>
+
#ifndef QT_NO_DBUS
QT_BEGIN_NAMESPACE
@@ -324,7 +326,7 @@ inline const QDBusArgument &operator>>(const QDBusArgument &arg, std::pair<T1, T
template <typename... T>
QDBusArgument &operator<<(QDBusArgument &argument, const std::tuple<T...> &tuple)
{
- static_assert(std::tuple_size_v<std::tuple<T...>> != 0, "D-Bus doesn't allow empty structs");
+ static_assert(sizeof...(T) != 0, "D-Bus doesn't allow empty structs");
argument.beginStructure();
std::apply([&argument](const auto &...elements) { (argument << ... << elements); }, tuple);
argument.endStructure();
@@ -334,7 +336,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const std::tuple<T...> &tuple
template <typename... T>
const QDBusArgument &operator>>(const QDBusArgument &argument, std::tuple<T...> &tuple)
{
- static_assert(std::tuple_size_v<std::tuple<T...>> != 0, "D-Bus doesn't allow empty structs");
+ static_assert(sizeof...(T) != 0, "D-Bus doesn't allow empty structs");
argument.beginStructure();
std::apply([&argument](auto &...elements) { (argument >> ... >> elements); }, tuple);
argument.endStructure();
diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp
index 59c469ae6b6..2f46a72eb3e 100644
--- a/src/gui/kernel/qsurfaceformat.cpp
+++ b/src/gui/kernel/qsurfaceformat.cpp
@@ -38,7 +38,6 @@ public:
, swapBehavior(QSurfaceFormat::DefaultSwapBehavior)
, numSamples(-1)
, renderableType(QSurfaceFormat::DefaultRenderableType)
- , colorComponentType(QSurfaceFormat::FixedColorComponentType)
, profile(QSurfaceFormat::NoProfile)
, major(2)
, minor(0)
@@ -58,7 +57,6 @@ public:
swapBehavior(other->swapBehavior),
numSamples(other->numSamples),
renderableType(other->renderableType),
- colorComponentType(other->colorComponentType),
profile(other->profile),
major(other->major),
minor(other->minor),
@@ -78,7 +76,6 @@ public:
QSurfaceFormat::SwapBehavior swapBehavior;
int numSamples;
QSurfaceFormat::RenderableType renderableType;
- QSurfaceFormat::ColorComponentType colorComponentType;
QSurfaceFormat::OpenGLContextProfile profile;
int major;
int minor;
@@ -543,40 +540,6 @@ void QSurfaceFormat::setAlphaBufferSize(int size)
}
/*!
- Sets the color component \a type.
-
- The default is FixedColorComponentType. To request a floating-point color
- buffer, set FloatColorComponentType. The red, green, and blue buffer sizes
- should then be set either to \c 16 or \c 32, to specify either half
- (16-bit) floating point components or 32-bit. The most commonly supported
- and used choice is the former (16-bit), for example when high dynamic range
- rendering is desired.
-
- \since 6.10
-
- \sa colorComponentType()
-*/
-void QSurfaceFormat::setColorComponentType(ColorComponentType type)
-{
- if (d->colorComponentType != type) {
- detach();
- d->colorComponentType = type;
- }
-}
-
-/*!
- \return the color component type.
-
- \since 6.10
-
- \sa setColorComponentType()
-*/
-QSurfaceFormat::ColorComponentType QSurfaceFormat::colorComponentType() const
-{
- return d->colorComponentType;
-}
-
-/*!
Sets the desired renderable \a type.
Chooses between desktop OpenGL, OpenGL ES, and OpenVG.
diff --git a/src/gui/kernel/qsurfaceformat.h b/src/gui/kernel/qsurfaceformat.h
index 9c499a286cd..a44b852fcc7 100644
--- a/src/gui/kernel/qsurfaceformat.h
+++ b/src/gui/kernel/qsurfaceformat.h
@@ -57,12 +57,6 @@ public:
Q_ENUM(ColorSpace)
#endif
- enum ColorComponentType {
- FixedColorComponentType,
- FloatColorComponentType
- };
- Q_ENUM(ColorComponentType)
-
QSurfaceFormat();
Q_IMPLICIT QSurfaceFormat(FormatOptions options);
QSurfaceFormat(const QSurfaceFormat &other);
@@ -84,9 +78,6 @@ public:
void setAlphaBufferSize(int size);
int alphaBufferSize() const;
- void setColorComponentType(ColorComponentType type);
- ColorComponentType colorComponentType() const;
-
void setSamples(int numSamples);
int samples() const;
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index b13b1bcad34..a6e540015d7 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -36,6 +36,8 @@
QT_BEGIN_NAMESPACE
+QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QPainterPathPrivate)
+
static inline bool isValidCoord(qreal c)
{
if (sizeof(qreal) >= sizeof(double))
@@ -512,6 +514,15 @@ QPainterPath::QPainterPath() noexcept
QPainterPath::QPainterPath(const QPainterPath &other) = default;
/*!
+ \fn QPainterPath::QPainterPath(QPainterPath &&other)
+ \since 6.10
+
+ Move-constructs a new painter path from \a other.
+
+ The moved-from object \a other is placed in the default-constructed state.
+*/
+
+/*!
Creates a QPainterPath object with the given \a startPoint as its
current position.
*/
@@ -3193,9 +3204,10 @@ qreal QPainterPath::slopeAtPercent(qreal t) const
/*!
\since 6.10
- Returns the section of the path between the length fractions \a f1 and \a f2. The effective range
- of the fractions are from 0, denoting the start point of the path, to 1, denoting its end point.
- The fractions are linear with respect to path length, in contrast to the percentage \e t values.
+ Returns the section of the path between the length fractions \a fromFraction and \a toFraction.
+ The effective range of the fractions are from 0, denoting the start point of the path, to 1,
+ denoting its end point. The fractions are linear with respect to path length, in contrast to the
+ percentage \e t values.
The value of \a offset will be added to the fraction values. If that causes an over- or underflow
of the [0, 1] range, the values will be wrapped around, as will the resulting path. The effective
@@ -3206,13 +3218,13 @@ qreal QPainterPath::slopeAtPercent(qreal t) const
\sa length(), percentAtLength(), setCachingEnabled()
*/
-QPainterPath QPainterPath::trimmed(qreal f1, qreal f2, qreal offset) const
+QPainterPath QPainterPath::trimmed(qreal fromFraction, qreal toFraction, qreal offset) const
{
if (isEmpty())
return *this;
- f1 = qBound(qreal(0), f1, qreal(1));
- f2 = qBound(qreal(0), f2, qreal(1));
+ qreal f1 = qBound(qreal(0), fromFraction, qreal(1));
+ qreal f2 = qBound(qreal(0), toFraction, qreal(1));
if (f1 > f2)
qSwap(f1, f2);
if (qFuzzyCompare(f2 - f1, qreal(1))) // Shortcut for no trimming
diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h
index 2d502936dfd..2e449a8835e 100644
--- a/src/gui/painting/qpainterpath.h
+++ b/src/gui/painting/qpainterpath.h
@@ -17,7 +17,6 @@ QT_BEGIN_NAMESPACE
class QFont;
class QPainterPathPrivate;
-struct QPainterPathPrivateDeleter;
class QPainterPathStrokerPrivate;
class QPen;
class QPolygonF;
@@ -25,6 +24,7 @@ class QRegion;
class QTransform;
class QVectorPath;
+QT_DECLARE_QESDP_SPECIALIZATION_DTOR(QPainterPathPrivate)
class Q_GUI_EXPORT QPainterPath
{
public:
@@ -56,6 +56,7 @@ public:
explicit QPainterPath(const QPointF &startPoint);
QPainterPath(const QPainterPath &other);
QPainterPath &operator=(const QPainterPath &other);
+ QPainterPath(QPainterPath &&other) noexcept = default;
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QPainterPath)
~QPainterPath();
@@ -141,7 +142,7 @@ public:
QPointF pointAtPercent(qreal t) const;
qreal angleAtPercent(qreal t) const;
qreal slopeAtPercent(qreal t) const;
- [[nodiscard]] QPainterPath trimmed(qreal f1, qreal f2, qreal offset = 0) const;
+ [[nodiscard]] QPainterPath trimmed(qreal fromFraction, qreal toFraction, qreal offset = 0) const;
bool intersects(const QPainterPath &p) const;
bool contains(const QPainterPath &p) const;
diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h
index de8aedb5be4..aaa22355cd8 100644
--- a/src/gui/painting/qpainterpath_p.h
+++ b/src/gui/painting/qpainterpath_p.h
@@ -100,7 +100,6 @@ public:
friend class QPainterPathStrokerPrivate;
friend class QTransform;
friend class QVectorPath;
- friend struct QPainterPathPrivateDeleter;
#ifndef QT_NO_DATASTREAM
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &);
diff --git a/src/network/kernel/qnetworkproxy_android.cpp b/src/network/kernel/qnetworkproxy_android.cpp
index d5b56bba865..2261572fea7 100644
--- a/src/network/kernel/qnetworkproxy_android.cpp
+++ b/src/network/kernel/qnetworkproxy_android.cpp
@@ -3,6 +3,7 @@
#include "qnetworkproxy.h"
+#include <QtCore/qapplicationstatic.h>
#include <QtCore/qcoreapplication_platform.h>
#include <QtCore/qjnienvironment.h>
#include <QtCore/qjniobject.h>
@@ -21,7 +22,7 @@ public:
using namespace QNativeInterface;
using namespace QtJniTypes;
-Q_GLOBAL_STATIC(ProxyInfoObject, proxyInfoInstance)
+Q_APPLICATION_STATIC(ProxyInfoObject, proxyInfoInstance)
Q_DECLARE_JNI_CLASS(QtNetwork, "org/qtproject/qt/android/network/QtNetwork")
Q_DECLARE_JNI_CLASS(ProxyInfo, "android/net/ProxyInfo")
diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp
index 6c02a73e7c8..7efe4d52d4c 100644
--- a/src/plugins/platforms/android/androidcontentfileengine.cpp
+++ b/src/plugins/platforms/android/androidcontentfileengine.cpp
@@ -1,7 +1,7 @@
// Copyright (C) 2019 Volker Krause <[email protected]>
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-// Qt-Security score:critical reason:file-handling
+// Qt-Security score:critical reason:data-parser
#include "androidcontentfileengine.h"
diff --git a/src/plugins/platforms/android/extract.cpp b/src/plugins/platforms/android/extract.cpp
index 48a2c4ecfaf..9160470e0cc 100644
--- a/src/plugins/platforms/android/extract.cpp
+++ b/src/plugins/platforms/android/extract.cpp
@@ -1,7 +1,6 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2014 BogDan Vatra <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-// Qt-Security score:critical reason:data-serializing
#include <QtCore/QJniEnvironment>
diff --git a/src/plugins/platforms/cocoa/qcocoaclipboard.mm b/src/plugins/platforms/cocoa/qcocoaclipboard.mm
index 241faadbec0..0b84cae956b 100644
--- a/src/plugins/platforms/cocoa/qcocoaclipboard.mm
+++ b/src/plugins/platforms/cocoa/qcocoaclipboard.mm
@@ -3,6 +3,7 @@
#include "qcocoaclipboard.h"
+#include <QtGui/qguiapplication.h>
#include <QtGui/qutimimeconverter.h>
#ifndef QT_NO_CLIPBOARD
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h
index 82c03573763..5c8aaeb1fde 100644
--- a/src/plugins/platforms/cocoa/qcocoacursor.h
+++ b/src/plugins/platforms/cocoa/qcocoacursor.h
@@ -4,9 +4,10 @@
#ifndef QWINDOWSCURSOR_H
#define QWINDOWSCURSOR_H
-#include <QtCore>
#include <qpa/qplatformcursor.h>
+#include <QtCore/qhash.h>
+
Q_FORWARD_DECLARE_OBJC_CLASS(NSCursor);
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
index c5c126ecf3e..09ba685078b 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.h
+++ b/src/plugins/platforms/cocoa/qcocoadrag.h
@@ -4,16 +4,12 @@
#ifndef QCOCOADRAG_H
#define QCOCOADRAG_H
-#include <QtGui>
#include <qpa/qplatformdrag.h>
-#include <private/qsimpledrag_p.h>
+#include <QtGui/private/qsimpledrag_p.h>
+#include <QtGui/private/qinternalmimedata_p.h>
#include <QtCore/private/qcore_mac_p.h>
-#include <QtGui/private/qdnd_p.h>
-#include <QtGui/private/qinternalmimedata_p.h>
-
-#include <QtCore/qeventloop.h>
Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
Q_FORWARD_DECLARE_OBJC_CLASS(NSEvent);
@@ -21,6 +17,10 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSPasteboard);
QT_BEGIN_NAMESPACE
+class QDrag;
+class QEventLoop;
+class QMimeData;
+
class QCocoaDrag : public QPlatformDrag
{
public:
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 64df903edcb..0f9df3f17ab 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -7,8 +7,15 @@
#include "qcocoadrag.h"
#include "qmacclipboard.h"
#include "qcocoahelpers.h"
-#include <QtGui/private/qcoregraphics_p.h>
+
+#include <QtGui/qfont.h>
+#include <QtGui/qfontmetrics.h>
+#include <QtGui/qpainter.h>
#include <QtGui/qutimimeconverter.h>
+#include <QtGui/private/qcoregraphics_p.h>
+#include <QtGui/private/qdnd_p.h>
+
+#include <QtCore/qeventloop.h>
#include <QtCore/private/qcore_mac_p.h>
#include <vector>
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm
index 7ef958e5d9b..a569ce2ba4d 100644
--- a/src/plugins/platforms/cocoa/qcocoahelpers.mm
+++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm
@@ -8,8 +8,6 @@
#include "qcocoahelpers.h"
#include "qnsview.h"
-#include <QtCore>
-#include <QtGui>
#include <qpa/qplatformscreen.h>
#include <private/qguiapplication_p.h>
#include <private/qwindow_p.h>
diff --git a/src/plugins/platforms/cocoa/qmacclipboard.h b/src/plugins/platforms/cocoa/qmacclipboard.h
index 95267565f2d..dcc300797c9 100644
--- a/src/plugins/platforms/cocoa/qmacclipboard.h
+++ b/src/plugins/platforms/cocoa/qmacclipboard.h
@@ -4,10 +4,10 @@
#ifndef QMACCLIPBOARD_H
#define QMACCLIPBOARD_H
-#include <QtGui>
#include <QtGui/qutimimeconverter.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qvariant.h>
#include <ApplicationServices/ApplicationServices.h>
diff --git a/src/plugins/platforms/cocoa/qmacclipboard.mm b/src/plugins/platforms/cocoa/qmacclipboard.mm
index edafa3b6a10..155c4aa826d 100644
--- a/src/plugins/platforms/cocoa/qmacclipboard.mm
+++ b/src/plugins/platforms/cocoa/qmacclipboard.mm
@@ -11,6 +11,7 @@
#include <QtGui/qbitmap.h>
#include <QtCore/qdatetime.h>
#include <QtCore/qmetatype.h>
+#include <QtCore/qmimedata.h>
#include <QtCore/qdebug.h>
#include <QtCore/private/qcore_mac_p.h>
#include <QtGui/qguiapplication.h>
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
index d47d37729f5..63647246589 100644
--- a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
+++ b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h
@@ -15,13 +15,12 @@
#ifndef QMULTITOUCH_MAC_P_H
#define QMULTITOUCH_MAC_P_H
-#include <QtCore/qglobal.h>
-#include <qpa/qwindowsysteminterface.h>
-#include <qhash.h>
-#include <QtCore>
+#include <QtCore/qhash.h>
+#include <QtCore/private/qcore_mac_p.h>
+
#include <QtGui/qpointingdevice.h>
-#include <QtCore/private/qcore_mac_p.h>
+#include <qpa/qwindowsysteminterface.h>
Q_FORWARD_DECLARE_OBJC_CLASS(NSTouch);
QT_FORWARD_DECLARE_OBJC_ENUM(NSTouchPhase, unsigned long);
diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm
index b4c82ddc0d8..805cc7d59ea 100644
--- a/src/plugins/platforms/cocoa/qnsview_dragging.mm
+++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm
@@ -3,6 +3,8 @@
// This file is included from qnsview.mm, and only used to organize the code
+#include <QtGui/qdrag.h>
+
@implementation QNSView (Dragging)
-(void)registerDragTypes
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 08178e7b685..f4b21d3b70d 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5269,7 +5269,11 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
if (rule.baseStyleCanDraw()) {
sz = baseStyle()->sizeFromContents(ct, opt, sz, w);
- } else if (spinbox->buttonSymbols != QAbstractSpinBox::NoButtons) {
+ if (rule.hasBox() || !rule.hasNativeBorder())
+ sz = rule.boxSize(sz);
+ return sz;
+ }
+ if (spinbox->buttonSymbols != QAbstractSpinBox::NoButtons) {
// Add some space for the up/down buttons
QRenderRule subRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
if (subRule.hasDrawable()) {