summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/linux/atspiadaptor.cpp9
-rw-r--r--src/gui/compat/removed_api.cpp13
-rw-r--r--src/gui/kernel/qaction.cpp2
-rw-r--r--src/gui/kernel/qguivariant.cpp15
-rw-r--r--src/gui/kernel/qscreen.cpp6
-rw-r--r--src/gui/kernel/qshortcut.cpp2
-rw-r--r--src/gui/math3d/qquaternion.cpp97
-rw-r--r--src/gui/math3d/qquaternion.h22
-rw-r--r--src/gui/painting/qpainter.cpp28
-rw-r--r--src/gui/painting/qpainter.h22
-rw-r--r--src/gui/painting/qtransform.cpp2
-rw-r--r--src/gui/rhi/qrhi.cpp2
-rw-r--r--src/gui/rhi/qshader.cpp2
-rw-r--r--src/gui/text/qfontdatabase.cpp43
-rw-r--r--src/gui/text/qfontdatabase_p.h2
15 files changed, 204 insertions, 63 deletions
diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp
index 6154af00950..e0cd5aee25c 100644
--- a/src/gui/accessible/linux/atspiadaptor.cpp
+++ b/src/gui/accessible/linux/atspiadaptor.cpp
@@ -1462,9 +1462,12 @@ bool AtSpiAdaptor::handleMessage(const QDBusMessage &message, const QDBusConnect
// handle properties like regular functions
if (interface == "org.freedesktop.DBus.Properties"_L1) {
- interface = message.arguments().at(0).toString();
- // Get/Set + Name
- function = message.member() + message.arguments().at(1).toString();
+ const auto arguments = message.arguments();
+ if (arguments.size() > 0) {
+ interface = arguments.at(0).toString();
+ if (arguments.size() > 1) // e.g. Get/Set + Name
+ function = function + arguments.at(1).toString();
+ }
}
// switch interface to call
diff --git a/src/gui/compat/removed_api.cpp b/src/gui/compat/removed_api.cpp
index 6a39d8b8615..33549a06504 100644
--- a/src/gui/compat/removed_api.cpp
+++ b/src/gui/compat/removed_api.cpp
@@ -88,3 +88,16 @@ void QWindowSystemInterface::handleContextMenuEvent(QWindow *window, bool mouseT
// order sections alphabetically
#endif // QT_GUI_REMOVED_SINCE(6, 8)
+
+#if QT_GUI_REMOVED_SINCE(6, 11)
+
+#include "qpainter.h" // inlined API
+
+#include "qquaternion.h" // inlined API
+
+
+// #include "qotherheader.h"
+// // implement removed functions from qotherheader.h
+// order sections alphabetically
+
+#endif // QT_GUI_REMOVED_SINCE(6, 11)
diff --git a/src/gui/kernel/qaction.cpp b/src/gui/kernel/qaction.cpp
index 1768cd8aa1a..f965a5a30e9 100644
--- a/src/gui/kernel/qaction.cpp
+++ b/src/gui/kernel/qaction.cpp
@@ -1325,4 +1325,6 @@ Q_GUI_EXPORT QDebug operator<<(QDebug d, const QAction *action)
QT_END_NAMESPACE
+#undef QAPP_CHECK
+
#include "moc_qaction.cpp"
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index c6462dfed7b..6da0c4d387b 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -52,14 +52,13 @@
QT_BEGIN_NAMESPACE
namespace {
-
-// NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class
struct QVariantGuiHelper : QMetaTypeModuleHelper
{
#define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \
QT_METATYPE_INTERFACE_INIT(RealName),
- const QtPrivate::QMetaTypeInterface *interfaceForType(int type) const override {
+ static const QtPrivate::QMetaTypeInterface *interfaceForType(int type)
+ {
switch (type) {
QT_FOR_EACH_STATIC_GUI_CLASS(QT_METATYPE_CONVERT_ID_TO_TYPE)
default: return nullptr;
@@ -67,7 +66,7 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper
}
#undef QT_IMPL_METATYPEINTERFACE_GUI_TYPES
- bool convert(const void *from, int fromTypeId, void *to, int toTypeId) const override
+ static bool convert(const void *from, int fromTypeId, void *to, int toTypeId)
{
Q_ASSERT(fromTypeId != toTypeId);
@@ -133,14 +132,14 @@ struct QVariantGuiHelper : QMetaTypeModuleHelper
return false;
}
};
-
-static constexpr QVariantGuiHelper qVariantGuiHelper;
-
} // namespace used to hide QVariant handler
void qRegisterGuiVariant()
{
- qMetaTypeGuiHelper = &qVariantGuiHelper;
+ qMetaTypeGuiHelper = QMetaTypeModuleHelper{
+ &QVariantGuiHelper::interfaceForType,
+ &QVariantGuiHelper::convert,
+ };
}
Q_CONSTRUCTOR_FUNCTION(qRegisterGuiVariant)
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index afe6de35305..caf4cb7fe5b 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -34,6 +34,12 @@ QT_BEGIN_NAMESPACE
\note Both physical and logical DPI are expressed in device-independent dots.
Multiply by QScreen::devicePixelRatio() to get device-dependent density.
+ To obtain a QScreen object, use QGuiApplication::primaryScreen() for the
+ primary screen, or QGuiApplication::screens() to get a list of all screens.
+
+ \sa QGuiApplication::primaryScreen()
+ \sa QGuiApplication::screens()
+
\inmodule QtGui
*/
diff --git a/src/gui/kernel/qshortcut.cpp b/src/gui/kernel/qshortcut.cpp
index 3f6822cb031..e730b5f9e8b 100644
--- a/src/gui/kernel/qshortcut.cpp
+++ b/src/gui/kernel/qshortcut.cpp
@@ -577,4 +577,6 @@ bool QShortcut::event(QEvent *e)
QT_END_NAMESPACE
+#undef QAPP_CHECK
+
#include "moc_qshortcut.cpp"
diff --git a/src/gui/math3d/qquaternion.cpp b/src/gui/math3d/qquaternion.cpp
index 3454b498804..99061fb7163 100644
--- a/src/gui/math3d/qquaternion.cpp
+++ b/src/gui/math3d/qquaternion.cpp
@@ -336,6 +336,9 @@ QVector3D QQuaternion::rotatedVector(const QVector3D &vector) const
Extracts a 3D axis \a axis and a rotating angle \a angle (in degrees)
that corresponds to this quaternion.
+ Both \a axis and \a angle must be valid, non-\nullptr pointers,
+ otherwise the behavior is undefined.
+
\sa fromAxisAndAngle()
*/
@@ -366,6 +369,9 @@ QQuaternion QQuaternion::fromAxisAndAngle(const QVector3D &axis, float angle)
Extracts a 3D axis (\a x, \a y, \a z) and a rotating angle \a angle (in degrees)
that corresponds to this quaternion.
+ All of \a x, \a y, \a z, and \a angle must be valid, non-\nullptr pointers,
+ otherwise the behavior is undefined.
+
\sa fromAxisAndAngle()
*/
void QQuaternion::getAxisAndAngle(float *x, float *y, float *z, float *angle) const
@@ -421,7 +427,7 @@ QQuaternion QQuaternion::fromAxisAndAngle
\since 5.5
Calculates roll, pitch, and yaw Euler angles (in degrees)
- that corresponds to this quaternion.
+ that correspond to this quaternion.
\sa fromEulerAngles()
*/
@@ -432,8 +438,9 @@ QQuaternion QQuaternion::fromAxisAndAngle
\overload
Creates a quaternion that corresponds to a rotation of \a angles:
- angles.z() degrees around the z axis, angles.x() degrees around the x axis,
- and angles.y() degrees around the y axis (in that order).
+ angles.\l{QVector3D::}{z()} degrees around the z axis,
+ angles.\l{QVector3D::}{x()} degrees around the x axis, and
+ angles.\l{QVector3D::}{y()} degrees around the y axis (in that order).
\sa toEulerAngles()
*/
@@ -446,6 +453,9 @@ QQuaternion QQuaternion::fromAxisAndAngle
Calculates \a roll, \a pitch, and \a yaw Euler angles (in degrees)
that corresponds to this quaternion.
+ All of \a pitch, \a yaw, and \a roll must be valid, non-\nullptr pointers,
+ otherwise the behavior is undefined.
+
\sa fromEulerAngles()
*/
void QQuaternion::getEulerAngles(float *pitch, float *yaw, float *roll) const
@@ -547,7 +557,7 @@ QQuaternion QQuaternion::fromEulerAngles(float pitch, float yaw, float roll)
\note If this quaternion is not normalized,
the resulting rotation matrix will contain scaling information.
- \sa fromRotationMatrix(), getAxes()
+ \sa fromRotationMatrix(), toAxes()
*/
QMatrix3x3 QQuaternion::toRotationMatrix() const
{
@@ -630,23 +640,71 @@ QQuaternion QQuaternion::fromRotationMatrix(const QMatrix3x3 &rot3x3)
#ifndef QT_NO_VECTOR3D
/*!
- \since 5.5
+ \since 6.11
+ \class QQuaternion::Axes
+ \ingroup painting-3D
+ \inmodule QtGui
- Returns the 3 orthonormal axes (\a xAxis, \a yAxis, \a zAxis) defining the quaternion.
+ A struct containing the three orthonormal axes that define a
+ \l{QQuaternion}{quaternion}.
- \sa fromAxes(), toRotationMatrix()
+
+ \sa QQuaternion::toAxes(), QQuaternion::fromAxes(Axes)
+*/
+
+/*!
+ \variable QQuaternion::Axes::x
+
+ The x orthonormal axis that, together with \l{y} and \l{z}, defines a
+ quaternion.
+*/
+
+/*!
+ \variable QQuaternion::Axes::y
+
+ The y orthonormal axis that, together with \l{x} and \l{z}, defines a
+ quaternion.
+*/
+
+/*!
+ \variable QQuaternion::Axes::z
+
+ The z orthonormal axis that, together with \l{x} and \l{y}, defines a
+ quaternion.
*/
-void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const
-{
- Q_ASSERT(xAxis && yAxis && zAxis);
+/*!
+ \since 6.11
+
+ Returns the three orthonormal axes that define this quaternion.
+
+ \sa QQuaternion::Axes, fromAxes(QQuaternion::Axes), toRotationMatrix()
+*/
+auto QQuaternion::toAxes() const -> Axes
+{
const QMatrix3x3 rot3x3(toRotationMatrix());
- *xAxis = QVector3D(rot3x3(0, 0), rot3x3(1, 0), rot3x3(2, 0));
- *yAxis = QVector3D(rot3x3(0, 1), rot3x3(1, 1), rot3x3(2, 1));
- *zAxis = QVector3D(rot3x3(0, 2), rot3x3(1, 2), rot3x3(2, 2));
+ return { {rot3x3(0, 0), rot3x3(1, 0), rot3x3(2, 0)},
+ {rot3x3(0, 1), rot3x3(1, 1), rot3x3(2, 1)},
+ {rot3x3(0, 2), rot3x3(1, 2), rot3x3(2, 2)} };
}
+
+/*!
+ \fn void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const
+ \since 5.5
+
+ \obsolete
+ Use toAxes() instead.
+
+ Returns the 3 orthonormal axes (\a xAxis, \a yAxis, \a zAxis) defining the quaternion.
+
+ All of \a xAxis, \a yAxis, and \a zAxis must be valid, non-\nullptr pointers,
+ otherwise the behavior is undefined.
+
+ \sa fromAxes(), toRotationMatrix()
+*/
+
/*!
\since 5.5
@@ -654,7 +712,7 @@ void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis)
\note The axes are assumed to be orthonormal.
- \sa getAxes(), fromRotationMatrix()
+ \sa toAxes(), fromRotationMatrix()
*/
QQuaternion QQuaternion::fromAxes(const QVector3D &xAxis, const QVector3D &yAxis, const QVector3D &zAxis)
{
@@ -673,6 +731,17 @@ QQuaternion QQuaternion::fromAxes(const QVector3D &xAxis, const QVector3D &yAxis
}
/*!
+ \since 6.11
+ \overload
+
+ \sa toAxes(), fromRotationMatrix()
+*/
+QQuaternion QQuaternion::fromAxes(Axes axes) // clazy:exclude=function-args-by-ref
+{
+ return fromAxes(axes.x, axes.y, axes.z);
+}
+
+/*!
\since 5.5
Constructs the quaternion using specified forward direction \a direction
diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h
index 0ea844ae41f..ffc95a852ce 100644
--- a/src/gui/math3d/qquaternion.h
+++ b/src/gui/math3d/qquaternion.h
@@ -118,7 +118,14 @@ QT_WARNING_POP
QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromRotationMatrix(const QMatrix3x3 &rot3x3);
#ifndef QT_NO_VECTOR3D
- QT7_ONLY(Q_GUI_EXPORT) void getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const;
+ struct Axes
+ {
+ QVector3D x, y, z;
+ };
+ QT7_ONLY(Q_GUI_EXPORT) Axes toAxes() const;
+ QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromAxes(Axes axes); // clazy:exclude=function-args-by-ref
+ QT_GUI_INLINE_SINCE(6, 11)
+ void getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const;
QT7_ONLY(Q_GUI_EXPORT) static QQuaternion fromAxes(const QVector3D &xAxis,
const QVector3D &yAxis,
const QVector3D &zAxis);
@@ -330,6 +337,19 @@ QQuaternion QQuaternion::fromEulerAngles(const QVector3D &angles)
return QQuaternion::fromEulerAngles(angles.x(), angles.y(), angles.z());
}
+#if QT_GUI_INLINE_IMPL_SINCE(6, 11)
+void QQuaternion::getAxes(QVector3D *xAxis, QVector3D *yAxis, QVector3D *zAxis) const
+{
+ Q_PRE(xAxis);
+ Q_PRE(yAxis);
+ Q_PRE(zAxis);
+ const Axes axes = toAxes();
+ *xAxis = axes.x;
+ *yAxis = axes.y;
+ *zAxis = axes.z;
+}
+#endif // QT_GUI_INLINE_IMPL_SINCE(6, 11)
+
#endif // QT_NO_VECTOR3D
constexpr void QQuaternion::setVector(float aX, float aY, float aZ) noexcept
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 5013e96f740..344bb8f1bef 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -41,6 +41,8 @@
#include <private/qrawfont_p.h>
#include <private/qfont_p.h>
+#include <QtCore/private/qtclasshelper_p.h>
+
QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
@@ -3652,6 +3654,8 @@ void QPainter::setPen(const QColor &color)
}
/*!
+ \fn void QPainter::setPen(const QPen &pen)
+
Sets the painter's pen to be the given \a pen.
The \a pen defines how to draw lines and outlines, and it also
@@ -3660,7 +3664,13 @@ void QPainter::setPen(const QColor &color)
\sa pen(), {QPainter#Settings}{Settings}
*/
-void QPainter::setPen(const QPen &pen)
+/*!
+ \fn void QPainter::setPen(QPen &&pen)
+ \since 6.11
+ \overload
+*/
+
+void QPainter::doSetPen(const QPen &pen, QPen *rvalue)
{
#ifdef QT_DEBUG_DRAW
@@ -3677,7 +3687,7 @@ void QPainter::setPen(const QPen &pen)
if (d->state->pen == pen)
return;
- d->state->pen = pen;
+ q_choose_assign(d->state->pen, pen, rvalue);
if (d->extended) {
d->checkEmulation();
@@ -3733,6 +3743,8 @@ const QPen &QPainter::pen() const
/*!
+ \fn void QPainter::setBrush(const QBrush &brush)
+
Sets the painter's brush to the given \a brush.
The painter's brush defines how shapes are filled.
@@ -3740,7 +3752,13 @@ const QPen &QPainter::pen() const
\sa brush(), {QPainter#Settings}{Settings}
*/
-void QPainter::setBrush(const QBrush &brush)
+/*!
+ \fn void QPainter::setBrush(QBrush &&brush)
+ \since 6.11
+ \overload
+*/
+
+void QPainter::doSetBrush(const QBrush &brush, QBrush *rvalue)
{
#ifdef QT_DEBUG_DRAW
if constexpr (qt_show_painter_debug_output)
@@ -3756,13 +3774,13 @@ void QPainter::setBrush(const QBrush &brush)
return;
if (d->extended) {
- d->state->brush = brush;
+ q_choose_assign(d->state->brush, brush, rvalue);
d->checkEmulation();
d->extended->brushChanged();
return;
}
- d->state->brush = brush;
+ q_choose_assign(d->state->brush, brush, rvalue);
d->state->dirtyFlags |= QPaintEngine::DirtyBrush;
}
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h
index 3c09b632364..83bde3b8cad 100644
--- a/src/gui/painting/qpainter.h
+++ b/src/gui/painting/qpainter.h
@@ -150,11 +150,15 @@ public:
QFontInfo fontInfo() const;
void setPen(const QColor &color);
+ QT_GUI_INLINE_SINCE(6, 11)
void setPen(const QPen &pen);
+ void setPen(QPen &&pen) { doSetPen(pen, &pen); }
void setPen(Qt::PenStyle style);
const QPen &pen() const;
+ QT_GUI_INLINE_SINCE(6, 11)
void setBrush(const QBrush &brush);
+ void setBrush(QBrush &&brush) { doSetBrush(brush, &brush); }
void setBrush(Qt::BrushStyle style);
void setBrush(QColor color);
void setBrush(Qt::GlobalColor color) { setBrush(QColor(color)); }
@@ -419,6 +423,9 @@ public:
private:
Q_DISABLE_COPY(QPainter)
+ void doSetPen(const QPen &lvalue, QPen *rvalue);
+ void doSetBrush(const QBrush &lvalue, QBrush *rvalue);
+
std::unique_ptr<QPainterPrivate> d_ptr;
friend class QWidget;
@@ -700,6 +707,21 @@ inline void QPainter::fillRect(const QRectF &r, QGradient::Preset p)
fillRect(r, QGradient(p));
}
+#if QT_GUI_INLINE_IMPL_SINCE(6, 11)
+
+void QPainter::setPen(const QPen &p)
+{
+ doSetPen(p, nullptr);
+}
+
+void QPainter::setBrush(const QBrush &b)
+{
+ doSetBrush(b, nullptr);
+}
+
+#endif // QT_GUI_INLINE_IMPL_SINCE(6, 11)
+
+
inline void QPainter::setBrushOrigin(int x, int y)
{
setBrushOrigin(QPoint(x, y));
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 66f1cf2a985..148d40b8361 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -784,7 +784,7 @@ bool QTransform::operator==(const QTransform &o) const
*/
size_t qHash(const QTransform &key, size_t seed) noexcept
{
- QtPrivate::QHashCombine hash(seed);
+ QtPrivate::QHashCombineWithSeed hash(seed);
seed = hash(seed, key.m11());
seed = hash(seed, key.m12());
seed = hash(seed, key.m21());
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index b9312f6b304..7a3d4974e53 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -6543,7 +6543,7 @@ bool operator!=(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBind
size_t qHash(const QRhiShaderResourceBinding &b, size_t seed) noexcept
{
const QRhiShaderResourceBinding::Data *d = QRhiImplementation::shaderResourceBindingData(b);
- QtPrivate::QHashCombine hash(seed);
+ QtPrivate::QHashCombineWithSeed hash(seed);
seed = hash(seed, d->binding);
seed = hash(seed, d->stage);
seed = hash(seed, d->type);
diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp
index 5e967c62e40..1234d01b6ec 100644
--- a/src/gui/rhi/qshader.cpp
+++ b/src/gui/rhi/qshader.cpp
@@ -812,7 +812,7 @@ bool operator==(const QShader &lhs, const QShader &rhs) noexcept
size_t qHash(const QShader &s, size_t seed) noexcept
{
if (s.d) {
- QtPrivate::QHashCombine hash(seed);
+ QtPrivate::QHashCombineWithSeed hash(seed);
seed = hash(seed, s.stage());
if (!s.d->shaders.isEmpty()) {
seed = hash(seed, s.d->shaders.firstKey());
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 5d455219359..8380a8b7f68 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1570,7 +1570,6 @@ bool QFontDatabase::isFixedPitch(const QString &family,
bool QFontDatabase::isBitmapScalable(const QString &family,
const QString &style)
{
- bool bitmapScalable = false;
QString familyName, foundryName;
parseFontName(family, foundryName, familyName);
@@ -1578,7 +1577,8 @@ bool QFontDatabase::isBitmapScalable(const QString &family,
QFontDatabasePrivate *d = QFontDatabasePrivate::ensureFontDatabase();
QtFontFamily *f = d->family(familyName);
- if (!f) return bitmapScalable;
+ if (!f)
+ return false;
QtFontStyle::Key styleKey(style);
for (int j = 0; j < f->count; j++) {
@@ -1589,13 +1589,11 @@ bool QFontDatabase::isBitmapScalable(const QString &family,
foundry->styles[k]->styleName == style ||
foundry->styles[k]->key == styleKey)
&& foundry->styles[k]->bitmapScalable && !foundry->styles[k]->smoothScalable) {
- bitmapScalable = true;
- goto end;
+ return true;
}
}
}
- end:
- return bitmapScalable;
+ return false;
}
@@ -1609,7 +1607,6 @@ bool QFontDatabase::isBitmapScalable(const QString &family,
*/
bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &style)
{
- bool smoothScalable = false;
QString familyName, foundryName;
parseFontName(family, foundryName, familyName);
@@ -1626,7 +1623,8 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty
}
}
}
- if (!f) return smoothScalable;
+ if (!f)
+ return false;
const QtFontStyle::Key styleKey(style);
for (int j = 0; j < f->count; j++) {
@@ -1634,7 +1632,7 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty
if (foundryName.isEmpty() || foundry->name.compare(foundryName, Qt::CaseInsensitive) == 0) {
for (int k = 0; k < foundry->count; k++) {
const QtFontStyle *fontStyle = foundry->styles[k];
- smoothScalable =
+ const bool smoothScalable =
fontStyle->smoothScalable
&& ((style.isEmpty()
|| fontStyle->styleName == style
@@ -1643,12 +1641,11 @@ bool QFontDatabase::isSmoothlyScalable(const QString &family, const QString &sty
&& style == styleStringHelper(fontStyle->key.weight,
QFont::Style(fontStyle->key.style))));
if (smoothScalable)
- goto end;
+ return true;
}
}
}
- end:
- return smoothScalable;
+ return false;
}
/*!
@@ -1679,7 +1676,6 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable())
return standardSizes();
- bool smoothScalable = false;
QString familyName, foundryName;
parseFontName(family, foundryName, familyName);
@@ -1701,10 +1697,9 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
QtFontStyle *style = foundry->style(styleKey, styleName);
if (!style) continue;
- if (style->smoothScalable) {
- smoothScalable = true;
- goto end;
- }
+ if (style->smoothScalable)
+ return standardSizes();
+
for (int l = 0; l < style->count; l++) {
const QtFontSize *size = style->pixelSizes + l;
@@ -1716,9 +1711,6 @@ QList<int> QFontDatabase::pointSizes(const QString &family,
}
}
}
- end:
- if (smoothScalable)
- return standardSizes();
std::sort(sizes.begin(), sizes.end());
return sizes;
@@ -1781,7 +1773,6 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable())
return standardSizes();
- bool smoothScalable = false;
QString familyName, foundryName;
parseFontName(family, foundryName, familyName);
@@ -1803,10 +1794,9 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
QtFontStyle *style = foundry->style(styleKey, styleName);
if (!style) continue;
- if (style->smoothScalable) {
- smoothScalable = true;
- goto end;
- }
+ if (style->smoothScalable)
+ return QFontDatabase::standardSizes();
+
for (int l = 0; l < style->count; l++) {
const QtFontSize *size = style->pixelSizes + l;
@@ -1818,9 +1808,6 @@ QList<int> QFontDatabase::smoothSizes(const QString &family,
}
}
}
- end:
- if (smoothScalable)
- return QFontDatabase::standardSizes();
std::sort(sizes.begin(), sizes.end());
return sizes;
diff --git a/src/gui/text/qfontdatabase_p.h b/src/gui/text/qfontdatabase_p.h
index 4cd6996aab8..27fb34aecdd 100644
--- a/src/gui/text/qfontdatabase_p.h
+++ b/src/gui/text/qfontdatabase_p.h
@@ -51,7 +51,7 @@ inline bool operator!=(const QtFontFallbacksCacheKey &lhs, const QtFontFallbacks
inline size_t qHash(const QtFontFallbacksCacheKey &key, size_t seed = 0) noexcept
{
- QtPrivate::QHashCombine hash(seed);
+ QtPrivate::QHashCombineWithSeed hash(seed);
seed = hash(seed, key.family);
seed = hash(seed, int(key.style));
seed = hash(seed, int(key.styleHint));