summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qeasingcurve.cpp10
-rw-r--r--src/plugins/styles/modernwindows/qwindowsvistastyle.cpp5
-rw-r--r--src/plugins/tls/openssl/qtlsbackend_openssl.cpp9
-rw-r--r--src/widgets/kernel/qwidget.cpp6
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp12
5 files changed, 26 insertions, 16 deletions
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index ce35e8ccffe..1e647a83dc0 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -333,12 +333,12 @@ struct TCBPoint
qreal _b;
- bool operator==(const TCBPoint &other) const
+ friend bool operator==(const TCBPoint &lhs, const TCBPoint &rhs) noexcept
{
- return _point == other._point &&
- qFuzzyCompare(_t, other._t) &&
- qFuzzyCompare(_c, other._c) &&
- qFuzzyCompare(_b, other._b);
+ return qFuzzyCompare(lhs._point, rhs._point)
+ && QtPrivate::fuzzyCompare(lhs._t, rhs._t)
+ && QtPrivate::fuzzyCompare(lhs._c, rhs._c)
+ && QtPrivate::fuzzyCompare(lhs._b, rhs._b);
}
};
Q_DECLARE_TYPEINFO(TCBPoint, Q_PRIMITIVE_TYPE);
diff --git a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
index 64ffba2d6f8..36b5d0f0143 100644
--- a/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/modernwindows/qwindowsvistastyle.cpp
@@ -16,6 +16,9 @@
#include <private/qapplication_p.h>
#include <private/qsystemlibrary_p.h>
#include <private/qwindowsthemecache_p.h>
+#if QT_CONFIG(tooltip)
+#include "private/qtooltip_p.h"
+#endif
#include "qdrawutil.h" // for now
#include <qbackingstore.h>
@@ -4676,7 +4679,7 @@ void QWindowsVistaStyle::polish(QWidget *widget)
widget->setPalette(pal);
} else
#endif // QT_CONFIG(commandlinkbutton)
- if (widget->inherits("QTipLabel")) {
+ if (qobject_cast<const QTipLabel *>(widget)) {
//note that since tooltips are not reused
//we do not have to care about unpolishing
widget->setContentsMargins(3, 0, 4, 0);
diff --git a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
index deb257be01c..d3b7d669ec7 100644
--- a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
+++ b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
@@ -407,8 +407,13 @@ QList<QSslCertificate> systemCaCertificates()
for (const QByteArray &directory : directories) {
for (const auto &dirEntry : QDirListing(QFile::decodeName(directory), flags)) {
// use canonical path here to not load the same certificate twice if symlinked
- if (hasMatchingExtension(dirEntry.fileName()))
- certFiles.insert(dirEntry.canonicalFilePath());
+ if (hasMatchingExtension(dirEntry.fileName())) {
+ QString canonicalPath = dirEntry.canonicalFilePath();
+ // skip broken symlinks to not end up adding "" to the list which will then
+ // just be rejected by `QSslCertificate::fromFile`
+ if (!canonicalPath.isEmpty())
+ certFiles.insert(canonicalPath);
+ }
}
}
for (const QString& file : std::as_const(certFiles))
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 9499c88af12..bd2b5be11aa 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -32,7 +32,7 @@
#include "private/qwidgetwindow_p.h"
#include "qpainter.h"
#if QT_CONFIG(tooltip)
-#include "qtooltip.h"
+#include "private/qtooltip_p.h"
#endif
#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
@@ -1435,7 +1435,9 @@ void QWidgetPrivate::createTLSysExtra()
if (extra->topextra->opacity != 255 && q->isWindow())
extra->topextra->window->setOpacity(qreal(extra->topextra->opacity) / qreal(255));
- const bool isTipLabel = q->inherits("QTipLabel");
+#if QT_CONFIG(tooltip)
+ const bool isTipLabel = qobject_cast<const QTipLabel *>(q) != nullptr;
+#endif
const bool isAlphaWidget = !isTipLabel && q->inherits("QAlphaWidget");
#ifdef Q_OS_WIN
// Pass on native parent handle for Widget embedded into Active X.
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 25b048db65e..e0fdd56e6d8 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -35,7 +35,7 @@
#include <qabstractscrollarea.h>
#include "private/qabstractscrollarea_p.h"
#if QT_CONFIG(tooltip)
-#include <qtooltip.h>
+#include "private/qtooltip_p.h"
#endif
#include <qshareddata.h>
#if QT_CONFIG(toolbutton)
@@ -950,7 +950,7 @@ QRenderRule::QRenderRule(const QList<Declaration> &declarations, const QObject *
hasFont = v.extractFont(&font, &adj);
#if QT_CONFIG(tooltip)
- if (object && qstrcmp(object->metaObject()->className(), "QTipLabel") == 0)
+ if (qobject_cast<const QTipLabel *>(object) != nullptr)
palette = QToolTip::palette();
#endif
@@ -1495,7 +1495,7 @@ bool QRenderRule::hasModification() const
static inline QObject *parentObject(const QObject *obj)
{
#if QT_CONFIG(tooltip)
- if (qobject_cast<const QLabel *>(obj) && qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0) {
+ if (qobject_cast<const QTipLabel *>(obj) != nullptr) {
QObject *p = qvariant_cast<QObject *>(obj->property("_q_stylesheet_parent"));
if (p)
return p;
@@ -1515,7 +1515,7 @@ public:
return QStringList();
const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
#if QT_CONFIG(tooltip)
- if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
+ if (metaObject == &QTipLabel::staticMetaObject)
return QStringList("QToolTip"_L1);
#endif
QStringList result;
@@ -1581,7 +1581,7 @@ public:
return false;
const QMetaObject *metaObject = OBJECT_PTR(node)->metaObject();
#if QT_CONFIG(tooltip)
- if (qstrcmp(metaObject->className(), "QTipLabel") == 0)
+ if (metaObject == &QTipLabel::staticMetaObject)
return nodeName == "QToolTip"_L1;
#endif
do {
@@ -1747,7 +1747,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w)
}
#endif
- if (qstrcmp(w->metaObject()->className(), "QTipLabel") == 0)
+ if (w->metaObject() == &QTipLabel::staticMetaObject)
return base->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, nullptr, w);
return base->pixelMetric(QStyle::PM_DefaultFrameWidth, nullptr, w);