KFontDialog Class Reference
The KFontDialog provides a dialog for interactive font selection. A font selection dialog. More...
#include <kfontdialog.h>
Inheritance diagram for KFontDialog:

Signals | |
void | fontSelected (const QFont &font) |
Emitted whenever the currently selected font changes. | |
Public Member Functions | |
KFontDialog (QWidget *parent=0L, const char *name=0, bool onlyFixed=false, bool modal=false, const QStringList &fontlist=QStringList(), bool makeFrame=true, bool diff=false, QButton::ToggleState *sizeIsRelativeState=0L) | |
Constructs a font selection dialog. | |
void | setFont (const QFont &font, bool onlyFixed=false) |
Sets the currently selected font in the dialog. | |
QFont | font () const |
void | setSizeIsRelative (QButton::ToggleState relative) |
Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size. | |
QButton::ToggleState | sizeIsRelative () const |
Static Public Member Functions | |
int | getFont (QFont &theFont, bool onlyFixed=false, QWidget *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L) |
Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed. | |
int | getFontDiff (QFont &theFont, int &diffFlags, bool onlyFixed=false, QWidget *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L) |
Creates a modal font difference dialog, lets the user choose a selection of changes that should be made to a set of fonts, and returns when the dialog is closed. | |
int | getFontAndText (QFont &theFont, QString &theString, bool onlyFixed=false, QWidget *parent=0L, bool makeFrame=true, QButton::ToggleState *sizeIsRelativeState=0L) |
When you are not only interested in the font selected, but also in the example string typed in, you can call this method. | |
Protected Member Functions | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KFontChooser * | chooser |
Detailed Description
The KFontDialog provides a dialog for interactive font selection. A font selection dialog.It is basically a thin wrapper around the KFontChooser widget, which can also be used standalone. In most cases, the simplest use of this class is the static method KFontDialog::getFont(), which pops up the dialog, allows the user to select a font, and returns when the dialog is closed.
Example:
QFont myFont; int result = KFontDialog::getFont( myFont ); if ( result == KFontDialog::Accepted ) ...
![]()
KDE Font Dialog
- Author:
- Preston Brown <pbrown@kde.org>, Bernd Wuebben <wuebben@kde.org>
- Version:
- Id
- kfontdialog.h,v 1.61 2002/09/11 02:18:25 orlovich Exp
Definition at line 319 of file kfontdialog.h.
Constructor & Destructor Documentation
|
Constructs a font selection dialog.
Definition at line 723 of file kfontdialog.cpp. References KStdAccel::name(), and KDialogBase::setMainWidget(). |
Member Function Documentation
|
Sets the currently selected font in the dialog.
Definition at line 358 of file kfontdialog.h. References KFontChooser::setFont(). Referenced by getFont(), getFontAndText(), and getFontDiff(). |
|
Definition at line 364 of file kfontdialog.h. References KFontChooser::font(). |
|
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 dialog this setting will be ignored. Definition at line 372 of file kfontdialog.h. References KFontChooser::setSizeIsRelative(). |
|
Definition at line 379 of file kfontdialog.h. References KFontChooser::sizeIsRelative(). |
|
Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed.
Definition at line 755 of file kfontdialog.cpp. References chooser, QDialog::exec(), KFontChooser::font(), QDialog::result(), setFont(), and KFontChooser::sizeIsRelative(). Referenced by KEdit::selectFont(). |
|
Creates a modal font difference dialog, lets the user choose a selection of changes that should be made to a set of fonts, and returns when the dialog is closed. Useful for choosing slight adjustments to the font set when the user would otherwise have to manually edit a number of fonts.
Definition at line 736 of file kfontdialog.cpp. References chooser, QDialog::exec(), KFontChooser::font(), KFontChooser::fontDiffFlags(), QDialog::result(), setFont(), and KFontChooser::sizeIsRelative(). |
|
When you are not only interested in the font selected, but also in the example string typed in, you can call this method.
Definition at line 774 of file kfontdialog.cpp. References chooser, QDialog::exec(), KFontChooser::font(), QDialog::result(), KFontChooser::sampleText(), setFont(), and KFontChooser::sizeIsRelative(). |
|
Emitted whenever the currently selected font changes. Connect to this to monitor the font as it is selected if you are not running modal. |
The documentation for this class was generated from the following files: