kdeui Library API Documentation

KFontCombo Class Reference

A combobox that lists the available fonts. A combobox to choose a font. More...

#include <kfontcombo.h>

Inheritance diagram for KFontCombo:

KComboBox QComboBox KCompletionBase List of all members.

Public Member Functions

 KFontCombo (QWidget *parent, const char *name=0)
 KFontCombo (const QStringList &fonts, QWidget *parent, const char *name=0)
virtual ~KFontCombo ()
void setFonts (const QStringList &fonts)
void setCurrentFont (const QString &family)
QString currentFont () const
void setBold (bool bold)
bool bold () const
void setItalic (bool italic)
bool italic () const
void setUnderline (bool underline)
bool underline () const
void setStrikeOut (bool strikeOut)
bool strikeOut () const
void setSize (int size)
int size () const
virtual void setCurrentItem (int i)

Static Public Member Functions

bool displayFonts ()

Protected Member Functions

void updateFonts ()
virtual void virtual_hook (int id, void *data)

Properties

QString family
bool bold
bool italic
bool underline
bool strikeOut
int fontSize

Detailed Description

A combobox that lists the available fonts. A combobox to choose a font.

The items are painted using the respective font itself, so the user can easily choose a font based on its look. This can be turned off globally if the user wishes so.

Author:
Malte Starostik <malte@kde.org>
Version:
Id
kfontcombo.h,v 1.11 2003/08/17 19:24:45 coolo Exp

Definition at line 37 of file kfontcombo.h.


Constructor & Destructor Documentation

KFontCombo::KFontCombo QWidget parent,
const char *  name = 0
 

Constructor.

Parameters:
parent The parent widget
name The object name for the widget

Definition at line 164 of file kfontcombo.cpp.

References KFontCombo(), and setFonts().

Referenced by KFontCombo().

KFontCombo::KFontCombo const QStringList fonts,
QWidget parent,
const char *  name = 0
 

Constructor that takes an already initialzed font list.

Parameters:
fonts A list of fonts to show
parent The parent widget
name The object name for the widget

Definition at line 173 of file kfontcombo.cpp.

References KFontCombo(), and setFonts().

KFontCombo::~KFontCombo  )  [virtual]
 

Destructor.

Definition at line 255 of file kfontcombo.cpp.


Member Function Documentation

void KFontCombo::setFonts const QStringList fonts  ) 
 

Sets the font list.

Parameters:
fonts Font list to show

Definition at line 180 of file kfontcombo.cpp.

References setFonts().

Referenced by KFontCombo(), and setFonts().

void KFontCombo::setCurrentFont const QString family  ) 
 

Sets the currently selected font.

Parameters:
family Font to select.

Definition at line 190 of file kfontcombo.cpp.

References setCurrentFont(), and setCurrentItem().

Referenced by setCurrentFont().

QString KFontCombo::currentFont  )  const
 

Returns:
the currently selected font.

Definition at line 233 of file kfontcombo.cpp.

void KFontCombo::setBold bool  bold  ) 
 

Sets the listed fonts to bold or normal.

Parameters:
bold Set to true to display fonts in bold

Definition at line 260 of file kfontcombo.cpp.

References setBold(), and updateFonts().

Referenced by setBold().

bool KFontCombo::bold  )  const
 

Returns the current bold status.

Returns:
true if fonts are bold

void KFontCombo::setItalic bool  italic  ) 
 

Sets the listed fonts to italic or regular.

Parameters:
italic Set to true to display fonts italic

Definition at line 273 of file kfontcombo.cpp.

References setItalic(), and updateFonts().

Referenced by setItalic().

bool KFontCombo::italic  )  const
 

Returns the current italic status.

Returns:
True if fonts are italic

void KFontCombo::setUnderline bool  underline  ) 
 

Sets the listed fonts to underlined or not underlined.

Parameters:
underline Set to true to display fonts underlined

Definition at line 286 of file kfontcombo.cpp.

References setUnderline(), and updateFonts().

Referenced by setUnderline().

bool KFontCombo::underline  )  const
 

Returns the current underline status.

Returns:
True if fonts are underlined

void KFontCombo::setStrikeOut bool  strikeOut  ) 
 

Sets the listed fonts to striked out or not.

Parameters:
strikeOut Set to true to display fonts striked out

Definition at line 299 of file kfontcombo.cpp.

References setStrikeOut(), and updateFonts().

Referenced by setStrikeOut().

bool KFontCombo::strikeOut  )  const
 

Returns the current strike out status.

Returns:
True if fonts are striked out

void KFontCombo::setSize int  size  ) 
 

Sets the listed fonts' size.

Parameters:
size Set to the point size to display the fonts in

Definition at line 312 of file kfontcombo.cpp.

References setSize(), and updateFonts().

Referenced by setSize().

int KFontCombo::size  )  const
 

Returns the current font size.

Returns:
The point size of the fonts

Definition at line 324 of file kfontcombo.cpp.

bool KFontCombo::displayFonts  )  [static]
 

Returns the user's setting of whether the items should be painted in the respective fonts or not.

Returns:
True if the respective fonts are used for painting

Definition at line 341 of file kfontcombo.cpp.

References KGlobal::config(), and KConfigBase::readBoolEntry().

void KFontCombo::setCurrentItem int  i  )  [virtual]
 

Simply calls QComboBox' implementation.

Only here to not become shadowed.

Reimplemented from KComboBox.

Definition at line 240 of file kfontcombo.cpp.

References setCurrentItem().

Referenced by setCurrentFont(), and setCurrentItem().

void KFontCombo::updateFonts  )  [protected]
 

Updated the combo's listBox() to reflect changes made to the fonts' attributed.

Definition at line 329 of file kfontcombo.cpp.

Referenced by setBold(), setItalic(), setSize(), setStrikeOut(), and setUnderline().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 8 11:14:33 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003