\section{KFont\-Dialog Class Reference}
\label{classKFontDialog}\index{KFontDialog@{KFontDialog}}
The KFont\-Dialog provides a dialog for interactive font selection. A font selection dialog.  


{\tt \#include $<$kfontdialog.h$>$}

Inheritance diagram for KFont\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKFontDialog__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KFont\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=108pt]{classKFontDialog__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf font\-Selected} (const  {\bf QFont} \&font)
\begin{CompactList}\small\item\em Emitted whenever the currently selected font changes. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KFont\-Dialog} ({\bf QWidget} $\ast$parent=0L, const  char $\ast$name=0, bool only\-Fixed=false, bool modal=false, const  {\bf QString\-List} \&fontlist={\bf QString\-List}(), bool make\-Frame=true, bool diff=false, QButton::Toggle\-State $\ast$size\-Is\-Relative\-State=0L)
\begin{CompactList}\small\item\em Constructs a font selection dialog. \item\end{CompactList}\item 
void {\bf set\-Font} (const  {\bf QFont} \&font, bool only\-Fixed=false)
\begin{CompactList}\small\item\em Sets the currently selected font in the dialog. \item\end{CompactList}\item 
{\bf QFont} {\bf font} () const 
\item 
void {\bf set\-Size\-Is\-Relative} (QButton::Toggle\-State relative)
\begin{CompactList}\small\item\em Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size. \item\end{CompactList}\item 
QButton::Toggle\-State {\bf size\-Is\-Relative} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf get\-Font} ({\bf QFont} \&the\-Font, bool only\-Fixed=false, {\bf QWidget} $\ast$parent=0L, bool make\-Frame=true, QButton::Toggle\-State $\ast$size\-Is\-Relative\-State=0L)
\begin{CompactList}\small\item\em Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed. \item\end{CompactList}\item 
int {\bf get\-Font\-Diff} ({\bf QFont} \&the\-Font, int \&diff\-Flags, bool only\-Fixed=false, {\bf QWidget} $\ast$parent=0L, bool make\-Frame=true, QButton::Toggle\-State $\ast$size\-Is\-Relative\-State=0L)
\begin{CompactList}\small\item\em Creates a modal font difference dialog, lets the user choose a selection of changes that should be made to a set of fonts, and returns when the dialog is closed. \item\end{CompactList}\item 
int {\bf get\-Font\-And\-Text} ({\bf QFont} \&the\-Font, {\bf QString} \&the\-String, bool only\-Fixed=false, {\bf QWidget} $\ast$parent=0L, bool make\-Frame=true, QButton::Toggle\-State $\ast$size\-Is\-Relative\-State=0L)
\begin{CompactList}\small\item\em When you are not only interested in the font selected, but also in the example string typed in, you can call this method. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKFontDialog_b0}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KFont\-Chooser} $\ast$ {\bf chooser}\label{classKFontDialog_p0}

\end{CompactItemize}


\subsection{Detailed Description}
The KFont\-Dialog provides a dialog for interactive font selection. A font selection dialog. 

It is basically a thin wrapper around the {\bf KFont\-Chooser}{\rm (p.\,\pageref{classKFontChooser})} widget, which can also be used standalone. In most cases, the simplest use of this class is the static method {\bf KFont\-Dialog::get\-Font}{\rm (p.\,\pageref{classKFontDialog_e0})}(), which pops up the dialog, allows the user to select a font, and returns when the dialog is closed.

Example:

\small\begin{alltt}
      {\bf QFont} myFont;
      int result = KFontDialog::getFont( myFont );
      if ( result == KFontDialog::Accepted )
            ...
 \end{alltt}\normalsize 


 

\begin{Desc}
\item[Author:]Preston Brown $<${\tt pbrown@kde.org}$>$, Bernd Wuebben $<${\tt wuebben@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kfontdialog.h}{\rm (p.\,\pageref{kfontdialog_8h})},v 1.61 2002/09/11 02:18:25 orlovich Exp \end{Desc}
\end{Desc}




Definition at line 319 of file kfontdialog.h.

\subsection{Constructor \& Destructor Documentation}
\index{KFontDialog@{KFont\-Dialog}!KFontDialog@{KFontDialog}}
\index{KFontDialog@{KFontDialog}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KFont\-Dialog::KFont\-Dialog ({\bf QWidget} $\ast$ {\em parent} = 0L, const char $\ast$ {\em name} = 0, bool {\em only\-Fixed} = false, bool {\em modal} = false, const {\bf QString\-List} \& {\em fontlist} = {\bf QString\-List}(), bool {\em make\-Frame} = true, bool {\em diff} = false, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = 0L)}\label{classKFontDialog_a0}


Constructs a font selection dialog. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]The parent widget of the dialog, if any. \item[{\em name}]The name of the dialog. \item[{\em modal}]Specifies whether the dialog is modal or not. \item[{\em only\-Fixed}]only display fonts which have fixed-width character sizes. \item[{\em fontlist}]a list of fonts to display, in XLFD format. If no list is formatted, the internal {\bf KDE} font list is used. If that has not been created, X is queried, and all fonts available on the system are displayed. \item[{\em make\-Frame}]Draws a frame with titles around the contents. \item[{\em diff}]Display the difference version dialog. See {\bf get\-Font\-Diff()}{\rm (p.\,\pageref{classKFontDialog_e1})}. \item[{\em size\-Is\-Relative\-State}]If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to $\ast$size\-Is\-Relative\-State, user choice may be retrieved by calling {\bf size\-Is\-Relative()}{\rm (p.\,\pageref{classKFontDialog_a4})}. \end{description}
\end{Desc}


Definition at line 723 of file kfontdialog.cpp.

References KStd\-Accel::name(), and KDialog\-Base::set\-Main\-Widget().

\subsection{Member Function Documentation}
\index{KFontDialog@{KFont\-Dialog}!setFont@{setFont}}
\index{setFont@{setFont}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFont\-Dialog::set\-Font (const {\bf QFont} \& {\em font}, bool {\em only\-Fixed} = false)\hspace{0.3cm}{\tt  [inline]}}\label{classKFontDialog_a1}


Sets the currently selected font in the dialog. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em font}]The font to select. \item[{\em only\-Fixed}]readjust the font list to display only fixed width fonts if true, or vice-versa \end{description}
\end{Desc}


Definition at line 358 of file kfontdialog.h.

References KFont\-Chooser::set\-Font().

Referenced by get\-Font(), get\-Font\-And\-Text(), and get\-Font\-Diff().\index{KFontDialog@{KFont\-Dialog}!font@{font}}
\index{font@{font}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QFont} KFont\-Dialog::font () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFontDialog_a2}


\begin{Desc}
\item[Returns:]The currently selected font in the dialog. \end{Desc}


Definition at line 364 of file kfontdialog.h.

References KFont\-Chooser::font().\index{KFontDialog@{KFont\-Dialog}!setSizeIsRelative@{setSizeIsRelative}}
\index{setSizeIsRelative@{setSizeIsRelative}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFont\-Dialog::set\-Size\-Is\-Relative (QButton::Toggle\-State {\em relative})\hspace{0.3cm}{\tt  [inline]}}\label{classKFontDialog_a3}


Sets the state of the checkbox indicating whether the font size is to be interpreted as relative size. 

NOTE: If parameter size\-Is\-Relative was not set in the constructor of the dialog this setting will be ignored. 

Definition at line 372 of file kfontdialog.h.

References KFont\-Chooser::set\-Size\-Is\-Relative().\index{KFontDialog@{KFont\-Dialog}!sizeIsRelative@{sizeIsRelative}}
\index{sizeIsRelative@{sizeIsRelative}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}QButton::Toggle\-State KFont\-Dialog::size\-Is\-Relative () const\hspace{0.3cm}{\tt  [inline]}}\label{classKFontDialog_a4}


\begin{Desc}
\item[Returns:]Whether the font size is to be interpreted as relative size (default: false) \end{Desc}


Definition at line 379 of file kfontdialog.h.

References KFont\-Chooser::size\-Is\-Relative().\index{KFontDialog@{KFont\-Dialog}!getFont@{getFont}}
\index{getFont@{getFont}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KFont\-Dialog::get\-Font ({\bf QFont} \& {\em the\-Font}, bool {\em only\-Fixed} = false, {\bf QWidget} $\ast$ {\em parent} = 0L, bool {\em make\-Frame} = true, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = 0L)\hspace{0.3cm}{\tt  [static]}}\label{classKFontDialog_e0}


Creates a modal font dialog, lets the user choose a font, and returns when the dialog is closed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the\-Font}]a reference to the font to write the chosen font into. \item[{\em only\-Fixed}]if true, only select from fixed-width fonts. \item[{\em parent}]Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). \item[{\em make\-Frame}]Draws a frame with titles around the contents. \item[{\em size\-Is\-Relative\-State}]If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to $\ast$size\-Is\-Relative\-State and user choice will be returned therein.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]{\bf QDialog::result}(). \end{Desc}


Definition at line 755 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font(), QDialog::result(), set\-Font(), and KFont\-Chooser::size\-Is\-Relative().

Referenced by KEdit::select\-Font().\index{KFontDialog@{KFont\-Dialog}!getFontDiff@{getFontDiff}}
\index{getFontDiff@{getFontDiff}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KFont\-Dialog::get\-Font\-Diff ({\bf QFont} \& {\em the\-Font}, int \& {\em diff\-Flags}, bool {\em only\-Fixed} = false, {\bf QWidget} $\ast$ {\em parent} = 0L, bool {\em make\-Frame} = true, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = 0L)\hspace{0.3cm}{\tt  [static]}}\label{classKFontDialog_e1}


Creates a modal font difference dialog, lets the user choose a selection of changes that should be made to a set of fonts, and returns when the dialog is closed. 

Useful for choosing slight adjustments to the font set when the user would otherwise have to manually edit a number of fonts.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the\-Font}]a reference to the font to write the chosen font into. \item[{\em diff\-Flags}]a reference to the int into which the chosen difference selection bitmask should be written. Check the returned bitmask like: \small\begin{alltt}
        if ( diffFlags \& KFontChooser::FontDiffFamily )
            [...]
        if ( diffFlags \& KFontChooser::FontDiffStyle )
            [...]
        if ( diffFlags \& KFontChooser::FontDiffSize )
            [...]
        \end{alltt}\normalsize 
 \item[{\em only\-Fixed}]if true, only select from fixed-width fonts. \item[{\em parent}]Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). \item[{\em make\-Frame}]Draws a frame with titles around the contents. \item[{\em size\-Is\-Relative\-State}]If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to $\ast$size\-Is\-Relative\-State and user choice will be returned therein.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]{\bf QDialog::result}(). \end{Desc}


Definition at line 736 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font(), KFont\-Chooser::font\-Diff\-Flags(), QDialog::result(), set\-Font(), and KFont\-Chooser::size\-Is\-Relative().\index{KFontDialog@{KFont\-Dialog}!getFontAndText@{getFontAndText}}
\index{getFontAndText@{getFontAndText}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KFont\-Dialog::get\-Font\-And\-Text ({\bf QFont} \& {\em the\-Font}, {\bf QString} \& {\em the\-String}, bool {\em only\-Fixed} = false, {\bf QWidget} $\ast$ {\em parent} = 0L, bool {\em make\-Frame} = true, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = 0L)\hspace{0.3cm}{\tt  [static]}}\label{classKFontDialog_e2}


When you are not only interested in the font selected, but also in the example string typed in, you can call this method. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the\-Font}]a reference to the font to write the chosen font into. \item[{\em the\-String}]a reference to the example text that was typed. \item[{\em only\-Fixed}]if true, only select from fixed-width fonts. \item[{\em parent}]Parent widget of the dialog. Specifying a widget different from 0 (Null) improves centering (looks better). \item[{\em make\-Frame}]Draws a frame with titles around the contents. \item[{\em size\-Is\-Relative\-State}]If not zero the widget will show a checkbox where the user may choose whether the font size is to be interpreted as relative size. Initial state of this checkbox will be set according to $\ast$size\-Is\-Relative\-State and user choice will be returned therein. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The result of the dialog. \end{Desc}


Definition at line 774 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font(), QDialog::result(), KFont\-Chooser::sample\-Text(), set\-Font(), and KFont\-Chooser::size\-Is\-Relative().\index{KFontDialog@{KFont\-Dialog}!fontSelected@{fontSelected}}
\index{fontSelected@{fontSelected}!KFontDialog@{KFont\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KFont\-Dialog::font\-Selected (const {\bf QFont} \& {\em font})\hspace{0.3cm}{\tt  [signal]}}\label{classKFontDialog_l0}


Emitted whenever the currently selected font changes. 

Connect to this to monitor the font as it is selected if you are not running modal. 

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kfontdialog.h\item 
kfontdialog.cpp\end{CompactItemize}
