The QtxFontEdit class represents a widget for font preference items editing. More...
#include <QtxFontEdit.h>

Public Types | |
| enum | Features { Family = 0x01, Size = 0x02, UserSize = 0x04, Bold = 0x08, Italic = 0x10, Underline = 0x20, Shadow = 0x40, Preview = 0x80, Scripting = Bold | Italic | Underline, All = Family | Size | UserSize | Scripting | Preview } |
Font widget features. More... | |
| enum | Mode { Native, Custom } |
Signals | |
| void | changed (const QFont &) |
Public Member Functions | |
| QtxFontEdit (const int, QWidget *=0) | |
| Constructor. | |
| QtxFontEdit (QWidget *=0) | |
| Constructor. | |
| virtual | ~QtxFontEdit () |
| Destructor. | |
| QFont | currentFont () const |
| Get currently selected font. | |
| void | setCurrentFont (const QFont &) |
| Set currently selected font. | |
| int | fontSize () const |
| Get selected font size. | |
| QString | fontFamily () const |
| Get selected font family name. | |
| int | fontScripting () const |
| Get selected font scripting. | |
| void | setFontSize (const int) |
| Set font size. | |
| void | setFontFamily (const QString &) |
| Set font family name. | |
| void | setFontScripting (const int) |
| Set font scripting. | |
| int | features () const |
| Get font widget features. | |
| void | setFeatures (const int) |
| Set font widget features. | |
| void | setMode (const int) |
| Specifies whether widget works in Native or Custom mode. Native mode is intended for working with system fonts. Custom mode is intended for working with manually defined set of fonts. Set of custom fonts can be specified with setCustomFonts() method. | |
| int | mode () const |
| Verifies whether widget works in Native or Custom mode. | |
| void | setFonts (const QStringList &) |
| Sets list of custom fonts. This method is intended for working in Custom mode. | |
| QStringList | fonts () const |
| Gets list of custom fonts. | |
| void | setSizes (const QList< int > &=QList< int >()) |
| Sets list of available font sizes. This method is intended for working in Custom mode. The list of sizes can be empty. In this case system generate listof size automatically from 8 till 72. | |
| QList< int > | sizes () const |
| Gets list of custom fonts. | |
Private Slots | |
| void | onPreview (bool) |
| Called when "Preview" button is clicked. | |
| void | onFontChanged (const QFont &) |
| Called when current font is changed. | |
| void | onPropertyChanged () |
Private Member Functions | |
| void | initialize () |
| void | updateState () |
| Update widget state. | |
Private Attributes | |
| QtxComboBox * | mySize |
| QFontComboBox * | myFamily |
| QToolButton * | myPreview |
| int | myFeatures |
| QToolButton * | myB |
| QToolButton * | myI |
| QToolButton * | myU |
| QToolButton * | myS |
| int | myMode |
| QComboBox * | myCustomFams |
The font preference item is represented as the drop-down combo box filled with the list of available fonts. Additional controls for modifying font properties ('bold', 'italic', font size, etc) are also available for use.
Initial font value can be set with setCurrentFont() method. Chosen font can be retrieved with the currentFont() method.
Font properties can be set with the setFontSize(), setFontFamily(), setFontScripting() methods and retrieved with fontSize(), fontFamily(), fontScripting() methods.
Additional widgets for direct modyfing font properties are available with use of setFeatures() method.
| enum QtxFontEdit::Mode |
| QtxFontEdit::QtxFontEdit | ( | const int | feat, |
| QWidget * | parent = 0 |
||
| ) |
| feat | font widget features (ORed QtxFontEdit.Features flags) |
| parent | parent widget |
References initialize().
| QtxFontEdit::QtxFontEdit | ( | QWidget * | parent = 0 | ) |
| QtxFontEdit::~QtxFontEdit | ( | ) | [virtual] |
| QFont QtxFontEdit::currentFont | ( | ) | const |
References Bold, fontFamily(), fontScripting(), fontSize(), Italic, Shadow, and Underline.
| void QtxFontEdit::setCurrentFont | ( | const QFont & | fnt | ) |
| fnt | current font |
References Bold, changed(), currentFont(), Italic, myB, myCustomFams, myFamily, myI, mySize, myU, setFontFamily(), setFontScripting(), setFontSize(), Shadow, and Underline.
| int QtxFontEdit::fontSize | ( | ) | const |
| QString QtxFontEdit::fontFamily | ( | ) | const |
References myCustomFams, myFamily, myMode, and Native.
| int QtxFontEdit::fontScripting | ( | ) | const |
| void QtxFontEdit::setFontSize | ( | const int | s | ) |
| void QtxFontEdit::setFontFamily | ( | const QString & | fam | ) |
| fam | new font family name |
References changed(), currentFont(), myCustomFams, myFamily, myMode, Native, and onFontChanged().
| void QtxFontEdit::setFontScripting | ( | const int | script | ) |
| int QtxFontEdit::features | ( | ) | const |
References myFeatures.
| void QtxFontEdit::setFeatures | ( | const int | f | ) |
| f | font widget features (ORed QtxFontEdit.Features flags) |
References myFeatures, and updateState().
| void QtxFontEdit::setMode | ( | const int | mode | ) |
| mode | mode from QtxFontEdit.Mode enumeration |
References Custom, mode(), myCustomFams, myFamily, myMode, and Native.
| void QtxFontEdit::setFonts | ( | const QStringList & | fams | ) |
| fams | list of families |
References myCustomFams, and setSizes().
| QStringList QtxFontEdit::fonts | ( | ) | const |
| QList< int > QtxFontEdit::sizes | ( | ) | const |
| void QtxFontEdit.changed | ( | const QFont & | ) | [signal] |
| void QtxFontEdit::onPreview | ( | bool | ) | [private, slot] |
| on | (not used) |
References currentFont(), and setCurrentFont().
| void QtxFontEdit::onFontChanged | ( | const QFont & | ) | [private, slot] |
| f | (not used) |
References changed(), currentFont(), fontFamily(), fontSize(), myFamily, mySize, setFontSize(), and sizes().
| void QtxFontEdit::onPropertyChanged | ( | ) | [private, slot] |
References changed(), and currentFont().
| void QtxFontEdit::initialize | ( | ) | [private] |
References currentFont(), myB, myCustomFams, myFamily, myI, myPreview, myS, mySize, myU, onFontChanged(), onPreview(), onPropertyChanged(), and updateState().
| void QtxFontEdit::updateState | ( | ) | [private] |
QtxComboBox* QtxFontEdit.mySize [private] |
QFontComboBox* QtxFontEdit.myFamily [private] |
QToolButton* QtxFontEdit.myPreview [private] |
int QtxFontEdit.myFeatures [private] |
QToolButton* QtxFontEdit.myB [private] |
QToolButton * QtxFontEdit.myI [private] |
QToolButton * QtxFontEdit.myU [private] |
QToolButton * QtxFontEdit.myS [private] |
int QtxFontEdit.myMode [private] |
QComboBox* QtxFontEdit.myCustomFams [private] |