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

« back to all changes in this revision

Viewing changes to doc/html/q3actiongroup.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/widgets/q3action.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3ActionGroup Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<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="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3ActionGroup Class Reference</h1>
 
21
<p>The Q3ActionGroup class groups actions together. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3ActionGroup&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="q3action.html">Q3Action</a>.</p>
 
25
<ul>
 
26
<li><a href="q3actiongroup-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="properties"></a>
 
29
<h3>Properties</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3actiongroup.html#exclusive-prop">exclusive</a></b> : bool</li>
 
32
<li><div class="fn"/><b><a href="q3actiongroup.html#usesDropDown-prop">usesDropDown</a></b> : bool</li>
 
33
</ul>
 
34
<ul>
 
35
<li><div class="fn"/>11 properties inherited from <a href="q3action.html#properties">Q3Action</a></li>
 
36
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
37
</ul>
 
38
<a name="public-functions"></a>
 
39
<h3>Public Functions</h3>
 
40
<ul>
 
41
<li><div class="fn"/><b><a href="q3actiongroup.html#Q3ActionGroup">Q3ActionGroup</a></b> ( QObject * <i>parent</i>, const char * <i>name</i> = 0 )</li>
 
42
<li><div class="fn"/><b><a href="q3actiongroup.html#Q3ActionGroup-2">Q3ActionGroup</a></b> ( QObject * <i>parent</i>, const char * <i>name</i>, bool <i>exclusive</i> )</li>
 
43
<li><div class="fn"/><b><a href="q3actiongroup.html#dtor.Q3ActionGroup">~Q3ActionGroup</a></b> ()</li>
 
44
<li><div class="fn"/>void <b><a href="q3actiongroup.html#add">add</a></b> ( Q3Action * <i>action</i> )</li>
 
45
<li><div class="fn"/>void <b><a href="q3actiongroup.html#addSeparator">addSeparator</a></b> ()</li>
 
46
<li><div class="fn"/>virtual bool <b><a href="q3actiongroup.html#addTo">addTo</a></b> ( QWidget * <i>w</i> )</li>
 
47
<li><div class="fn"/>void <b><a href="q3actiongroup.html#insert">insert</a></b> ( Q3Action * <i>action</i> )</li>
 
48
<li><div class="fn"/>bool <b><a href="q3actiongroup.html#exclusive-prop">isExclusive</a></b> () const</li>
 
49
<li><div class="fn"/>void <b><a href="q3actiongroup.html#exclusive-prop">setExclusive</a></b> ( bool )</li>
 
50
<li><div class="fn"/>void <b><a href="q3actiongroup.html#usesDropDown-prop">setUsesDropDown</a></b> ( bool <i>enable</i> )</li>
 
51
<li><div class="fn"/>bool <b><a href="q3actiongroup.html#usesDropDown-prop">usesDropDown</a></b> () const</li>
 
52
</ul>
 
53
<ul>
 
54
<li><div class="fn"/>21 public functions inherited from <a href="q3action.html#public-functions">Q3Action</a></li>
 
55
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
56
</ul>
 
57
<a name="signals"></a>
 
58
<h3>Signals</h3>
 
59
<ul>
 
60
<li><div class="fn"/>void <b><a href="q3actiongroup.html#activated">activated</a></b> ( Q3Action * <i>action</i> )</li>
 
61
<li><div class="fn"/>void <b><a href="q3actiongroup.html#selected">selected</a></b> ( Q3Action * <i>action</i> )</li>
 
62
</ul>
 
63
<ul>
 
64
<li><div class="fn"/>2 signals inherited from <a href="q3action.html#signals">Q3Action</a></li>
 
65
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
66
</ul>
 
67
<a name="protected-functions"></a>
 
68
<h3>Protected Functions</h3>
 
69
<ul>
 
70
<li><div class="fn"/>virtual void <b><a href="q3actiongroup.html#addedTo">addedTo</a></b> ( QWidget * <i>actionWidget</i>, QWidget * <i>container</i>, Q3Action * <i>a</i> )</li>
 
71
<li><div class="fn"/>virtual void <b><a href="q3actiongroup.html#addedTo-2">addedTo</a></b> ( int <i>index</i>, Q3PopupMenu * <i>menu</i>, Q3Action * <i>a</i> )</li>
 
72
</ul>
 
73
<ul>
 
74
<li><div class="fn"/>2 protected functions inherited from <a href="q3action.html#protected-functions">Q3Action</a></li>
 
75
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
76
</ul>
 
77
<h3>Additional Inherited Members</h3>
 
78
<ul>
 
79
<li><div class="fn"/>6 public slots inherited from <a href="q3action.html#public-slots">Q3Action</a></li>
 
80
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
81
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
82
</ul>
 
83
<a name="details"></a>
 
84
<hr />
 
85
<h2>Detailed Description</h2>
 
86
<p>The Q3ActionGroup class groups actions together.</p>
 
87
<p>In some situations it is useful to group actions together. For example, if you have a left justify action, a right justify action and a center action, only one of these actions should be active at any one time, and one simple way of achieving this is to group the actions together in an action group.</p>
 
88
<p>An action group can also be added to a menu or a toolbar as a single unit, with all the actions within the action group appearing as separate menu options and toolbar buttons.</p>
 
89
<p>The actions in an action group emit their <a href="q3actiongroup.html#activated">activated</a>() (and for toggle actions, <a href="q3action.html#toggled">toggled</a>()) signals as usual.</p>
 
90
<p>The <a href="q3actiongroup.html#exclusive-prop">setExclusive</a>() function is used to ensure that only one action is active at any one time: it should be used with actions which have their <tt>toggleAction</tt> set to true.</p>
 
91
<p>Action group actions appear as individual menu options and toolbar buttons. For exclusive action groups use <a href="q3actiongroup.html#usesDropDown-prop">setUsesDropDown</a>() to display the actions in a subwidget of any widget the action group is added to. For example, the actions would appear in a combobox in a toolbar or as a submenu in a menu.</p>
 
92
<p>Actions can be added to an action group using <a href="q3actiongroup.html#add">add</a>(), but normally they are added by creating the action with the action group as parent. Actions can have separators dividing them using <a href="q3actiongroup.html#addSeparator">addSeparator</a>(). Action groups are added to widgets with <a href="q3actiongroup.html#addTo">addTo</a>().</p>
 
93
<hr />
 
94
<h2>Property Documentation</h2>
 
95
<h3 class="fn"><a name="exclusive-prop"></a>exclusive : bool</h3>
 
96
<p>This property holds whether the action group does exclusive toggling.</p>
 
97
<p>If exclusive is true only one toggle action in the action group can ever be active at any one time. If the user chooses another toggle action in the group the one they chose becomes active and the one that was active becomes inactive.</p>
 
98
<p>Access functions:</p>
 
99
<ul>
 
100
<li><div class="fn"/><b>bool isExclusive () const</b></li>
 
101
<li><div class="fn"/><b>void setExclusive ( bool )</b></li>
 
102
</ul>
 
103
<p>See also <a href="q3action.html#toggleAction-prop">Q3Action::toggleAction</a>.</p>
 
104
<h3 class="fn"><a name="usesDropDown-prop"></a>usesDropDown : bool</h3>
 
105
<p>This property holds whether the group's actions are displayed in a subwidget of the widgets the action group is added to.</p>
 
106
<p>Exclusive action groups added to a toolbar display their actions in a combobox with the action's <a href="q3action.html#text-prop">Q3Action::text</a> and <a href="q3action.html#iconSet-prop">Q3Action::iconSet</a> properties shown. Non-exclusive groups are represented by a tool button showing their <a href="q3action.html#iconSet-prop">Q3Action::iconSet</a> and <a href="q3action.html#text-prop">text</a>() property.</p>
 
107
<p>In a popup menu the member actions are displayed in a submenu.</p>
 
108
<p>Changing usesDropDown only affects <i>subsequent</i> calls to <a href="q3actiongroup.html#addTo">addTo</a>().</p>
 
109
<p>This property's default is false.</p>
 
110
<p>Access functions:</p>
 
111
<ul>
 
112
<li><div class="fn"/><b>bool usesDropDown () const</b></li>
 
113
<li><div class="fn"/><b>void setUsesDropDown ( bool <i>enable</i> )</b></li>
 
114
</ul>
 
115
<hr />
 
116
<h2>Member Function Documentation</h2>
 
117
<h3 class="fn"><a name="Q3ActionGroup"></a>Q3ActionGroup::Q3ActionGroup ( <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i> = 0 )</h3>
 
118
<p>Constructs an action group called <i>name</i>, with parent <i>parent</i>.</p>
 
119
<p>The action group is exclusive by default. Call setExclusive(false) to make the action group non-exclusive.</p>
 
120
<h3 class="fn"><a name="Q3ActionGroup-2"></a>Q3ActionGroup::Q3ActionGroup ( <a href="qobject.html">QObject</a> * <i>parent</i>, const char * <i>name</i>, bool <i>exclusive</i> )</h3>
 
121
<p>Constructs an action group called <i>name</i>, with parent <i>parent</i>.</p>
 
122
<p>If <i>exclusive</i> is true only one toggle action in the group will ever be active.</p>
 
123
<p>See also <a href="q3actiongroup.html#exclusive-prop">exclusive</a>.</p>
 
124
<h3 class="fn"><a name="dtor.Q3ActionGroup"></a>Q3ActionGroup::~Q3ActionGroup ()</h3>
 
125
<p>Destroys the object and frees allocated resources.</p>
 
126
<h3 class="fn"><a name="activated"></a>void Q3ActionGroup::activated ( <a href="q3action.html">Q3Action</a> * <i>action</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
127
<p>This signal is emitted from groups when one of it's actions gets activated.</p>
 
128
<p>The argument is the <i>action</i> which was activated.</p>
 
129
<p>See also <a href="q3actiongroup.html#exclusive-prop">setExclusive</a>(), <a href="q3action.html#on-prop">isOn</a>(), and <a href="q3action.html#toggled">Q3Action::toggled</a>().</p>
 
130
<h3 class="fn"><a name="add"></a>void Q3ActionGroup::add ( <a href="q3action.html">Q3Action</a> * <i>action</i> )</h3>
 
131
<p>Adds action <i>action</i> to this group.</p>
 
132
<p>Normally an action is added to a group by creating it with the group as parent, so this function is not usually used.</p>
 
133
<p>See also <a href="q3actiongroup.html#addTo">addTo</a>().</p>
 
134
<h3 class="fn"><a name="addSeparator"></a>void Q3ActionGroup::addSeparator ()</h3>
 
135
<p>Adds a separator to the group.</p>
 
136
<h3 class="fn"><a name="addTo"></a>bool Q3ActionGroup::addTo ( <a href="qwidget.html">QWidget</a> * <i>w</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
137
<p>Adds this action group to the widget <i>w</i>.</p>
 
138
<p>If <a href="q3actiongroup.html#exclusive-prop">isExclusive</a>() is false or <a href="q3actiongroup.html#usesDropDown-prop">usesDropDown</a>() is false, the actions within the group are added to the widget individually. For example, if the widget is a menu, the actions will appear as individual menu options, and if the widget is a toolbar, the actions will appear as toolbar buttons.</p>
 
139
<p>If both <a href="q3actiongroup.html#exclusive-prop">isExclusive</a>() and <a href="q3actiongroup.html#usesDropDown-prop">usesDropDown</a>() are true, the actions are presented either in a combobox (if <i>w</i> is a toolbar) or in a submenu (if <i>w</i> is a menu).</p>
 
140
<p>All actions should be added to the action group <i>before</i> the action group is added to the widget. If actions are added to the action group <i>after</i> the action group has been added to the widget these later actions will <i>not</i> appear.</p>
 
141
<p>Reimplemented from <a href="q3action.html#addTo">Q3Action</a>.</p>
 
142
<p>See also <a href="q3actiongroup.html#exclusive-prop">setExclusive</a>(), <a href="q3actiongroup.html#usesDropDown-prop">setUsesDropDown</a>(), and <a href="q3actiongroup.html#removeFrom">removeFrom</a>().</p>
 
143
<h3 class="fn"><a name="addedTo"></a>void Q3ActionGroup::addedTo ( <a href="qwidget.html">QWidget</a> * <i>actionWidget</i>, <a href="qwidget.html">QWidget</a> * <i>container</i>, <a href="q3action.html">Q3Action</a> * <i>a</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
144
<p>This function is called from the <a href="q3actiongroup.html#addTo">addTo</a>() function when it has created a widget (<i>actionWidget</i>) for the child action <i>a</i> in the <i>container</i>.</p>
 
145
<h3 class="fn"><a name="addedTo-2"></a>void Q3ActionGroup::addedTo ( int <i>index</i>, <a href="q3popupmenu.html">Q3PopupMenu</a> * <i>menu</i>, <a href="q3action.html">Q3Action</a> * <i>a</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
146
<p>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.</p>
 
147
<p>This function is called from the <a href="q3actiongroup.html#addTo">addTo</a>() function when it has created a menu item for the child action at the index position <i>index</i> in the popup menu <i>menu</i>.</p>
 
148
<h3 class="fn"><a name="insert"></a>void Q3ActionGroup::insert ( <a href="q3action.html">Q3Action</a> * <i>action</i> )</h3>
 
149
<p>Use add(<i>action</i>) instead.</p>
 
150
<h3 class="fn"><a name="selected"></a>void Q3ActionGroup::selected ( <a href="q3action.html">Q3Action</a> * <i>action</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
151
<p>This signal is emitted from exclusive groups when toggle actions change state.</p>
 
152
<p>The argument is the <i>action</i> whose state changed to &quot;on&quot;.</p>
 
153
<p>See also <a href="q3actiongroup.html#exclusive-prop">setExclusive</a>(), <a href="q3action.html#on-prop">isOn</a>(), and <a href="q3action.html#toggled">Q3Action::toggled</a>().</p>
 
154
<p /><address><hr /><div align="center">
 
155
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
156
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
157
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
158
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
159
</tr></table></div></address></body>
 
160
</html>