KFontChooser Class Reference
from PyKDE4.kdeui import *
Detailed Description
A font selection widget.
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.

"KDE Font Chooser Widget"
- See also:
- KFontRequester
Enumerations | |
DisplayFlag | { NoDisplayFlags, FixedFontsOnly, DisplayFrame, ShowDifferences } |
FontColumn | { FamilyList, StyleList, SizeList } |
FontDiff | { NoFontDiffFlags, FontDiffFamily, FontDiffStyle, FontDiffSize, AllFontDiffs } |
FontListCriteria | { FixedWidthFonts, ScalableFonts, SmoothScalableFonts } |
Signals | |
fontSelected (QFont font) | |
Methods | |
__init__ (self, QWidget parent=0, KFontChooser.DisplayFlags flags=KFontChooser.DisplayFrame, QStringList fontList=QStringList(), int visibleListSize=8, Qt::CheckState sizeIsRelativeState=0) | |
__init__ (self, KFontChooser a0) | |
QColor | backgroundColor (self) |
QColor | color (self) |
enableColumn (self, int column, bool state) | |
QFont | font (self) |
KFontChooser.FontDiffFlags | fontDiffFlags (self) |
fontSelected (self, QFont font) | |
getFontList (self, QStringList list, long fontListCriteria) | |
QString | sampleText (self) |
setBackgroundColor (self, QColor col) | |
setColor (self, QColor col) | |
setFont (self, QFont font, bool onlyFixed=0) | |
setSampleBoxVisible (self, bool visible) | |
setSampleText (self, QString text) | |
setSizeIsRelative (self, Qt::CheckState relative) | |
QSize | sizeHint (self) |
Qt::CheckState | sizeIsRelative (self) |
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0, | |||
KFontChooser.DisplayFlags | flags=KFontChooser.DisplayFrame, | |||
QStringList | fontList=QStringList(), | |||
int | visibleListSize=8, | |||
Qt::CheckState | sizeIsRelativeState=0 | |||
) |
__init__ | ( | self, | ||
KFontChooser | a0 | |||
) |
QColor backgroundColor | ( | self ) |
- Returns:
- The background color currently used in the preview (default: the base color of the active colorgroup)
QColor color | ( | self ) |
- Returns:
- The color currently used in the preview (default: the text color of the active color group)
enableColumn | ( | self, | ||
int | column, | |||
bool | state | |||
) |
Enables or disable a font column in the chooser.
Use this function if your application does not need or supports all font properties.
- Parameters:
-
column Specify the columns. An or'ed combination of FamilyList, StyleList and SizeList is possible. state If false the columns are disabled.
QFont font | ( | self ) |
- Returns:
- The currently selected font in the chooser.
KFontChooser.FontDiffFlags fontDiffFlags | ( | self ) |
- Returns:
- The bitmask corresponding to the attributes the user wishes to change.
fontSelected | ( | self, | ||
QFont | font | |||
) |
Emitted whenever the selected font changes.
- Signal syntax:
QObject.connect(source, SIGNAL("fontSelected(const const QFont&)"), target_slot)
getFontList | ( | self, | ||
QStringList | list, | |||
long | fontListCriteria | |||
) |
Creates a list of font strings.
- Parameters:
-
list The list is returned here. fontListCriteria should contain all the restrictions for font selection as OR-ed values
- See also:
- KFontChooser.FontListCriteria for the individual values
QString sampleText | ( | self ) |
- Returns:
- The current text in the sample text input area.
setBackgroundColor | ( | self, | ||
QColor | col | |||
) |
Sets the background color to use in the preview.
setColor | ( | self, | ||
QColor | col | |||
) |
Sets the color to use in the preview.
setFont | ( | self, | ||
QFont | font, | |||
bool | onlyFixed=0 | |||
) |
Sets 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.
setSampleBoxVisible | ( | self, | ||
bool | visible | |||
) |
Shows or hides the sample text box.
- Parameters:
-
visible Set it to true to show the box, to false to hide it.
setSampleText | ( | self, | ||
QString | text | |||
) |
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.
- Parameters:
-
text The new sample text. The current will be removed.
setSizeIsRelative | ( | self, | ||
Qt::CheckState | relative | |||
) |
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.
QSize sizeHint | ( | self ) |
Reimplemented for internal reasons.
Qt::CheckState sizeIsRelative | ( | self ) |
- Returns:
- Whether the font size is to be interpreted as relative size (default: QButton:Off)
Enumeration Documentation
DisplayFlag |
- Enumerator:
-
FontColumn |
- Enumerator:
-
FontDiff |
- Enumerator:
-
FontListCriteria |
- Enumerator:
-