Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Métodos públicos | Métodos públicos estáticos | Funciones relacionadas
Referencia de la Clase QPalette

The QPalette class contains color groups for each widget state. Más...

#include <qpalette.h>

Lista de todos los miembros.

Clases

struct  QPalData

Tipos públicos

enum  ColorGroup {
  Disabled, Active, Inactive, NColorGroups,
  Normal = Active, Disabled, Active, Inactive,
  NColorGroups, Normal = Active
}
enum  ColorGroup {
  Disabled, Active, Inactive, NColorGroups,
  Normal = Active, Disabled, Active, Inactive,
  NColorGroups, Normal = Active
}

Métodos públicos

 QPalette ()
 QPalette (const QColor &button)
 QPalette (const QColor &button, const QColor &background)
 QPalette (const QColorGroup &active, const QColorGroup &disabled, const QColorGroup &inactive)
 QPalette (const QPalette &)
 ~QPalette ()
QPaletteoperator= (const QPalette &)
const QColorcolor (ColorGroup, QColorGroup::ColorRole) const
const QBrushbrush (ColorGroup, QColorGroup::ColorRole) const
void setColor (ColorGroup, QColorGroup::ColorRole, const QColor &)
void setBrush (ColorGroup, QColorGroup::ColorRole, const QBrush &)
void setColor (QColorGroup::ColorRole, const QColor &)
void setBrush (QColorGroup::ColorRole, const QBrush &)
QPalette copy () const
const QColorGroupactive () const
const QColorGroupdisabled () const
const QColorGroupinactive () const
const QColorGroupnormal () const
void setActive (const QColorGroup &)
void setDisabled (const QColorGroup &)
void setInactive (const QColorGroup &)
void setNormal (const QColorGroup &cg)
bool operator== (const QPalette &p) const
bool operator!= (const QPalette &p) const
bool isCopyOf (const QPalette &)
int serialNumber () const
 QPalette ()
 QPalette (const QColor &button)
 QPalette (const QColor &button, const QColor &background)
 QPalette (const QColorGroup &active, const QColorGroup &disabled, const QColorGroup &inactive)
 QPalette (const QPalette &)
 ~QPalette ()
QPaletteoperator= (const QPalette &)
const QColorcolor (ColorGroup, QColorGroup::ColorRole) const
const QBrushbrush (ColorGroup, QColorGroup::ColorRole) const
void setColor (ColorGroup, QColorGroup::ColorRole, const QColor &)
void setBrush (ColorGroup, QColorGroup::ColorRole, const QBrush &)
void setColor (QColorGroup::ColorRole, const QColor &)
void setBrush (QColorGroup::ColorRole, const QBrush &)
QPalette copy () const
const QColorGroupactive () const
const QColorGroupdisabled () const
const QColorGroupinactive () const
const QColorGroupnormal () const
void setActive (const QColorGroup &)
void setDisabled (const QColorGroup &)
void setInactive (const QColorGroup &)
void setNormal (const QColorGroup &cg)
bool operator== (const QPalette &p) const
bool operator!= (const QPalette &p) const
bool isCopyOf (const QPalette &)
int serialNumber () const

Métodos públicos estáticos

static QColorGroup::ColorRole foregroundRoleFromMode (Qt::BackgroundMode mode)
static QColorGroup::ColorRole backgroundRoleFromMode (Qt::BackgroundMode mode)
static QColorGroup::ColorRole foregroundRoleFromMode (Qt::BackgroundMode mode)
static QColorGroup::ColorRole backgroundRoleFromMode (Qt::BackgroundMode mode)

Funciones relacionadas

(Observar que estas no son funciones miembro.)

QDataStreamoperator<< (QDataStream &s, const QPalette &p)
QDataStreamoperator>> (QDataStream &s, QPalette &p)

Descripción detallada

The QPalette class contains color groups for each widget state.

A palette consists of three color groups: active, disabled, and inactive. All widgets contain a palette, and all widgets in Qt use their palette to draw themselves. This makes the user interface easily configurable and easier to keep consistent.

If you create a new widget we strongly recommend that you use the colors in the palette rather than hard-coding specific colors.

The color groups: The active() group is used for the window that has keyboard focus. The inactive() group is used for other windows. The disabled() group is used for widgets (not windows) that are disabled for some reason.

Both active and inactive windows can contain disabled widgets. (Disabled widgets are often called inaccessible or {grayed out}.)

In Motif style, active() and inactive() look the same. In Windows 2000 style and Macintosh Platinum style, the two styles look slightly different.

There are setActive(), setInactive(), and setDisabled() functions to modify the palette. (Qt also supports a normal() group; this is an obsolete alias for active(), supported for backwards compatibility.)

Colors and brushes can be set for particular roles in any of a palette's color groups with setColor() and setBrush().

You can copy a palette using the copy constructor and test to see if two palettes are identical using isCopyOf().

Ver también:
QApplication::setPalette(), QWidget::setPalette(), QColorGroup, QColor

Documentación de las enumeraciones miembro de la clase

Disabled Active Inactive NColorGroups Normal synonym for Active

Valores de enumeraciones:
Disabled 
Active 
Inactive 
NColorGroups 
Normal 
Disabled 
Active 
Inactive 
NColorGroups 
Normal 
Valores de enumeraciones:
Disabled 
Active 
Inactive 
NColorGroups 
Normal 
Disabled 
Active 
Inactive 
NColorGroups 
Normal 

Documentación del constructor y destructor

QPalette::QPalette ( )

Constructs a palette that consists of color groups with only black colors.

QPalette::QPalette ( const QColor button)

Constructs a palette from the button color. The other colors are automatically calculated, based on this color. Background will be the button color as well.

QPalette::QPalette ( const QColor button,
const QColor background 
)

Constructs a palette from a button color and a background. The other colors are automatically calculated, based on these colors.

QPalette::QPalette ( const QColorGroup active,
const QColorGroup disabled,
const QColorGroup inactive 
)

Constructs a palette that consists of the three color groups active, disabled and inactive. See the Detailed Description for definitions of the color groups and QColorGroup::ColorRole for definitions of each color role in the three groups.

Ver también:
QColorGroup QColorGroup::ColorRole QPalette
QPalette::QPalette ( const QPalette p)

Constructs a copy of p.

This constructor is fast (it uses copy-on-write).

QPalette::~QPalette ( )

Destroys the palette.

QPalette::QPalette ( )
QPalette::QPalette ( const QColor button)
QPalette::QPalette ( const QColor button,
const QColor background 
)
QPalette::QPalette ( const QColorGroup active,
const QColorGroup disabled,
const QColorGroup inactive 
)
QPalette::QPalette ( const QPalette )
QPalette::~QPalette ( )

Documentación de las funciones miembro

const QColorGroup & QPalette::active ( ) const [inline]

Returns the active color group of this palette.

Ver también:
QColorGroup, setActive(), inactive(), disabled()
const QColorGroup& QPalette::active ( ) const [inline]
QColorGroup::ColorRole QPalette::backgroundRoleFromMode ( Qt::BackgroundMode  mode) [static]
static QColorGroup::ColorRole QPalette::backgroundRoleFromMode ( Qt::BackgroundMode  mode) [static]
const QBrush & QPalette::brush ( ColorGroup  gr,
QColorGroup::ColorRole  r 
) const

Returns the brush in color group gr, used for color role r.

Ver también:
color() setBrush() QColorGroup::ColorRole
const QBrush& QPalette::brush ( ColorGroup  ,
QColorGroup::ColorRole   
) const
const QColor & QPalette::color ( ColorGroup  gr,
QColorGroup::ColorRole  r 
) const

Returns the color in color group gr, used for color role r.

Ver también:
brush() setColor() QColorGroup::ColorRole
const QColor& QPalette::color ( ColorGroup  ,
QColorGroup::ColorRole   
) const
QPalette QPalette::copy ( ) const

Returns a deep copy of this palette.

Atención:
This is slower than the copy constructor and assignment operator and offers no benefits.
QPalette QPalette::copy ( ) const
const QColorGroup& QPalette::disabled ( ) const [inline]
const QColorGroup & QPalette::disabled ( ) const [inline]

Returns the disabled color group of this palette.

Ver también:
QColorGroup, setDisabled(), active(), inactive()
QColorGroup::ColorRole QPalette::foregroundRoleFromMode ( Qt::BackgroundMode  mode) [static]
static QColorGroup::ColorRole QPalette::foregroundRoleFromMode ( Qt::BackgroundMode  mode) [static]
const QColorGroup& QPalette::inactive ( ) const [inline]
const QColorGroup & QPalette::inactive ( ) const [inline]

Returns the inactive color group of this palette.

Ver también:
QColorGroup, setInactive(), active(), disabled()
bool QPalette::isCopyOf ( const QPalette p)

Returns TRUE if this palette and p are copies of each other, i.e. one of them was created as a copy of the other and neither was subsequently modified; otherwise returns FALSE. This is much stricter than equality.

Ver también:
operator=() operator==()
bool QPalette::isCopyOf ( const QPalette )
const QColorGroup& QPalette::normal ( ) const [inline]
const QColorGroup & QPalette::normal ( ) const [inline]

Returns the active color group. Use active() instead.

Ver también:
setActive() active()
bool QPalette::operator!= ( const QPalette p) const [inline]
bool QPalette::operator!= ( const QPalette p) const [inline]

Returns TRUE (slowly) if this palette is different from p; otherwise returns FALSE (usually quickly).

QPalette & QPalette::operator= ( const QPalette p)

Assigns p to this palette and returns a reference to this palette.

This is fast (it uses copy-on-write).

Ver también:
copy()
QPalette& QPalette::operator= ( const QPalette )
bool QPalette::operator== ( const QPalette p) const

Returns TRUE (usually quickly) if this palette is equal to p; otherwise returns FALSE (slowly).

bool QPalette::operator== ( const QPalette p) const
int QPalette::serialNumber ( ) const [inline]
int QPalette::serialNumber ( ) const [inline]

Returns a number that uniquely identifies this QPalette object. The serial number is intended for caching. Its value may not be used for anything other than equality testing.

Note that QPalette uses copy-on-write, and the serial number changes during the lazy copy operation (detach()), not during a shallow copy (copy constructor or assignment).

Ver también:
QPixmap QPixmapCache QCache
void QPalette::setActive ( const QColorGroup )
void QPalette::setActive ( const QColorGroup g)

Sets the Active color group to g.

Ver también:
active() setDisabled() setInactive() QColorGroup
void QPalette::setBrush ( QColorGroup::ColorRole  r,
const QBrush b 
)

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the brush in for color role r in all three color groups to b.

Ver también:
brush() setColor() QColorGroup::ColorRole active() inactive() disabled()
void QPalette::setBrush ( ColorGroup  ,
QColorGroup::ColorRole  ,
const QBrush  
)
void QPalette::setBrush ( ColorGroup  gr,
QColorGroup::ColorRole  r,
const QBrush b 
)

Sets the brush in color group gr, used for color role r, to b.

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

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Sets the brush color used for color role r to color c in all three color groups.

Ver también:
color() setBrush() QColorGroup::ColorRole
void QPalette::setColor ( ColorGroup  gr,
QColorGroup::ColorRole  r,
const QColor c 
)

Sets the brush in color group gr, used for color role r, to the solid color c.

Ver también:
setBrush() color() QColorGroup::ColorRole
void QPalette::setColor ( ColorGroup  ,
QColorGroup::ColorRole  ,
const QColor  
)
void QPalette::setDisabled ( const QColorGroup g)

Sets the Disabled color group to g.

Ver también:
disabled() setActive() setInactive()
void QPalette::setDisabled ( const QColorGroup )
void QPalette::setInactive ( const QColorGroup g)

Sets the Inactive color group to g.

Ver también:
active() setDisabled() setActive() QColorGroup
void QPalette::setInactive ( const QColorGroup )
void QPalette::setNormal ( const QColorGroup cg) [inline]
void QPalette::setNormal ( const QColorGroup cg) [inline]

Sets the active color group to cg. Use setActive() instead.

Ver también:
setActive() active()

Documentación de las funciones relacionadas y clases amigas

QDataStream & operator<< ( QDataStream s,
const QPalette p 
) [related]

Writes the palette, p to the stream s and returns a reference to the stream.

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

Reads a palette from the stream, s into the palette p, and returns a reference to the stream.

Ver también:
Format of the QDataStream operators

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'