From 49c4c061e0cd9cbbae0c911a81376f6820ce1f1e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Tue, 4 Apr 2017 15:47:31 +0100 Subject: [PATCH] QStaticText: mark constructor as explicit A QStaticText object is supposed to be created and *kept* by the user, and then used repeatedly for drawing, saving the expensive layouting/rasterization process which would otherwise be done for each drawText-like call. Allowing an implicit conversion from QString is therefore surely unwanted. [ChangeLog][Potentially Source-Incompatible Changes][QStaticText] The QStaticText(const QString &) constructor is now explicit. Change-Id: Ib939a5f46638cb9a54d1cc30ff50e3a9d20be5e4 Reviewed-by: Marc Mutz --- src/gui/text/qstatictext.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h index 00dfccc144a..e6a196d8659 100644 --- a/src/gui/text/qstatictext.h +++ b/src/gui/text/qstatictext.h @@ -62,7 +62,7 @@ public: }; QStaticText(); - QStaticText(const QString &text); + explicit QStaticText(const QString &text); QStaticText(const QStaticText &other); #ifdef Q_COMPILER_RVALUE_REFS QStaticText &operator=(QStaticText &&other) Q_DECL_NOTHROW { swap(other); return *this; }