~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/widgets-wiggly.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/doc/src/examples/wiggly.qdoc -->
 
5
<!-- wiggly.qdoc -->
6
6
<head>
7
 
  <title>Qt 4.5: Wiggly Example</title>
 
7
  <title>Qt 4.6: Wiggly Example</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
11
11
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
12
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">Wiggly Example<br /><span class="subtitle"></span>
 
13
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
14
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
15
</tr></table><h1 class="title">Wiggly Example<br /><span class="subtitle"></span>
16
16
</h1>
17
17
<p>Files:</p>
18
18
<ul>
38
38
     Q_OBJECT
39
39
 
40
40
 public:
41
 
     Dialog(QWidget *parent = 0);
 
41
     Dialog(QWidget *parent = 0, bool smallScreen = false);
42
42
 };</pre>
43
43
<p>The <tt>Dialog</tt> class provides a dialog widget that allows the user to enter a text. The text is then rendered by <tt>WigglyWidget</tt>.</p>
44
44
<a name="dialog-class-implementation"></a>
45
45
<h2>Dialog Class Implementation</h2>
46
 
<pre> Dialog::Dialog(QWidget *parent)
 
46
<pre> Dialog::Dialog(QWidget *parent, bool smallScreen)
47
47
     : QDialog(parent)
48
48
 {
49
49
     WigglyWidget *wigglyWidget = new WigglyWidget;
56
56
 
57
57
     connect(lineEdit, SIGNAL(textChanged(QString)),
58
58
             wigglyWidget, SLOT(setText(QString)));
59
 
 
60
 
     lineEdit-&gt;setText(tr(&quot;Hello world!&quot;));
61
 
 
 
59
     if (!smallScreen){
 
60
         lineEdit-&gt;setText(tr(&quot;Hello world!&quot;));
 
61
     }
 
62
     else{
 
63
         lineEdit-&gt;setText(tr(&quot;Hello!&quot;));
 
64
     }
62
65
     setWindowTitle(tr(&quot;Wiggly&quot;));
63
66
     resize(360, 145);
64
67
 }</pre>
140
143
<p>The <a href="qwidget.html#update">QWidget::update</a>() slot does not cause an immediate repaint; instead the slot schedules a paint event for processing when Qt returns to the main event loop. The paint events are then handled by <tt>WigglyWidget</tt>'s <tt>paintEvent()</tt> function.</p>
141
144
<p /><address><hr /><div align="center">
142
145
<table width="100%" cellspacing="0" border="0"><tr class="address">
143
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
144
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
145
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
146
 
</tr></table></div></address></body>
 
146
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
147
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
148
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
149
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
147
150
</html>