Predefined Colors
Additionally, the Qt::color0, Qt::color1 and Qt::transparent colors are used for special purposes.
Qt::color0 (zero pixel value) and Qt::color1 (non-zero pixel value) are special colors for drawing in QBitmaps. Painting with Qt::color0 sets the bitmap bits to 0 (transparent; i.e., background), and painting with Qt::color1 sets the bits to 1 (opaque; i.e., foreground).
Qt::transparent is used to indicate a transparent pixel. When painting with this value, a pixel value will be used that is appropriate for the underlying pixel format in use.
QColor::QColor ( int r, int g, int b, int a = 255 )
Constructs a color with the RGB value r, g, b, and the alpha-channel (transparency) value of a.
The color is left invalid if any of the arguments are invalid.
本文介绍了Qt中预定义的颜色及其使用方式,包括20种由Qt::GlobalColor枚举描述的颜色,如黑色、白色及不同深浅的灰色等。此外还详细解释了Qt::color0、Qt::color1和Qt::transparent三种颜色的特殊用途。
2311

被折叠的 条评论
为什么被折叠?



