.TH "KInputDialog" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KInputDialog \- The KInputDialog class provides a simple dialog to get a single value from the user.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kinputdialog.h>\fP
.PP
Inherits \fBKDialogBase\fP.
.PP
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBQString\fP \fBgetText\fP (const \fBQString\fP &caption, const \fBQString\fP &label, const \fBQString\fP &value=QString::null, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0, \fBQValidator\fP *validator=0, const \fBQString\fP &mask=QString::null)"
.br
.ti -1c
.RI "static \fBQString\fP \fBtext\fP (const \fBQString\fP &caption, const \fBQString\fP &label, const \fBQString\fP &value=QString::null, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0, \fBQValidator\fP *validator=0, const \fBQString\fP &mask=QString::null, const \fBQString\fP &whatsThis=QString::null)"
.br
.ti -1c
.RI "static \fBQString\fP \fBgetMultiLineText\fP (const \fBQString\fP &caption, const \fBQString\fP &label, const \fBQString\fP &value=QString::null, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static int \fBgetInteger\fP (const \fBQString\fP &caption, const \fBQString\fP &label, int value=0, int minValue=-2147483647, int maxValue=2147483647, int step=1, int base=10, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static int \fBgetInteger\fP (const \fBQString\fP &caption, const \fBQString\fP &label, int value=0, int minValue=-2147483647, int maxValue=2147483647, int step=1, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static double \fBgetDouble\fP (const \fBQString\fP &caption, const \fBQString\fP &label, double value=0, double minValue=-2147483647, double maxValue=2147483647, double step=0.1, int decimals=1, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static double \fBgetDouble\fP (const \fBQString\fP &caption, const \fBQString\fP &label, double value=0, double minValue=-2147483647, double maxValue=2147483647, int decimals=1, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static \fBQString\fP \fBgetItem\fP (const \fBQString\fP &caption, const \fBQString\fP &label, const \fBQStringList\fP &list, int current=0, bool editable=false, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "static \fBQStringList\fP \fBgetItemList\fP (const \fBQString\fP &caption, const \fBQString\fP &label, const \fBQStringList\fP &list=\fBQStringList\fP(), const \fBQStringList\fP &select=\fBQStringList\fP(), bool multiple=false, bool *ok=0, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKInputDialogPrivate\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
The KInputDialog 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 \fBQInputDialog\fP.
.PP
Five static convenience functions are provided: \fBgetText()\fP, \fBgetInteger()\fP. \fBgetDouble()\fP, \fBgetItem()\fP and \fBgetItemList()\fP.
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP
\fBAuthor:\fP
.RS 4
Nadeem Hasan <nhasan@kde.org> 
.RE
.PP

.PP
Definition at line 46 of file kinputdialog.h.
.SH "Member Function Documentation"
.PP 
.SS "\fBQString\fP KInputDialog::getText (const \fBQString\fP & caption, const \fBQString\fP & label, const \fBQString\fP & value = \fCQString::null\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, \fBQValidator\fP * validator = \fC0\fP, const \fBQString\fP & mask = \fCQString::null\fP)\fC [static]\fP"
.PP
Static convenience function to get a string from the user. 
.PP
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.
.PP
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 \fBQValidator\fP that always returns acceptable, e.g. \fBQRegExpValidator\fP with a regexp of '.*'.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the line edit 
.br
\fIvalue\fP Initial value of the line edit 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget 
.br
\fIvalidator\fP A \fBQValidator\fP to be associated with the line edit 
.br
\fImask\fP Mask associated with the line edit. See the documentation for \fBQLineEdit\fP about masks.
.RE
.PP
\fBReturns:\fP
.RS 4
String user entered if Ok was pressed, else a null string 
.RE
.PP

.PP
Definition at line 259 of file kinputdialog.cpp.
.PP
References text().
.SS "\fBQString\fP KInputDialog::text (const \fBQString\fP & caption, const \fBQString\fP & label, const \fBQString\fP & value = \fCQString::null\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP, \fBQValidator\fP * validator = \fC0\fP, const \fBQString\fP & mask = \fCQString::null\fP, const \fBQString\fP & whatsThis = \fCQString::null\fP)\fC [static]\fP"
.PP
Same as \fBgetText\fP except it provides an extra parameter to specify a \fBQWhatsThis\fP text for the input widget. 
.PP
### KDE4: Merge with getText.
.PP
\fBSince:\fP
.RS 4
\fBKDE\fP 3.3 
.RE
.PP

.PP
Definition at line 267 of file kinputdialog.cpp.
.PP
References QWhatsThis::add(), QDialog::exec(), QString::isEmpty(), lineEdit(), QString::stripWhiteSpace(), and QLineEdit::text().
.PP
Referenced by getText().
.SS "\fBQString\fP KInputDialog::getMultiLineText (const \fBQString\fP & caption, const \fBQString\fP & label, const \fBQString\fP & value = \fCQString::null\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Static convenience function to get a multiline string from the user. 
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the line edit 
.br
\fIvalue\fP Initial value of the line edit 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget
.RE
.PP
\fBReturns:\fP
.RS 4
String user entered if Ok was pressed, else a null string 
.RE
.PP
\fBSince:\fP
.RS 4
3.3 
.RE
.PP

.PP
Definition at line 293 of file kinputdialog.cpp.
.PP
References QDialog::exec(), QTextEdit::text(), and textEdit().
.SS "int KInputDialog::getInteger (const \fBQString\fP & caption, const \fBQString\fP & label, int value = \fC0\fP, int minValue = \fC-2147483647\fP, int maxValue = \fC2147483647\fP, int step = \fC1\fP, int base = \fC10\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Static convenience function to get an integer from the user. 
.PP
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. minValue and maxValue 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.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the spin box 
.br
\fIvalue\fP Initial value of the spin box 
.br
\fIminValue\fP Minimum value user can input 
.br
\fImaxValue\fP Maximum value user can input 
.br
\fIstep\fP Amount by which value is incremented or decremented 
.br
\fIbase\fP Base of the number 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget
.RE
.PP
\fBReturns:\fP
.RS 4
Number user entered if Ok was pressed, else 0 
.RE
.PP

.PP
Definition at line 311 of file kinputdialog.cpp.
.PP
References QDialog::exec(), intSpinBox(), and QSpinBox::value().
.PP
Referenced by getInteger().
.SS "int KInputDialog::getInteger (const \fBQString\fP & caption, const \fBQString\fP & label, int value = \fC0\fP, int minValue = \fC-2147483647\fP, int maxValue = \fC2147483647\fP, int step = \fC1\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
This is an overloaded convenience function. 
.PP
It behaves exactly same as above except it assumes base to be 10, i.e. accepts decimal numbers. 
.PP
Definition at line 330 of file kinputdialog.cpp.
.PP
References getInteger().
.SS "double KInputDialog::getDouble (const \fBQString\fP & caption, const \fBQString\fP & label, double value = \fC0\fP, double minValue = \fC-2147483647\fP, double maxValue = \fC2147483647\fP, double step = \fC0.1\fP, int decimals = \fC1\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Static convenience function to get a floating point number from the user. 
.PP
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. minValue and maxValue 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.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the spin box 
.br
\fIvalue\fP Initial value of the spin box 
.br
\fIminValue\fP Minimum value user can input 
.br
\fImaxValue\fP Maximum value user can input 
.br
\fIstep\fP Amount by which value is incremented or decremented 
.br
\fIdecimals\fP Number of digits after the decimal point 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget
.RE
.PP
\fBReturns:\fP
.RS 4
Number user entered if Ok was pressed, else 0 
.RE
.PP

.PP
Definition at line 338 of file kinputdialog.cpp.
.PP
References doubleSpinBox(), QDialog::exec(), and KDoubleSpinBox::value().
.PP
Referenced by getDouble().
.SS "double KInputDialog::getDouble (const \fBQString\fP & caption, const \fBQString\fP & label, double value = \fC0\fP, double minValue = \fC-2147483647\fP, double maxValue = \fC2147483647\fP, int decimals = \fC1\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
This is an overloaded convenience function. 
.PP
It behaves exctly like the above function. 
.PP
Definition at line 357 of file kinputdialog.cpp.
.PP
References getDouble().
.SS "\fBQString\fP KInputDialog::getItem (const \fBQString\fP & caption, const \fBQString\fP & label, const \fBQStringList\fP & list, int current = \fC0\fP, bool editable = \fCfalse\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Static convenience function to let the user select an item from a list. 
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the spin box 
.br
\fIlist\fP List of item for user to choose from 
.br
\fIcurrent\fP Index of the selected item 
.br
\fIeditable\fP If true, user can enter own text 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget
.RE
.PP
\fBReturns:\fP
.RS 4
Text of the selected item. If \fCeditable\fP is true this can be a text entered by the user. 
.RE
.PP

.PP
Definition at line 365 of file kinputdialog.cpp.
.PP
References comboBox(), QListBox::currentText(), QComboBox::currentText(), QDialog::exec(), listBox(), and KDialogBase::slotOk().
.SS "\fBQStringList\fP KInputDialog::getItemList (const \fBQString\fP & caption, const \fBQString\fP & label, const \fBQStringList\fP & list = \fC\fBQStringList\fP()\fP, const \fBQStringList\fP & select = \fC\fBQStringList\fP()\fP, bool multiple = \fCfalse\fP, bool * ok = \fC0\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
Static convenience function to let the user select one or more items from a listbox. 
.PP
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.
.PP
\fBParameters:\fP
.RS 4
\fIcaption\fP Caption of the dialog 
.br
\fIlabel\fP Text of the label for the spin box 
.br
\fIlist\fP List of item for user to choose from 
.br
\fIselect\fP List of item(s) that should be selected 
.br
\fImultiple\fP If true, user can select multiple items 
.br
\fIok\fP This bool would be set to true if user pressed Ok 
.br
\fIparent\fP Parent of the dialog widget 
.br
\fIname\fP Name of the dialog widget
.RE
.PP
\fBReturns:\fP
.RS 4
List of selected items if multiple is true, else currently selected item as a \fBQStringList\fP 
.RE
.PP

.PP
Definition at line 390 of file kinputdialog.cpp.
.PP
References QDialog::exec(), QListBox::firstItem(), and listBox().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
