\section{KFont\-Dialog Class Reference}
\label{classKFontDialog}\index{KFontDialog@{KFontDialog}}
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=104pt]{classKFontDialog__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf font\-Selected} (const {\bf QFont} \&font)
\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)
\item 
void {\bf set\-Font} (const {\bf QFont} \&font, bool only\-Fixed=false)
\item 
{\bf QFont} {\bf font} () const 
\item 
void {\bf set\-Size\-Is\-Relative} (QButton::Toggle\-State relative)
\item 
QButton::Toggle\-State {\bf size\-Is\-Relative} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static 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)
\item 
static 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)
\item 
static 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)
\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}
A font selection dialog. 

The KFont\-Dialog provides a dialog for interactive font selection. 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:



\footnotesize\begin{verbatim}      QFont myFont;
      int result = KFontDialog::getFont( myFont );
      if ( result == KFontDialog::Accepted )
            ...
\end{verbatim}
\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})} 353310 2004-10-10 10:27:49Z bhards \end{Desc}
\end{Desc}




Definition at line 326 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} = {\tt 0L}, const char $\ast$ {\em name} = {\tt 0}, bool {\em only\-Fixed} = {\tt false}, bool {\em modal} = {\tt false}, const {\bf QString\-List} \& {\em fontlist} = {\tt {\bf QString\-List}()}, bool {\em make\-Frame} = {\tt true}, bool {\em diff} = {\tt false}, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = {\tt 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 727 of file kfontdialog.cpp.

References 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} = {\tt 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 365 of file kfontdialog.h.

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 371 of file kfontdialog.h.\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 379 of file kfontdialog.h.\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 386 of file kfontdialog.h.\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} = {\tt false}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, bool {\em make\-Frame} = {\tt true}, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = {\tt 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 759 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font, 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} = {\tt false}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, bool {\em make\-Frame} = {\tt true}, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = {\tt 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: 

\footnotesize\begin{verbatim}        if ( diffFlags & KFontChooser::FontDiffFamily )
            [...]
        if ( diffFlags & KFontChooser::FontDiffStyle )
            [...]
        if ( diffFlags & KFontChooser::FontDiffSize )
            [...]
\end{verbatim}
\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 740 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font, KFont\-Chooser::font\-Diff\-Flags(), 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} = {\tt false}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0L}, bool {\em make\-Frame} = {\tt true}, QButton::Toggle\-State $\ast$ {\em size\-Is\-Relative\-State} = {\tt 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 778 of file kfontdialog.cpp.

References chooser, QDialog::exec(), KFont\-Chooser::font, 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}
