kdeui Library API Documentation

KFontRequester Class Reference

This class provides a widget with a lineedit and a button, which invokes a font dialog (KFontDialog). More...

#include <kfontrequester.h>

Inheritance diagram for KFontRequester:

QWidget List of all members.

Public Methods

 KFontRequester (QWidget *parent=0L, const char *name=0L, bool onlyFixed=false)
QFont font () const
bool isFixedOnly () const
QString sampleText () const
QString title () const
QLabellabel () const
QPushButtonbutton () const
virtual void setFont (const QFont &font, bool onlyFixed=false)
virtual void setSampleText (const QString &text)
virtual void setTitle (const QString &title)

Detailed Description

This class provides a widget with a lineedit and a button, which invokes a font dialog (KFontDialog).

The lineedit provides a preview of the selected font. The preview text can be customized. You can also have the font dialog show only the fixed fonts.

kfontrequester.png

KDE Font Requester

Author:
Nadeem Hasan <nhasan@kde.org>

Definition at line 42 of file kfontrequester.h.


Constructor & Destructor Documentation

KFontRequester::KFontRequester QWidget   parent = 0L,
const char *    name = 0L,
bool    onlyFixed = false
 

Constructs a font requester widget.

Parameters:
parent  The parent widget.
name  The widget name.
onlyFixed  Only display fonts which have fixed-width character sizes.

Definition at line 31 of file kfontrequester.cpp.

References QWidget::layout(), and KDialog::spacingHint().


Member Function Documentation

QFont KFontRequester::font   const [inline]
 

Returns:
The currently selected font in the requester.

Definition at line 66 of file kfontrequester.h.

bool KFontRequester::isFixedOnly   const [inline]
 

Returns:
Returns true if only fixed fonts are displayed.

Definition at line 71 of file kfontrequester.h.

QString KFontRequester::sampleText   const [inline]
 

Returns:
The current text in the sample text input area.

Definition at line 76 of file kfontrequester.h.

QString KFontRequester::title   const [inline]
 

Returns:
The current title of the widget.

Definition at line 81 of file kfontrequester.h.

QLabel* KFontRequester::label   const [inline]
 

Returns:
Pointer to the label used for preview.

Definition at line 86 of file kfontrequester.h.

QPushButton* KFontRequester::button   const [inline]
 

Returns:
Pointer to the pushbutton in the widget.

Definition at line 91 of file kfontrequester.h.

void KFontRequester::setFont const QFont   font,
bool    onlyFixed = false
[virtual]
 

Sets the currently selected font in the requester.

Parameters:
font  The font to select.
onlyFixed  Display only fixed-width fonts in the font dialog if true, or vice-versa.

Definition at line 51 of file kfontrequester.cpp.

void KFontRequester::setSampleText const QString   text [virtual]
 

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. Default text is current font name and size. Setting the text to QString::null will restore the default.

Parameters:
text  The new sample text. The current will be removed.

Definition at line 60 of file kfontrequester.cpp.

void KFontRequester::setTitle const QString   title [virtual]
 

Set the title for the widget that will be used in the tooltip and what's this text.

Parameters:
title  The title to be set.

Definition at line 66 of file kfontrequester.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 22 14:23:34 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003