diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-05-26 22:48:15 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-07 05:22:13 +0000 |
commit | 3d788fc0f1adab960446ef9074ccfcda964a8391 (patch) | |
tree | 2c183d13d686844262d40fd60ab4bed8781e3f41 /src/widgets/widgets/qlabel.cpp | |
parent | f405352fee01c167226990a5b871c515942f7938 (diff) |
QLabelPrivate: de-inline ctor
...and move most of the init() code into the ctor-init-list.
Saves 176B of text size on Linux AMD64 GCC 4.9 optimized C++11
builds.
Change-Id: I6cd42e19c40a031456eaf626e32619aed1758a6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qlabel.cpp')
-rw-r--r-- | src/widgets/widgets/qlabel.cpp | 76 |
1 files changed, 43 insertions, 33 deletions
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp index 409e4a34f9..905c5ce7ef 100644 --- a/src/widgets/widgets/qlabel.cpp +++ b/src/widgets/widgets/qlabel.cpp @@ -53,6 +53,49 @@ QT_BEGIN_NAMESPACE +QLabelPrivate::QLabelPrivate() + : QFramePrivate(), + sh(), + msh(), + valid_hints(false), + sizePolicy(), + margin(0), + text(), + pixmap(Q_NULLPTR), + scaledpixmap(Q_NULLPTR), + cachedimage(Q_NULLPTR), +#ifndef QT_NO_PICTURE + picture(Q_NULLPTR), +#endif +#ifndef QT_NO_MOVIE + movie(), +#endif +#ifndef QT_NO_SHORTCUT + buddy(), + shortcutId(0), +#endif + align(Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs), + indent(-1), + scaledcontents(false), + textLayoutDirty(false), + textDirty(false), + isRichText(false), + isTextLabel(false), + hasShortcut(/*???*/), + textformat(Qt::AutoText), + control(Q_NULLPTR), + shortcutCursor(), + textInteractionFlags(Qt::LinksAccessibleByMouse), + openExternalLinks(false) +#ifndef QT_NO_CURSOR + , + validCursor(false), + onAnchor(false), + cursor() +#endif +{ +} + QLabelPrivate::~QLabelPrivate() { } @@ -206,41 +249,8 @@ void QLabelPrivate::init() { Q_Q(QLabel); - valid_hints = false; - margin = 0; -#ifndef QT_NO_MOVIE - movie = 0; -#endif -#ifndef QT_NO_SHORTCUT - shortcutId = 0; -#endif - pixmap = 0; - scaledpixmap = 0; - cachedimage = 0; -#ifndef QT_NO_PICTURE - picture = 0; -#endif - align = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs; - indent = -1; - scaledcontents = false; - textLayoutDirty = false; - textDirty = false; - textformat = Qt::AutoText; - control = 0; - textInteractionFlags = Qt::LinksAccessibleByMouse; - isRichText = false; - isTextLabel = false; - q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, QSizePolicy::Label)); - -#ifndef QT_NO_CURSOR - validCursor = false; - onAnchor = false; -#endif - - openExternalLinks = false; - setLayoutItemMargins(QStyle::SE_LabelLayoutItem); } |