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

The QIconSet class provides a set of icons with different styles and sizes. Más...

#include <qiconset.h>

Lista de todos los miembros.

Tipos públicos

enum  Size {
  Automatic, Small, Large, Automatic,
  Small, Large
}
enum  Mode {
  Normal, Disabled, Active, Normal,
  Disabled, Active
}
enum  State { On, Off, On, Off }
enum  Size {
  Automatic, Small, Large, Automatic,
  Small, Large
}
enum  Mode {
  Normal, Disabled, Active, Normal,
  Disabled, Active
}
enum  State { On, Off, On, Off }

Métodos públicos

 QIconSet ()
 QIconSet (const QPixmap &pixmap, Size size=Automatic)
 QIconSet (const QPixmap &smallPix, const QPixmap &largePix)
 QIconSet (const QIconSet &other)
virtual ~QIconSet ()
void reset (const QPixmap &pixmap, Size size)
virtual void setPixmap (const QPixmap &pixmap, Size size, Mode mode=Normal, State state=Off)
virtual void setPixmap (const QString &fileName, Size size, Mode mode=Normal, State state=Off)
QPixmap pixmap (Size size, Mode mode, State state=Off) const
QPixmap pixmap (Size size, bool enabled, State state=Off) const
QPixmap pixmap () const
bool isGenerated (Size size, Mode mode, State state=Off) const
void clearGenerated ()
void installIconFactory (QIconFactory *factory)
bool isNull () const
void detach ()
QIconSetoperator= (const QIconSet &other)
 QIconSet ()
 QIconSet (const QPixmap &pixmap, Size size=Automatic)
 QIconSet (const QPixmap &smallPix, const QPixmap &largePix)
 QIconSet (const QIconSet &other)
virtual ~QIconSet ()
void reset (const QPixmap &pixmap, Size size)
virtual void setPixmap (const QPixmap &pixmap, Size size, Mode mode=Normal, State state=Off)
virtual void setPixmap (const QString &fileName, Size size, Mode mode=Normal, State state=Off)
QPixmap pixmap (Size size, Mode mode, State state=Off) const
QPixmap pixmap (Size size, bool enabled, State state=Off) const
QPixmap pixmap () const
bool isGenerated (Size size, Mode mode, State state=Off) const
void clearGenerated ()
void installIconFactory (QIconFactory *factory)
bool isNull () const
void detach ()
QIconSetoperator= (const QIconSet &other)

Métodos públicos estáticos

static void setIconSize (Size which, const QSize &size)
static const QSizeiconSize (Size which)
static void setIconSize (Size which, const QSize &size)
static const QSizeiconSize (Size which)

Descripción detallada

The QIconSet class provides a set of icons with different styles and sizes.

A QIconSet can generate smaller, larger, active, and disabled pixmaps from the set of icons it is given. Such pixmaps are used by QToolButton, QHeader, QPopupMenu, etc. to show an icon representing a particular action.

The simplest use of QIconSet is to create one from a QPixmap and then use it, allowing Qt to work out all the required icon styles and sizes. For example:

    QToolButton *but = new QToolButton( QIconSet( QPixmap("open.xpm") ), ... );

Using whichever pixmaps you specify as a base, QIconSet provides a set of six icons, each with a Size and a Mode: Small Normal, Small Disabled, Small Active, Large Normal, Large Disabled, and Large Active.

An additional set of six icons can be provided for widgets that have an "On" or "Off" state, like checkable menu items or toggleable toolbuttons. If you provide pixmaps for the "On" state, but not for the "Off" state, the QIconSet will provide the "Off" pixmaps. You may specify icons for both states in you wish.

You can set any of the icons using setPixmap().

When you retrieve a pixmap using pixmap(Size, Mode, State), QIconSet will return the icon that has been set or previously generated for that size, mode and state combination. If none is available, QIconSet will ask the icon factory. If the icon factory cannot provide any (the default), QIconSet generates a pixmap based on the pixmaps it has been given and returns it.

The Disabled appearance is computed using an algorithm that produces results very similar to those used in Microsoft Windows 95. The Active appearance is identical to the Normal appearance unless you use setPixmap() to set it to something special.

When scaling icons, QIconSet uses smooth scaling, which can partially blend the color component of pixmaps. If the results look poor, the best solution is to supply pixmaps in both large and small sizes.

You can use the static function setIconSize() to set the preferred size of the generated large/small icons. The default small size is 22 x 22, while the default large size is 32 x 32. These sizes only affect generated icons.

The isGenerated() function returns TRUE if an icon was generated by QIconSet or by a factory; clearGenerated() clears all cached pixmaps.


Documentación de las enumeraciones miembro de la clase

This enum type describes the mode for which a pixmap is intended to be used. The currently defined modes are:

Normal Display the pixmap when the user is not interacting with the icon, but the functionality represented by the icon is available. Disabled Display the pixmap when the functionality represented by the icon is not available. Active Display the pixmap when the functionality represented by the icon is available and the user is interacting with the icon, for example, moving the mouse over it or clicking it.

Valores de enumeraciones:
Normal 
Disabled 
Active 
Normal 
Disabled 
Active 
Valores de enumeraciones:
Normal 
Disabled 
Active 
Normal 
Disabled 
Active 

This enum type describes the size at which a pixmap is intended to be used. The currently defined sizes are:

Automatic The size of the pixmap is determined from its pixel size. This is a useful default. Small The pixmap is the smaller of two. Large The pixmap is the larger of two.

If a Small pixmap is not set by QIconSet::setPixmap(), the Large pixmap will be automatically scaled down to the size of a small pixmap to generate the Small pixmap when required. Similarly, a Small pixmap will be automatically scaled up to generate a Large pixmap. The preferred sizes for large/small generated icons can be set using setIconSize().

Ver también:
setIconSize() iconSize() setPixmap() pixmap() QMainWindow::setUsesBigPixmaps()
Valores de enumeraciones:
Automatic 
Small 
Large 
Automatic 
Small 
Large 
Valores de enumeraciones:
Automatic 
Small 
Large 
Automatic 
Small 
Large 

This enum describes the state for which a pixmap is intended to be used. The state can be:

Off Display the pixmap when the widget is in an "off" state On Display the pixmap when the widget is in an "on" state

Ver también:
setPixmap() pixmap()
Valores de enumeraciones:
On 
Off 
On 
Off 
Valores de enumeraciones:
On 
Off 
On 
Off 

Documentación del constructor y destructor

QIconSet::QIconSet ( )

Constructs a null icon set.

Ver también:
setPixmap(), reset()
QIconSet::QIconSet ( const QPixmap pixmap,
Size  size = Automatic 
)

Constructs an icon set for which the Normal pixmap is pixmap, which is assumed to be of size size.

The default for size is Automatic, which means that QIconSet will determine whether the pixmap is Small or Large from its pixel size. Pixmaps less than the width of a small generated icon are considered to be Small. You can use setIconSize() to set the preferred size of a generated icon.

Ver también:
setIconSize() reset()
QIconSet::QIconSet ( const QPixmap smallPix,
const QPixmap largePix 
)

Creates an iconset which uses the pixmap smallPix for for displaying a small icon, and the pixmap largePix for displaying a large icon.

QIconSet::QIconSet ( const QIconSet other)

Constructs a copy of other. This is very fast.

QIconSet::~QIconSet ( ) [virtual]

Destroys the icon set and frees any allocated resources.

QIconSet::QIconSet ( )
QIconSet::QIconSet ( const QPixmap pixmap,
Size  size = Automatic 
)
QIconSet::QIconSet ( const QPixmap smallPix,
const QPixmap largePix 
)
QIconSet::QIconSet ( const QIconSet other)
virtual QIconSet::~QIconSet ( ) [virtual]

Documentación de las funciones miembro

void QIconSet::clearGenerated ( )

Clears all cached pixmaps, including those obtained from an eventual QIconFactory.

void QIconSet::clearGenerated ( )
void QIconSet::detach ( )

Detaches this icon set from others with which it may share data.

You will never need to call this function; other QIconSet functions call it as necessary.

void QIconSet::detach ( )
const QSize & QIconSet::iconSize ( Size  which) [static]

If which is Small, returns the preferred size of a small generated icon; if which is Large, returns the preferred size of a large generated icon.

Ver también:
setIconSize()
static const QSize& QIconSet::iconSize ( Size  which) [static]
void QIconSet::installIconFactory ( QIconFactory factory)

Installs factory as the icon factory for this iconset. The icon factory is used to generates pixmaps not set by the user.

If no icon factory is installed, QIconFactory::defaultFactory() is used.

void QIconSet::installIconFactory ( QIconFactory factory)
bool QIconSet::isGenerated ( Size  size,
Mode  mode,
State  state = Off 
) const

Returns TRUE if the pixmap with size size, mode mode and state state is generated from other pixmaps; otherwise returns FALSE.

A pixmap obtained from a QIconFactory is considered non-generated.

bool QIconSet::isGenerated ( Size  size,
Mode  mode,
State  state = Off 
) const
bool QIconSet::isNull ( ) const

Returns TRUE if the icon set is empty; otherwise returns FALSE.

bool QIconSet::isNull ( ) const
QIconSet& QIconSet::operator= ( const QIconSet other)
QIconSet & QIconSet::operator= ( const QIconSet other)

Assigns other to this icon set and returns a reference to this icon set.

Ver también:
detach()
QPixmap QIconSet::pixmap ( Size  size,
bool  enabled,
State  state = Off 
) const
QPixmap QIconSet::pixmap ( Size  size,
bool  enabled,
State  state = Off 
) const

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta.

This is the same as pixmap(size, enabled, state).

QPixmap QIconSet::pixmap ( Size  size,
Mode  mode,
State  state = Off 
) const
QPixmap QIconSet::pixmap ( ) const

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Returns the pixmap originally provided to the constructor or to reset(). This is the Normal pixmap of unspecified Size.

Ver también:
reset()
QPixmap QIconSet::pixmap ( ) const
QPixmap QIconSet::pixmap ( Size  size,
Mode  mode,
State  state = Off 
) const

Returns a pixmap with size size, mode mode and state state, generating one if necessary. Generated pixmaps are cached.

void QIconSet::reset ( const QPixmap pixmap,
Size  size 
)

Sets this icon set to use pixmap pixmap for the Normal pixmap, assuming it to be of size size.

This is equivalent to assigning QIconSet(pixmap, size) to this icon set.

This function does nothing if pixmap is a null pixmap.

void QIconSet::reset ( const QPixmap pixmap,
Size  size 
)
void QIconSet::setIconSize ( Size  which,
const QSize size 
) [static]

Set the preferred size for all small or large icons that are generated after this call. If which is Small, sets the preferred size of small generated icons to size. Similarly, if which is Large, sets the preferred size of large generated icons to size.

Note that cached icons will not be regenerated, so it is recommended that you set the preferred icon sizes before generating any icon sets. Also note that the preferred icon sizes will be ignored for icon sets that have been created using both small and large pixmaps.

Ver también:
iconSize()
static void QIconSet::setIconSize ( Size  which,
const QSize size 
) [static]
void QIconSet::setPixmap ( const QString fileName,
Size  size,
Mode  mode = Normal,
State  state = Off 
) [virtual]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. The pixmap is loaded from fileName when it becomes necessary.

virtual void QIconSet::setPixmap ( const QString fileName,
Size  size,
Mode  mode = Normal,
State  state = Off 
) [virtual]
void QIconSet::setPixmap ( const QPixmap pixmap,
Size  size,
Mode  mode = Normal,
State  state = Off 
) [virtual]

Sets this icon set to provide pixmap pixmap for size size, mode mode and state state. The icon set may also use pixmap for generating other pixmaps if they are not explicitly set.

The size can be one of Automatic, Large or Small. If Automatic is used, QIconSet will determine if the pixmap is Small or Large from its pixel size.

Pixmaps less than the width of a small generated icon are considered to be Small. You can use setIconSize() to set the preferred size of a generated icon.

This function does nothing if pixmap is a null pixmap.

Ver también:
reset()
virtual void QIconSet::setPixmap ( const QPixmap pixmap,
Size  size,
Mode  mode = Normal,
State  state = Off 
) [virtual]

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'