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>
This commit is contained in:
Marc Mutz 2015-05-26 22:48:15 +02:00
parent f405352fee
commit 3d788fc0f1
2 changed files with 44 additions and 34 deletions

View File

@ -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);
}

View File

@ -64,7 +64,7 @@ class QLabelPrivate : public QFramePrivate
{
Q_DECLARE_PUBLIC(QLabel)
public:
QLabelPrivate() {}
QLabelPrivate();
~QLabelPrivate();
void init();