File: qdesignerformwindowcursorinterface.html

package info (click to toggle)
python-qt4 4.9.3-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 34,432 kB
  • sloc: python: 34,126; cpp: 11,938; xml: 290; makefile: 223; php: 27
file content (220 lines) | stat: -rw-r--r-- 18,606 bytes parent folder | download
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDesignerFormWindowCursorInterface Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDesignerFormWindowCursorInterface Class Reference<br /><sup><sup>[<a href="qtdesigner.html">QtDesigner</a> module]</sup></sup></h1><p>The QDesignerFormWindowCursorInterface class allows you to query
and modify a form window's widget selection, and in addition modify
the properties of all the form's widgets. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdesignerformwindowcursorinterface.html#MoveMode-enum">MoveMode</a></b> { MoveAnchor, KeepAnchor }</li><li><div class="fn" />enum <b><a href="qdesignerformwindowcursorinterface.html#MoveOperation-enum">MoveOperation</a></b> { NoMove, Start, End, Next, ..., Down }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#QDesignerFormWindowCursorInterface">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#QDesignerFormWindowCursorInterface-2">__init__</a></b> (<i>self</i>, QDesignerFormWindowCursorInterface)</li><li><div class="fn" />QWidget <b><a href="qdesignerformwindowcursorinterface.html#current">current</a></b> (<i>self</i>)</li><li><div class="fn" />QDesignerFormWindowInterface <b><a href="qdesignerformwindowcursorinterface.html#formWindow">formWindow</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdesignerformwindowcursorinterface.html#hasSelection">hasSelection</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdesignerformwindowcursorinterface.html#isWidgetSelected">isWidgetSelected</a></b> (<i>self</i>, QWidget&#160;<i>widget</i>)</li><li><div class="fn" />bool <b><a href="qdesignerformwindowcursorinterface.html#movePosition">movePosition</a></b> (<i>self</i>, MoveOperation&#160;<i>op</i>, MoveMode&#160;<i>mode</i>&#160;=&#160;QDesignerFormWindowCursorInterface.MoveAnchor)</li><li><div class="fn" />int <b><a href="qdesignerformwindowcursorinterface.html#position">position</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#resetWidgetProperty">resetWidgetProperty</a></b> (<i>self</i>, QWidget&#160;<i>widget</i>, QString&#160;<i>name</i>)</li><li><div class="fn" />QWidget <b><a href="qdesignerformwindowcursorinterface.html#selectedWidget">selectedWidget</a></b> (<i>self</i>, int&#160;<i>index</i>)</li><li><div class="fn" />int <b><a href="qdesignerformwindowcursorinterface.html#selectedWidgetCount">selectedWidgetCount</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#setPosition">setPosition</a></b> (<i>self</i>, int&#160;<i>pos</i>, MoveMode&#160;<i>mode</i>&#160;=&#160;QDesignerFormWindowCursorInterface.MoveAnchor)</li><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#setProperty">setProperty</a></b> (<i>self</i>, QString&#160;<i>name</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" /><b><a href="qdesignerformwindowcursorinterface.html#setWidgetProperty">setWidgetProperty</a></b> (<i>self</i>, QWidget&#160;<i>widget</i>, QString&#160;<i>name</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" />QWidget <b><a href="qdesignerformwindowcursorinterface.html#widget">widget</a></b> (<i>self</i>, int&#160;<i>index</i>)</li><li><div class="fn" />int <b><a href="qdesignerformwindowcursorinterface.html#widgetCount">widgetCount</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDesignerFormWindowCursorInterface class allows you to query
and modify a form window's widget selection, and in addition modify
the properties of all the form's widgets.</p>
<p>QDesignerFormWindowCursorInterface is a convenience class that
provides an interface to the associated form window's text cursor;
it provides a collection of functions that enables you to query a
given form window's selection and change the selection's focus
according to defined modes (<a href="qdesignerformwindowcursorinterface.html#MoveMode-enum">MoveMode</a>)
and movements (<a href="qdesignerformwindowcursorinterface.html#MoveOperation-enum">MoveOperation</a>).
You can also use the interface to query the form's widgets and
change their properties.</p>
<p>The interface is not intended to be instantiated directly, but
to provide access to the selections and widgets of <i>Qt
Designer</i>'s current form windows. <a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a>
always provides an associated cursor interface. The form window for
a given widget can be retrieved using the static <a href="qdesignerformwindowinterface.html#findFormWindow">QDesignerFormWindowInterface.findFormWindow</a>()
functions. For example:</p>
<pre class="cpp">
     <span class="type"><a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a></span> <span class="operator">*</span>formWindow <span class="operator">=</span> <span class="number">0</span>;
     formWindow <span class="operator">=</span> <span class="type"><a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a></span><span class="operator">.</span>findFormWindow(myWidget);

     formWindow<span class="operator">-</span><span class="operator">&gt;</span>cursor()<span class="operator">-</span><span class="operator">&gt;</span><a href="qdesignerformwindowcursorinterface.html#setProperty">setProperty</a>(myWidget<span class="operator">,</span> myProperty<span class="operator">,</span> newValue);
</pre>
<p>You can retrieve any of <i>Qt Designer</i>'s current form
windows through <i>Qt Designer</i>'s <a href="qdesignerformwindowmanagerinterface.html">form window
manager</a>.</p>
<p>Once you have a form window's cursor interface, you can check if
the form window has a selection at all using the <a href="qdesignerformwindowcursorinterface.html#hasSelection">hasSelection</a>()
function. You can query the form window for its total <a href="qdesignerformwindowcursorinterface.html#widgetCount">widgetCount</a>()
and <a href="qdesignerformwindowcursorinterface.html#selectedWidgetCount">selectedWidgetCount</a>().
You can retrieve the currently selected widget (or widgets) using
the <a href="qdesignerformwindowcursorinterface.html#current">current</a>() or
<a href="qdesignerformwindowcursorinterface.html#selectedWidget">selectedWidget</a>()
functions.</p>
<p>You can retrieve any of the form window's widgets using the
<a href="qdesignerformwindowcursorinterface.html#widget">widget</a>()
function, and check if a widget is selected using the <a href="qdesignerformwindowcursorinterface.html#isWidgetSelected">isWidgetSelected</a>()
function. You can use the <a href="qdesignerformwindowcursorinterface.html#setProperty">setProperty</a>()
function to set the selected widget's properties, and the <a href="qdesignerformwindowcursorinterface.html#setWidgetProperty">setWidgetProperty</a>()
or <a href="qdesignerformwindowcursorinterface.html#resetWidgetProperty">resetWidgetProperty</a>()
functions to modify the properties of any given widget.</p>
<p>Finally, you can change the selection by changing the text
cursor's <a href="qdesignerformwindowcursorinterface.html#position">position</a>()
using the <a href="qdesignerformwindowcursorinterface.html#setPosition">setPosition</a>()
and <a href="qdesignerformwindowcursorinterface.html#movePosition">movePosition</a>()
functions.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="MoveMode-enum" />QDesignerFormWindowCursorInterface.MoveMode</h3><p>This enum describes the different modes that are used when the
text cursor moves.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.MoveAnchor</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The anchor moves with the cursor to its new
location.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.KeepAnchor</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The anchor remains at the cursor's old
location.</td>
</tr>
</table>


<h3 class="fn"><a name="MoveOperation-enum" />QDesignerFormWindowCursorInterface.MoveOperation</h3><p>This enum describes the types of text cursor operation that can
occur in a form window.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.NoMove</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The cursor does not move.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Start</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Moves the cursor to the start of the focus
chain.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.End</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Moves the cursor to the end of the focus
chain.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Next</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Moves the cursor to the next widget in the
focus chain.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Prev</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Moves the cursor to the previous widget in the
focus chain.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Left</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The cursor moves to the left.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Right</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">The cursor moves to the right.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Up</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">The cursor moves upwards.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDesignerFormWindowCursorInterface.Down</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">The cursor moves downwards.</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDesignerFormWindowCursorInterface" />QDesignerFormWindowCursorInterface.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QDesignerFormWindowCursorInterface-2" />QDesignerFormWindowCursorInterface.__init__ (<i>self</i>, <a href="qdesignerformwindowcursorinterface.html">QDesignerFormWindowCursorInterface</a>)</h3><h3 class="fn"><a name="current" /><a href="qwidget.html">QWidget</a> QDesignerFormWindowCursorInterface.current (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the currently selected widget in the form window.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#selectedWidget">selectedWidget</a>().</p>


<h3 class="fn"><a name="formWindow" /><a href="qdesignerformwindowinterface.html">QDesignerFormWindowInterface</a> QDesignerFormWindowCursorInterface.formWindow (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the form window interface associated with this cursor
interface.</p>


<h3 class="fn"><a name="hasSelection" />bool QDesignerFormWindowCursorInterface.hasSelection (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns true if the form window contains a selection; otherwise
returns false.</p>


<h3 class="fn"><a name="isWidgetSelected" />bool QDesignerFormWindowCursorInterface.isWidgetSelected (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>)</h3><p>Returns true if the specified <i>widget</i> is selected;
otherwise returns false.</p>


<h3 class="fn"><a name="movePosition" />bool QDesignerFormWindowCursorInterface.movePosition (<i>self</i>, <a href="qdesignerformwindowcursorinterface.html#MoveOperation-enum">MoveOperation</a>&#160;<i>op</i>, <a href="qdesignerformwindowcursorinterface.html#MoveMode-enum">MoveMode</a>&#160;<i>mode</i>&#160;=&#160;QDesignerFormWindowCursorInterface.MoveAnchor)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Performs the given <i>operation</i> on the cursor using the
specified <i>mode</i>, and returns true if it completed
successfully; otherwise returns false.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#position">position</a>()
and <a href="qdesignerformwindowcursorinterface.html#setPosition">setPosition</a>().</p>


<h3 class="fn"><a name="position" />int QDesignerFormWindowCursorInterface.position (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the cursor position.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#setPosition">setPosition</a>()
and <a href="qdesignerformwindowcursorinterface.html#movePosition">movePosition</a>().</p>


<h3 class="fn"><a name="resetWidgetProperty" />QDesignerFormWindowCursorInterface.resetWidgetProperty (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>, QString&#160;<i>name</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Resets the property with the given <i>name</i> for the specified
<i>widget</i> to its default value.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#setProperty">setProperty</a>()
and <a href="qdesignerformwindowcursorinterface.html#setWidgetProperty">setWidgetProperty</a>().</p>


<h3 class="fn"><a name="selectedWidget" /><a href="qwidget.html">QWidget</a> QDesignerFormWindowCursorInterface.selectedWidget (<i>self</i>, int&#160;<i>index</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the widget with the given <i>index</i> in the list of
selected widgets.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#current">current</a>() and
<a href="qdesignerformwindowcursorinterface.html#widget">widget</a>().</p>


<h3 class="fn"><a name="selectedWidgetCount" />int QDesignerFormWindowCursorInterface.selectedWidgetCount (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the number of selected widgets in the form window.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#widgetCount">widgetCount</a>().</p>


<h3 class="fn"><a name="setPosition" />QDesignerFormWindowCursorInterface.setPosition (<i>self</i>, int&#160;<i>pos</i>, <a href="qdesignerformwindowcursorinterface.html#MoveMode-enum">MoveMode</a>&#160;<i>mode</i>&#160;=&#160;QDesignerFormWindowCursorInterface.MoveAnchor)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the position of the cursor to the given <i>position</i>
using the <i>mode</i> to specify how it is moved there.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#position">position</a>()
and <a href="qdesignerformwindowcursorinterface.html#movePosition">movePosition</a>().</p>


<h3 class="fn"><a name="setProperty" />QDesignerFormWindowCursorInterface.setProperty (<i>self</i>, QString&#160;<i>name</i>, QVariant&#160;<i>value</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the property with the given <i>name</i> for the currently
selected widget to the specified <i>value</i>.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#setWidgetProperty">setWidgetProperty</a>()
and <a href="qdesignerformwindowcursorinterface.html#resetWidgetProperty">resetWidgetProperty</a>().</p>


<h3 class="fn"><a name="setWidgetProperty" />QDesignerFormWindowCursorInterface.setWidgetProperty (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>, QString&#160;<i>name</i>, QVariant&#160;<i>value</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Sets the property with the given <i>name</i> for the given
<i>widget</i> to the specified <i>value</i>.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#resetWidgetProperty">resetWidgetProperty</a>()
and <a href="qdesignerformwindowcursorinterface.html#setProperty">setProperty</a>().</p>


<h3 class="fn"><a name="widget" /><a href="qwidget.html">QWidget</a> QDesignerFormWindowCursorInterface.widget (<i>self</i>, int&#160;<i>index</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the widget with the given <i>index</i> in the list of
widgets in the form window.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#selectedWidget">selectedWidget</a>().</p>


<h3 class="fn"><a name="widgetCount" />int QDesignerFormWindowCursorInterface.widgetCount (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the number of widgets in the form window.</p>
<p><b>See also</b> <a href="qdesignerformwindowcursorinterface.html#selectedWidgetCount">selectedWidgetCount</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.2</td></tr></table></div></address></body></html>