KFontChooser
#include <KFontChooser>
Public Types | |
enum | DisplayFlag { NoDisplayFlags = 0 , FixedFontsOnly = 1 , DisplayFrame = 2 , ShowDifferences = 4 } |
typedef QFlags< DisplayFlag > | DisplayFlags |
enum | FontColumn { FamilyList = 0x01 , StyleList = 0x02 , SizeList = 0x04 } |
enum | FontDiff { NoFontDiffFlags = 0 , FontDiffFamily = 1 , FontDiffStyle = 2 , FontDiffSize = 4 , AllFontDiffs = FontDiffFamily | FontDiffStyle | FontDiffSize } |
typedef QFlags< FontDiff > | FontDiffFlags |
enum | FontListCriteria { FixedWidthFonts = 0x01 , ScalableFonts = 0x02 , SmoothScalableFonts = 0x04 } |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Signals | |
void | fontSelected (const QFont &font) |
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 QFontDialog.
- See also
- KFontRequester
Definition at line 34 of file kfontchooser.h.
Member Typedef Documentation
◆ DisplayFlags
typedef QFlags< DisplayFlag > KFontChooser::DisplayFlags |
Stores a combination of DisplayFlag values.
Definition at line 82 of file kfontchooser.h.
◆ FontDiffFlags
typedef QFlags< FontDiff > KFontChooser::FontDiffFlags |
Stores an combination of FontDiff values.
Definition at line 66 of file kfontchooser.h.
Member Enumeration Documentation
◆ DisplayFlag
Flags for selecting what is displayed in the widget.
- See also
- DisplayFlags
Definition at line 72 of file kfontchooser.h.
◆ FontColumn
Displayed columns.
Enumerator | |
---|---|
FamilyList | Identifies the family (leftmost) list. |
StyleList | Identifies the style (center) list. |
SizeList | Identifies the size (rightmost) list. |
Definition at line 46 of file kfontchooser.h.
◆ FontDiff
Flags for selecting which font attributes to change.
- See also
- FontDiffFlags
Definition at line 56 of file kfontchooser.h.
◆ FontListCriteria
The selection criteria for the font families shown in the dialog.
Definition at line 184 of file kfontchooser.h.
Property Documentation
◆ backgroundColor
|
readwrite |
Definition at line 39 of file kfontchooser.h.
◆ color
|
readwrite |
Definition at line 38 of file kfontchooser.h.
◆ font
|
readwrite |
Definition at line 37 of file kfontchooser.h.
◆ sampleText
|
readwrite |
Definition at line 40 of file kfontchooser.h.
Constructor & Destructor Documentation
◆ KFontChooser() [1/2]
Constructs a font picker widget.
- Parameters
-
parent the parent widget
- Since
- 5.86
Definition at line 126 of file kfontchooser.cpp.
◆ KFontChooser() [2/2]
|
explicit |
Create a font picker widget.
- Parameters
-
flags a combination of OR-ed values from the KFontChooser::DisplayFlags
enum, the default isDisplayFonts::NoDisplayFlags
parent the parent widget, if not nullptr the windowing system will use it to position the chooser widget relative to it
- Since
- 5.86
Definition at line 133 of file kfontchooser.cpp.
◆ ~KFontChooser()
|
overridedefault |
Destructor.
Member Function Documentation
◆ backgroundColor()
QColor KFontChooser::backgroundColor | ( | ) | const |
Returns the background color currently used in the preview area (default: the base color of the active colorgroup)
Definition at line 293 of file kfontchooser.cpp.
◆ color()
QColor KFontChooser::color | ( | ) | const |
Returns the color currently used for the font in the preview area (default: the text color of the active color group).
Definition at line 280 of file kfontchooser.cpp.
◆ createFontList()
|
static |
Returns a list of font faimly name strings filtered based on fontListCriteria
.
- Parameters
-
fontListCriteria specifies the criteria used to select fonts to add to the list, a combination of OR-ed values from KFontChooser::FontListCriteria
- Since
- 5.86
Definition at line 779 of file kfontchooser.cpp.
◆ enableColumn()
void KFontChooser::enableColumn | ( | int | column, |
bool | state ) |
Enables or disables a column (family, style, size) in the widget.
Use this function if your application does not need or support all font properties.
- Parameters
-
column specify the column(s) to enable/disable, an OR-ed combination of KFontChooser::FontColumn
enum valuesstate if false
the columns are disabled, and vice-versa
Definition at line 318 of file kfontchooser.cpp.
◆ font()
QFont KFontChooser::font | ( | ) | const |
Returns the currently selected font in the chooser.
Definition at line 366 of file kfontchooser.cpp.
◆ fontDiffFlags()
KFontChooser::FontDiffFlags KFontChooser::fontDiffFlags | ( | ) | const |
Returns the bitmask corresponding to the attributes the user wishes to change.
Definition at line 347 of file kfontchooser.cpp.
◆ fontSelected
Emitted when the selected font changes.
◆ sampleText()
QString KFontChooser::sampleText | ( | ) | const |
- Returns
- The current text in the sample text input area.
Definition at line 298 of file kfontchooser.cpp.
◆ setBackgroundColor()
Sets the background color to use in the preview area.
Definition at line 285 of file kfontchooser.cpp.
◆ setColor()
Sets the color to use for the font in the preview area.
Definition at line 268 of file kfontchooser.cpp.
◆ setFont()
Sets the currently selected font in the widget.
- Parameters
-
font the font to select onlyFixed if true
, the font list will only display fixed-width fonts, otherwise all fonts are displayed. The default isfalse
.
Definition at line 332 of file kfontchooser.cpp.
◆ setFontListItems()
void KFontChooser::setFontListItems | ( | const QStringList & | fontList | ) |
Uses fontList
to fill the font family list in the widget.
You can create a custom list of fonts using the static createFontList(uint
criteria)
to only include fonts that meet certain criteria (e.g. only smooth-scalable fonts).
Note that if fontList
is empty, the font list in the chooser will show all the available fonts on the system.
- Since
- 5.86
Definition at line 815 of file kfontchooser.cpp.
◆ setMinVisibleItems()
void KFontChooser::setMinVisibleItems | ( | int | visibleItems | ) |
Sets the minimum number of items that should be visible in the child list widgets; this number will be used to compute and set the minimum heights for those widgets.
- Since
- 5.86
Definition at line 861 of file kfontchooser.cpp.
◆ setSampleBoxVisible()
void KFontChooser::setSampleBoxVisible | ( | bool | visible | ) |
If visible
is true
the preview area will be shown, and vice-versa is it's false
.
Definition at line 308 of file kfontchooser.cpp.
◆ setSampleText()
Sets the sample text in the preview area; this is useful if you want to use text in your native language.
- Parameters
-
text the new sample text (it will replace the current text)
Definition at line 303 of file kfontchooser.cpp.
◆ sizeHint()
Reimplemented for internal reasons.
Reimplemented from QWidget.
Definition at line 313 of file kfontchooser.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:40:26 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.