What does "pad" mean for QColor?
I'm reading the documentation of "Serializing Qt Data Types".
I found that when serializing a QColor , QDataStream outputs the following things:spec,alpha,red,green,blue,pad.
What does the pad value mean for a QColor? And what does pad mean for a real-life color?
Re: What does "pad" mean for QColor?
See: http://qt.gitorious.org/qt/qt/blobs/...nting/qcolor.h
I guess it is just nonsignificant "padding" to get the size of all alternative representations of color have the same number of bytes (see the unions in QColor class).
Re: What does "pad" mean for QColor?
I have read the implementation of QColor. "pad" is just set to 0 in the constructors . So I think you are right.
And I think the serialization of pad is not necessary . Is that right? It's always 0.
Quote:
Originally Posted by
mvuori
Added after 1 32 minutes:
I just thought about it again. The serialization of pad is necessary. Because QDataStream is serializing the whole union , which is not always rgb. The explaination of the union depends on spec . Pad is not always 0.
Quote:
Originally Posted by
hxcan
I have read the implementation of QColor. "pad" is just set to 0 in the constructors . So I think you are right.
And I think the serialization of pad is not necessary . Is that right? It's always 0.