diff options
author | Timothy Pearson <[email protected]> | 2011-11-08 12:31:36 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-11-08 12:31:36 -0600 |
commit | d796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch) | |
tree | 6e3dcca4f77e20ec8966c666aac7c35bd4704053 /doc/html/qinputdialog.html | |
download | tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip |
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'doc/html/qinputdialog.html')
-rw-r--r-- | doc/html/qinputdialog.html | 196 |
1 files changed, 196 insertions, 0 deletions
diff --git a/doc/html/qinputdialog.html b/doc/html/qinputdialog.html new file mode 100644 index 000000000..6214c5344 --- /dev/null +++ b/doc/html/qinputdialog.html @@ -0,0 +1,196 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> +<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/dialogs/qinputdialog.cpp:65 --> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>TQInputDialog Class</title> +<style type="text/css"><!-- +fn { margin-left: 1cm; text-indent: -1cm; } +a:link { color: #004faf; text-decoration: none } +a:visited { color: #672967; text-decoration: none } +body { background: #ffffff; color: black; } +--></style> +</head> +<body> + +<table border="0" cellpadding="0" cellspacing="0" width="100%"> +<tr bgcolor="#E5E5E5"> +<td valign=center> + <a href="index.html"> +<font color="#004faf">Home</font></a> + | <a href="classes.html"> +<font color="#004faf">All Classes</font></a> + | <a href="mainclasses.html"> +<font color="#004faf">Main Classes</font></a> + | <a href="annotated.html"> +<font color="#004faf">Annotated</font></a> + | <a href="groups.html"> +<font color="#004faf">Grouped Classes</font></a> + | <a href="functions.html"> +<font color="#004faf">Functions</font></a> +</td> +<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>TQInputDialog Class Reference</h1> + +<p>The TQInputDialog class provides a simple convenience dialog to get a single value from the user. +<a href="#details">More...</a> +<p><tt>#include <<a href="qinputdialog-h.html">qinputdialog.h</a>></tt> +<p>Inherits <a href="qdialog.html">TQDialog</a>. +<p><a href="qinputdialog-members.html">List of all member functions.</a> +<h2>Static Public Members</h2> +<ul> +<li class=fn>TQString <a href="#getText"><b>getText</b></a> ( const TQString & caption, const TQString & label, TQLineEdit::EchoMode mode = TQLineEdit::Normal, const TQString & text = TQString::null, bool * ok = 0, TQWidget * parent = 0, const char * name = 0 )</li> +<li class=fn>int <a href="#getInteger"><b>getInteger</b></a> ( 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 )</li> +<li class=fn>double <a href="#getDouble"><b>getDouble</b></a> ( 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 )</li> +<li class=fn>TQString <a href="#getItem"><b>getItem</b></a> ( const TQString & caption, const TQString & label, const TQStringList & list, int current = 0, bool editable = TRUE, bool * ok = 0, TQWidget * parent = 0, const char * name = 0 )</li> +</ul> +<hr><a name="details"></a><h2>Detailed Description</h2> + + +The TQInputDialog class provides a simple convenience dialog to get a single value from the user. + + +<p> The input value can be a string, a number or an item from a list. A +label must be set to tell the user what they should enter. +<p> Four static convenience functions are provided: +<a href="#getText">getText</a>(), <a href="#getInteger">getInteger</a>(), <a href="#getDouble">getDouble</a>() and <a href="#getItem">getItem</a>(). All the +functions can be used in a similar way, for example: +<pre> + bool ok; + <a href="qstring.html">TQString</a> text = TQInputDialog::<a href="#getText">getText</a>( + "MyApp 3000", "Enter your name:", TQLineEdit::Normal, + <a href="qstring.html#TQString-null">TQString::null</a>, &ok, this ); + if ( ok && !text.<a href="qstring.html#isEmpty">isEmpty</a>() ) { + // user entered something and pressed OK + } else { + // user entered nothing or pressed Cancel + } + </pre> + +<p> <center><img src="inputdialogs.png" alt="Input Dialogs"></center> <p>See also <a href="dialogs.html">Dialog Classes</a>. + +<hr><h2>Member Function Documentation</h2> +<h3 class=fn>double <a name="getDouble"></a>TQInputDialog::getDouble ( const <a href="qstring.html">TQString</a> & caption, const <a href="qstring.html">TQString</a> & label, double value = 0, double minValue = -2147483647, double maxValue = 2147483647, int decimals = 1, bool * ok = 0, <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt> +</h3> +Static convenience function to get a floating point number from +the user. <em>caption</em> is the text which is displayed in the title +bar of the dialog. <em>label</em> is the text which is shown to the user +(it should say what should be entered). <em>value</em> is the default +floating point number that the line edit will be set to. <em>minValue</em> and <em>maxValue</em> are the minimum and maximum values the +user may choose, and <em>decimals</em> is the maximum number of decimal +places the number may have. +<p> If <em>ok</em> is not-null <em>*</em><em>ok</em> will be set to TRUE if the user +pressed OK and to FALSE if the user pressed Cancel. The dialog's +parent is <em>parent</em>; the dialog is called <em>name</em>. The dialog will +be modal. +<p> This function returns the floating point number which has been +entered by the user. +<p> Use this static function like this: +<p> <pre> + bool ok; + double res = TQInputDialog::<a href="#getDouble">getDouble</a>( + "MyApp 3000", "Enter a decimal number:", 33.7, 0, + 1000, 2, &ok, this ); + if ( ok ) { + // user entered something and pressed OK + } else { + // user pressed Cancel + } + </pre> + + +<h3 class=fn>int <a name="getInteger"></a>TQInputDialog::getInteger ( const <a href="qstring.html">TQString</a> & caption, const <a href="qstring.html">TQString</a> & label, int value = 0, int minValue = -2147483647, int maxValue = 2147483647, int step = 1, bool * ok = 0, <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt> +</h3> +Static convenience function to get an integer input from the +user. <em>caption</em> is the text which is displayed in the title bar +of the dialog. <em>label</em> is the text which is shown to the user +(it should say what should be entered). <em>value</em> is the default +integer which the spinbox will be set to. <em>minValue</em> and <em>maxValue</em> are the minimum and maximum values the user may choose, +and <em>step</em> is the amount by which the values change as the user +presses the arrow buttons to increment or decrement the value. +<p> If <em>ok</em> is not-null *<em>ok</em> will be set to TRUE if the user +pressed OK and to FALSE if the user pressed Cancel. The dialog's +parent is <em>parent</em>; the dialog is called <em>name</em>. The dialog will +be modal. +<p> This function returns the integer which has been entered by the user. +<p> Use this static function like this: +<p> <pre> + bool ok; + int res = TQInputDialog::<a href="#getInteger">getInteger</a>( + "MyApp 3000", "Enter a number:", 22, 0, 1000, 2, + &ok, this ); + if ( ok ) { + // user entered something and pressed OK + } else { + // user pressed Cancel + } + </pre> + + +<h3 class=fn><a href="qstring.html">TQString</a> <a name="getItem"></a>TQInputDialog::getItem ( const <a href="qstring.html">TQString</a> & caption, const <a href="qstring.html">TQString</a> & label, const <a href="qstringlist.html">TQStringList</a> & list, int current = 0, bool editable = TRUE, bool * ok = 0, <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt> +</h3> +Static convenience function to let the user select an item from a +string list. <em>caption</em> is the text which is displayed in the title +bar of the dialog. <em>label</em> is the text which is shown to the user (it +should say what should be entered). <em>list</em> is the +string list which is inserted into the combobox, and <em>current</em> is the number +of the item which should be the current item. If <em>editable</em> is TRUE +the user can enter their own text; if <em>editable</em> is FALSE the user +may only select one of the existing items. +<p> If <em>ok</em> is not-null <em>*</em><em>ok</em> will be set to TRUE if the user +pressed OK and to FALSE if the user pressed Cancel. The dialog's +parent is <em>parent</em>; the dialog is called <em>name</em>. The dialog will +be modal. +<p> This function returns the text of the current item, or if <em>editable</em> is TRUE, the current text of the combobox. +<p> Use this static function like this: +<p> <pre> + <a href="qstringlist.html">TQStringList</a> lst; + lst << "First" << "Second" << "Third" << "Fourth" << "Fifth"; + bool ok; + <a href="qstring.html">TQString</a> res = TQInputDialog::<a href="#getItem">getItem</a>( + "MyApp 3000", "Select an item:", lst, 1, TRUE, &ok, + this ); + if ( ok ) { + // user selected an item and pressed OK + } else { + // user pressed Cancel + } + </pre> + + +<h3 class=fn><a href="qstring.html">TQString</a> <a name="getText"></a>TQInputDialog::getText ( const <a href="qstring.html">TQString</a> & caption, const <a href="qstring.html">TQString</a> & label, <a href="qlineedit.html#EchoMode-enum">TQLineEdit::EchoMode</a> mode = TQLineEdit::Normal, const <a href="qstring.html">TQString</a> & text = TQString::null, bool * ok = 0, <a href="qwidget.html">TQWidget</a> * parent = 0, const char * name = 0 )<tt> [static]</tt> +</h3> +Static convenience function to get a string from the user. <em>caption</em> is the text which is displayed in the title bar of the +dialog. <em>label</em> is the text which is shown to the user (it should +say what should be entered). <em>text</em> is the default text which is +placed in the line edit. The <em>mode</em> is the echo mode the line edit +will use. If <em>ok</em> is not-null <em>*</em><em>ok</em> will be set to TRUE if the +user pressed OK and to FALSE if the user pressed Cancel. The +dialog's parent is <em>parent</em>; the dialog is called <em>name</em>. The +dialog will be modal. +<p> This function returns the text which has been entered in the line +edit. It will not return an empty string. +<p> Use this static function like this: +<p> <pre> + bool ok; + <a href="qstring.html">TQString</a> text = TQInputDialog::<a href="#getText">getText</a>( + "MyApp 3000", "Enter your name:", TQLineEdit::Normal, + <a href="qstring.html#TQString-null">TQString::null</a>, &ok, this ); + if ( ok && !text.<a href="qstring.html#isEmpty">isEmpty</a>() ) { + // user entered something and pressed OK + } else { + // user entered nothing or pressed Cancel + } + </pre> + + +<!-- eof --> +<hr><p> +This file is part of the <a href="index.html">TQt toolkit</a>. +Copyright © 1995-2007 +<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> +<table width=100% cellspacing=0 border=0><tr> +<td>Copyright © 2007 +<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a> +<td align=right><div align=right>TQt 3.3.8</div> +</table></div></address></body> +</html> |