From e9d4412538badf1dd81424b6ddb8266160339f34 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 21 Mar 2025 22:42:54 +0100 Subject: [PATCH] QKdeTheme: de-inline dtor; make ctor explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1/ A QStringList and an int are not a faithful representation of a KDE Theme, so the ctor should be explicit. Make it so™. 2/ As a polymorphic class, the (undeclared, therefore inline) dtor may cause weak vtables to be emitted, with all the bad side-effects described in the docs of -Wweak-vtable and QTBUG-45582. Mark the dtor out-of-line in the usual way (= default'ing, but in the .cpp file). Amends 53fb13456fffe8bfd192f9197c6d1703854b49a2. Task-number: QTBUG-45582 Task-number: QTBUG-132929 Task-number: QTBUG-135037 Change-Id: Ie0c14e60d76d2205c2025598ac31a917dbf870b1 Reviewed-by: Axel Spoerl --- src/gui/platform/unix/qkdetheme.cpp | 3 +++ src/gui/platform/unix/qkdetheme_p.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/platform/unix/qkdetheme.cpp b/src/gui/platform/unix/qkdetheme.cpp index 7cb571fc3b6..07df7124430 100644 --- a/src/gui/platform/unix/qkdetheme.cpp +++ b/src/gui/platform/unix/qkdetheme.cpp @@ -544,6 +544,9 @@ QKdeTheme::QKdeTheme(const QStringList& kdeDirs, int kdeVersion) d_func()->refresh(); } +QKdeTheme::~QKdeTheme() + = default; + QFont *QKdeThemePrivate::kdeFont(const QVariant &fontValue) { if (fontValue.isValid()) { diff --git a/src/gui/platform/unix/qkdetheme_p.h b/src/gui/platform/unix/qkdetheme_p.h index e3f71e1b647..006f557b4c1 100644 --- a/src/gui/platform/unix/qkdetheme_p.h +++ b/src/gui/platform/unix/qkdetheme_p.h @@ -29,7 +29,8 @@ class Q_GUI_EXPORT QKdeTheme : public QGenericUnixTheme { Q_DECLARE_PRIVATE(QKdeTheme) public: - QKdeTheme(const QStringList& kdeDirs, int kdeVersion); + explicit QKdeTheme(const QStringList& kdeDirs, int kdeVersion); + ~QKdeTheme() override; static QPlatformTheme *createKdeTheme(); QVariant themeHint(ThemeHint hint) const override;