diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-04 15:47:31 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-04-05 07:58:08 +0000 |
commit | 49c4c061e0cd9cbbae0c911a81376f6820ce1f1e (patch) | |
tree | 5a6af24b68c3ae2cc2cc4eba105d12ec0e975801 /src | |
parent | 89302436cbd3c02cad3e73da9b20159a78bd870b (diff) |
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 <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qstatictext.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qstatictext.h b/src/gui/text/qstatictext.h index 00dfccc144..e6a196d865 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; } |