#include <kinputdialog.h>
Static Public Member Functions | |
static TQString | getText (const TQString &caption, const TQString &label, const TQString &value=TQString::null, bool *ok=0, TQWidget *parent=0, const char *name=0, TQValidator *validator=0, const TQString &mask=TQString::null) |
static TQString | text (const TQString &caption, const TQString &label, const TQString &value=TQString::null, bool *ok=0, TQWidget *parent=0, const char *name=0, TQValidator *validator=0, const TQString &mask=TQString::null, const TQString &whatsThis=TQString::null) |
static TQString | getMultiLineText (const TQString &caption, const TQString &label, const TQString &value=TQString::null, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static int | getInteger (const TQString &caption, const TQString &label, int value=0, int minValue=-2147483647, int maxValue=2147483647, int step=1, int base=10, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static int | getInteger (const TQString &caption, const TQString &label, int value=0, int minValue=-2147483647, int maxValue=2147483647, int step=1, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static double | getDouble (const TQString &caption, const TQString &label, double value=0, double minValue=-2147483647, double maxValue=2147483647, double step=0.1, int decimals=1, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static double | getDouble (const TQString &caption, const TQString &label, double value=0, double minValue=-2147483647, double maxValue=2147483647, int decimals=1, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static TQString | getItem (const TQString &caption, const TQString &label, const TQStringList &list, int current=0, bool editable=false, bool *ok=0, TQWidget *parent=0, const char *name=0) |
static TQStringList | getItemList (const TQString &caption, const TQString &label, const TQStringList &list=TQStringList(), const TQStringList &select=TQStringList(), bool multiple=false, bool *ok=0, TQWidget *parent=0, const char *name=0) |
Static Public Member Functions inherited from KDialogBase | |
static bool | haveBackgroundTile () |
static const TQPixmap * | backgroundTile () |
static const TQPixmap * | getBackgroundTile () TDE_DEPRECATED |
static void | setBackgroundTile (const TQPixmap *pix) |
Static Public Member Functions inherited from KDialog | |
static int | marginHint () |
static int | spacingHint () |
static void | resizeLayout (TQWidget *widget, int margin, int spacing) |
static void | resizeLayout (TQLayoutItem *lay, int margin, int spacing) |
static void | centerOnScreen (TQWidget *widget, int screen=-1) |
static bool | avoidArea (TQWidget *widget, const TQRect &area, int screen=-1) |
Friends | |
class | KInputDialogPrivate |
Additional Inherited Members | |
Public Types inherited from KDialogBase | |
enum | ButtonCode { Help = 0x00000001 , Default = 0x00000002 , Ok = 0x00000004 , Apply = 0x00000008 , Try = 0x00000010 , Cancel = 0x00000020 , Close = 0x00000040 , User1 = 0x00000080 , User2 = 0x00000100 , User3 = 0x00000200 , No = 0x00000080 , Yes = 0x00000100 , Details = 0x00000400 , Filler = 0x40000000 , Stretch = 0x80000000 , NoDefault } |
enum | ActionButtonStyle { ActionStyle0 =0 , ActionStyle1 , ActionStyle2 , ActionStyle3 , ActionStyle4 , ActionStyleMAX } |
enum | DialogType { TreeList = KJanusWidget::TreeList , Tabbed = KJanusWidget::Tabbed , Plain = KJanusWidget::Plain , Swallow = KJanusWidget::Swallow , IconList = KJanusWidget::IconList } |
Public Slots inherited from KDialogBase | |
void | enableButton (ButtonCode id, bool state) |
void | enableButtonOK (bool state) |
void | enableButtonApply (bool state) |
void | enableButtonCancel (bool state) |
void | enableLinkedHelp (bool state) |
void | delayedDestruct () |
void | setHelpLinkText (const TQString &text) |
void | setHelp (const TQString &anchor, const TQString &appname=TQString::null) |
void | helpClickedSlot (const TQString &) |
void | setDetails (bool showDetails) |
void | setDetailsWidget (TQWidget *detailsWidget) |
void | updateBackground () |
void | cancel () |
Public Slots inherited from KDialog | |
virtual void | polish () |
virtual void | setCaption (const TQString &caption) |
virtual void | setPlainCaption (const TQString &caption) |
Signals inherited from KDialogBase | |
void | helpClicked () |
void | defaultClicked () |
void | user3Clicked () |
void | user2Clicked () |
void | user1Clicked () |
void | applyClicked () |
void | tryClicked () |
void | okClicked () |
void | yesClicked () |
void | noClicked () |
void | cancelClicked () |
void | closeClicked () |
void | apply () |
void | backgroundChanged () |
void | hidden () |
void | finished () |
void | aboutToShowDetails () |
void | aboutToShowPage (TQWidget *page) |
Signals inherited from KDialog | |
void | layoutHintChanged () |
Public Member Functions inherited from KDialogBase | |
KDialogBase (TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (int dialogFace, const TQString &caption, int buttonMask, ButtonCode defaultButton, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (KDialogBase::DialogType dialogFace, WFlags f, TQWidget *parent=0, const char *name=0, bool modal=true, const TQString &caption=TQString::null, int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok, bool separator=false, const KGuiItem &user1=KGuiItem(), const KGuiItem &user2=KGuiItem(), const KGuiItem &user3=KGuiItem()) | |
KDialogBase (const TQString &caption, int buttonMask=Yes|No|Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, TQWidget *parent=0, const char *name=0, bool modal=true, bool separator=false, const KGuiItem &yes=KStdGuiItem::yes(), const KGuiItem &no=KStdGuiItem::no(), const KGuiItem &cancel=KStdGuiItem::cancel()) | |
~KDialogBase () | |
void | setButtonBoxOrientation (int orientation) |
void | setEscapeButton (ButtonCode id) |
virtual void | adjustSize () |
virtual TQSize | sizeHint () const |
virtual TQSize | minimumSizeHint () const |
TQFrame * | plainPage () |
TQFrame * | addPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQFrame * | addPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQVBox * | addVBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQVBox * | addVBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQHBox * | addHBoxPage (const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQHBox * | addHBoxPage (const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQGrid * | addGridPage (int n, Orientation dir, const TQString &itemName, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
TQGrid * | addGridPage (int n, Orientation dir, const TQStringList &items, const TQString &header=TQString::null, const TQPixmap &pixmap=TQPixmap()) |
void | setFolderIcon (const TQStringList &path, const TQPixmap &pixmap) |
TQFrame * | makeMainWidget () |
TQVBox * | makeVBoxMainWidget () |
TQHBox * | makeHBoxMainWidget () |
TQGrid * | makeGridMainWidget (int n, Orientation dir) |
void | enableButtonSeparator (bool state) |
void | showButton (ButtonCode id, bool state) |
void | showButtonOK (bool state) |
void | showButtonApply (bool state) |
void | showButtonCancel (bool state) |
bool | showPage (int index) |
int | activePageIndex () const |
int | pageIndex (TQWidget *widget) const |
void | setMainWidget (TQWidget *widget) |
TQWidget * | mainWidget () |
void | disableResize () |
void | setInitialSize (const TQSize &s, bool noResize=false) |
void | incInitialSize (const TQSize &s, bool noResize=false) |
TQSize | configDialogSize (const TQString &groupName) const |
TQSize | configDialogSize (TDEConfig &config, const TQString &groupName) const |
void | saveDialogSize (const TQString &groupName, bool global=false) |
void | saveDialogSize (TDEConfig &config, const TQString &groupName, bool global=false) const |
void | setButtonOK (const KGuiItem &item=KStdGuiItem::ok()) |
void | setButtonOKText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonApply (const KGuiItem &item=KStdGuiItem::apply()) |
void | setButtonApplyText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonCancel (const KGuiItem &item=KStdGuiItem::cancel()) |
void | setButtonCancelText (const TQString &text=TQString::null, const TQString &tooltip=TQString::null, const TQString &quickhelp=TQString::null) TDE_DEPRECATED |
void | setButtonText (ButtonCode id, const TQString &text) |
void | setButtonTip (ButtonCode id, const TQString &text) |
void | setButtonWhatsThis (ButtonCode id, const TQString &text) |
void | setButtonGuiItem (ButtonCode id, const KGuiItem &item) |
void | setTreeListAutoResize (bool state) |
void | setShowIconsInTreeList (bool state) |
void | setRootIsDecorated (bool state) |
void | unfoldTreeList (bool persist=false) |
void | addWidgetBelowList (TQWidget *widget) |
void | addButtonBelowList (const TQString &text, TQObject *recv, const char *slot) |
void | addButtonBelowList (const KGuiItem &guiitem, TQObject *recv, const char *slot) |
void | setIconListAllVisible (bool state) |
void | showTile (bool state) |
void | getBorderWidths (int &ulx, int &uly, int &lrx, int &lry) const TDE_DEPRECATED |
TQRect | getContentsRect () const TDE_DEPRECATED |
TQSize | calculateSize (int w, int h) const |
TQString | helpLinkText () const |
TQPushButton * | actionButton (ButtonCode id) |
Public Member Functions inherited from KDialog | |
KDialog (TQWidget *parent=0, const char *name=0, bool modal=false, WFlags f=0) | |
Protected Slots inherited from KDialogBase | |
virtual void | slotHelp () |
virtual void | slotDefault () |
virtual void | slotDetails () |
virtual void | slotUser3 () |
virtual void | slotUser2 () |
virtual void | slotUser1 () |
virtual void | slotOk () |
virtual void | slotApply () |
virtual void | slotTry () |
virtual void | slotYes () |
virtual void | slotNo () |
virtual void | slotCancel () |
virtual void | slotClose () |
virtual void | applyPressed () |
void | updateGeometry () |
void | slotDelayedDestruct () |
Protected Member Functions inherited from KDialogBase | |
virtual void | keyPressEvent (TQKeyEvent *e) |
virtual void | hideEvent (TQHideEvent *) |
virtual void | closeEvent (TQCloseEvent *e) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
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 QInputDialog.
Five static convenience functions are provided: getText(), getInteger(). getDouble(), getItem() and getItemList().
- Since
- 3.2
Definition at line 46 of file kinputdialog.h.
Member Function Documentation
◆ getDouble() [1/2]
|
static |
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. 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.
- Parameters
-
caption Caption of the dialog label Text of the label for the spin box value Initial value of the spin box minValue Minimum value user can input maxValue Maximum value user can input step Amount by which value is incremented or decremented decimals Number of digits after the decimal point ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget
- Returns
- Number user entered if Ok was pressed, else 0
Definition at line 338 of file kinputdialog.cpp.
◆ getDouble() [2/2]
|
static |
This is an overloaded convenience function.
It behaves exctly like the above function.
Definition at line 357 of file kinputdialog.cpp.
◆ getInteger() [1/2]
|
static |
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.
◆ getInteger() [2/2]
|
static |
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. 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.
- Parameters
-
caption Caption of the dialog label Text of the label for the spin box value Initial value of the spin box minValue Minimum value user can input maxValue Maximum value user can input step Amount by which value is incremented or decremented base Base of the number ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget
- Returns
- Number user entered if Ok was pressed, else 0
Definition at line 311 of file kinputdialog.cpp.
◆ getItem()
|
static |
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.
- Parameters
-
caption Caption of the dialog label Text of the label for the spin box list List of item for user to choose from current Index of the selected item editable If true, user can enter own text ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget
- Returns
- Text of the selected item. If
editable
is true this can be a text entered by the user.
Definition at line 365 of file kinputdialog.cpp.
◆ getItemList()
|
static |
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.
- Parameters
-
caption Caption of the dialog label Text of the label for the spin box list List of item for user to choose from select List of item(s) that should be selected multiple If true, user can select multiple items ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget
- Returns
- List of selected items if multiple is true, else currently selected item as a QStringList
Definition at line 390 of file kinputdialog.cpp.
◆ getMultiLineText()
|
static |
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.
- Parameters
-
caption Caption of the dialog label Text of the label for the line edit value Initial value of the line edit ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget
- Returns
- String user entered if Ok was pressed, else a null string
- Since
- 3.3
Definition at line 293 of file kinputdialog.cpp.
◆ getText()
|
static |
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 TQValidator that always returns acceptable, e.g. TQRegExpValidator with a regexp of ".*".
- Parameters
-
caption Caption of the dialog label Text of the label for the line edit value Initial value of the line edit ok This bool would be set to true if user pressed Ok parent Parent of the dialog widget name Name of the dialog widget validator A TQValidator to be associated with the line edit mask Mask associated with the line edit. See the documentation for TQLineEdit about masks.
- Returns
- String user entered if Ok was pressed, else a null string
Definition at line 259 of file kinputdialog.cpp.
◆ text()
|
static |
Same as getText except it provides an extra parameter to specify a TQWhatsThis text for the input widget.
KDE4: Merge with getText.
- Since
- KDE 3.3
Definition at line 267 of file kinputdialog.cpp.
The documentation for this class was generated from the following files: