summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlabel_p.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2015-06-01 13:56:59 +0200
committerMarc Mutz <marc.mutz@kdab.com>2015-07-07 05:22:18 +0000
commit48d7a53abf53e2798ce532f5f9c2b38d3806d430 (patch)
treeeb1be0037b2c338f323a870fb39d9330a559bfcc /src/widgets/widgets/qlabel_p.h
parent3d788fc0f1adab960446ef9074ccfcda964a8391 (diff)
QLabelPrivate: separate data and function members, avoid padding
sizeof(QLabelPrivate) only goes down from 640 to 632 (on 64-bit), but we now have a non-conditional data member as the last member, so the ctor-init-list doesn't look quite so ugly anymore. Change-Id: I51f7e56d92cfcca4f35128595c829e2f3f887c72 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qlabel_p.h')
-rw-r--r--src/widgets/widgets/qlabel_p.h69
1 files changed, 36 insertions, 33 deletions
diff --git a/src/widgets/widgets/qlabel_p.h b/src/widgets/widgets/qlabel_p.h
index d3ad25be6f..bd7a9d1e8f 100644
--- a/src/widgets/widgets/qlabel_p.h
+++ b/src/widgets/widgets/qlabel_p.h
@@ -72,43 +72,13 @@ public:
void updateLabel();
QSize sizeForWidth(int w) const;
- mutable QSize sh;
- mutable QSize msh;
- mutable bool valid_hints;
- mutable QSizePolicy sizePolicy;
- int margin;
- QString text;
- QPixmap *pixmap;
- QPixmap *scaledpixmap;
- QImage *cachedimage;
-#ifndef QT_NO_PICTURE
- QPicture *picture;
-#endif
#ifndef QT_NO_MOVIE
- QPointer<QMovie> movie;
void _q_movieUpdated(const QRect&);
void _q_movieResized(const QSize&);
#endif
#ifndef QT_NO_SHORTCUT
void updateShortcut();
#endif
-#ifndef QT_NO_SHORTCUT
- QPointer<QWidget> buddy;
- int shortcutId;
-#endif
- ushort align;
- short indent;
- uint scaledcontents :1;
- mutable uint textLayoutDirty : 1;
- mutable uint textDirty : 1;
- mutable uint isRichText : 1;
- mutable uint isTextLabel : 1;
- mutable uint hasShortcut : 1;
- Qt::TextFormat textformat;
- mutable QWidgetTextControl *control;
- mutable QTextCursor shortcutCursor;
- Qt::TextInteractionFlags textInteractionFlags;
-
inline bool needTextControl() const {
return isTextLabel
&& (isRichText
@@ -130,13 +100,46 @@ public:
QMenu *createStandardContextMenu(const QPoint &pos);
#endif
- bool openExternalLinks;
-
+ mutable QSize sh;
+ mutable QSize msh;
+ QString text;
+ QPixmap *pixmap;
+ QPixmap *scaledpixmap;
+ QImage *cachedimage;
+#ifndef QT_NO_PICTURE
+ QPicture *picture;
+#endif
+#ifndef QT_NO_MOVIE
+ QPointer<QMovie> movie;
+#endif
+ mutable QWidgetTextControl *control;
+ mutable QTextCursor shortcutCursor;
+#ifndef QT_NO_CURSOR
+ QCursor cursor;
+#endif
+#ifndef QT_NO_SHORTCUT
+ QPointer<QWidget> buddy;
+ int shortcutId;
+#endif
+ Qt::TextFormat textformat;
+ Qt::TextInteractionFlags textInteractionFlags;
+ mutable QSizePolicy sizePolicy;
+ int margin;
+ ushort align;
+ short indent;
+ mutable uint valid_hints : 1;
+ uint scaledcontents : 1;
+ mutable uint textLayoutDirty : 1;
+ mutable uint textDirty : 1;
+ mutable uint isRichText : 1;
+ mutable uint isTextLabel : 1;
+ mutable uint hasShortcut : 1;
#ifndef QT_NO_CURSOR
uint validCursor : 1;
uint onAnchor : 1;
- QCursor cursor;
#endif
+ uint openExternalLinks : 1;
+ // <-- space for more bit field values here
friend class QMessageBoxPrivate;
};