KFontChooser Class Reference
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. A font selection widget. More...
#include <kfontdialog.h>
Inheritance diagram for KFontChooser:


Public Types | |
enum | FontColumn { FamilyList = 0x01, StyleList = 0x02, SizeList = 0x04 } |
enum | FontDiff { FontDiffFamily = 0x01, FontDiffStyle = 0x02, FontDiffSize = 0x04 } |
enum | FontListCriteria { FixedWidthFonts = 0x01, ScalableFonts = 0x02, SmoothScalableFonts = 0x04 } |
Signals | |
void | fontSelected (const QFont &font) |
Public Member Functions | |
KFontChooser (QWidget *parent=0L, const char *name=0L, bool onlyFixed=false, const QStringList &fontList=QStringList(), bool makeFrame=true, int visibleListSize=8, bool diff=false, QButton::ToggleState *sizeIsRelativeState=0L) | |
virtual | ~KFontChooser () |
void | enableColumn (int column, bool state) |
void | setFont (const QFont &font, bool onlyFixed=false) |
int | fontDiffFlags () |
QFont | font () const |
void | setColor (const QColor &col) |
QColor | color () const |
void | setBackgroundColor (const QColor &col) |
QColor | backgroundColor () const |
void | setSizeIsRelative (QButton::ToggleState relative) |
QButton::ToggleState | sizeIsRelative () const |
QString | sampleText () const |
void | setSampleText (const QString &text) |
virtual QSize | sizeHint (void) const |
Static Public Member Functions | |
QString | getXLFD (const QFont &theFont) |
void | getFontList (QStringList &list, uint fontListCriteria) |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
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. A font selection widget.
- Author:
- Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org>
- Version:
- Id
- kfontdialog.h,v 1.68 2003/09/09 12:40:58 bhards Exp
Definition at line 51 of file kfontdialog.h.
Member Enumeration Documentation
|
Definition at line 62 of file kfontdialog.h. |
|
Definition at line 69 of file kfontdialog.h. |
|
The selection criteria for the font families shown in the dialog.
Definition at line 227 of file kfontdialog.h. |
Constructor & Destructor Documentation
|
Constructs a font picker widget. It normally comes up with all font families present on the system; the getFont method below does allow some more fine-tuning of the selection of fonts that will be displayed in the dialog. Consider the following code snippet; QStringList list; KFontChooser::getFontList(list,SmoothScalableFonts); KFontChooser chooseFont = new KFontChooser(0, "FontList", false, list); The above creates a font chooser dialog with only SmoothScaleble fonts.
Definition at line 97 of file kfontdialog.cpp. References QToolTip::add(), QWhatsThis::add(), QGridLayout::addLayout(), QGridLayout::addMultiCellWidget(), QGridLayout::addWidget(), KGlobal::config(), QListBox::findItem(), QWidget::fontMetrics(), fontSelected(), QString::fromLatin1(), KGlobalSettings::generalFont(), QListBox::insertItem(), QListBox::insertStringList(), KStdAccel::label(), KDialog::marginHint(), KStdAccel::name(), QString::number(), QWidget::QWidget(), KConfigBase::readBoolEntry(), QLineEdit::setAlignment(), QGridLayout::setColStretch(), QWidget::setEnabled(), setFont(), KIntNumInput::setMinValue(), QListBox::setSelected(), setSizeIsRelative(), QLineEdit::setText(), QCheckBox::setTristate(), and KDialog::spacingHint(). |
|
Destructs the font chooser.
Definition at line 342 of file kfontdialog.cpp. |
Member Function Documentation
|
Enables or disable a font column in the chooser. Use this function if your application does not need or supports all font properties.
Definition at line 416 of file kfontdialog.cpp. |
|
Sets the currently selected font in the chooser.
Definition at line 433 of file kfontdialog.cpp. Referenced by KFontChooser(), and KFontDialog::setFont(). |
|
Definition at line 450 of file kfontdialog.cpp. References QCheckBox::isChecked(). Referenced by KFontDialog::getFontDiff(). |
|
Reimplemented from QWidget. Definition at line 147 of file kfontdialog.h. Referenced by KFontDialog::font(), KFontDialog::getFont(), KFontDialog::getFontAndText(), and KFontDialog::getFontDiff(). |
|
Sets the color to use in the preview.
Definition at line 366 of file kfontdialog.cpp. References QPalette::setColor(). |
|
Definition at line 374 of file kfontdialog.cpp. |
|
Sets the background color to use in the preview.
Definition at line 379 of file kfontdialog.cpp. References QPalette::setColor(). |
|
Definition at line 387 of file kfontdialog.cpp. |
|
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size. NOTE: If parameter sizeIsRelative was not set in the constructor of the widget this setting will be ignored. Definition at line 392 of file kfontdialog.cpp. References QCheckBox::setChecked(), and QCheckBox::setNoChange(). Referenced by KFontChooser(), and KFontDialog::setSizeIsRelative(). |
|
Definition at line 403 of file kfontdialog.cpp. References QCheckBox::state(). Referenced by KFontDialog::getFont(), KFontDialog::getFontAndText(), KFontDialog::getFontDiff(), and KFontDialog::sizeIsRelative(). |
|
Definition at line 189 of file kfontdialog.h. References QLineEdit::text(). Referenced by KFontDialog::getFontAndText(). |
|
Sets 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.
Definition at line 201 of file kfontdialog.h. References QLineEdit::setText(). |
|
Converts a QFont into the corresponding X Logical Font Description (XLFD).
Definition at line 213 of file kfontdialog.h. References QFont::rawName(). |
|
Creates a list of font strings.
Definition at line 645 of file kfontdialog.cpp. References QFontDatabase::families(), QFontDatabase::isBitmapScalable(), QFontDatabase::isFixedPitch(), QFontDatabase::isSmoothlyScalable(), and QStringList::sort(). Referenced by KFontCombo::KFontCombo(). |
|
Reimplemented for internal reasons.
Reimplemented from QWidget. Definition at line 410 of file kfontdialog.cpp. References QWidget::minimumSizeHint(). |
|
Emitted whenever the selected font changes.
Referenced by KFontChooser(). |
The documentation for this class was generated from the following files: