Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QColor4ub Class

The QColor4ub class represents a color by four unsigned byte components. More...

 #include <QColor4ub>

This class was introduced in Qt 4.8.

Public Functions

QColor4ub()
QColor4ub(int red, int green, int blue, int alpha = 255)
QColor4ub(const QColor & color)
QColor4ub(Qt::GlobalColor color)
QColor4ub(QRgb rgba)
int alpha() const
qreal alphaF() const
int blue() const
qreal blueF() const
int green() const
qreal greenF() const
int red() const
qreal redF() const
void setAlpha(int value)
void setAlphaF(qreal value)
void setBlue(int value)
void setBlueF(qreal value)
void setGreen(int value)
void setGreenF(qreal value)
void setRed(int value)
void setRedF(qreal value)
void setRgb(int red, int green, int blue, int alpha = 255)
void setRgbF(qreal red, qreal green, qreal blue, qreal alpha = 1.0f)
QColor toColor() const
bool operator!=(const QColor4ub & other) const
QColor4ub & operator=(const QColor & color)
QColor4ub & operator=(Qt::GlobalColor color)
bool operator==(const QColor4ub & other) const

Static Public Members

QColor4ub fromRaw(const uchar * data)
QColor4ub fromRgb(int red, int green, int blue, int alpha = 255)
QColor4ub fromRgbF(qreal red, qreal green, qreal blue, qreal alpha = 1.0f)

Detailed Description

The QColor4ub class represents a color by four unsigned byte components.

OpenGL applications commonly use four unsigned byte values to compactly represent a color value. QColor4ub provides a convenience class for manipulating such compact color values.

An alternative is to represent a color value as four floating-point values between 0.0 and 1.0. The QVector4D class can be used for that purpose if required.

Member Function Documentation

QColor4ub::QColor4ub()

Constructs a four-byte default color value of (0, 0, 0, 255).

QColor4ub::QColor4ub(int red, int green, int blue, int alpha = 255)

Constructs a four-byte color value with the components red, green, blue, and alpha.

QColor4ub::QColor4ub(const QColor & color)

Constructs a four-byte color value from color.

QColor4ub::QColor4ub(Qt::GlobalColor color)

Constructs a four-byte color value from color.

QColor4ub::QColor4ub(QRgb rgba)

Constructs a four-byte color value from the red, green, blue, and alpha components of rgba.

int QColor4ub::alpha() const

Returns the alpha component of this color, between 0 and 255.

See also red(), green(), blue(), setAlpha(), and alphaF().

qreal QColor4ub::alphaF() const

Returns the alpha component of this color as a floating-point value between 0 and 1.

See also redF(), greenF(), blueF(), setAlphaF(), and alpha().

int QColor4ub::blue() const

Returns the blue component of this color, between 0 and 255.

See also red(), green(), alpha(), setBlue(), and blueF().

qreal QColor4ub::blueF() const

Returns the blue component of this color as a floating-point value between 0 and 1.

See also redF(), greenF(), alphaF(), setBlueF(), and blue().

QColor4ub QColor4ub::fromRaw(const uchar * data) [static]

Returns a QColor4ub with components from the first four elements in data. The data parameter must contain at least four elements and not be null.

QColor4ub QColor4ub::fromRgb(int red, int green, int blue, int alpha = 255) [static]

Returns a QColor4ub with the components red, green, blue, and alpha. Each component is between 0 and 255.

See also fromRgbF() and setRgb().

QColor4ub QColor4ub::fromRgbF(qreal red, qreal green, qreal blue, qreal alpha = 1.0f) [static]

Returns a QColor4ub with the components red, green, blue, and alpha. Each component is a floating-point value between 0 and 1.

See also fromRgb() and setRgbF().

int QColor4ub::green() const

Returns the green component of this color, between 0 and 255.

See also red(), blue(), alpha(), setGreen(), and greenF().

qreal QColor4ub::greenF() const

Returns the green component of this color as a floating-point value between 0 and 1.

See also redF(), blueF(), alphaF(), setGreenF(), and green().

int QColor4ub::red() const

Returns the red component of this color, between 0 and 255.

See also green(), blue(), alpha(), setRed(), and redF().

qreal QColor4ub::redF() const

Returns the red component of this color as a floating-point value between 0 and 1.

See also greenF(), blueF(), alphaF(), setRedF(), and red().

void QColor4ub::setAlpha(int value)

Sets the alpha component of this color to value, between 0 and 255.

See also setRed(), setGreen(), setBlue(), alpha(), and setAlphaF().

void QColor4ub::setAlphaF(qreal value)

Sets the alpha component of this color to a floating-point value, between 0 and 1.

See also setRedF(), setGreenF(), setBlueF(), alphaF(), and setAlpha().

void QColor4ub::setBlue(int value)

Sets the blue component of this color to value, between 0 and 255.

See also setRed(), setGreen(), setAlpha(), blue(), and setBlueF().

void QColor4ub::setBlueF(qreal value)

Sets the blue component of this color to a floating-point value, between 0 and 1.

See also setRedF(), setGreenF(), setAlphaF(), blueF(), and setBlue().

void QColor4ub::setGreen(int value)

Sets the green component of this color to value, between 0 and 255.

See also setRed(), setBlue(), setAlpha(), green(), and setGreenF().

void QColor4ub::setGreenF(qreal value)

Sets the green component of this color to a floating-point value, between 0 and 1.

See also setRedF(), setBlueF(), setAlphaF(), greenF(), and setGreen().

void QColor4ub::setRed(int value)

Sets the red component of this color to value, between 0 and 255.

See also setGreen(), setBlue(), setAlpha(), red(), and setRedF().

void QColor4ub::setRedF(qreal value)

Sets the red component of this color to a floating-point value, between 0 and 1.

See also setGreenF(), setBlueF(), setAlphaF(), redF(), and setRed().

void QColor4ub::setRgb(int red, int green, int blue, int alpha = 255)

Sets the components of this color to red, green, blue, and alpha. Each component is between 0 and 255.

See also setRgbF() and fromRgb().

void QColor4ub::setRgbF(qreal red, qreal green, qreal blue, qreal alpha = 1.0f)

Sets the components of this color to red, green, blue, and alpha. Each component is a floating-point value between 0 and 1.

See also setRgb() and fromRgbF().

QColor QColor4ub::toColor() const

Returns this color as a QColor.

bool QColor4ub::operator!=(const QColor4ub & other) const

Returns true if this color is not the same as other; false otherwise.

QColor4ub & QColor4ub::operator=(const QColor & color)

Copies the red, green, blue, and alpha components of color into this object.

QColor4ub & QColor4ub::operator=(Qt::GlobalColor color)

Copies the red, green, blue, and alpha components of the specified global color name into this object.

bool QColor4ub::operator==(const QColor4ub & other) const

Returns true if this color is the same as other; false otherwise.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web