summaryrefslogtreecommitdiffstats
path: root/doc/html/wizard-wizard-cpp.html
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:24:15 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:24:15 -0500
commitbd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch)
tree7a520322212d48ebcb9fbe1087e7fca28b76185c /doc/html/wizard-wizard-cpp.html
downloadqt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz
qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip
Add Qt3 development HEAD version
Diffstat (limited to 'doc/html/wizard-wizard-cpp.html')
-rw-r--r--doc/html/wizard-wizard-cpp.html269
1 files changed, 269 insertions, 0 deletions
diff --git a/doc/html/wizard-wizard-cpp.html b/doc/html/wizard-wizard-cpp.html
new file mode 100644
index 0000000..f8b58d0
--- /dev/null
+++ b/doc/html/wizard-wizard-cpp.html
@@ -0,0 +1,269 @@
+<!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/qwizard.cpp:52 -->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>wizard/wizard.cpp Example File</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&nbsp;Classes</font></a>
+ | <a href="mainclasses.html">
+<font color="#004faf">Main&nbsp;Classes</font></a>
+ | <a href="annotated.html">
+<font color="#004faf">Annotated</font></a>
+ | <a href="groups.html">
+<font color="#004faf">Grouped&nbsp;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>wizard/wizard.cpp Example File</h1>
+
+
+<pre>/****************************************************************************
+** $Id: qt/wizard.cpp 3.3.8 edited Jan 11 14:37 $
+**
+** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
+**
+** This file is part of an example program for Qt. This example
+** program may be used, distributed and modified without limitation.
+**
+*****************************************************************************/
+
+#include "wizard.h"
+
+#include &lt;<a href="qwidget-h.html">qwidget.h</a>&gt;
+#include &lt;<a href="qhbox-h.html">qhbox.h</a>&gt;
+#include &lt;<a href="qvbox-h.html">qvbox.h</a>&gt;
+#include &lt;<a href="qlabel-h.html">qlabel.h</a>&gt;
+#include &lt;<a href="qlineedit-h.html">qlineedit.h</a>&gt;
+#include &lt;<a href="qpushbutton-h.html">qpushbutton.h</a>&gt;
+#include &lt;<a href="qvalidator-h.html">qvalidator.h</a>&gt;
+#include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;
+
+<a name="f3"></a>Wizard::Wizard( <a href="qwidget.html">QWidget</a> *parent, const char *name )
+ : <a href="qwizard.html">QWizard</a>( parent, name, TRUE )
+{
+ setupPage1();
+ setupPage2();
+ setupPage3();
+
+<a name="x11"></a> key-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
+}
+
+void <a name="f4"></a>Wizard::setupPage1()
+{
+ page1 = new <a href="qhbox.html">QHBox</a>( this );
+<a name="x2"></a> page1-&gt;<a href="qhbox.html#setSpacing">setSpacing</a>(8);
+
+ <a href="qlabel.html">QLabel</a> *info = new <a href="qlabel.html">QLabel</a>( page1 );
+<a name="x1"></a> info-&gt;<a href="qframe.html#setMargin">setMargin</a>( 11 );
+<a name="x14"></a> info-&gt;<a href="qwidget.html#setPalette">setPalette</a>( yellow );
+<a name="x4"></a> info-&gt;<a href="qlabel.html#setText">setText</a>( "Enter your personal\n"
+ "key here.\n\n"
+ "Your personal key\n"
+ "consists of 4 digits" );
+<a name="x5"></a><a name="x12"></a> info-&gt;<a href="qwidget.html#setMaximumWidth">setMaximumWidth</a>( info-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+
+ <a href="qvbox.html">QVBox</a> *page = new <a href="qvbox.html">QVBox</a>( page1 );
+
+ <a href="qhbox.html">QHBox</a> *row1 = new <a href="qhbox.html">QHBox</a>( page );
+
+ (void)new <a href="qlabel.html">QLabel</a>( "Key:", row1 );
+
+ key = new <a href="qlineedit.html">QLineEdit</a>( row1 );
+<a name="x6"></a> key-&gt;<a href="qlineedit.html#setMaxLength">setMaxLength</a>( 4 );
+<a name="x7"></a> key-&gt;<a href="qlineedit.html#setValidator">setValidator</a>( new <a href="qintvalidator.html">QIntValidator</a>( 1000, 9999, key ) );
+
+<a name="x9"></a> <a href="qobject.html#connect">connect</a>( key, SIGNAL( <a href="qlineedit.html#textChanged">textChanged</a>( const <a href="qstring.html">QString</a> &amp; ) ),
+ this, SLOT( keyChanged( const <a href="qstring.html">QString</a> &amp; ) ) );
+
+ <a href="qwizard.html#addPage">addPage</a>( page1, "Personal Key" );
+
+ <a href="qwizard.html#setNextEnabled">setNextEnabled</a>( page1, FALSE );
+ <a href="qwizard.html#setHelpEnabled">setHelpEnabled</a>( page1, FALSE );
+}
+
+void <a name="f5"></a>Wizard::setupPage2()
+{
+ page2 = new <a href="qhbox.html">QHBox</a>( this );
+ page2-&gt;<a href="qhbox.html#setSpacing">setSpacing</a>(8);
+
+ <a href="qlabel.html">QLabel</a> *info = new <a href="qlabel.html">QLabel</a>( page2 );
+ info-&gt;<a href="qframe.html#setMargin">setMargin</a>( 11 );
+ info-&gt;<a href="qwidget.html#setPalette">setPalette</a>( yellow );
+ info-&gt;<a href="qlabel.html#setText">setText</a>( "\n"
+ "Enter your personal\n"
+ "data here.\n\n"
+ "The required fields are\n"
+ "First Name, Last Name \n"
+ "and E-Mail.\n" );
+ info-&gt;<a href="qwidget.html#setMaximumWidth">setMaximumWidth</a>( info-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+
+ <a href="qvbox.html">QVBox</a> *page = new <a href="qvbox.html">QVBox</a>( page2 );
+
+ <a href="qhbox.html">QHBox</a> *row1 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row2 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row3 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row4 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row5 = new <a href="qhbox.html">QHBox</a>( page );
+
+ <a href="qlabel.html">QLabel</a> *label1 = new <a href="qlabel.html">QLabel</a>( " First Name: ", row1 );
+<a name="x3"></a> label1-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label2 = new <a href="qlabel.html">QLabel</a>( " Last Name: ", row2 );
+ label2-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label3 = new <a href="qlabel.html">QLabel</a>( " Address: ", row3 );
+ label3-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label4 = new <a href="qlabel.html">QLabel</a>( " Phone Number: ", row4 );
+ label4-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label5 = new <a href="qlabel.html">QLabel</a>( " E-Mail: ", row5 );
+ label5-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+
+<a name="x13"></a> label1-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label4-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label2-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label4-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label3-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label4-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label4-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label4-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label5-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label4-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+
+ firstName = new <a href="qlineedit.html">QLineEdit</a>( row1 );
+ lastName = new <a href="qlineedit.html">QLineEdit</a>( row2 );
+ address = new <a href="qlineedit.html">QLineEdit</a>( row3 );
+ phone = new <a href="qlineedit.html">QLineEdit</a>( row4 );
+ email = new <a href="qlineedit.html">QLineEdit</a>( row5 );
+
+ <a href="qobject.html#connect">connect</a>( firstName, SIGNAL( <a href="qlineedit.html#textChanged">textChanged</a>( const <a href="qstring.html">QString</a> &amp; ) ),
+ this, SLOT( dataChanged( const <a href="qstring.html">QString</a> &amp; ) ) );
+ <a href="qobject.html#connect">connect</a>( lastName, SIGNAL( <a href="qlineedit.html#textChanged">textChanged</a>( const <a href="qstring.html">QString</a> &amp; ) ),
+ this, SLOT( dataChanged( const <a href="qstring.html">QString</a> &amp; ) ) );
+ <a href="qobject.html#connect">connect</a>( email, SIGNAL( <a href="qlineedit.html#textChanged">textChanged</a>( const <a href="qstring.html">QString</a> &amp; ) ),
+ this, SLOT( dataChanged( const <a href="qstring.html">QString</a> &amp; ) ) );
+
+ <a href="qwizard.html#addPage">addPage</a>( page2, "Personal Data" );
+
+ <a href="qwizard.html#setHelpEnabled">setHelpEnabled</a>( page2, FALSE );
+}
+
+void <a name="f6"></a>Wizard::setupPage3()
+{
+ page3 = new <a href="qhbox.html">QHBox</a>( this );
+ page3-&gt;<a href="qhbox.html#setSpacing">setSpacing</a>(8);
+
+ <a href="qlabel.html">QLabel</a> *info = new <a href="qlabel.html">QLabel</a>( page3 );
+ info-&gt;<a href="qwidget.html#setPalette">setPalette</a>( yellow );
+ info-&gt;<a href="qlabel.html#setText">setText</a>( "\n"
+ "Look here to see of\n"
+ "the data you entered\n"
+ "is correct. To confirm,\n"
+ "press the [Finish] button\n"
+ "else go back to correct\n"
+ "mistakes." );
+ info-&gt;<a href="qframe.html#setMargin">setMargin</a>( 11 );
+ info-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( AlignTop|AlignLeft );
+ info-&gt;<a href="qwidget.html#setMaximumWidth">setMaximumWidth</a>( info-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+
+ <a href="qvbox.html">QVBox</a> *page = new <a href="qvbox.html">QVBox</a>( page3 );
+
+ <a href="qhbox.html">QHBox</a> *row1 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row2 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row3 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row4 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row5 = new <a href="qhbox.html">QHBox</a>( page );
+ <a href="qhbox.html">QHBox</a> *row6 = new <a href="qhbox.html">QHBox</a>( page );
+
+ <a href="qlabel.html">QLabel</a> *label1 = new <a href="qlabel.html">QLabel</a>( " Personal Key: ", row1 );
+ label1-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label2 = new <a href="qlabel.html">QLabel</a>( " First Name: ", row2 );
+ label2-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label3 = new <a href="qlabel.html">QLabel</a>( " Last Name: ", row3 );
+ label3-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label4 = new <a href="qlabel.html">QLabel</a>( " Address: ", row4 );
+ label4-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label5 = new <a href="qlabel.html">QLabel</a>( " Phone Number: ", row5 );
+ label5-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+ <a href="qlabel.html">QLabel</a> *label6 = new <a href="qlabel.html">QLabel</a>( " E-Mail: ", row6 );
+ label6-&gt;<a href="qlabel.html#setAlignment">setAlignment</a>( Qt::AlignVCenter );
+
+ label1-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label2-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label3-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label4-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label5-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+ label6-&gt;<a href="qwidget.html#setMinimumWidth">setMinimumWidth</a>( label1-&gt;<a href="qwidget.html#sizeHint">sizeHint</a>().width() );
+
+ lKey = new <a href="qlabel.html">QLabel</a>( row1 );
+ lFirstName = new <a href="qlabel.html">QLabel</a>( row2 );
+ lLastName = new <a href="qlabel.html">QLabel</a>( row3 );
+ lAddress = new <a href="qlabel.html">QLabel</a>( row4 );
+ lPhone = new <a href="qlabel.html">QLabel</a>( row5 );
+ lEmail = new <a href="qlabel.html">QLabel</a>( row6 );
+
+ <a href="qwizard.html#addPage">addPage</a>( page3, "Finish" );
+
+ <a href="qwizard.html#setFinishEnabled">setFinishEnabled</a>( page3, TRUE );
+ <a href="qwizard.html#setHelpEnabled">setHelpEnabled</a>( page3, FALSE );
+}
+
+<a name="x15"></a>void Wizard::<a href="qwizard.html#showPage">showPage</a>( <a href="qwidget.html">QWidget</a>* page )
+{
+ if ( page == page1 ) {
+ } else if ( page == page2 ) {
+ } else if ( page == page3 ) {
+<a name="x8"></a> lKey-&gt;<a href="qlabel.html#setText">setText</a>( key-&gt;<a href="qlineedit.html#text">text</a>() );
+ lFirstName-&gt;<a href="qlabel.html#setText">setText</a>( firstName-&gt;<a href="qlineedit.html#text">text</a>() );
+ lLastName-&gt;<a href="qlabel.html#setText">setText</a>( lastName-&gt;<a href="qlineedit.html#text">text</a>() );
+ lAddress-&gt;<a href="qlabel.html#setText">setText</a>( address-&gt;<a href="qlineedit.html#text">text</a>() );
+ lPhone-&gt;<a href="qlabel.html#setText">setText</a>( phone-&gt;<a href="qlineedit.html#text">text</a>() );
+ lEmail-&gt;<a href="qlabel.html#setText">setText</a>( email-&gt;<a href="qlineedit.html#text">text</a>() );
+ }
+
+ QWizard::<a href="qwizard.html#showPage">showPage</a>(page);
+
+ if ( page == page1 ) {
+ keyChanged( key-&gt;<a href="qlineedit.html#text">text</a>() );
+ key-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
+ } else if ( page == page2 ) {
+ dataChanged( firstName-&gt;<a href="qlineedit.html#text">text</a>() );
+ firstName-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
+ } else if ( page == page3 ) {
+ <a href="qwizard.html#finishButton">finishButton</a>()-&gt;setEnabled( TRUE );
+ <a href="qwizard.html#finishButton">finishButton</a>()-&gt;setFocus();
+ }
+}
+
+void <a name="f7"></a>Wizard::keyChanged( const <a href="qstring.html">QString</a> &amp;text )
+{
+ <a href="qstring.html">QString</a> t = text;
+ int p = 0;
+<a name="x10"></a> bool on = ( key-&gt;<a href="qlineedit.html#validator">validator</a>()-&gt;validate(t, p) == QValidator::Acceptable );
+ <a href="qwizard.html#nextButton">nextButton</a>()-&gt;setEnabled( on );
+}
+
+void <a name="f8"></a>Wizard::dataChanged( const <a href="qstring.html">QString</a> &amp; )
+{
+ if ( !firstName-&gt;<a href="qlineedit.html#text">text</a>().isEmpty() &amp;&amp;
+ !lastName-&gt;<a href="qlineedit.html#text">text</a>().isEmpty() &amp;&amp;
+ !email-&gt;<a href="qlineedit.html#text">text</a>().isEmpty() )
+ <a href="qwizard.html#nextButton">nextButton</a>()-&gt;setEnabled( TRUE );
+ else
+ <a href="qwizard.html#nextButton">nextButton</a>()-&gt;setEnabled( FALSE );
+}
+</pre><!-- eof -->
+<p><address><hr><div align=center>
+<table width=100% cellspacing=0 border=0><tr>
+<td>Copyright &copy; 2007
+<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
+<td align=right><div align=right>Qt 3.3.8</div>
+</table></div></address></body>
+</html>