\section{KInput\-Dialog Class Reference}
\label{classKInputDialog}\index{KInputDialog@{KInputDialog}}
The KInput\-Dialog class provides a simple dialog to get a single value from the user.  


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

Inheritance diagram for KInput\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKInputDialog__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KInput\-Dialog:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=55pt]{classKInputDialog__coll__graph}
\end{center}
\end{figure}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf QString} {\bf get\-Text} (const {\bf QString} \&caption, const {\bf QString} \&label, const {\bf QString} \&value=QString::null, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0, {\bf QValidator} $\ast$validator=0, const {\bf QString} \&mask=QString::null)
\item 
static {\bf QString} {\bf text} (const {\bf QString} \&caption, const {\bf QString} \&label, const {\bf QString} \&value=QString::null, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0, {\bf QValidator} $\ast$validator=0, const {\bf QString} \&mask=QString::null, const {\bf QString} \&whats\-This=QString::null)
\item 
static {\bf QString} {\bf get\-Multi\-Line\-Text} (const {\bf QString} \&caption, const {\bf QString} \&label, const {\bf QString} \&value=QString::null, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static int {\bf get\-Integer} (const {\bf QString} \&caption, const {\bf QString} \&label, int value=0, int min\-Value=-2147483647, int max\-Value=2147483647, int step=1, int base=10, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static int {\bf get\-Integer} (const {\bf QString} \&caption, const {\bf QString} \&label, int value=0, int min\-Value=-2147483647, int max\-Value=2147483647, int step=1, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static double {\bf get\-Double} (const {\bf QString} \&caption, const {\bf QString} \&label, double value=0, double min\-Value=-2147483647, double max\-Value=2147483647, double step=0.1, int decimals=1, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static double {\bf get\-Double} (const {\bf QString} \&caption, const {\bf QString} \&label, double value=0, double min\-Value=-2147483647, double max\-Value=2147483647, int decimals=1, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static {\bf QString} {\bf get\-Item} (const {\bf QString} \&caption, const {\bf QString} \&label, const {\bf QString\-List} \&list, int current=0, bool editable=false, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
static {\bf QString\-List} {\bf get\-Item\-List} (const {\bf QString} \&caption, const {\bf QString} \&label, const {\bf QString\-List} \&list={\bf QString\-List}(), const {\bf QString\-List} \&select={\bf QString\-List}(), bool multiple=false, bool $\ast$ok=0, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KInput\-Dialog\-Private}\label{classKInputDialog_n0}

\end{CompactItemize}


\subsection{Detailed Description}
The KInput\-Dialog class provides a simple dialog to get a single value from the user. 

The value can be a string, a number (either an integer or a float) or an item from a list. This class is designed to be source compatible with {\bf QInput\-Dialog}.

Five static convenience functions are provided: {\bf get\-Text()}{\rm (p.\,\pageref{classKInputDialog_e0})}, {\bf get\-Integer()}{\rm (p.\,\pageref{classKInputDialog_e3})}. {\bf get\-Double()}{\rm (p.\,\pageref{classKInputDialog_e5})}, {\bf get\-Item()}{\rm (p.\,\pageref{classKInputDialog_e7})} and {\bf get\-Item\-List()}{\rm (p.\,\pageref{classKInputDialog_e8})}.

\begin{Desc}
\item[Since:]3.2 \end{Desc}
\begin{Desc}
\item[Author:]Nadeem Hasan $<${\tt nhasan@kde.org}$>$ \end{Desc}




Definition at line 46 of file kinputdialog.h.

\subsection{Member Function Documentation}
\index{KInputDialog@{KInput\-Dialog}!getText@{getText}}
\index{getText@{getText}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KInput\-Dialog::get\-Text (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, const {\bf QString} \& {\em value} = {\tt QString::null}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, {\bf QValidator} $\ast$ {\em validator} = {\tt 0}, const {\bf QString} \& {\em mask} = {\tt QString::null})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e0}


Static convenience function to get a string from the user. 

caption is the text that is displayed in the title bar. label is the text that appears as a label for the line edit. value is the initial value of the line edit. ok will be set to true if user pressed Ok and false if user pressed Cancel.

If you provide a validator, the Ok button is disabled as long as the validator doesn't return Acceptable. If there is no validator, the Ok button is enabled whenever the line edit isn't empty. If you want to accept empty input, create a trivial {\bf QValidator} that always returns acceptable, e.g. {\bf QReg\-Exp\-Validator} with a regexp of \char`\"{}.$\ast$\char`\"{}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the line edit \item[{\em value}]Initial value of the line edit \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget \item[{\em validator}]A {\bf QValidator} to be associated with the line edit \item[{\em mask}]Mask associated with the line edit. See the documentation for {\bf QLine\-Edit} about masks.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]String user entered if Ok was pressed, else a null string \end{Desc}


Definition at line 259 of file kinputdialog.cpp.

References text().\index{KInputDialog@{KInput\-Dialog}!text@{text}}
\index{text@{text}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KInput\-Dialog::text (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, const {\bf QString} \& {\em value} = {\tt QString::null}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0}, {\bf QValidator} $\ast$ {\em validator} = {\tt 0}, const {\bf QString} \& {\em mask} = {\tt QString::null}, const {\bf QString} \& {\em whats\-This} = {\tt QString::null})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e1}


Same as {\bf get\-Text}{\rm (p.\,\pageref{classKInputDialog_e0})} except it provides an extra parameter to specify a {\bf QWhats\-This} text for the input widget. 

\#\#\# KDE4: Merge with get\-Text.

\begin{Desc}
\item[Since:]{\bf KDE} 3.3 \end{Desc}


Definition at line 267 of file kinputdialog.cpp.

References QWhats\-This::add(), QDialog::exec(), QString::is\-Empty(), line\-Edit(), QString::strip\-White\-Space(), and QLine\-Edit::text().

Referenced by get\-Text().\index{KInputDialog@{KInput\-Dialog}!getMultiLineText@{getMultiLineText}}
\index{getMultiLineText@{getMultiLineText}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KInput\-Dialog::get\-Multi\-Line\-Text (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, const {\bf QString} \& {\em value} = {\tt QString::null}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e2}


Static convenience function to get a multiline string from the user. 

caption is the text that is displayed in the title bar. label is the text that appears as a label for the line edit. value is the initial value of the line edit. ok will be set to true if user pressed Ok and false if user pressed Cancel.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the line edit \item[{\em value}]Initial value of the line edit \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]String user entered if Ok was pressed, else a null string \end{Desc}
\begin{Desc}
\item[Since:]3.3 \end{Desc}


Definition at line 293 of file kinputdialog.cpp.

References QDialog::exec(), QText\-Edit::text(), and text\-Edit().\index{KInputDialog@{KInput\-Dialog}!getInteger@{getInteger}}
\index{getInteger@{getInteger}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KInput\-Dialog::get\-Integer (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, int {\em value} = {\tt 0}, int {\em min\-Value} = {\tt -2147483647}, int {\em max\-Value} = {\tt 2147483647}, int {\em step} = {\tt 1}, int {\em base} = {\tt 10}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e3}


Static convenience function to get an integer from the user. 

caption is the text that is displayed in the title bar. label is the text that appears as the label for the spin box. value is the initial value for the spin box. min\-Value and max\-Value are the minimum and maximum allowable values the user may choose. step is the amount by which the value will change as the user presses the increment and decrement buttons of the spin box. Base is the base of the number.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the spin box \item[{\em value}]Initial value of the spin box \item[{\em min\-Value}]Minimum value user can input \item[{\em max\-Value}]Maximum value user can input \item[{\em step}]Amount by which value is incremented or decremented \item[{\em base}]Base of the number \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number user entered if Ok was pressed, else 0 \end{Desc}


Definition at line 311 of file kinputdialog.cpp.

References QDialog::exec(), int\-Spin\-Box(), and QSpin\-Box::value().

Referenced by get\-Integer().\index{KInputDialog@{KInput\-Dialog}!getInteger@{getInteger}}
\index{getInteger@{getInteger}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KInput\-Dialog::get\-Integer (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, int {\em value} = {\tt 0}, int {\em min\-Value} = {\tt -2147483647}, int {\em max\-Value} = {\tt 2147483647}, int {\em step} = {\tt 1}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e4}


This is an overloaded convenience function. 

It behaves exactly same as above except it assumes base to be 10, i.e. accepts decimal numbers. 

Definition at line 330 of file kinputdialog.cpp.

References get\-Integer().\index{KInputDialog@{KInput\-Dialog}!getDouble@{getDouble}}
\index{getDouble@{getDouble}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double KInput\-Dialog::get\-Double (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, double {\em value} = {\tt 0}, double {\em min\-Value} = {\tt -2147483647}, double {\em max\-Value} = {\tt 2147483647}, double {\em step} = {\tt 0.1}, int {\em decimals} = {\tt 1}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e5}


Static convenience function to get a floating point number from the user. 

caption is the text that is displayed in the title bar. label is the text that appears as the label for the spin box. value is the initial value for the spin box. min\-Value and max\-Value are the minimum and maximum allowable values the user may choose. step is the amount by which the value will change as the user presses the increment and decrement buttons of the spin box.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the spin box \item[{\em value}]Initial value of the spin box \item[{\em min\-Value}]Minimum value user can input \item[{\em max\-Value}]Maximum value user can input \item[{\em step}]Amount by which value is incremented or decremented \item[{\em decimals}]Number of digits after the decimal point \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Number user entered if Ok was pressed, else 0 \end{Desc}


Definition at line 338 of file kinputdialog.cpp.

References double\-Spin\-Box(), QDialog::exec(), and KDouble\-Spin\-Box::value().

Referenced by get\-Double().\index{KInputDialog@{KInput\-Dialog}!getDouble@{getDouble}}
\index{getDouble@{getDouble}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}double KInput\-Dialog::get\-Double (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, double {\em value} = {\tt 0}, double {\em min\-Value} = {\tt -2147483647}, double {\em max\-Value} = {\tt 2147483647}, int {\em decimals} = {\tt 1}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e6}


This is an overloaded convenience function. 

It behaves exctly like the above function. 

Definition at line 357 of file kinputdialog.cpp.

References get\-Double().\index{KInputDialog@{KInput\-Dialog}!getItem@{getItem}}
\index{getItem@{getItem}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KInput\-Dialog::get\-Item (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, const {\bf QString\-List} \& {\em list}, int {\em current} = {\tt 0}, bool {\em editable} = {\tt false}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e7}


Static convenience function to let the user select an item from a list. 

caption is the text that is displayed in the title bar. label is the text that appears as the label for the list. list is the string list which is inserted into the list, and current is the number of the item which should be the selected item. If editable is true, the user can enter their own text.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the spin box \item[{\em list}]List of item for user to choose from \item[{\em current}]Index of the selected item \item[{\em editable}]If true, user can enter own text \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Text of the selected item. If {\tt editable} is true this can be a text entered by the user. \end{Desc}


Definition at line 365 of file kinputdialog.cpp.

References combo\-Box(), QList\-Box::current\-Text(), QCombo\-Box::current\-Text(), QDialog::exec(), list\-Box(), and KDialog\-Base::slot\-Ok().\index{KInputDialog@{KInput\-Dialog}!getItemList@{getItemList}}
\index{getItemList@{getItemList}!KInputDialog@{KInput\-Dialog}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KInput\-Dialog::get\-Item\-List (const {\bf QString} \& {\em caption}, const {\bf QString} \& {\em label}, const {\bf QString\-List} \& {\em list} = {\tt {\bf QString\-List}()}, const {\bf QString\-List} \& {\em select} = {\tt {\bf QString\-List}()}, bool {\em multiple} = {\tt false}, bool $\ast$ {\em ok} = {\tt 0}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})\hspace{0.3cm}{\tt  [static]}}\label{classKInputDialog_e8}


Static convenience function to let the user select one or more items from a listbox. 

caption is the text that is displayed in the title bar. label is the text that appears as the label for the listbox. list is the string list which is inserted into the listbox, select is the list of item(s) that should be the selected. If multiple is true, the user can select multiple items.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em caption}]Caption of the dialog \item[{\em label}]Text of the label for the spin box \item[{\em list}]List of item for user to choose from \item[{\em select}]List of item(s) that should be selected \item[{\em multiple}]If true, user can select multiple items \item[{\em ok}]This bool would be set to true if user pressed Ok \item[{\em parent}]Parent of the dialog widget \item[{\em name}]Name of the dialog widget\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]List of selected items if multiple is true, else currently selected item as a {\bf QString\-List} \end{Desc}


Definition at line 390 of file kinputdialog.cpp.

References QDialog::exec(), QList\-Box::first\-Item(), and list\-Box().

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