File: qdockwidget.html

package info (click to toggle)
qt4-x11 4%3A4.8.2%2Bdfsg-11
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 701,696 kB
  • sloc: cpp: 2,686,179; ansic: 375,485; python: 25,859; sh: 19,349; xml: 17,091; perl: 14,765; yacc: 5,383; asm: 5,038; makefile: 1,259; lex: 555; ruby: 526; objc: 347; cs: 112; pascal: 112; php: 54; sed: 34
file content (347 lines) | stat: -rw-r--r-- 33,691 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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdockwidget.cpp -->
  <title>Qt 4.8: QDockWidget Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="content"> 
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
  </div>
  <div class="breadcrumb toolblock">
    <ul>
      <li class="first"><a href="index.html">Home</a></li>
      <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QDockWidget</li>
    </ul>
  </div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#appearance">Appearance</a></li>
</ul>
</div>
<h1 class="title">QDockWidget Class Reference</h1>
<!-- $$$QDockWidget-brief -->
<p>The QDockWidget class provides a widget that can be docked inside a <a href="qmainwindow.html">QMainWindow</a> or floated as a top-level window on the desktop. <a href="#details">More...</a></p>
<!-- @@@QDockWidget -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDockWidget&gt;</span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qdockwidget-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetFeature</a></b> { DockWidgetClosable, DockWidgetMovable, DockWidgetFloatable, DockWidgetVerticalTitleBar, AllDockWidgetFeatures, NoDockWidgetFeatures }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetFeatures</a></b></td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qdockwidget.html#allowedAreas-prop">allowedAreas</a></b> : Qt::DockWidgetAreas</li>
<li class="fn"><b><a href="qdockwidget.html#features-prop">features</a></b> : DockWidgetFeatures</li>
<li class="fn"><b><a href="qdockwidget.html#floating-prop">floating</a></b> : bool</li>
<li class="fn"><b><a href="qdockwidget.html#windowTitle-prop">windowTitle</a></b> : QString</li>
</ul>
<ul>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#QDockWidget">QDockWidget</a></b> ( const QString &amp; <i>title</i>, QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>flags</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#QDockWidget-2">QDockWidget</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>flags</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#dtor.QDockWidget">~QDockWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::DockWidgetAreas </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#allowedAreas-prop">allowedAreas</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> DockWidgetFeatures </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#features-prop">features</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#isAreaAllowed">isAreaAllowed</a></b> ( Qt::DockWidgetArea <i>area</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#floating-prop">isFloating</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#allowedAreas-prop">setAllowedAreas</a></b> ( Qt::DockWidgetAreas <i>areas</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#features-prop">setFeatures</a></b> ( DockWidgetFeatures <i>features</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#floating-prop">setFloating</a></b> ( bool <i>floating</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#setTitleBarWidget">setTitleBarWidget</a></b> ( QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#setWidget">setWidget</a></b> ( QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#titleBarWidget">titleBarWidget</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#toggleViewAction">toggleViewAction</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#widget">widget</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#allowedAreasChanged">allowedAreasChanged</a></b> ( Qt::DockWidgetAreas <i>allowedAreas</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#dockLocationChanged">dockLocationChanged</a></b> ( Qt::DockWidgetArea <i>area</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#featuresChanged">featuresChanged</a></b> ( QDockWidget::DockWidgetFeatures <i>features</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#topLevelChanged">topLevelChanged</a></b> ( bool <i>topLevel</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#visibilityChanged">visibilityChanged</a></b> ( bool <i>visible</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#initStyleOption">initStyleOption</a></b> ( QStyleOptionDockWidget * <i>option</i> ) const</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#changeEvent">changeEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#closeEvent">closeEvent</a></b> ( QCloseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qdockwidget.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDockWidget-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDockWidget class provides a widget that can be docked inside a <a href="qmainwindow.html">QMainWindow</a> or floated as a top-level window on the desktop.</p>
<p>QDockWidget provides the concept of dock widgets, also know as tool palettes or utility windows. Dock windows are secondary windows placed in the <i>dock widget area</i> around the <a href="qmainwindow.html#centralWidget">central widget</a> in a <a href="qmainwindow.html">QMainWindow</a>.</p>
<p class="centerAlign"><img src="images/mainwindow-docks.png" alt="" /></p><p>Dock windows can be moved inside their current area, moved into new areas and floated (e.g&#x2e;, undocked) by the end-user. The QDockWidget API allows the programmer to restrict the dock widgets ability to move, float and close, as well as the areas in which they can be placed.</p>
<a name="appearance"></a>
<h3>Appearance</h3>
<p>A QDockWidget consists of a title bar and the content area. The title bar displays the dock widgets <a href="qwidget.html#windowTitle-prop">window title</a>, a <i>float</i> button and a <i>close</i> button. Depending on the state of the QDockWidget, the <i>float</i> and <i>close</i> buttons may be either disabled or not shown at all.</p>
<p>The visual appearance of the title bar and buttons is dependent on the <a href="qstyle.html">style</a> in use.</p>
<p>A QDockWidget acts as a wrapper for its child widget, set with <a href="qdockwidget.html#setWidget">setWidget</a>(). Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title. Size constraints should not be set on the QDockWidget itself, because they change depending on whether it is docked; a docked QDockWidget has no frame and a smaller title bar.</p>
</div>
<p><b>See also </b><a href="qmainwindow.html">QMainWindow</a> and <a href="mainwindows-dockwidgets.html">Dock Widgets Example</a>.</p>
<!-- @@@QDockWidget -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DockWidgetFeature$$$DockWidgetClosable$$$DockWidgetMovable$$$DockWidgetFloatable$$$DockWidgetVerticalTitleBar$$$DockWidgetFeatureMask$$$AllDockWidgetFeatures$$$NoDockWidgetFeatures$$$Reserved -->
<h3 class="flags"><a name="DockWidgetFeature-enum"></a>enum QDockWidget::<span class="name">DockWidgetFeature</span><br/>flags QDockWidget::<span class="name">DockWidgetFeatures</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QDockWidget::DockWidgetClosable</tt></td><td class="topAlign"><tt>0x01</tt></td><td class="topAlign">The dock widget can be closed. On some systems the dock widget always has a close button when it's floating (for example on MacOS 10.5).</td></tr>
<tr><td class="topAlign"><tt>QDockWidget::DockWidgetMovable</tt></td><td class="topAlign"><tt>0x02</tt></td><td class="topAlign">The dock widget can be moved between docks by the user.</td></tr>
<tr><td class="topAlign"><tt>QDockWidget::DockWidgetFloatable</tt></td><td class="topAlign"><tt>0x04</tt></td><td class="topAlign">The dock widget can be detached from the main window, and floated as an independent window.</td></tr>
<tr><td class="topAlign"><tt>QDockWidget::DockWidgetVerticalTitleBar</tt></td><td class="topAlign"><tt>0x08</tt></td><td class="topAlign">The dock widget displays a vertical title bar on its left side. This can be used to increase the amount of vertical space in a <a href="qmainwindow.html">QMainWindow</a>.</td></tr>
<tr><td class="topAlign"><tt>QDockWidget::AllDockWidgetFeatures</tt></td><td class="topAlign"><tt>DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable</tt></td><td class="topAlign">(Deprecated) The dock widget can be closed, moved, and floated. Since new features might be added in future releases, the look and behavior of dock widgets might change if you use this flag. Please specify individual flags instead.</td></tr>
<tr><td class="topAlign"><tt>QDockWidget::NoDockWidgetFeatures</tt></td><td class="topAlign"><tt>0x00</tt></td><td class="topAlign">The dock widget cannot be closed, moved, or floated.</td></tr>
</table>
<p>The DockWidgetFeatures type is a typedef for <a href="qflags.html">QFlags</a>&lt;DockWidgetFeature&gt;. It stores an OR combination of DockWidgetFeature values.</p>
<!-- @@@DockWidgetFeature -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$allowedAreas-prop$$$allowedAreas$$$setAllowedAreasQt::DockWidgetAreas$$$allowedAreasChangedQt::DockWidgetAreas -->
<h3 class="fn"><a name="allowedAreas-prop"></a><span class="name">allowedAreas</span> : <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetAreas</a></span></h3>
<p>This property holds areas where the dock widget may be placed.</p>
<p>The default is <a href="qt.html#DockWidgetArea-enum">Qt::AllDockWidgetAreas</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::DockWidgetAreas </td><td class="memItemRight bottomAlign"><span class="name"><b>allowedAreas</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAllowedAreas</b></span> ( Qt::DockWidgetAreas <i>areas</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qdockwidget.html#allowedAreasChanged">allowedAreasChanged</a></b></span> ( Qt::DockWidgetAreas <i>allowedAreas</i> )</td></tr>
</table>
<p><b>See also </b><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a>.</p>
<!-- @@@allowedAreas -->
<!-- $$$features-prop$$$features$$$setFeaturesDockWidgetFeatures$$$featuresChangedQDockWidget::DockWidgetFeatures -->
<h3 class="fn"><a name="features-prop"></a><span class="name">features</span> : <span class="type"><a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetFeatures</a></span></h3>
<p>This property holds whether the dock widget is movable, closable, and floatable.</p>
<p>By default, this property is set to a combination of <a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetClosable</a>, <a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetMovable</a> and <a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetFloatable</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> DockWidgetFeatures </td><td class="memItemRight bottomAlign"><span class="name"><b>features</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFeatures</b></span> ( DockWidgetFeatures <i>features</i> )</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qdockwidget.html#featuresChanged">featuresChanged</a></b></span> ( QDockWidget::DockWidgetFeatures <i>features</i> )</td></tr>
</table>
<p><b>See also </b><a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetFeature</a>.</p>
<!-- @@@features -->
<!-- $$$floating-prop$$$isFloating$$$setFloatingbool -->
<h3 class="fn"><a name="floating-prop"></a><span class="name">floating</span> : <span class="type">bool</span></h3>
<p>This property holds whether the dock widget is floating.</p>
<p>A floating dock widget is presented to the user as an independent window &quot;on top&quot; of its parent <a href="qmainwindow.html">QMainWindow</a>, instead of being docked in the <a href="qmainwindow.html">QMainWindow</a>.</p>
<p>By default, this property is true.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isFloating</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFloating</b></span> ( bool <i>floating</i> )</td></tr>
</table>
<p><b>See also </b><a href="qwidget.html#isWindow">isWindow</a>().</p>
<!-- @@@floating -->
<!-- $$$windowTitle-prop$$$windowTitle$$$setWindowTitleconstQString& -->
<h3 class="fn"><a name="windowTitle-prop"></a><span class="name">windowTitle</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the dock widget title (caption).</p>
<p>By default, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qwidget.html#windowTitle-prop">windowTitle</a></b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qwidget.html#windowTitle-prop">setWindowTitle</a></b></span> ( const QString &amp; )</td></tr>
</table>
<!-- @@@windowTitle -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDockWidget[overload1]$$$QDockWidgetconstQString&QWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="QDockWidget"></a>QDockWidget::<span class="name">QDockWidget</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>title</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = 0 )</h3>
<p>Constructs a <a href="qdockwidget.html">QDockWidget</a> with parent <i>parent</i> and window flags <i>flags</i>. The dock widget will be placed in the left dock widget area.</p>
<p>The window title is set to <i>title</i>. This title is used when the <a href="qdockwidget.html">QDockWidget</a> is docked and undocked. It is also used in the context menu provided by <a href="qmainwindow.html">QMainWindow</a>.</p>
<p><b>See also </b><a href="qwidget.html#windowTitle-prop">setWindowTitle</a>().</p>
<!-- @@@QDockWidget -->
<!-- $$$QDockWidget$$$QDockWidgetQWidget*Qt::WindowFlags -->
<h3 class="fn"><a name="QDockWidget-2"></a>QDockWidget::<span class="name">QDockWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = 0 )</h3>
<p>Constructs a <a href="qdockwidget.html">QDockWidget</a> with parent <i>parent</i> and window flags <i>flags</i>. The dock widget will be placed in the left dock widget area.</p>
<!-- @@@QDockWidget -->
<!-- $$$~QDockWidget[overload1]$$$~QDockWidget -->
<h3 class="fn"><a name="dtor.QDockWidget"></a>QDockWidget::<span class="name">~QDockWidget</span> ()</h3>
<p>Destroys the dock widget.</p>
<!-- @@@~QDockWidget -->
<!-- $$$allowedAreasChanged[overload1]$$$allowedAreasChangedQt::DockWidgetAreas -->
<h3 class="fn"><a name="allowedAreasChanged"></a><span class="type">void</span> QDockWidget::<span class="name">allowedAreasChanged</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetAreas</a></span> <i>allowedAreas</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the <a href="qdockwidget.html#allowedAreas-prop">allowedAreas</a> property changes. The <i>allowedAreas</i> parameter gives the new value of the property.</p>
<!-- @@@allowedAreasChanged -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QDockWidget::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$closeEvent[overload1]$$$closeEventQCloseEvent* -->
<h3 class="fn"><a name="closeEvent"></a><span class="type">void</span> QDockWidget::<span class="name">closeEvent</span> ( <span class="type"><a href="qcloseevent.html">QCloseEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#closeEvent">QWidget::closeEvent</a>().</p>
<!-- @@@closeEvent -->
<!-- $$$dockLocationChanged[overload1]$$$dockLocationChangedQt::DockWidgetArea -->
<h3 class="fn"><a name="dockLocationChanged"></a><span class="type">void</span> QDockWidget::<span class="name">dockLocationChanged</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the dock widget is moved to another dock <i>area</i>, or is moved to a different location in its current dock area. This happens when the dock widget is moved programmatically or is dragged to a new location by the user.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@dockLocationChanged -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QDockWidget::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$featuresChanged[overload1]$$$featuresChangedQDockWidget::DockWidgetFeatures -->
<h3 class="fn"><a name="featuresChanged"></a><span class="type">void</span> QDockWidget::<span class="name">featuresChanged</span> ( <span class="type"><a href="qdockwidget.html#DockWidgetFeature-enum">QDockWidget::DockWidgetFeatures</a></span> <i>features</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the <a href="qdockwidget.html#features-prop">features</a> property changes. The <i>features</i> parameter gives the new value of the property.</p>
<!-- @@@featuresChanged -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionDockWidget* -->
<h3 class="fn"><a name="initStyleOption"></a><span class="type">void</span> QDockWidget::<span class="name">initStyleOption</span> ( <span class="type"><a href="qstyleoptiondockwidget.html">QStyleOptionDockWidget</a></span> * <i>option</i> ) const<tt> [protected]</tt></h3>
<p>Initialize <i>option</i> with the values from this <a href="qdockwidget.html">QDockWidget</a>. This method is useful for subclasses when they need a <a href="qstyleoptiondockwidget.html">QStyleOptionDockWidget</a>, but don't want to fill in all the information themselves.</p>
<p><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$isAreaAllowed[overload1]$$$isAreaAllowedQt::DockWidgetArea -->
<h3 class="fn"><a name="isAreaAllowed"></a><span class="type">bool</span> QDockWidget::<span class="name">isAreaAllowed</span> ( <span class="type"><a href="qt.html#DockWidgetArea-enum">Qt::DockWidgetArea</a></span> <i>area</i> ) const</h3>
<p>Returns true if this dock widget can be placed in the given <i>area</i>; otherwise returns false.</p>
<!-- @@@isAreaAllowed -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn"><a name="paintEvent"></a><span class="type">void</span> QDockWidget::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$setTitleBarWidget[overload1]$$$setTitleBarWidgetQWidget* -->
<h3 class="fn"><a name="setTitleBarWidget"></a><span class="type">void</span> QDockWidget::<span class="name">setTitleBarWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3>
<p>Sets an arbitrary <i>widget</i> as the dock widget's title bar. If <i>widget</i> is 0, any custom title bar widget previously set on the dock widget is removed, but not deleted, and the default title bar will be used instead.</p>
<p>If a title bar widget is set, <a href="qdockwidget.html">QDockWidget</a> will not use native window decorations when it is floated.</p>
<p>Here are some tips for implementing custom title bars:</p>
<ul>
<li>Mouse events that are not explicitly handled by the title bar widget must be ignored by calling <a href="qevent.html#ignore">QMouseEvent::ignore</a>(). These events then propagate to the <a href="qdockwidget.html">QDockWidget</a> parent, which handles them in the usual manner, moving when the title bar is dragged, docking and undocking when it is double-clicked, etc.</li>
<li>When <a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetVerticalTitleBar</a> is set on <a href="qdockwidget.html">QDockWidget</a>, the title bar widget is repositioned accordingly. In <a href="qwidget.html#resizeEvent">resizeEvent</a>(), the title bar should check what orientation it should assume:<pre class="cpp"> <span class="type"><a href="qdockwidget.html">QDockWidget</a></span> <span class="operator">*</span>dockWidget <span class="operator">=</span> qobject_cast<span class="operator">&lt;</span><span class="type"><a href="qdockwidget.html">QDockWidget</a></span><span class="operator">*</span><span class="operator">&gt;</span>(parentWidget());
 <span class="keyword">if</span> (dockWidget<span class="operator">-</span><span class="operator">&gt;</span>features() <span class="operator">&amp;</span> <span class="type"><a href="qdockwidget.html">QDockWidget</a></span><span class="operator">::</span>DockWidgetVerticalTitleBar) {
     <span class="comment">// I need to be vertical</span>
 } <span class="keyword">else</span> {
     <span class="comment">// I need to be horizontal</span>
 }</pre>
</li>
<li>The title bar widget must have a valid <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>() and <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>(). These functions should take into account the current orientation of the title bar.</li>
<li>It is not possible to remove a title bar from a dock widget. However, a similar effect can be achieved by setting a default constructed <a href="qwidget.html">QWidget</a> as the title bar widget.</li>
</ul>
<p>Using <a href="qobject.html#qobject_cast">qobject_cast</a>() as shown above, the title bar widget has full access to its parent <a href="qdockwidget.html">QDockWidget</a>. Hence it can perform such operations as docking and hiding in response to user actions.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qdockwidget.html#titleBarWidget">titleBarWidget</a>() and <a href="qdockwidget.html#DockWidgetFeature-enum">DockWidgetVerticalTitleBar</a>.</p>
<!-- @@@setTitleBarWidget -->
<!-- $$$setWidget[overload1]$$$setWidgetQWidget* -->
<h3 class="fn"><a name="setWidget"></a><span class="type">void</span> QDockWidget::<span class="name">setWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i> )</h3>
<p>Sets the widget for the dock widget to <i>widget</i>.</p>
<p>If the dock widget is visible when <i>widget</i> is added, you must <a href="qwidget.html#show">show()</a> it explicitly.</p>
<p>Note that you must add the layout of the <i>widget</i> before you call this function; if not, the <i>widget</i> will not be visible.</p>
<p><b>See also </b><a href="qdockwidget.html#widget">widget</a>().</p>
<!-- @@@setWidget -->
<!-- $$$titleBarWidget[overload1]$$$titleBarWidget -->
<h3 class="fn"><a name="titleBarWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QDockWidget::<span class="name">titleBarWidget</span> () const</h3>
<p>Returns the custom title bar widget set on the <a href="qdockwidget.html">QDockWidget</a>, or 0 if no custom title bar has been set.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qdockwidget.html#setTitleBarWidget">setTitleBarWidget</a>().</p>
<!-- @@@titleBarWidget -->
<!-- $$$toggleViewAction[overload1]$$$toggleViewAction -->
<h3 class="fn"><a name="toggleViewAction"></a><span class="type"><a href="qaction.html">QAction</a></span> * QDockWidget::<span class="name">toggleViewAction</span> () const</h3>
<p>Returns a checkable action that can be used to show or close this dock widget.</p>
<p>The action's text is set to the dock widget's window title.</p>
<p><b>See also </b><a href="qaction.html#text-prop">QAction::text</a> and <a href="qwidget.html#windowTitle-prop">QWidget::windowTitle</a>.</p>
<!-- @@@toggleViewAction -->
<!-- $$$topLevelChanged[overload1]$$$topLevelChangedbool -->
<h3 class="fn"><a name="topLevelChanged"></a><span class="type">void</span> QDockWidget::<span class="name">topLevelChanged</span> ( <span class="type">bool</span> <i>topLevel</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the <a href="qdockwidget.html#floating-prop">floating</a> property changes. The <i>topLevel</i> parameter is true if the dock widget is now floating; otherwise it is false.</p>
<p><b>See also </b><a href="qwidget.html#isWindow">isWindow</a>().</p>
<!-- @@@topLevelChanged -->
<!-- $$$visibilityChanged[overload1]$$$visibilityChangedbool -->
<h3 class="fn"><a name="visibilityChanged"></a><span class="type">void</span> QDockWidget::<span class="name">visibilityChanged</span> ( <span class="type">bool</span> <i>visible</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when the dock widget becomes <i>visible</i> (or invisible). This happens when the widget is hidden or shown, as well as when it is docked in a tabbed dock area and its tab becomes selected or unselected.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@visibilityChanged -->
<!-- $$$widget[overload1]$$$widget -->
<h3 class="fn"><a name="widget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QDockWidget::<span class="name">widget</span> () const</h3>
<p>Returns the widget for the dock widget. This function returns zero if the widget has not been set.</p>
<p><b>See also </b><a href="qdockwidget.html#setWidget">setWidget</a>().</p>
<!-- @@@widget -->
</div>
  <div class="ft">
    <span></span>
  </div>
</div> 
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2012 Nokia Corporation and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Nokia, Qt and their respective logos are trademarks of Nokia Corporation 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>