• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

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:

Inheritance graph
[legend]

List of all members.


Signals

void fontSelected (const QFont &font)

Public Member Functions

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

Protected Slots

virtual void buttonClicked ()

Protected Member Functions

void displaySampleText ()
void setToolTip ()

Protected Attributes

QPushButton * m_button
bool m_onlyFixed
QLabel * m_sampleLabel
QString m_sampleText
QFont m_selFont
QString m_title

Properties

QFont font
QString sampleText
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 44 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.


Member Function Documentation

QPushButton* KFontRequester::button (  )  const [inline]

Returns:
Pointer to the pushbutton in the widget.

Definition at line 93 of file kfontrequester.h.

void KFontRequester::buttonClicked (  )  [protected, virtual, slot]

Definition at line 73 of file kfontrequester.cpp.

void KFontRequester::displaySampleText (  )  [protected]

Definition at line 84 of file kfontrequester.cpp.

QFont KFontRequester::font (  )  const [inline]

Returns:
The currently selected font in the requester.

Reimplemented from QWidget.

Definition at line 68 of file kfontrequester.h.

void KFontRequester::fontSelected ( const QFont &  font  )  [signal]

Emitted when a new font has been selected in the underlying dialog.

bool KFontRequester::isFixedOnly (  )  const [inline]

Returns:
Returns true if only fixed fonts are displayed.

Definition at line 73 of file kfontrequester.h.

QLabel* KFontRequester::label (  )  const [inline]

Returns:
Pointer to the label used for preview.

Definition at line 88 of file kfontrequester.h.

QString KFontRequester::sampleText (  )  const [inline]

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

Definition at line 78 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 52 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 61 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 67 of file kfontrequester.cpp.

void KFontRequester::setToolTip (  )  [protected]

Definition at line 99 of file kfontrequester.cpp.

QString KFontRequester::title (  )  const [inline]

Returns:
The current title of the widget.

Definition at line 83 of file kfontrequester.h.


Member Data Documentation

QPushButton* KFontRequester::m_button [protected]

Definition at line 145 of file kfontrequester.h.

bool KFontRequester::m_onlyFixed [protected]

Definition at line 142 of file kfontrequester.h.

QLabel* KFontRequester::m_sampleLabel [protected]

Definition at line 144 of file kfontrequester.h.

QString KFontRequester::m_sampleText [protected]

Definition at line 143 of file kfontrequester.h.

QFont KFontRequester::m_selFont [protected]

Definition at line 146 of file kfontrequester.h.

QString KFontRequester::m_title [protected]

Definition at line 143 of file kfontrequester.h.


Property Documentation

QFont KFontRequester::font [read, write]

Definition at line 50 of file kfontrequester.h.

QString KFontRequester::sampleText [read, write]

Definition at line 49 of file kfontrequester.h.

QString KFontRequester::title [read, write]

Definition at line 48 of file kfontrequester.h.


The documentation for this class was generated from the following files:
  • kfontrequester.h
  • kfontrequester.cpp

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal