QColor is a class in Qt, a cross-platform application development framework, that represents a color in the RGB color space. The alpha property of a QColor object represents the transparency of the color.
Examples:
1. Setting the alpha value to create a partially transparent color:
QColor color(Qt::red);
color.setAlpha(128);
This code sets the alpha value of a red QColor object to 128, creating a partially transparent color.
2. Retrieving the alpha value of a QColor object:
QColor color(Qt::blue);
int alpha = color.alpha();
This code retrieves the alpha value of a blue QColor object and stores it in the integer variable alpha.
Package library: Qt.
C++ (Cpp) QColor::alpha - 30 examples found. These are the top rated real world C++ (Cpp) examples of QColor::alpha extracted from open source projects. You can rate examples to help us improve the quality of examples.