File: chap3_4.html

package info (click to toggle)
qt-embedded 2.3.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 68,608 kB
  • ctags: 45,998
  • sloc: cpp: 276,654; ansic: 71,987; makefile: 29,074; sh: 12,305; yacc: 2,465; python: 1,863; perl: 481; lex: 480; xml: 68; lisp: 15
file content (68 lines) | stat: -rw-r--r-- 4,608 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>

	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Connecting Widgets To Each Other</title>
		<meta name="generator" content="Adobe GoLive 4">
		<link rel="HOME" href="book1.html">
		<link rel="UP" title="Tutorial: Adding Functionality To A Dialog By
	  Subclassing" href="chap3_1.html">
		<link rel="PREVIOUS" title="Initializing The State Of Widgets In The Form" href="chap3_3.html">
		<link rel="NEXT" title="Tutorial: Using Layout Management" href="chap4_1.html">
		
	</head>

	<body class="SECT1" bgcolor="white" text="black" link="blue" vlink="#840084" alink="blue">
		<div class="NAVHEADER">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr>
					<td width="500" align="left" valign="middle"><img height="90" width="475" src="figures/title.png" border="0"></td>
					<td></td>
					<td align="right" valign="top"><a href="../company/about/trolls.html">
						<table border="0" cellpadding="0" cellspacing="0" width="137">
							<tr>
								<td><img height="100" width="100" src="figures/f001.png" border="0"></td>
								<td><img height="100" width="100" src="figures/qtlogo.png" align="top" border="0"></td>
							</tr>
						</table>
						</a></td>
				</tr>
				<tr>
					<td width="500"><spacer type="block" width="500" height="20"></td>
					<td><spacer type="block" width="42" height="20"></td>
					<td><br>
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="black">
				<tr>
					<td width="10%" align="left" valign="bottom"><a href="chap3_3.html"><img height="20" width="20" src="arrows/left.png" border="0"></a></td>
					<td width="80%" align="center" valign="bottom"><font color="white"><b>Chapter 3. Tutorial: Adding Functionality To A Dialog By Subclassing</b></font></td>
					<td width="10%" align="right" valign="bottom"><a href="chap4_1.html"><img height="20" width="20" src="arrows/right.png" border="0"></a></td>
				</tr>
			</table>
		</div>
		<div class="SECT1">
			<h1 class="SECT1"><a name="AEN651"></a>Connecting Widgets To Each Other</h1>
			<p>We have one goal left: Enabling the <span class="GUILABEL">Extra Cheese</span> check box when the <span class="GUILABEL">Anchovies</span> check box is checked as well disabling it when the <span class="GUILABEL">Anchovies</span> check box is unchecked. You might expect that this means more additions to the <tt class="LITERAL">PizzaEntryImpl</tt> class, but this is not the case: We have the fortunate situation here that we can just connect the right signals and slots to each other and have Qt Designer and <b class="COMMAND">uic</b> do the rest.</p>
			<p>Start Qt Designer again and load <tt class="FILENAME">pizza.ui</tt>. This time, we do not need to create our own slots but just use predefined ones. So start the connection tool by hitting <b class="KEYCAP">F3</b> or by any other of the previously described means and &ldquo;draw&rdquo; a connection between the <span class="GUILABEL">Anchovies</span> check box and the <span class="GUILABEL">Extra Cheese</span>. In the <span class="GUILABEL">Connections</span> dialog that appears, connect the <tt class="LITERAL">toggled(bool)</tt> signal, which is emitted when the <span class="GUILABEL">Anchovies</span> check box is operated, to the <tt class="LITERAL">setEnabled(bool)</tt> slot. Close the dialog with <span class="GUILABEL">OK</span>. That's all! Save your work and compile your program as described in the first section in this tutorial. Run the program and check that it actually does what we wanted.</p>
		</div>
		<div class="NAVFOOTER">
			<br>
			<br>
			<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="black">
				<tr>
					<td width="33%" align="left" valign="top"><a href="chap3_3.html"><img height="20" width="20" src="arrows/left.png" border="0"></a></td>
					<td width="34%" align="center" valign="top"><a href="book1.html"><img height="20" width="25" src="arrows/home.png" border="0"></a></td>
					<td width="33%" align="right" valign="top"><a href="chap4_1.html"><img height="20" width="20" src="arrows/right.png" border="0"></a></td>
				</tr>
				<tr>
					<td width="33%" align="left" valign="top"><font  color="white">Initializing The State Of Widgets In The Form</font></td>
					<td width="34%" align="center" valign="top"><a href="chap3_1.html"><img height="20" width="20" src="arrows/up.png" border="0"></a></td>
					<td width="33%" align="right" valign="top"><font  color="white">Tutorial: Using Layout Management</font></td>
				</tr>
			</table>
		</div>
	</body>

</html>