Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Amigas | Funciones relacionadas
Referencia de la Clase QColorGroup

The QColorGroup class contains a group of widget colors. Más...

#include <qpalette.h>

Lista de todos los miembros.

Tipos públicos

enum  ColorRole {
  Foreground, Button, Light, Midlight,
  Dark, Mid, Text, BrightText,
  ButtonText, Base, Background, Shadow,
  Highlight, HighlightedText, Link, LinkVisited,
  NColorRoles, Foreground, Button, Light,
  Midlight, Dark, Mid, Text,
  BrightText, ButtonText, Base, Background,
  Shadow, Highlight, HighlightedText, Link,
  LinkVisited, NColorRoles
}
enum  ColorRole {
  Foreground, Button, Light, Midlight,
  Dark, Mid, Text, BrightText,
  ButtonText, Base, Background, Shadow,
  Highlight, HighlightedText, Link, LinkVisited,
  NColorRoles, Foreground, Button, Light,
  Midlight, Dark, Mid, Text,
  BrightText, ButtonText, Base, Background,
  Shadow, Highlight, HighlightedText, Link,
  LinkVisited, NColorRoles
}

Métodos públicos

 QColorGroup ()
 QColorGroup (const QColor &foreground, const QColor &button, const QColor &light, const QColor &dark, const QColor &mid, const QColor &text, const QColor &base)
 QColorGroup (const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background)
 QColorGroup (const QColorGroup &)
 ~QColorGroup ()
QColorGroupoperator= (const QColorGroup &)
const QColorcolor (ColorRole) const
const QBrushbrush (ColorRole) const
void setColor (ColorRole, const QColor &)
void setBrush (ColorRole, const QBrush &)
const QColorforeground () const
const QColorbutton () const
const QColorlight () const
const QColordark () const
const QColormid () const
const QColortext () const
const QColorbase () const
const QColorbackground () const
const QColormidlight () const
const QColorbrightText () const
const QColorbuttonText () const
const QColorshadow () const
const QColorhighlight () const
const QColorhighlightedText () const
const QColorlink () const
const QColorlinkVisited () const
bool operator== (const QColorGroup &g) const
bool operator!= (const QColorGroup &g) const
 QColorGroup ()
 QColorGroup (const QColor &foreground, const QColor &button, const QColor &light, const QColor &dark, const QColor &mid, const QColor &text, const QColor &base)
 QColorGroup (const QBrush &foreground, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &background)
 QColorGroup (const QColorGroup &)
 ~QColorGroup ()
QColorGroupoperator= (const QColorGroup &)
const QColorcolor (ColorRole) const
const QBrushbrush (ColorRole) const
void setColor (ColorRole, const QColor &)
void setBrush (ColorRole, const QBrush &)
const QColorforeground () const
const QColorbutton () const
const QColorlight () const
const QColordark () const
const QColormid () const
const QColortext () const
const QColorbase () const
const QColorbackground () const
const QColormidlight () const
const QColorbrightText () const
const QColorbuttonText () const
const QColorshadow () const
const QColorhighlight () const
const QColorhighlightedText () const
const QColorlink () const
const QColorlinkVisited () const
bool operator== (const QColorGroup &g) const
bool operator!= (const QColorGroup &g) const

Amigas

class QPalette

Funciones relacionadas

(Observar que estas no son funciones miembro.)

QDataStreamoperator<< (QDataStream &s, const QColorGroup &g)
QDataStreamoperator>> (QDataStream &s, QColorGroup &g)

Descripción detallada

The QColorGroup class contains a group of widget colors.

A color group contains a group of colors used by widgets for drawing themselves. We recommend that widgets use color group roles such as "foreground" and "base" rather than literal colors like "red" or "turquoise". The color roles are enumerated and defined in the ColorRole documentation.

The most common use of QColorGroup is like this:

        QPainter p;
        ...
        p.setPen( colorGroup().foreground() );
        p.drawLine( ... )

It is also possible to modify color groups or create new color groups from scratch.

The color group class can be created using three different constructors or by modifying one supplied by Qt. The default constructor creates an all-black color group, which can then be modified using set functions; there's also a constructor for specifying all the color group colors. And there is also a copy constructor.

We strongly recommend using a system-supplied color group and modifying that as necessary.

You modify a color group by calling the access functions setColor() and setBrush(), depending on whether you want a pure color or a pixmap pattern.

There are also corresponding color() and brush() getters, and a commonly used convenience function to get each ColorRole: background(), foreground(), base(), etc.

Ver también:
QColor QPalette QWidget::colorGroup()

Documentación de las enumeraciones miembro de la clase

The ColorRole enum defines the different symbolic color roles used in current GUIs.

The central roles are:

Background general background color.

Foreground general foreground color.

Base used as background color for text entry widgets, for example; usually white or another light color.

Text the foreground color used with Base. Usually this is the same as the Foreground, in which case it must provide good contrast with Background and Base.

Button general button background color in which buttons need a background different from Background, as in the Macintosh style.

ButtonText a foreground color used with the Button color.

There are some color roles used mostly for 3D bevel and shadow effects:

Light lighter than Button color.

Midlight between Button and Light.

Dark darker than Button.

Mid between Button and Dark.

Shadow a very dark color. By default, the shadow color is Qt::black.

All of these are normally derived from Background and used in ways that depend on that relationship. For example, buttons depend on it to make the bevels look attractive, and Motif scroll bars depend on Mid to be slightly different from Background.

Selected (marked) items have two roles:

Highlight a color to indicate a selected item or the current item. By default, the highlight color is Qt::darkBlue.

HighlightedText a text color that contrasts with Highlight. By default, the highlighted text color is Qt::white.

Finally, there is a special role for text that needs to be drawn where Text or Foreground would give poor contrast, such as on pressed push buttons:

BrightText a text color that is very different from Foreground and contrasts well with e.g. Dark.

Link a text color used for unvisited hyperlinks. By default, the link color is Qt::blue.

LinkVisited a text color used for already visited hyperlinks. By default, the linkvisited color is Qt::magenta.

NColorRoles Internal.

Note that text colors can be used for things other than just words; text colors are usually used for text, but it's quite common to use the text color roles for lines, icons, etc.

This image shows most of the color roles in use: palette.png Color Roles

Valores de enumeraciones:
Foreground 
Button 
Light 
Midlight 
Dark 
Mid 
Text 
BrightText 
ButtonText 
Base 
Background 
Shadow 
Highlight 
HighlightedText 
Link 
LinkVisited 
NColorRoles 
Foreground 
Button 
Light 
Midlight 
Dark 
Mid 
Text 
BrightText 
ButtonText 
Base 
Background 
Shadow 
Highlight 
HighlightedText 
Link 
LinkVisited 
NColorRoles 
Valores de enumeraciones:
Foreground 
Button 
Light 
Midlight 
Dark 
Mid 
Text 
BrightText 
ButtonText 
Base 
Background 
Shadow 
Highlight 
HighlightedText 
Link 
LinkVisited 
NColorRoles 
Foreground 
Button 
Light 
Midlight 
Dark 
Mid 
Text 
BrightText 
ButtonText 
Base 
Background 
Shadow 
Highlight 
HighlightedText 
Link 
LinkVisited 
NColorRoles 

Documentación del constructor y destructor

QColorGroup::QColorGroup ( )

Constructs a color group with all colors set to black.

QColorGroup::QColorGroup ( const QColor foreground,
const QColor background,
const QColor light,
const QColor dark,
const QColor mid,
const QColor text,
const QColor base 
)

Constructs a color group with the specified colors. The button color will be set to the background color.

QColorGroup::QColorGroup ( const QBrush foreground,
const QBrush button,
const QBrush light,
const QBrush dark,
const QBrush mid,
const QBrush text,
const QBrush bright_text,
const QBrush base,
const QBrush background 
)

Constructs a color group. You can pass either brushes, pixmaps or plain colors for foreground, button, light, dark, mid, text, bright_text, base and background.

Ver también:
QBrush
QColorGroup::QColorGroup ( const QColorGroup other)

Constructs a color group that is an independent copy of other.

QColorGroup::~QColorGroup ( )

Destroys the color group.

QColorGroup::QColorGroup ( )
QColorGroup::QColorGroup ( const QColor foreground,
const QColor button,
const QColor light,
const QColor dark,
const QColor mid,
const QColor text,
const QColor base 
)
QColorGroup::QColorGroup ( const QBrush foreground,
const QBrush button,
const QBrush light,
const QBrush dark,
const QBrush mid,
const QBrush text,
const QBrush bright_text,
const QBrush base,
const QBrush background 
)
QColorGroup::QColorGroup ( const QColorGroup )
QColorGroup::~QColorGroup ( )

Documentación de las funciones miembro

const QColor & QColorGroup::background ( ) const [inline]

Returns the background color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::background ( ) const [inline]
const QColor& QColorGroup::base ( ) const [inline]
const QColor & QColorGroup::base ( ) const [inline]

Returns the base color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::brightText ( ) const [inline]
const QColor & QColorGroup::brightText ( ) const [inline]

Returns the bright text foreground color of the color group.

Ver también:
ColorRole
const QBrush & QColorGroup::brush ( ColorRole  r) const

Returns the brush that has been set for color role r.

Ver también:
color() setBrush() ColorRole
const QBrush& QColorGroup::brush ( ColorRole  ) const
const QColor & QColorGroup::button ( ) const [inline]

Returns the button color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::button ( ) const [inline]
const QColor & QColorGroup::buttonText ( ) const [inline]

Returns the button text foreground color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::buttonText ( ) const [inline]
const QColor& QColorGroup::color ( ColorRole  ) const
const QColor & QColorGroup::color ( ColorRole  r) const

Returns the color that has been set for color role r.

Ver también:
brush() ColorRole
const QColor & QColorGroup::dark ( ) const [inline]

Returns the dark color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::dark ( ) const [inline]
const QColor & QColorGroup::foreground ( ) const [inline]

Returns the foreground color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::foreground ( ) const [inline]
const QColor & QColorGroup::highlight ( ) const [inline]

Returns the highlight color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::highlight ( ) const [inline]
const QColor & QColorGroup::highlightedText ( ) const [inline]

Returns the highlighted text color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::highlightedText ( ) const [inline]
const QColor & QColorGroup::light ( ) const [inline]

Returns the light color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::light ( ) const [inline]
const QColor& QColorGroup::link ( ) const [inline]
const QColor & QColorGroup::link ( ) const [inline]

Returns the unvisited link text color of the color group.

Ver también:
ColorRole
const QColor & QColorGroup::linkVisited ( ) const [inline]

Returns the visited link text color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::linkVisited ( ) const [inline]
const QColor& QColorGroup::mid ( ) const [inline]
const QColor & QColorGroup::mid ( ) const [inline]

Returns the mid color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::midlight ( ) const [inline]
const QColor & QColorGroup::midlight ( ) const [inline]

Returns the midlight color of the color group.

Ver también:
ColorRole
bool QColorGroup::operator!= ( const QColorGroup g) const [inline]
bool QColorGroup::operator!= ( const QColorGroup g) const [inline]

Returns TRUE if this color group is different from g; otherwise returns FALSE.

Ver también:
operator!=()
QColorGroup & QColorGroup::operator= ( const QColorGroup other)

Copies the colors of other to this color group.

QColorGroup& QColorGroup::operator= ( const QColorGroup )
bool QColorGroup::operator== ( const QColorGroup g) const
bool QColorGroup::operator== ( const QColorGroup g) const

Returns TRUE if this color group is equal to g; otherwise returns FALSE.

Ver también:
operator==()
void QColorGroup::setBrush ( ColorRole  r,
const QBrush b 
)

Sets the brush used for color role r to b.

Ver también:
brush() setColor() ColorRole
void QColorGroup::setBrush ( ColorRole  ,
const QBrush  
)
void QColorGroup::setColor ( ColorRole  r,
const QColor c 
)

Sets the brush used for color role r to a solid color c.

Ver también:
brush() setColor() ColorRole
void QColorGroup::setColor ( ColorRole  ,
const QColor  
)
const QColor & QColorGroup::shadow ( ) const [inline]

Returns the shadow color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::shadow ( ) const [inline]
const QColor & QColorGroup::text ( ) const [inline]

Returns the text foreground color of the color group.

Ver también:
ColorRole
const QColor& QColorGroup::text ( ) const [inline]

Documentación de las funciones relacionadas y clases amigas

QDataStream & operator<< ( QDataStream s,
const QColorGroup g 
) [related]

Writes color group, g to the stream s.

Ver también:
Format of the QDataStream operators
QDataStream & operator>> ( QDataStream s,
QColorGroup g 
) [related]

Reads a color group from the stream.

Ver también:
Format of the QDataStream operators
QPalette [friend]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'