Add Qt7 TODOs for reducing the size of QColor
It could fit into QVariant's inline storage if we didn't waste so much space. Change-Id: Ie9e592a49c955b0a97a202e0bd875183396af993 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
f3c9200b5c
commit
1015919e8e
@ -54,6 +54,12 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
// QColor fits into QVariant's internal storage on 64bit systems.
|
||||||
|
// It could also fit on 32bit systems, but we cannot make it happen in Qt6, due to BC.
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(7,0,0) || QT_POINTER_SIZE > 4
|
||||||
|
static_assert(sizeof(QColor) <= QVariant::Private::MaxInternalSize);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
If s[0..n] is a valid hex number, returns its integer value,
|
If s[0..n] is a valid hex number, returns its integer value,
|
||||||
|
@ -66,6 +66,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
|
|||||||
class Q_GUI_EXPORT QColor
|
class Q_GUI_EXPORT QColor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
// ### Qt7: make this "enum Spec: quint8 {...}" and reorder the members below for tighter
|
||||||
|
// struct packing. QColor could fit into the inline storage of a QVariant on 32bit.
|
||||||
enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl, ExtendedRgb };
|
enum Spec { Invalid, Rgb, Hsv, Cmyk, Hsl, ExtendedRgb };
|
||||||
enum NameFormat { HexRgb, HexArgb };
|
enum NameFormat { HexRgb, HexArgb };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user