# class KFontChooser | A font selection widget. More...
Definition | `#include <kfontdialog.h>`
Inherits | QWidget (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- enum FontColumn { FamilyList=0x01, StyleList=0x02, SizeList=0x04 }

#### Public Methods

- KFontChooser (QWidget *parent = 0L, const char *name = 0L, bool onlyFixed = false, const QStringList &fontList = QStringList(), bool makeFrame = true, int visibleListSize=8 )
- void enableColumn ( int column, bool state )
- void setFont ( const QFont &font, bool onlyFixed = false )
- QFont font () const
- void setCharset ( const QString & charset )
- QString charset () const
- QString sampleText () const
- void setSampleText ( const QString &text )
- virtual QSize sizeHint ( void ) const

#### Signals

- void fontSelected ( const QFont &font )

#### Public Static Methods

- static QString getXLFD ( const QFont &theFont )
- static void getFontList ( QStringList &list, const char *pattern )
- static void getFontList ( QStringList &list, bool fixed )

## Detailed Description

A widget for interactive font selection.

While KFontChooser as an ordinary widget can be embedded in custom dialogs and therefore is very flexible, in most cases it is preferable to use the convenience functions in KFontDialog.

enum FontColumn { FamilyList=0x01, StyleList=0x02, SizeList=0x04 } | ### FontColumn

- `FamilyList` - Identifies the family (leftmost) list.
- `StyleList` - Identifies the style (center) list.
- `SizeList` - Identifies the size (rightmost) list.

KFontChooser (QWidget *parent = 0L, const char *name = 0L, bool onlyFixed = false, const QStringList &fontList = QStringList(), bool makeFrame = true, int visibleListSize=8 ) | ### KFontChooser

Constructs a font picker widget.

Parameters:

parent | The parent widget.
name | The widget name.
onlyFixedFonts | Only display fonts which have fixed-width character sizes.
fontList | A list of fonts to display, in XLFD format. If no list is formatted, the internal KDE font list is used. If that has not been created, X is queried, and all fonts available on the system are displayed.
visibleListSize | The minimum number of visible entries in the fontlists.

void enableColumn ( int column, bool state ) | ### enableColumn

Enable or disable a font column in the chooser.

Use this function if your application does not need or supports all font properties.

Parameters:

font | Specifie the columns. An or'ed combination of `FamilyList`, `StyleList` and `SizeList` is possible.
state | If `false` the columns are disabled.

void setFont ( const QFont &font, bool onlyFixed = false ) | ### setFont

Set the currently selected font in the chooser.

Parameters:

font | The font to select.
onlyFixed | Readjust the font list to display only fixed width fonts if `true`, or vice-versa.

Reimplemented from QWidget.

QFont font () | ### font

[const]

Returns: The currently selected font in the chooser.

Reimplemented from QWidget.

void setCharset ( const QString & charset ) | ### setCharset

Set the currently selected charset in the chooser.

QString charset () | ### charset

[const]

Returns: The currently selected charset in the dialog.

QString sampleText () | ### sampleText

[const]

Returns: The current text in the sample text input area.

void setSampleText ( const QString &text ) | ### setSampleText

Set the sample text.

Normally you should not change this text, but it can be better to do this if the default text is too large for the edit area when using the default font of your application.

Parameters:

text | The new sample text. The current will be removed.

QString getXLFD ( const QFont &theFont ) | ### getXLFD

[static]

Convert a QFont into the corresponding X Logical Font Description (XLFD).

Parameters:

theFont | The font to convert.

Returns: A string representing the given font in XLFD format.

void getFontList ( QStringList &list, const char *pattern ) | ### getFontList

[static]

Create a list of font strings that match `pattern`.

Parameters:

list | The list is returned here.
pattern | The font pattern.

void getFontList ( QStringList &list, bool fixed ) | ### getFontList

[static]

Create a list of font strings.

Parameters:

list | The list is returned here.
fixed | Flag, when true only fixed fonts are returned.

QSize sizeHint ( void ) | ### sizeHint

[const virtual]

Reimplemented for internal reasons.

Reimplemented from QWidget.

void fontSelected ( const QFont &font ) | ### fontSelected

[signal]

connect to this to monitor the font as it is selected.

- Version: $Id: kfontdialog.h,v 1.38 2000/09/25 13:45:17 faure Exp $
- Author: Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org>
- Generated: root@sparc.ports.openbsd.org on Wed May 2 09:37:45 2001, using kdoc 2.0a53.