libopie API Documentation

OFontSelector Class Reference

This class lets you chose a Font out of a list of Fonts. A widget to select a font. More...

#include <ofontselector.h>

Inheritance diagram for OFontSelector:

Inheritance graph
[legend]
Collaboration diagram for OFontSelector:

Collaboration graph
[legend]
List of all members.

Signals

void fontSelected (const QFont &)
 This signal gets emitted when a font got chosen.


Public Member Functions

 OFontSelector (bool withpreview, QWidget *parent=0, const char *name=0, WFlags fl=0)
 Constructs the Selector object.

bool selectedFont (QString &family, QString &style, int &size)
 This method returns the name, style and size of the currently selected font or false if no font is selected.

bool selectedFont (QString &family, QString &style, int &size, QString &charset)
 Overloaded member function see above.

QFont selectedFont ()
 Return the selected font.

bool setSelectedFont (const QFont &)
 This methods tries to set the font.

bool setSelectedFont (const QString &family, const QString &style, int size, const QString &charset=0)
 This is an overloaded method.

QString fontFamily () const
 This method does return the font family or QString::null if there is no font item selected.

QString fontStyle () const
 This method will return the style of the font or QString::null.

int fontSize () const
 This method will return the font size or 10 if no font size is available.

QString fontCharSet () const
 returns the charset of the font or QString::null


Protected Slots

virtual void fontFamilyClicked (int)
virtual void fontStyleClicked (int)
virtual void fontSizeClicked (int)

Protected Member Functions

virtual void resizeEvent (QResizeEvent *re)

Detailed Description

This class lets you chose a Font out of a list of Fonts. A widget to select a font.

It can show a preview too. This selector will use all available fonts

See also:
QWidget

QFont

Author:
Rober Griebl

Definition at line 48 of file ofontselector.h.


Constructor & Destructor Documentation

OFontSelector::OFontSelector bool  withpreview,
QWidget parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Constructs the Selector object.

Parameters:
withpreview If a font preview should be given
parent The parent of the Font Selector
name The name of the object
fl WidgetFlags

Definition at line 114 of file ofontselector.cpp.

References QGridLayout::addMultiCellWidget(), QGridLayout::addWidget(), QObject::connect(), QGridLayout::setRowStretch(), and QObject::tr().


Member Function Documentation

bool OFontSelector::selectedFont QString family,
QString style,
int &  size
 

This method returns the name, style and size of the currently selected font or false if no font is selected.

Parameters:
family The font family will be written there
style The style will be written there
size The size will be written there
Returns:
success or failure

Definition at line 220 of file ofontselector.cpp.

References selectedFont().

bool OFontSelector::selectedFont QString family,
QString style,
int &  size,
QString charset
 

Overloaded member function see above.

See also:
selectedFont

Definition at line 276 of file ofontselector.cpp.

QFont OFontSelector::selectedFont  ) 
 

Return the selected font.

Definition at line 381 of file ofontselector.cpp.

References QWidget::font().

Referenced by selectedFont().

bool OFontSelector::setSelectedFont const QFont f  ) 
 

This methods tries to set the font.

Parameters:
f The wishes font
Returns:
success or failure

Definition at line 168 of file ofontselector.cpp.

bool OFontSelector::setSelectedFont const QString familyStr,
const QString styleStr,
int  sizeVal,
const QString charset = 0
 

This is an overloaded method.

See also:
setSelectedFont
Parameters:
familyStr The family of the font
styleStr The style of the font
sizeVal The size of font
charset The charset to be used. Will be deprecated by QT3

Definition at line 181 of file ofontselector.cpp.

References QString::number().

QString OFontSelector::fontFamily  )  const
 

This method does return the font family or QString::null if there is no font item selected.

Returns:
the font family

Definition at line 232 of file ofontselector.cpp.

QString OFontSelector::fontStyle  )  const
 

This method will return the style of the font or QString::null.

Returns:
the style of the font

Definition at line 243 of file ofontselector.cpp.

int OFontSelector::fontSize  )  const
 

This method will return the font size or 10 if no font size is available.

Definition at line 254 of file ofontselector.cpp.

QString OFontSelector::fontCharSet  )  const
 

returns the charset of the font or QString::null

Definition at line 265 of file ofontselector.cpp.

void OFontSelector::fontSelected const QFont  )  [signal]
 

This signal gets emitted when a font got chosen.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:57 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001