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

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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qgraphicswidget.cpp -->
<head>
  <title>Qt 4.6: QGraphicsWidget Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsWidget" />
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<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>
<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>
</tr></table><h1 class="title">QGraphicsWidget Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QGraphicsWidget class is the base class for all widget items in a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsWidget&gt;</pre><p>Inherits <a href="qgraphicsobject.html">QGraphicsObject</a> and <a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a>.</p>
<p>Inherited by <a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a> and <a href="qgraphicswebview.html">QGraphicsWebView</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qgraphicswidget-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="properties"></a>
<h2>Properties</h2>
<p><table class="propsummary" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="45%" valign="top"><ul>
<li><div class="fn"><b><a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a></b> : Qt::FocusPolicy</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#font-prop">font</a></b> : QFont</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#geometry-prop">geometry</a></b> : QRectF</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection</a></b> : Qt::LayoutDirection</div></li>
</ul></td><td valign="top"><ul>
<li><div class="fn"><b><a href="qgraphicswidget.html#palette-prop">palette</a></b> : QPalette</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#size-prop">size</a></b> : QSizeF</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a></b> : Qt::WindowFlags</div></li>
<li><div class="fn"><b><a href="qgraphicswidget.html#windowTitle-prop">windowTitle</a></b> : QString</div></li>
</ul>
</td></tr>
</table></p>
<ul>
<li><div bar="2" class="fn"></div>12 properties inherited from <a href="qgraphicsobject.html#properties">QGraphicsObject</a></li>
<li><div bar="2" class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#QGraphicsWidget">QGraphicsWidget</a></b> ( QGraphicsItem * <i>parent</i> = 0, Qt::WindowFlags <i>wFlags</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#dtor.QGraphicsWidget">~QGraphicsWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QList&lt;QAction *&gt; </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#actions">actions</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#addAction">addAction</a></b> ( QAction * <i>action</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#addActions">addActions</a></b> ( QList&lt;QAction *&gt; <i>actions</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#adjustSize">adjustSize</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::FocusPolicy </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QGraphicsWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusWidget">focusWidget</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QFont </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#font-prop">font</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a></b> ( qreal * <i>left</i>, qreal * <i>top</i>, qreal * <i>right</i>, qreal * <i>bottom</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#grabShortcut">grabShortcut</a></b> ( const QKeySequence &amp; <i>sequence</i>, Qt::ShortcutContext <i>context</i> = Qt::WindowShortcut )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#insertAction">insertAction</a></b> ( QAction * <i>before</i>, QAction * <i>action</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#insertActions">insertActions</a></b> ( QAction * <i>before</i>, QList&lt;QAction *&gt; <i>actions</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#isActiveWindow">isActiveWindow</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QGraphicsLayout * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#layout">layout</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::LayoutDirection </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#paintWindowFrame">paintWindowFrame</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QPalette </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#palette-prop">palette</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#rect">rect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a></b> ( int <i>id</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#removeAction">removeAction</a></b> ( QAction * <i>action</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#size-prop">resize</a></b> ( const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#size-prop">resize</a></b> ( qreal <i>w</i>, qreal <i>h</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setAttribute">setAttribute</a></b> ( Qt::WidgetAttribute <i>attribute</i>, bool <i>on</i> = true )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setContentsMargins">setContentsMargins</a></b> ( qreal <i>left</i>, qreal <i>top</i>, qreal <i>right</i>, qreal <i>bottom</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusPolicy-prop">setFocusPolicy</a></b> ( Qt::FocusPolicy <i>policy</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#font-prop">setFont</a></b> ( const QFont &amp; <i>font</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#geometry-prop">setGeometry</a></b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setLayout">setLayout</a></b> ( QGraphicsLayout * <i>layout</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#layoutDirection-prop">setLayoutDirection</a></b> ( Qt::LayoutDirection <i>direction</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#palette-prop">setPalette</a></b> ( const QPalette &amp; <i>palette</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setShortcutAutoRepeat">setShortcutAutoRepeat</a></b> ( int <i>id</i>, bool <i>enabled</i> = true )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a></b> ( int <i>id</i>, bool <i>enabled</i> = true )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setStyle">setStyle</a></b> ( QStyle * <i>style</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFlags-prop">setWindowFlags</a></b> ( Qt::WindowFlags <i>wFlags</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a></b> ( qreal <i>left</i>, qreal <i>top</i>, qreal <i>right</i>, qreal <i>bottom</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowTitle-prop">setWindowTitle</a></b> ( const QString &amp; <i>title</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#size-prop">size</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QStyle * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#style">style</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#testAttribute">testAttribute</a></b> ( Qt::WidgetAttribute <i>attribute</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#layoutDirection-prop">unsetLayoutDirection</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#unsetWindowFrameMargins">unsetWindowFrameMargins</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::WindowFlags </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowTitle-prop">windowTitle</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Qt::WindowType </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowType">windowType</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#getContentsMargins">getContentsMargins</a></b> ( qreal * <i>left</i>, qreal * <i>top</i>, qreal * <i>right</i>, qreal * <i>bottom</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#geometry-prop">setGeometry</a></b> ( const QRectF &amp; <i>rect</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QPainterPath </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#shape">shape</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#type">type</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 public function inherited from <a href="qgraphicsobject.html#public-functions">QGraphicsObject</a></li>
<li><div bar="2" class="fn"></div>35 public functions inherited from <a href="qgraphicslayoutitem.html#public-functions">QGraphicsLayoutItem</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>177 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#close">close</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#setTabOrder">setTabOrder</a></b> ( QGraphicsWidget * <i>first</i>, QGraphicsWidget * <i>second</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div bar="2" class="fn"></div>1 static public member inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
</ul>
<hr />
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#changeEvent">changeEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#closeEvent">closeEvent</a></b> ( QCloseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusNextPrevChild">focusNextPrevChild</a></b> ( bool <i>next</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#grabKeyboardEvent">grabKeyboardEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#grabMouseEvent">grabMouseEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#hideEvent">hideEvent</a></b> ( QHideEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#initStyleOption">initStyleOption</a></b> ( QStyleOption * <i>option</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#moveEvent">moveEvent</a></b> ( QGraphicsSceneMoveEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#polishEvent">polishEvent</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#resizeEvent">resizeEvent</a></b> ( QGraphicsSceneResizeEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#showEvent">showEvent</a></b> ( QShowEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#ungrabKeyboardEvent">ungrabKeyboardEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#ungrabMouseEvent">ungrabMouseEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFrameEvent">windowFrameEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual Qt::WindowFrameSection </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#windowFrameSectionAt">windowFrameSectionAt</a></b> ( const QPointF &amp; <i>pos</i> ) const</td></tr>
</table>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#hoverLeaveEvent">hoverLeaveEvent</a></b> ( QGraphicsSceneHoverEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#hoverMoveEvent">hoverMoveEvent</a></b> ( QGraphicsSceneHoverEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#itemChange">itemChange</a></b> ( GraphicsItemChange <i>change</i>, const QVariant &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#sceneEvent">sceneEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#sizeHint">sizeHint</a></b> ( Qt::SizeHint <i>which</i>, const QSizeF &amp; <i>constraint</i> = QSizeF() ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicswidget.html#updateGeometry">updateGeometry</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>9 signals inherited from <a href="qgraphicsobject.html#signals">QGraphicsObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QGraphicsWidget class is the base class for all widget items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>QGraphicsWidget is an extended base item that provides extra functionality over <a href="qgraphicsitem.html">QGraphicsItem</a>. It is similar to <a href="qwidget.html">QWidget</a> in many ways:</p>
<ul>
<li>Provides a <a href="qgraphicswidget.html#palette-prop">palette</a>, a <a href="qgraphicswidget.html#font-prop">font</a> and a <a href="qgraphicswidget.html#style">style</a>().</li>
<li>Has a defined <a href="qgraphicslayoutitem.html#geometry">geometry</a>().</li>
<li>Supports layouts with <a href="qgraphicswidget.html#setLayout">setLayout</a>() and <a href="qgraphicswidget.html#layout">layout</a>().</li>
<li>Supports shortcuts and actions with <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>() and <a href="qgraphicswidget.html#insertAction">insertAction</a>()</li>
</ul>
<p>Unlike <a href="qgraphicsitem.html">QGraphicsItem</a>, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.</p>
<p>QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g&#x2e;, tab focus and activation, or layouts.</p>
<p>Since QGraphicsWidget resembles <a href="qwidget.html">QWidget</a> and has similar API, it is easier to port a widget from <a href="qwidget.html">QWidget</a> to QGraphicsWidget, instead of <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p><b>Note:</b> <a href="qwidget.html">QWidget</a>-based widgets can be directly embedded into a <a href="qgraphicsscene.html">QGraphicsScene</a> using <a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a>.</p>
<p>Noticeable differences between QGraphicsWidget and <a href="qwidget.html">QWidget</a> are:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>QGraphicsWidget</th><th><a href="qwidget.html">QWidget</a></th></tr></thead>
<tr valign="top" class="odd"><td>Coordinates and geometry are defined with qreals (doubles or floats, depending on the platform).</td><td><a href="qwidget.html">QWidget</a> uses integer geometry (<a href="qpoint.html">QPoint</a>, <a href="qrect.html">QRect</a>).</td></tr>
<tr valign="top" class="even"><td>The widget is already visible by default; you do not have to call <a href="qgraphicsitem.html#show">show</a>() to display the widget.</td><td><a href="qwidget.html">QWidget</a> is hidden by default until you call <a href="qgraphicsitem.html#show">show</a>().</td></tr>
<tr valign="top" class="odd"><td>A subset of widget attributes are supported.</td><td>All widget attributes are supported.</td></tr>
<tr valign="top" class="even"><td>A top-level item's style defaults to QGraphicsScene::style</td><td>A top-level widget's style defaults to QApplication::style</td></tr>
<tr valign="top" class="odd"><td>Graphics View provides a custom drag and drop framework, different from <a href="qwidget.html">QWidget</a>.</td><td>Standard drag and drop framework.</td></tr>
<tr valign="top" class="even"><td>Widget items do not support modality.</td><td>Full modality support.</td></tr>
</table></p>
<p>QGraphicsWidget supports a subset of Qt's widget attributes, (<a href="qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a>), as shown in the table below. Any attributes not listed in this table are unsupported, or otherwise unused.</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Widget Attribute</th><th>Usage</th></tr></thead>
<tr valign="top" class="odd"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_SetLayoutDirection</a></td><td>Set by <a href="qgraphicswidget.html#layoutDirection-prop">setLayoutDirection</a>(), cleared by <a href="qgraphicswidget.html#layoutDirection-prop">unsetLayoutDirection</a>(). You can test this attribute to check if the widget has been explicitly assigned a <a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection</a>. If the attribute is not set, the <a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection()</a> is inherited.</td></tr>
<tr valign="top" class="even"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_RightToLeft</a></td><td>Toggled by <a href="qgraphicswidget.html#layoutDirection-prop">setLayoutDirection</a>(). Inherited from the parent/scene. If set, the widget's layout will order horizontally arranged widgets from right to left.</td></tr>
<tr valign="top" class="odd"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_SetStyle</a></td><td>Set and cleared by <a href="qgraphicswidget.html#setStyle">setStyle</a>(). If this attribute is set, the widget has been explicitly assigned a style. If it is unset, the widget will use the scene's or the application's style.</td></tr>
<tr valign="top" class="even"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_Resized</a></td><td>Set by <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</td></tr>
<tr valign="top" class="odd"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_SetPalette</a></td><td>Set by <a href="qgraphicswidget.html#palette-prop">setPalette</a>().</td></tr>
<tr valign="top" class="even"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_SetFont</a></td><td>Set by <a href="qgraphicswidget.html#palette-prop">setPalette</a>().</td></tr>
<tr valign="top" class="odd"><td><a href="qt.html#WidgetAttribute-enum">Qt::WA_WindowPropagation</a></td><td>Enables propagation to window widgets.</td></tr>
</table></p>
<p>Although QGraphicsWidget inherits from both <a href="qobject.html">QObject</a> and <a href="qgraphicsitem.html">QGraphicsItem</a>, you should use the functions provided by <a href="qgraphicsitem.html">QGraphicsItem</a>, <i>not</i> <a href="qobject.html">QObject</a>, to manage the relationships between parent and child items. These functions control the stacking order of items as well as their ownership.</p>
<p><b>Note:</b> The <a href="qobject.html#parent">QObject::parent</a>() should always return 0 for QGraphicsWidgets, but this policy is not strictly defined.</p>
<p>See also <a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a>, <a href="qgraphicsitem.html">QGraphicsItem</a>, and <a href="widgets-and-layouts.html">Widgets and Layouts</a>.</p>
<hr />
<h2>Property Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/focusPolicy" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setFocusPolicy" />
<h3 class="fn"><a name="focusPolicy-prop"></a>focusPolicy : <a href="qt.html#FocusPolicy-enum">Qt::FocusPolicy</a></h3>
<p>This property holds the way the widget accepts keyboard focus.</p>
<p>The focus policy is <a href="qt.html#FocusPolicy-enum">Qt::TabFocus</a> if the widget accepts keyboard focus by tabbing, <a href="qt.html#FocusPolicy-enum">Qt::ClickFocus</a> if the widget accepts focus by clicking, <a href="qt.html#FocusPolicy-enum">Qt::StrongFocus</a> if it accepts both, and <a href="qt.html#FocusPolicy-enum">Qt::NoFocus</a> (the default) if it does not accept focus at all.</p>
<p>You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the <a href="qlineedit.html">QLineEdit</a> constructor calls setFocusPolicy(<a href="qt.html#FocusPolicy-enum">Qt::StrongFocus</a>).</p>
<p>If you enable a focus policy (i.e&#x2e;, not <a href="qt.html#FocusPolicy-enum">Qt::NoFocus</a>), <a href="qgraphicswidget.html">QGraphicsWidget</a> will automatically enable the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag. Setting <a href="qt.html#FocusPolicy-enum">Qt::NoFocus</a> on a widget will clear the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag. If the widget currently has keyboard focus, the widget will automatically lose focus.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">Qt::FocusPolicy </td><td class="memItemRight" valign="bottom"><b>focusPolicy</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setFocusPolicy</b> ( Qt::FocusPolicy <i>policy</i> )</td></tr>
</table>
<p>See also <a href="qgraphicswidget.html#focusInEvent">focusInEvent</a>(), <a href="qgraphicswidget.html#focusOutEvent">focusOutEvent</a>(), <a href="qgraphicsitem.html#keyPressEvent">keyPressEvent</a>(), <a href="qgraphicsitem.html#keyReleaseEvent">keyReleaseEvent</a>(), and <a href="qgraphicsobject.html#enabled-prop">enabled</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/font" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setFont" />
<h3 class="fn"><a name="font-prop"></a>font : <a href="qfont.html">QFont</a></h3>
<p>This property holds the widgets' font.</p>
<p>This property provides the widget's font.</p>
<p><a href="qfont.html">QFont</a> consists of font properties that have been explicitly defined and properties implicitly inherited from the widget's parent. Hence, font() can return a different font compared to the one set with setFont(). This scheme allows you to define single entries in a font without affecting the font's inherited entries.</p>
<p>When a widget's font changes, it resolves its entries against its parent widget. If the widget does not have a parent widget, it resolves its entries against the scene. The widget then sends itself a <a href="qevent.html#Type-enum">FontChange</a> event and notifies all its descendants so that they can resolve their fonts as well.</p>
<p>By default, this property contains the application's default font.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QFont </td><td class="memItemRight" valign="bottom"><b>font</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setFont</b> ( const QFont &amp; <i>font</i> )</td></tr>
</table>
<p>See also <a href="qapplication.html#font">QApplication::font</a>(), <a href="qgraphicsscene.html#font-prop">QGraphicsScene::font</a>, and <a href="qfont.html#resolve">QFont::resolve</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setGeometry" />
<h3 class="fn"><a name="geometry-prop"></a>geometry : <a href="qrectf.html">QRectF</a></h3>
<p>This property holds the geometry of the widget.</p>
<p>Sets the item's geometry to <i>rect</i>. The item's position and size are modified as a result of calling this function. The item is first moved, then resized.</p>
<p>A side effect of calling this function is that the widget will receive a move event and a resize event. Also, if the widget has a layout assigned, the layout will activate.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b>setGeometry</b> ( const QRectF &amp; <i>rect</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setGeometry</b> ( qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i> )</td></tr>
</table>
<p>See also <a href="qgraphicslayoutitem.html#geometry">geometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/layoutDirection" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setLayoutDirection" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/unsetLayoutDirection" />
<h3 class="fn"><a name="layoutDirection-prop"></a>layoutDirection : <a href="qt.html#LayoutDirection-enum">Qt::LayoutDirection</a></h3>
<p>This property holds the layout direction for this widget.</p>
<p>This property modifies this widget's and all of its descendants' <a href="qt.html#WidgetAttribute-enum">Qt::WA_RightToLeft</a> attribute. It also sets this widget's <a href="qt.html#WidgetAttribute-enum">Qt::WA_SetLayoutDirection</a> attribute.</p>
<p>The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With <a href="qt.html#LayoutDirection-enum">Qt::LeftToRight</a>, the layout starts placing subwidgets from the left side of this widget towards the right. <a href="qt.html#LayoutDirection-enum">Qt::RightToLeft</a> does the opposite - the layout will place widgets starting from the right edge moving towards the left.</p>
<p>Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a <a href="qevent.html#Type-enum">LayoutDirectionChange</a> event, and then propagate the new layout direction to all its descendants.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">Qt::LayoutDirection </td><td class="memItemRight" valign="bottom"><b>layoutDirection</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setLayoutDirection</b> ( Qt::LayoutDirection <i>direction</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>unsetLayoutDirection</b> ()</td></tr>
</table>
<p>See also <a href="qwidget.html#layoutDirection-prop">QWidget::layoutDirection</a> and <a href="qapplication.html#layoutDirection-prop">QApplication::layoutDirection</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/palette" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setPalette" />
<h3 class="fn"><a name="palette-prop"></a>palette : <a href="qpalette.html">QPalette</a></h3>
<p>This property holds the widget's palette.</p>
<p>This property provides the widget's palette. The palette provides colors and brushes for color groups (e.g&#x2e;, <a href="qpalette.html#ColorRole-enum">QPalette::Button</a>) and states (e.g&#x2e;, <a href="qpalette.html#ColorGroup-enum">QPalette::Inactive</a>), loosely defining the general look of the widget and its children.</p>
<p><a href="qpalette.html">QPalette</a> consists of color groups that have been explicitly defined, and groups that are implicitly inherited from the widget's parent. Because of this, palette() can return a different palette than what has been set with setPalette(). This scheme allows you to define single entries in a palette without affecting the palette's inherited entries.</p>
<p>When a widget's palette changes, it resolves its entries against its parent widget, or if it doesn't have a parent widget, it resolves against the scene. It then sends itself a <a href="qevent.html#Type-enum">PaletteChange</a> event, and notifies all its descendants so they can resolve their palettes as well.</p>
<p>By default, this property contains the application's default palette.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QPalette </td><td class="memItemRight" valign="bottom"><b>palette</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setPalette</b> ( const QPalette &amp; <i>palette</i> )</td></tr>
</table>
<p>See also <a href="qapplication.html#palette">QApplication::palette</a>(), <a href="qgraphicsscene.html#palette-prop">QGraphicsScene::palette</a>, and <a href="qpalette.html#resolve">QPalette::resolve</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/size" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/resize" />
<h3 class="fn"><a name="size-prop"></a>size : <a href="qsizef.html">QSizeF</a></h3>
<p>This property holds the size of the widget.</p>
<p>Calling resize() resizes the widget to a <i>size</i> bounded by <a href="qgraphicslayoutitem.html#minimumSize">minimumSize</a>() and <a href="qgraphicslayoutitem.html#maximumSize">maximumSize</a>(). This property only affects the widget's width and height (e.g&#x2e;, its right and bottom edges); the widget's position and top-left corner remains unaffected.</p>
<p>Resizing a widget triggers the widget to immediately receive a <a href="qevent.html#Type-enum">GraphicsSceneResize</a> event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.</p>
<p>This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g&#x2e;, it has a parent widget with a layout assigned, that layout will not activate.</p>
<p>By default, this property contains a size with zero width and height.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QSizeF </td><td class="memItemRight" valign="bottom"><b>size</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>resize</b> ( const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>resize</b> ( qreal <i>w</i>, qreal <i>h</i> )</td></tr>
</table>
<p>See also <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>(), <a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a>, and <a href="qgraphicslayout.html">QGraphicsLayout</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowFlags" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setWindowFlags" />
<h3 class="fn"><a name="windowFlags-prop"></a>windowFlags : <a href="qt.html#WindowType-enum">Qt::WindowFlags</a></h3>
<p>This property holds the widget's window flags.</p>
<p>Window flags are a combination of a window type (e.g&#x2e;, <a href="qt.html#WindowType-enum">Qt::Dialog</a>) and several flags giving hints on the behavior of the window. The behavior is platform-dependent.</p>
<p>By default, this property contains no window flags.</p>
<p>Windows are panels. If you set the <a href="qt.html#WindowType-enum">Qt::Window</a> flag, the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a> flag will be set automatically. If you clear the <a href="qt.html#WindowType-enum">Qt::Window</a> flag, the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a> flag is also cleared. Note that the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsPanel</a> flag can be set independently of <a href="qt.html#WindowType-enum">Qt::Window</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">Qt::WindowFlags </td><td class="memItemRight" valign="bottom"><b>windowFlags</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setWindowFlags</b> ( Qt::WindowFlags <i>wFlags</i> )</td></tr>
</table>
<p>See also <a href="qgraphicsitem.html#isWindow">isWindow</a>() and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowTitle" />
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setWindowTitle" />
<h3 class="fn"><a name="windowTitle-prop"></a>windowTitle : <a href="qstring.html">QString</a></h3>
<p>This property holds this property holds the window title (caption).</p>
<p>This property is only used for windows.</p>
<p>By default, if no title has been set, this property contains an empty string.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QString </td><td class="memItemRight" valign="bottom"><b>windowTitle</b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b>setWindowTitle</b> ( const QString &amp; <i>title</i> )</td></tr>
</table>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/QGraphicsWidget" />
<h3 class="fn"><a name="QGraphicsWidget"></a>QGraphicsWidget::QGraphicsWidget ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0, <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>wFlags</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicswidget.html">QGraphicsWidget</a> instance. The optional <i>parent</i> argument is passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor. The optional <i>wFlags</i> argument specifies the widget's window flags (e.g&#x2e;, whether the widget should be a window, a tool, a popup, etc).</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/~QGraphicsWidget" />
<h3 class="fn"><a name="dtor.QGraphicsWidget"></a>QGraphicsWidget::~QGraphicsWidget ()</h3>
<p>Destroys the <a href="qgraphicswidget.html">QGraphicsWidget</a> instance.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/actions" />
<h3 class="fn"><a name="actions"></a><a href="qlist.html">QList</a>&lt;<a href="qaction.html">QAction</a> *&gt; QGraphicsWidget::actions () const</h3>
<p>Returns the (possibly empty) list of this widget's actions.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#insertAction">insertAction</a>(), <a href="qgraphicswidget.html#removeAction">removeAction</a>(), <a href="qwidget.html#actions">QWidget::actions</a>(), <a href="qaction.html#associatedWidgets">QAction::associatedWidgets</a>(), and <a href="qaction.html#associatedGraphicsWidgets">QAction::associatedGraphicsWidgets</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/addAction" />
<h3 class="fn"><a name="addAction"></a>void QGraphicsWidget::addAction ( <a href="qaction.html">QAction</a> * <i>action</i> )</h3>
<p>Appends the action <i>action</i> to this widget's list of actions.</p>
<p>All QGraphicsWidgets have a list of <a href="qaction.html">QAction</a>s, however they can be represented graphically in many different ways. The default use of the <a href="qaction.html">QAction</a> list (as returned by <a href="qgraphicswidget.html#actions">actions</a>()) is to create a context <a href="qmenu.html">QMenu</a>.</p>
<p>A <a href="qgraphicswidget.html">QGraphicsWidget</a> should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#removeAction">removeAction</a>(), <a href="qgraphicswidget.html#insertAction">insertAction</a>(), <a href="qgraphicswidget.html#actions">actions</a>(), and <a href="qwidget.html#addAction">QWidget::addAction</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/addActions" />
<h3 class="fn"><a name="addActions"></a>void QGraphicsWidget::addActions ( <a href="qlist.html">QList</a>&lt;<a href="qaction.html">QAction</a> *&gt; <i>actions</i> )</h3>
<p>Appends the actions <i>actions</i> to this widget's list of actions.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#removeAction">removeAction</a>(), <a href="qmenu.html">QMenu</a>, <a href="qgraphicswidget.html#addAction">addAction</a>(), and <a href="qwidget.html#addActions">QWidget::addActions</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/adjustSize" />
<h3 class="fn"><a name="adjustSize"></a>void QGraphicsWidget::adjustSize ()</h3>
<p>Adjusts the size of the widget to its effective preferred size hint.</p>
<p>This function is called implicitly when the item is shown for the first time.</p>
<p>See also <a href="qgraphicslayoutitem.html#effectiveSizeHint">effectiveSizeHint</a>() and <a href="qt.html#SizeHint-enum">Qt::MinimumSize</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/boundingRect" />
<h3 class="fn"><a name="boundingRect"></a><a href="qrectf.html">QRectF</a> QGraphicsWidget::boundingRect () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem::boundingRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/changeEvent" />
<h3 class="fn"><a name="changeEvent"></a>void QGraphicsWidget::changeEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler can be reimplemented to handle state changes.</p>
<p>The state being changed in this event can be retrieved through <i>event</i>.</p>
<p>Change events include: <a href="qevent.html#Type-enum">QEvent::ActivationChange</a>, <a href="qevent.html#Type-enum">QEvent::EnabledChange</a>, <a href="qevent.html#Type-enum">QEvent::FontChange</a>, <a href="qevent.html#Type-enum">QEvent::StyleChange</a>, <a href="qevent.html#Type-enum">QEvent::PaletteChange</a>, <a href="qevent.html#Type-enum">QEvent::ParentChange</a>, <a href="qevent.html#Type-enum">QEvent::LayoutDirectionChange</a>, and <a href="qevent.html#Type-enum">QEvent::ContentsRectChange</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/close" />
<h3 class="fn"><a name="close"></a>bool QGraphicsWidget::close ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Call this function to close the widget.</p>
<p>Returns true if the widget was closed; otherwise returns false. This slot will first send a <a href="qcloseevent.html">QCloseEvent</a> to the widget, which may or may not accept the event. If the event was ignored, nothing happens. If the event was accepted, it will <a href="qgraphicsitem.html#hide">hide</a>() the widget.</p>
<p>If the widget has the <a href="qt.html#WidgetAttribute-enum">Qt::WA_DeleteOnClose</a> attribute set it will be deleted.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/closeEvent" />
<h3 class="fn"><a name="closeEvent"></a>void QGraphicsWidget::closeEvent ( <a href="qcloseevent.html">QCloseEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive widget close events. The default implementation accepts the event.</p>
<p>See also <a href="qgraphicswidget.html#close">close</a>() and <a href="qcloseevent.html">QCloseEvent</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/event" />
<h3 class="fn"><a name="event"></a>bool QGraphicsWidget::event ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<p>Handles the <i>event</i>. <a href="qgraphicswidget.html">QGraphicsWidget</a> handles the following events:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td>Polish</td><td>Delivered to the widget some time after it has been shown.</td></tr>
<tr valign="top" class="even"><td>GraphicsSceneMove</td><td>Delivered to the widget after its local position has changed.</td></tr>
<tr valign="top" class="odd"><td>GraphicsSceneResize</td><td>Delivered to the widget after its size has changed.</td></tr>
<tr valign="top" class="even"><td>Show</td><td>Delivered to the widget before it has been shown.</td></tr>
<tr valign="top" class="odd"><td>Hide</td><td>Delivered to the widget after it has been hidden.</td></tr>
<tr valign="top" class="even"><td>PaletteChange</td><td>Delivered to the widget after its palette has changed.</td></tr>
<tr valign="top" class="odd"><td>FontChange</td><td>Delivered to the widget after its font has changed.</td></tr>
<tr valign="top" class="even"><td>EnabledChange</td><td>Delivered to the widget after its enabled state has changed.</td></tr>
<tr valign="top" class="odd"><td>StyleChange</td><td>Delivered to the widget after its style has changed.</td></tr>
<tr valign="top" class="even"><td>LayoutDirectionChange</td><td>Delivered to the widget after its layout direction has changed.</td></tr>
<tr valign="top" class="odd"><td>ContentsRectChange</td><td>Delivered to the widget after its contents margins/ contents rect has changed.</td></tr>
</table></p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/focusInEvent" />
<h3 class="fn"><a name="focusInEvent"></a>void QGraphicsWidget::focusInEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusInEvent">QGraphicsItem::focusInEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/focusNextPrevChild" />
<h3 class="fn"><a name="focusNextPrevChild"></a>bool QGraphicsWidget::focusNextPrevChild ( bool <i>next</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget; returns false otherwise. If <i>next</i> is true, this function searches forward; if <i>next</i> is false, it searches backward.</p>
<p>Sometimes, you will want to reimplement this function to provide special focus handling for your widget and its subwidgets. For example, a web browser might reimplement it to move its current active link forward or backward, and call the base implementation only when it reaches the last or first link on the page.</p>
<p>Child widgets call focusNextPrevChild() on their parent widgets, but only the window that contains the child widgets decides where to redirect focus. By reimplementing this function for an object, you gain control of focus traversal for all child widgets.</p>
<p>See also <a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/focusOutEvent" />
<h3 class="fn"><a name="focusOutEvent"></a>void QGraphicsWidget::focusOutEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem::focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/focusWidget" />
<h3 class="fn"><a name="focusWidget"></a>QGraphicsWidget * QGraphicsWidget::focusWidget () const</h3>
<p>If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget. If no descendant widget has input focus, 0 is returned.</p>
<p>See also <a href="qgraphicsitem.html#focusItem">QGraphicsItem::focusItem</a>() and <a href="qwidget.html#focusWidget">QWidget::focusWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/getContentsMargins" />
<h3 class="fn"><a name="getContentsMargins"></a>void QGraphicsWidget::getContentsMargins ( <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>left</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>top</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>right</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>bottom</i> ) const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#getContentsMargins">QGraphicsLayoutItem::getContentsMargins</a>().</p>
<p>Gets the widget's contents margins. The margins are stored in <i>left</i>, <i>top</i>, <i>right</i> and <i>bottom</i>, as pointers to qreals. Each argument can be <i>omitted</i> by passing 0.</p>
<p>See also <a href="qgraphicswidget.html#setContentsMargins">setContentsMargins</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/getWindowFrameMargins" />
<h3 class="fn"><a name="getWindowFrameMargins"></a>void QGraphicsWidget::getWindowFrameMargins ( <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>left</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>top</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>right</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> * <i>bottom</i> ) const</h3>
<p>Gets the widget's window frame margins. The margins are stored in <i>left</i>, <i>top</i>, <i>right</i> and <i>bottom</i> as pointers to qreals. Each argument can be <i>omitted</i> by passing 0.</p>
<p>See also <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>() and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/grabKeyboardEvent" />
<h3 class="fn"><a name="grabKeyboardEvent"></a>void QGraphicsWidget::grabKeyboardEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for Qt::GrabKeyboard events.</p>
<p>See also <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>() and <a href="qgraphicsitem.html#grabMouse">grabMouse</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/grabMouseEvent" />
<h3 class="fn"><a name="grabMouseEvent"></a>void QGraphicsWidget::grabMouseEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for Qt::GrabMouse events.</p>
<p>See also <a href="qgraphicsitem.html#grabMouse">grabMouse</a>() and <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/grabShortcut" />
<h3 class="fn"><a name="grabShortcut"></a>int QGraphicsWidget::grabShortcut ( const <a href="qkeysequence.html">QKeySequence</a> &amp; <i>sequence</i>, <a href="qt.html#ShortcutContext-enum">Qt::ShortcutContext</a> <i>context</i> = Qt::WindowShortcut )</h3>
<p>Adds a shortcut to Qt's shortcut system that watches for the given key <i>sequence</i> in the given <i>context</i>. If the <i>context</i> is <a href="qt.html#ShortcutContext-enum">Qt::ApplicationShortcut</a>, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, <a href="qt.html#ShortcutContext-enum">Qt::WidgetShortcut</a>, or to the window itself, <a href="qt.html#ShortcutContext-enum">Qt::WindowShortcut</a>. For widgets that are not part of a window (i.e&#x2e;, top-level widgets and their children), <a href="qt.html#ShortcutContext-enum">Qt::WindowShortcut</a> shortcuts apply to the scene.</p>
<p>If the same key <i>sequence</i> has been grabbed by several widgets, when the key <i>sequence</i> occurs a <a href="qevent.html#Type-enum">QEvent::Shortcut</a> event is sent to all the widgets to which it applies in a non-deterministic order, but with the ``ambiguous'' flag set to true.</p>
<p><b>Warning:</b> You should not normally need to use this function; instead create <a href="qaction.html">QAction</a>s with the shortcut key sequences you require (if you also want equivalent menu options and toolbar buttons), or create <a href="qshortcut.html">QShortcut</a>s if you just need key sequences. Both <a href="qaction.html">QAction</a> and <a href="qshortcut.html">QShortcut</a> handle all the event filtering for you, and provide signals which are triggered when the user triggers the key sequence, so are much easier to use than this low-level function.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(), <a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a>(), and <a href="qwidget.html#grabShortcut">QWidget::grabShortcut</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/hideEvent" />
<h3 class="fn"><a name="hideEvent"></a>void QGraphicsWidget::hideEvent ( <a href="qhideevent.html">QHideEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <a href="qevent.html#Type-enum">Hide</a> events, is delivered after the widget has been hidden, for example, setVisible(false) has been called for the widget or one of its ancestors when the widget was previously shown.</p>
<p>You can reimplement this event handler to detect when your widget is hidden. Calling <a href="qevent.html#accept">QEvent::accept</a>() or <a href="qevent.html#ignore">QEvent::ignore</a>() on <i>event</i> has no effect.</p>
<p>See also <a href="qgraphicswidget.html#showEvent">showEvent</a>(), <a href="qwidget.html#hideEvent">QWidget::hideEvent</a>(), and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemVisibleChange</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/hoverLeaveEvent" />
<h3 class="fn"><a name="hoverLeaveEvent"></a>void QGraphicsWidget::hoverLeaveEvent ( <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverLeaveEvent">QGraphicsItem::hoverLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/hoverMoveEvent" />
<h3 class="fn"><a name="hoverMoveEvent"></a>void QGraphicsWidget::hoverMoveEvent ( <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverMoveEvent">QGraphicsItem::hoverMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/initStyleOption" />
<h3 class="fn"><a name="initStyleOption"></a>void QGraphicsWidget::initStyleOption ( <a href="qstyleoption.html">QStyleOption</a> * <i>option</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Populates a style option object for this widget based on its current state, and stores the output in <i>option</i>. The default implementation populates <i>option</i> with the following properties.</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Style Option Property</th><th>Value</th></tr></thead>
<tr valign="top" class="odd"><td>state &amp; <a href="qstyle.html#StateFlag-enum">QStyle::State_Enabled</a></td><td>Corresponds to <a href="qgraphicsitem.html#isEnabled">QGraphicsItem::isEnabled</a>().</td></tr>
<tr valign="top" class="even"><td>state &amp; <a href="qstyle.html#StateFlag-enum">QStyle::State_HasFocus</a></td><td>Corresponds to <a href="qgraphicsitem.html#hasFocus">QGraphicsItem::hasFocus</a>().</td></tr>
<tr valign="top" class="odd"><td>state &amp; <a href="qstyle.html#StateFlag-enum">QStyle::State_MouseOver</a></td><td>Corresponds to <a href="qgraphicsitem.html#isUnderMouse">QGraphicsItem::isUnderMouse</a>().</td></tr>
<tr valign="top" class="even"><td>direction</td><td>Corresponds to <a href="qgraphicswidget.html#layoutDirection-prop">QGraphicsWidget::layoutDirection</a>().</td></tr>
<tr valign="top" class="odd"><td>rect</td><td>Corresponds to <a href="qgraphicswidget.html#rect">QGraphicsWidget::rect</a>().toRect().</td></tr>
<tr valign="top" class="even"><td>palette</td><td>Corresponds to <a href="qgraphicswidget.html#palette-prop">QGraphicsWidget::palette</a>().</td></tr>
<tr valign="top" class="odd"><td>fontMetrics</td><td>Corresponds to <a href="qfontmetrics.html">QFontMetrics</a>(<a href="qgraphicswidget.html#font-prop">QGraphicsWidget::font</a>()).</td></tr>
</table></p>
<p>Subclasses of <a href="qgraphicswidget.html">QGraphicsWidget</a> should call the base implementation, and then test the type of <i>option</i> using qstyleoption_cast&lt;&gt;() or test <a href="qstyleoption.html#StyleOptionType-enum">QStyleOption::Type</a> before storing widget-specific options.</p>
<p>For example:</p>
<pre> void MyGroupBoxWidget::initStyleOption(QStyleOption *option) const
 {
     QGraphicsWidget::initStyleOption(option);
     if (QStyleOptionGroupBox *box = qstyleoption_cast&lt;QStyleOptionGroupBox *&gt;(option)) {
         <span class="comment">// Add group box specific state.</span>
         box-&gt;flat = isFlat();
         ...
     }
 }</pre>
<p>See also <a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/insertAction" />
<h3 class="fn"><a name="insertAction"></a>void QGraphicsWidget::insertAction ( <a href="qaction.html">QAction</a> * <i>before</i>, <a href="qaction.html">QAction</a> * <i>action</i> )</h3>
<p>Inserts the action <i>action</i> to this widget's list of actions, before the action <i>before</i>. It appends the action if <i>before</i> is 0 or <i>before</i> is not a valid action for this widget.</p>
<p>A <a href="qgraphicswidget.html">QGraphicsWidget</a> should only have one of each action.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#removeAction">removeAction</a>(), <a href="qgraphicswidget.html#addAction">addAction</a>(), <a href="qmenu.html">QMenu</a>, <a href="qgraphicswidget.html#actions">actions</a>(), and <a href="qwidget.html#insertActions">QWidget::insertActions</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/insertActions" />
<h3 class="fn"><a name="insertActions"></a>void QGraphicsWidget::insertActions ( <a href="qaction.html">QAction</a> * <i>before</i>, <a href="qlist.html">QList</a>&lt;<a href="qaction.html">QAction</a> *&gt; <i>actions</i> )</h3>
<p>Inserts the actions <i>actions</i> to this widget's list of actions, before the action <i>before</i>. It appends the action if <i>before</i> is 0 or <i>before</i> is not a valid action for this widget.</p>
<p>A <a href="qgraphicswidget.html">QGraphicsWidget</a> can have at most one of each action.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#removeAction">removeAction</a>(), <a href="qmenu.html">QMenu</a>, <a href="qgraphicswidget.html#insertAction">insertAction</a>(), and <a href="qwidget.html#insertActions">QWidget::insertActions</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/isActiveWindow" />
<h3 class="fn"><a name="isActiveWindow"></a>bool QGraphicsWidget::isActiveWindow () const</h3>
<p>Returns true if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e&#x2e;, a scene that currently has focus).</p>
<p>The active window is the window that either contains a child widget that currently has input focus, or that itself has input focus.</p>
<p>See also <a href="qgraphicsscene.html#activeWindow">QGraphicsScene::activeWindow</a>(), <a href="qgraphicsscene.html#setActiveWindow">QGraphicsScene::setActiveWindow</a>(), and <a href="qgraphicsitem.html#isActive">isActive</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/itemChange" />
<h3 class="fn"><a name="itemChange"></a><a href="qvariant.html">QVariant</a> QGraphicsWidget::itemChange ( <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a> <i>change</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#itemChange">QGraphicsItem::itemChange</a>().</p>
<p><a href="qgraphicswidget.html">QGraphicsWidget</a> uses the base implementation of this function to catch and deliver events related to state changes in the item. Because of this, it is very important that subclasses call the base implementation.</p>
<p><i>change</i> specifies the type of change, and <i>value</i> is the new value.</p>
<p>For example, <a href="qgraphicswidget.html">QGraphicsWidget</a> uses <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemVisibleChange</a> to deliver <a href="qevent.html#Type-enum">Show</a> and <a href="qevent.html#Type-enum">Hide</a> events, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a> to deliver <a href="qevent.html#Type-enum">Move</a> events, and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemParentChange</a> both to deliver <a href="qevent.html#Type-enum">ParentChange</a> events, and for managing the focus chain.</p>
<p><a href="qgraphicswidget.html">QGraphicsWidget</a> enables the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemSendsGeometryChanges</a> flag by default in order to track position changes.</p>
<p>See also <a href="qgraphicsitem.html#itemChange">QGraphicsItem::itemChange</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/layout" />
<h3 class="fn"><a name="layout"></a><a href="qgraphicslayout.html">QGraphicsLayout</a> * QGraphicsWidget::layout () const</h3>
<p>Returns this widget's layout, or 0 if no layout is currently managing this widget.</p>
<p>See also <a href="qgraphicswidget.html#setLayout">setLayout</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/moveEvent" />
<h3 class="fn"><a name="moveEvent"></a>void QGraphicsWidget::moveEvent ( <a href="qgraphicsscenemoveevent.html">QGraphicsSceneMoveEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <a href="qevent.html#Type-enum">GraphicsSceneMove</a> events, is delivered after the widget has moved (e.g&#x2e;, its local position has changed).</p>
<p>This event is only delivered when the item is moved locally. Calling <a href="qgraphicsitem.html#setTransform">setTransform</a>() or moving any of the item's ancestors does not affect the item's local position.</p>
<p>You can reimplement this event handler to detect when your widget has moved. Calling <a href="qevent.html#accept">QEvent::accept</a>() or <a href="qevent.html#ignore">QEvent::ignore</a>() on <i>event</i> has no effect.</p>
<p>See also <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionChange</a> and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/paint" />
<h3 class="fn"><a name="paint"></a>void QGraphicsWidget::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> * <i>option</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/paintWindowFrame" />
<h3 class="fn"><a name="paintWindowFrame"></a>void QGraphicsWidget::paintWindowFrame ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> * <i>option</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> = 0 )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>This virtual function is called by <a href="qgraphicsscene.html">QGraphicsScene</a> to draw the window frame for windows using <i>painter</i>, <i>option</i>, and <i>widget</i>, in local coordinates. The base implementation uses the current style to render the frame and title bar.</p>
<p>You can reimplement this function in a subclass of <a href="qgraphicswidget.html">QGraphicsWidget</a> to provide custom rendering of the widget's window frame.</p>
<p>See also <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/polishEvent" />
<h3 class="fn"><a name="polishEvent"></a>void QGraphicsWidget::polishEvent ()&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event is delivered to the item by the scene at some point after it has been constructed, but before it is shown or otherwise accessed through the scene. You can use this event handler to do last-minute initializations of the widget which require the item to be fully constructed.</p>
<p>The base implementation does nothing.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/rect" />
<h3 class="fn"><a name="rect"></a><a href="qrectf.html">QRectF</a> QGraphicsWidget::rect () const</h3>
<p>Returns the item's local rect as a <a href="qrectf.html">QRectF</a>. This function is equivalent to <a href="qrectf.html">QRectF</a>(QPointF(), <a href="qgraphicswidget.html#size-prop">size</a>()).</p>
<p>See also <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/releaseShortcut" />
<h3 class="fn"><a name="releaseShortcut"></a>void QGraphicsWidget::releaseShortcut ( int <i>id</i> )</h3>
<p>Removes the shortcut with the given <i>id</i> from Qt's shortcut system. The widget will no longer receive <a href="qevent.html#Type-enum">QEvent::Shortcut</a> events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).</p>
<p><b>Warning:</b> You should not normally need to use this function since Qt's shortcut system removes shortcuts automatically when their parent widget is destroyed. It is best to use <a href="qaction.html">QAction</a> or <a href="qshortcut.html">QShortcut</a> to handle shortcuts, since they are easier to use than this low-level function. Note also that this is an expensive operation.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a>(), and <a href="qwidget.html#releaseShortcut">QWidget::releaseShortcut</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/removeAction" />
<h3 class="fn"><a name="removeAction"></a>void QGraphicsWidget::removeAction ( <a href="qaction.html">QAction</a> * <i>action</i> )</h3>
<p>Removes the action <i>action</i> from this widget's list of actions.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#insertAction">insertAction</a>(), <a href="qgraphicswidget.html#actions">actions</a>(), <a href="qgraphicswidget.html#insertAction">insertAction</a>(), and <a href="qwidget.html#removeAction">QWidget::removeAction</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/resizeEvent" />
<h3 class="fn"><a name="resizeEvent"></a>void QGraphicsWidget::resizeEvent ( <a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <a href="qevent.html#Type-enum">GraphicsSceneResize</a> events, is delivered after the widget has been resized (i.e&#x2e;, its local size has changed). <i>event</i> contains both the old and the new size.</p>
<p>This event is only delivered when the widget is resized locally; calling <a href="qgraphicsitem.html#setTransform">setTransform</a>() on the widget or any of its ancestors or view, does not affect the widget's local size.</p>
<p>You can reimplement this event handler to detect when your widget has been resized. Calling <a href="qevent.html#accept">QEvent::accept</a>() or <a href="qevent.html#ignore">QEvent::ignore</a>() on <i>event</i> has no effect.</p>
<p>See also <a href="qgraphicslayoutitem.html#geometry">geometry</a>() and <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/sceneEvent" />
<h3 class="fn"><a name="sceneEvent"></a>bool QGraphicsWidget::sceneEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#sceneEvent">QGraphicsItem::sceneEvent</a>().</p>
<p><a href="qgraphicswidget.html">QGraphicsWidget</a>'s implementation of sceneEvent() simply passes <i>event</i> to <a href="qgraphicswidget.html#event">QGraphicsWidget::event</a>(). You can handle all events for your widget in <a href="qgraphicswidget.html#event">event</a>() or in any of the convenience functions; you should not have to reimplement this function in a subclass of <a href="qgraphicswidget.html">QGraphicsWidget</a>.</p>
<p>See also <a href="qgraphicsitem.html#sceneEvent">QGraphicsItem::sceneEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setAttribute" />
<h3 class="fn"><a name="setAttribute"></a>void QGraphicsWidget::setAttribute ( <a href="qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a> <i>attribute</i>, bool <i>on</i> = true )</h3>
<p>If <i>on</i> is true, this function enables <i>attribute</i>; otherwise <i>attribute</i> is disabled.</p>
<p>See the class documentation for <a href="qgraphicswidget.html">QGraphicsWidget</a> for a complete list of which attributes are supported, and what they are for.</p>
<p>See also <a href="qgraphicswidget.html#testAttribute">testAttribute</a>() and <a href="qwidget.html#setAttribute">QWidget::setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setContentsMargins" />
<h3 class="fn"><a name="setContentsMargins"></a>void QGraphicsWidget::setContentsMargins ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>left</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>top</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>right</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>bottom</i> )</h3>
<p>Sets the widget's contents margins to <i>left</i>, <i>top</i>, <i>right</i> and <i>bottom</i>.</p>
<p>Contents margins are used by the assigned layout to define the placement of subwidgets and layouts. Margins are particularily useful for widgets that constrain subwidgets to only a section of its own geometry. For example, a group box with a layout will place subwidgets inside its frame, but below the title.</p>
<p>Changing a widget's contents margins will always trigger an <a href="qgraphicsitem.html#update">update</a>(), and any assigned layout will be activated automatically. The widget will then receive a <a href="qevent.html#Type-enum">ContentsRectChange</a> event.</p>
<p>See also <a href="qgraphicswidget.html#getContentsMargins">getContentsMargins</a>() and <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setLayout" />
<h3 class="fn"><a name="setLayout"></a>void QGraphicsWidget::setLayout ( <a href="qgraphicslayout.html">QGraphicsLayout</a> * <i>layout</i> )</h3>
<p>Sets the layout for this widget to <i>layout</i>. Any existing layout manager is deleted before the new layout is assigned. If <i>layout</i> is 0, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.</p>
<p>All widgets that are currently managed by <i>layout</i> or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's <a href="qgraphicslayoutitem.html#geometry">geometry</a>() and contentsMargins(). Children who are not explicitly managed by <i>layout</i> remain unaffected by the layout after it has been assigned to this widget.</p>
<p><a href="qgraphicswidget.html">QGraphicsWidget</a> takes ownership of <i>layout</i>.</p>
<p>See also <a href="qgraphicswidget.html#layout">layout</a>(), <a href="qgraphicslinearlayout.html#addItem">QGraphicsLinearLayout::addItem</a>(), and <a href="qgraphicslayout.html#invalidate">QGraphicsLayout::invalidate</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setShortcutAutoRepeat" />
<h3 class="fn"><a name="setShortcutAutoRepeat"></a>void QGraphicsWidget::setShortcutAutoRepeat ( int <i>id</i>, bool <i>enabled</i> = true )</h3>
<p>If <i>enabled</i> is true, auto repeat of the shortcut with the given <i>id</i> is enabled; otherwise it is disabled.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(), and <a href="qwidget.html#setShortcutAutoRepeat">QWidget::setShortcutAutoRepeat</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setShortcutEnabled" />
<h3 class="fn"><a name="setShortcutEnabled"></a>void QGraphicsWidget::setShortcutEnabled ( int <i>id</i>, bool <i>enabled</i> = true )</h3>
<p>If <i>enabled</i> is true, the shortcut with the given <i>id</i> is enabled; otherwise the shortcut is disabled.</p>
<p><b>Warning:</b> You should not normally need to use this function since Qt's shortcut system enables/disables shortcuts automatically as widgets become hidden/visible and gain or lose focus. It is best to use <a href="qaction.html">QAction</a> or <a href="qshortcut.html">QShortcut</a> to handle shortcuts, since they are easier to use than this low-level function.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(), and <a href="qwidget.html#setShortcutEnabled">QWidget::setShortcutEnabled</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setStyle" />
<h3 class="fn"><a name="setStyle"></a>void QGraphicsWidget::setStyle ( <a href="qstyle.html">QStyle</a> * <i>style</i> )</h3>
<p>Sets the widget's style to <i>style</i>. <a href="qgraphicswidget.html">QGraphicsWidget</a> does <i>not</i> take ownership of <i>style</i>.</p>
<p>If no style is assigned, or <i>style</i> is 0, the widget will use <a href="qgraphicsscene.html#style">QGraphicsScene::style</a>() (if this has been set). Otherwise the widget will use <a href="qapplication.html#style">QApplication::style</a>().</p>
<p>This function sets the <a href="qt.html#WidgetAttribute-enum">Qt::WA_SetStyle</a> attribute if <i>style</i> is not 0; otherwise it clears the attribute.</p>
<p>See also <a href="qgraphicswidget.html#style">style</a>().</p>
<a name="//apple_ref/cpp/clm/QGraphicsWidget/setTabOrder" />
<h3 class="fn"><a name="setTabOrder"></a>void QGraphicsWidget::setTabOrder ( QGraphicsWidget * <i>first</i>, QGraphicsWidget * <i>second</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
<p>Moves the <i>second</i> widget around the ring of focus widgets so that keyboard focus moves from the <i>first</i> widget to the <i>second</i> widget when the Tab key is pressed.</p>
<p>Note that since the tab order of the <i>second</i> widget is changed, you should order a chain like this:</p>
<pre> setTabOrder(a, b); <span class="comment">// a to b</span>
 setTabOrder(b, c); <span class="comment">// a to b to c</span>
 setTabOrder(c, d); <span class="comment">// a to b to c to d</span></pre>
<p><i>not</i> like this:</p>
<pre><span class="comment"> // WRONG</span>
 setTabOrder(c, d); <span class="comment">// c to d</span>
 setTabOrder(a, b); <span class="comment">// a to b AND c to d</span>
 setTabOrder(b, c); <span class="comment">// a to b to c, but not c to d</span></pre>
<p>If <i>first</i> is 0, this indicates that <i>second</i> should be the first widget to receive input focus should the scene gain Tab focus (i.e&#x2e;, the user hits Tab so that focus passes into the scene). If <i>second</i> is 0, this indicates that <i>first</i> should be the first widget to gain focus if the scene gained BackTab focus.</p>
<p>By default, tab order is defined implicitly using widget creation order.</p>
<p>See also <a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a> and <a href="focus.html">Keyboard Focus</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/setWindowFrameMargins" />
<h3 class="fn"><a name="setWindowFrameMargins"></a>void QGraphicsWidget::setWindowFrameMargins ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>left</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>top</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>right</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>bottom</i> )</h3>
<p>Sets the widget's window frame margins to <i>left</i>, <i>top</i>, <i>right</i> and <i>bottom</i>. The default frame margins are provided by the style, and they depend on the current window flags.</p>
<p>If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.</p>
<p>See also <a href="qgraphicswidget.html#unsetWindowFrameMargins">unsetWindowFrameMargins</a>(), <a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(), and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/shape" />
<h3 class="fn"><a name="shape"></a><a href="qpainterpath.html">QPainterPath</a> QGraphicsWidget::shape () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem::shape</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/showEvent" />
<h3 class="fn"><a name="showEvent"></a>void QGraphicsWidget::showEvent ( <a href="qshowevent.html">QShowEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <a href="qevent.html#Type-enum">Show</a> events, is delivered before the widget has been shown, for example, setVisible(true) has been called for the widget or one of its ancestors when the widget was previously hidden.</p>
<p>You can reimplement this event handler to detect when your widget is shown. Calling <a href="qevent.html#accept">QEvent::accept</a>() or <a href="qevent.html#ignore">QEvent::ignore</a>() on <i>event</i> has no effect.</p>
<p>See also <a href="qgraphicswidget.html#hideEvent">hideEvent</a>(), <a href="qwidget.html#showEvent">QWidget::showEvent</a>(), and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemVisibleChange</a>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/sizeHint" />
<h3 class="fn"><a name="sizeHint"></a><a href="qsizef.html">QSizeF</a> QGraphicsWidget::sizeHint ( <a href="qt.html#SizeHint-enum">Qt::SizeHint</a> <i>which</i>, const <a href="qsizef.html">QSizeF</a> &amp; <i>constraint</i> = QSizeF() ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem::sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/style" />
<h3 class="fn"><a name="style"></a><a href="qstyle.html">QStyle</a> * QGraphicsWidget::style () const</h3>
<p>Returns a pointer to the widget's style. If this widget does not have any explicitly assigned style, the scene's style is returned instead. In turn, if the scene does not have any assigned style, this function returns <a href="qapplication.html#style">QApplication::style</a>().</p>
<p>See also <a href="qgraphicswidget.html#setStyle">setStyle</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/testAttribute" />
<h3 class="fn"><a name="testAttribute"></a>bool QGraphicsWidget::testAttribute ( <a href="qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a> <i>attribute</i> ) const</h3>
<p>Returns true if <i>attribute</i> is enabled for this widget; otherwise, returns false.</p>
<p>See also <a href="qgraphicswidget.html#setAttribute">setAttribute</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/type" />
<h3 class="fn"><a name="type"></a>int QGraphicsWidget::type () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/ungrabKeyboardEvent" />
<h3 class="fn"><a name="ungrabKeyboardEvent"></a>void QGraphicsWidget::ungrabKeyboardEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for Qt::UngrabKeyboard events.</p>
<p>See also <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>() and <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/ungrabMouseEvent" />
<h3 class="fn"><a name="ungrabMouseEvent"></a>void QGraphicsWidget::ungrabMouseEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for Qt::UngrabMouse events.</p>
<p>See also <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>() and <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/unsetWindowFrameMargins" />
<h3 class="fn"><a name="unsetWindowFrameMargins"></a>void QGraphicsWidget::unsetWindowFrameMargins ()</h3>
<p>Resets the window frame margins to the default value, provided by the style.</p>
<p>See also <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>(), <a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(), and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/updateGeometry" />
<h3 class="fn"><a name="updateGeometry"></a>void QGraphicsWidget::updateGeometry ()&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#updateGeometry">QGraphicsLayoutItem::updateGeometry</a>().</p>
<p>If this widget is currently managed by a layout, this function notifies the layout that the widget's size hints have changed and the layout may need to resize and reposition the widget accordingly.</p>
<p>Call this function if the widget's <a href="qgraphicswidget.html#sizeHint">sizeHint</a>() has changed.</p>
<p>See also <a href="qgraphicslayout.html#invalidate">QGraphicsLayout::invalidate</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowFrameEvent" />
<h3 class="fn"><a name="windowFrameEvent"></a>bool QGraphicsWidget::windowFrameEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>This event handler, for <i>event</i>, receives events for the window frame if this widget is a window. Its base implementation provides support for default window frame interaction such as moving, resizing, etc.</p>
<p>You can reimplement this handler in a subclass of <a href="qgraphicswidget.html">QGraphicsWidget</a> to provide your own custom window frame interaction support.</p>
<p>Returns true if <i>event</i> has been recognized and processed; otherwise, returns false.</p>
<p>See also <a href="qgraphicswidget.html#event">event</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowFrameGeometry" />
<h3 class="fn"><a name="windowFrameGeometry"></a><a href="qrectf.html">QRectF</a> QGraphicsWidget::windowFrameGeometry () const</h3>
<p>Returns the widget's geometry in parent coordinates including any window frame.</p>
<p>See also <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>(), <a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(), and <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowFrameRect" />
<h3 class="fn"><a name="windowFrameRect"></a><a href="qrectf.html">QRectF</a> QGraphicsWidget::windowFrameRect () const</h3>
<p>Returns the widget's local rect including any window frame.</p>
<p>See also <a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a>(), <a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(), and <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowFrameSectionAt" />
<h3 class="fn"><a name="windowFrameSectionAt"></a><a href="qt.html#WindowFrameSection-enum">Qt::WindowFrameSection</a> QGraphicsWidget::windowFrameSectionAt ( const <a href="qpointf.html">QPointF</a> &amp; <i>pos</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Returns the window frame section at position <i>pos</i>, or <a href="qt.html#WindowFrameSection-enum">Qt::NoSection</a> if there is no window frame section at this position.</p>
<p>This function is used in <a href="qgraphicswidget.html">QGraphicsWidget</a>'s base implementation for window frame interaction.</p>
<p>You can reimplement this function if you want to customize how a window can be interactively moved or resized. For instance, if you only want to allow a window to be resized by the bottom right corner, you can reimplement this function to return <a href="qt.html#WindowFrameSection-enum">Qt::NoSection</a> for all sections except <a href="qt.html#WindowFrameSection-enum">Qt::BottomRightSection</a>.</p>
<p>This function was introduced in Qt 4.4.</p>
<p>See also <a href="qgraphicswidget.html#windowFrameEvent">windowFrameEvent</a>(), <a href="qgraphicswidget.html#paintWindowFrame">paintWindowFrame</a>(), and <a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsWidget/windowType" />
<h3 class="fn"><a name="windowType"></a><a href="qt.html#WindowType-enum">Qt::WindowType</a> QGraphicsWidget::windowType () const</h3>
<p>Returns the widgets window type.</p>
<p>See also <a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a>(), <a href="qgraphicsitem.html#isWindow">isWindow</a>(), and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
<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>
</html>