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 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGraphicsWidget Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsWidget Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></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>
<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><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicswidget.html#QGraphicsWidget">__init__</a></b> (<i>self</i>, QGraphicsItem <i>parent</i> = None, Qt.WindowFlags <i>flags</i> = 0)</li><li><div class="fn" />list-of-QAction <b><a href="qgraphicswidget.html#actions">actions</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#addAction">addAction</a></b> (<i>self</i>, QAction <i>action</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#addActions">addActions</a></b> (<i>self</i>, list-of-QAction <i>actions</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#adjustSize">adjustSize</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#autoFillBackground">autoFillBackground</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicswidget.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#close">close</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#closeEvent">closeEvent</a></b> (<i>self</i>, QCloseEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#event">event</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#focusInEvent">focusInEvent</a></b> (<i>self</i>, QFocusEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#focusNextPrevChild">focusNextPrevChild</a></b> (<i>self</i>, bool <i>next</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#focusOutEvent">focusOutEvent</a></b> (<i>self</i>, QFocusEvent <i>event</i>)</li><li><div class="fn" />Qt.FocusPolicy <b><a href="qgraphicswidget.html#focusPolicy">focusPolicy</a></b> (<i>self</i>)</li><li><div class="fn" />QGraphicsWidget <b><a href="qgraphicswidget.html#focusWidget">focusWidget</a></b> (<i>self</i>)</li><li><div class="fn" />QFont <b><a href="qgraphicswidget.html#font">font</a></b> (<i>self</i>)</li><li><div class="fn" />(float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>) <b><a href="qgraphicswidget.html#getContentsMargins">getContentsMargins</a></b> (<i>self</i>)</li><li><div class="fn" />(float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>) <b><a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#grabKeyboardEvent">grabKeyboardEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#grabMouseEvent">grabMouseEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" />int <b><a href="qgraphicswidget.html#grabShortcut">grabShortcut</a></b> (<i>self</i>, QKeySequence <i>sequence</i>, Qt.ShortcutContext <i>context</i> = Qt.WindowShortcut)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#hideEvent">hideEvent</a></b> (<i>self</i>, QHideEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#hoverLeaveEvent">hoverLeaveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#hoverMoveEvent">hoverMoveEvent</a></b> (<i>self</i>, QGraphicsSceneHoverEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#initStyleOption">initStyleOption</a></b> (<i>self</i>, QStyleOption <i>option</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#insertAction">insertAction</a></b> (<i>self</i>, QAction <i>before</i>, QAction <i>action</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#insertActions">insertActions</a></b> (<i>self</i>, QAction <i>before</i>, list-of-QAction <i>actions</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#isActiveWindow">isActiveWindow</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qgraphicswidget.html#itemChange">itemChange</a></b> (<i>self</i>, QGraphicsItem.GraphicsItemChange <i>change</i>, QVariant <i>value</i>)</li><li><div class="fn" />QGraphicsLayout <b><a href="qgraphicswidget.html#layout">layout</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.LayoutDirection <b><a href="qgraphicswidget.html#layoutDirection">layoutDirection</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#moveEvent">moveEvent</a></b> (<i>self</i>, QGraphicsSceneMoveEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#paint">paint</a></b> (<i>self</i>, QPainter <i>painter</i>, QStyleOptionGraphicsItem <i>option</i>, QWidget <i>widget</i> = None)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#paintWindowFrame">paintWindowFrame</a></b> (<i>self</i>, QPainter <i>painter</i>, QStyleOptionGraphicsItem <i>option</i>, QWidget <i>widget</i> = None)</li><li><div class="fn" />QPalette <b><a href="qgraphicswidget.html#palette">palette</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#polishEvent">polishEvent</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicswidget.html#rect">rect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a></b> (<i>self</i>, int <i>id</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#removeAction">removeAction</a></b> (<i>self</i>, QAction <i>action</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#resize">resize</a></b> (<i>self</i>, QSizeF <i>size</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#resize-2">resize</a></b> (<i>self</i>, float <i>w</i>, float <i>h</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#resizeEvent">resizeEvent</a></b> (<i>self</i>, QGraphicsSceneResizeEvent <i>event</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#sceneEvent">sceneEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setAttribute">setAttribute</a></b> (<i>self</i>, Qt.WidgetAttribute <i>attribute</i>, bool <i>on</i> = True)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setAutoFillBackground">setAutoFillBackground</a></b> (<i>self</i>, bool <i>enabled</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setContentsMargins">setContentsMargins</a></b> (<i>self</i>, float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setFocusPolicy">setFocusPolicy</a></b> (<i>self</i>, Qt.FocusPolicy <i>policy</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setFont">setFont</a></b> (<i>self</i>, QFont <i>font</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setGeometry">setGeometry</a></b> (<i>self</i>, QRectF <i>rect</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setGeometry-2">setGeometry</a></b> (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>aw</i>, float <i>ah</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setLayout">setLayout</a></b> (<i>self</i>, QGraphicsLayout <i>layout</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setLayoutDirection">setLayoutDirection</a></b> (<i>self</i>, Qt.LayoutDirection <i>direction</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setPalette">setPalette</a></b> (<i>self</i>, QPalette <i>palette</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setShortcutAutoRepeat">setShortcutAutoRepeat</a></b> (<i>self</i>, int <i>id</i>, bool <i>enabled</i> = True)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a></b> (<i>self</i>, int <i>id</i>, bool <i>enabled</i> = True)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setStyle">setStyle</a></b> (<i>self</i>, QStyle <i>style</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setWindowFlags">setWindowFlags</a></b> (<i>self</i>, Qt.WindowFlags <i>wFlags</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a></b> (<i>self</i>, float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#setWindowTitle">setWindowTitle</a></b> (<i>self</i>, QString <i>title</i>)</li><li><div class="fn" />QPainterPath <b><a href="qgraphicswidget.html#shape">shape</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#showEvent">showEvent</a></b> (<i>self</i>, QShowEvent <i>event</i>)</li><li><div class="fn" />QSizeF <b><a href="qgraphicswidget.html#size">size</a></b> (<i>self</i>)</li><li><div class="fn" />QSizeF <b><a href="qgraphicswidget.html#sizeHint">sizeHint</a></b> (<i>self</i>, Qt.SizeHint <i>which</i>, QSizeF <i>constraint</i> = QSizeF())</li><li><div class="fn" />QStyle <b><a href="qgraphicswidget.html#style">style</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#testAttribute">testAttribute</a></b> (<i>self</i>, Qt.WidgetAttribute <i>attribute</i>)</li><li><div class="fn" />int <b><a href="qgraphicswidget.html#type">type</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#ungrabKeyboardEvent">ungrabKeyboardEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#ungrabMouseEvent">ungrabMouseEvent</a></b> (<i>self</i>, QEvent <i>event</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#unsetLayoutDirection">unsetLayoutDirection</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#unsetWindowFrameMargins">unsetWindowFrameMargins</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicswidget.html#updateGeometry">updateGeometry</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.WindowFlags <b><a href="qgraphicswidget.html#windowFlags">windowFlags</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qgraphicswidget.html#windowFrameEvent">windowFrameEvent</a></b> (<i>self</i>, QEvent <i>e</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a></b> (<i>self</i>)</li><li><div class="fn" />QRectF <b><a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.WindowFrameSection <b><a href="qgraphicswidget.html#windowFrameSectionAt">windowFrameSectionAt</a></b> (<i>self</i>, QPointF <i>pos</i>)</li><li><div class="fn" />QString <b><a href="qgraphicswidget.html#windowTitle">windowTitle</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.WindowType <b><a href="qgraphicswidget.html#windowType">windowType</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicswidget.html#setTabOrder">setTabOrder</a></b> (QGraphicsWidget <i>first</i>, QGraphicsWidget <i>second</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qgraphicswidget.html#geometryChanged">geometryChanged</a></b> ()</li></ul><a name="details" /><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#layout-prop">setLayout</a>() and <a href="qgraphicswidget.html#layout-prop">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., 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>
<table class="generic">
<thead>
<tr class="qt-style">
<th>QGraphicsWidget</th>
<th><a href="qwidget.html">QWidget</a></th>
</tr>
</thead>
<tr class="odd" valign="top">
<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 class="even" valign="top">
<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 class="odd" valign="top">
<td>A subset of widget attributes are supported.</td>
<td>All widget attributes are supported.</td>
</tr>
<tr class="even" valign="top">
<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 class="odd" valign="top">
<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 class="even" valign="top">
<td>Widget items do not support modality.</td>
<td>Full modality support.</td>
</tr>
</table>
<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>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Widget Attribute</th>
<th>Usage</th>
</tr>
</thead>
<tr class="odd" valign="top">
<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 class="even" valign="top">
<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 class="odd" valign="top">
<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 class="even" valign="top">
<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 class="odd" valign="top">
<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 class="even" valign="top">
<td><a href="qt.html#WidgetAttribute-enum">Qt.WA_SetFont</a></td>
<td>Set by <a href="qgraphicswidget.html#font-prop">setFont</a>().</td>
</tr>
<tr class="odd" valign="top">
<td><a href="qt.html#WidgetAttribute-enum">Qt.WA_WindowPropagation</a></td>
<td>Enables propagation to window widgets.</td>
</tr>
</table>
<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>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsWidget" />QGraphicsWidget.__init__ (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> <i>parent</i> = None, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>flags</i> = 0)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><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.,
whether the widget should be a window, a tool, a popup, etc).</p>
<h3 class="fn"><a name="actions" />list-of-QAction QGraphicsWidget.actions (<i>self</i>)</h3><p>Returns the (possibly empty) list of this widget's actions.</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also</b> <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>
<h3 class="fn"><a name="addAction" />QGraphicsWidget.addAction (<i>self</i>, <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><b>See also</b> <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>
<h3 class="fn"><a name="addActions" />QGraphicsWidget.addActions (<i>self</i>, list-of-QAction <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><b>See also</b> <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>
<h3 class="fn"><a name="adjustSize" />QGraphicsWidget.adjustSize (<i>self</i>)</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><b>See also</b> <a href="qgraphicslayoutitem.html#effectiveSizeHint">effectiveSizeHint</a>()
and <a href="qt.html#SizeHint-enum">Qt.MinimumSize</a>.</p>
<h3 class="fn"><a name="autoFillBackground" />bool QGraphicsWidget.autoFillBackground (<i>self</i>)</h3><h3 class="fn"><a name="boundingRect" /><a href="qrectf.html">QRectF</a> QGraphicsWidget.boundingRect (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem.boundingRect</a>().</p>
<h3 class="fn"><a name="changeEvent" />QGraphicsWidget.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</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>
<h3 class="fn"><a name="close" />bool QGraphicsWidget.close (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>bool close()</tt>.</p><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>
<h3 class="fn"><a name="closeEvent" />QGraphicsWidget.closeEvent (<i>self</i>, <a href="qcloseevent.html">QCloseEvent</a> <i>event</i>)</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><b>See also</b> <a href="qgraphicswidget.html#close">close</a>()
and <a href="qcloseevent.html">QCloseEvent</a>.</p>
<h3 class="fn"><a name="event" />bool QGraphicsWidget.event (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</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>
<table class="generic">
<tr class="odd" valign="top">
<td>Polish</td>
<td>Delivered to the widget some time after it has been shown.</td>
</tr>
<tr class="even" valign="top">
<td>GraphicsSceneMove</td>
<td>Delivered to the widget after its local position has
changed.</td>
</tr>
<tr class="odd" valign="top">
<td>GraphicsSceneResize</td>
<td>Delivered to the widget after its size has changed.</td>
</tr>
<tr class="even" valign="top">
<td>Show</td>
<td>Delivered to the widget before it has been shown.</td>
</tr>
<tr class="odd" valign="top">
<td>Hide</td>
<td>Delivered to the widget after it has been hidden.</td>
</tr>
<tr class="even" valign="top">
<td>PaletteChange</td>
<td>Delivered to the widget after its palette has changed.</td>
</tr>
<tr class="odd" valign="top">
<td>FontChange</td>
<td>Delivered to the widget after its font has changed.</td>
</tr>
<tr class="even" valign="top">
<td>EnabledChange</td>
<td>Delivered to the widget after its enabled state has
changed.</td>
</tr>
<tr class="odd" valign="top">
<td>StyleChange</td>
<td>Delivered to the widget after its style has changed.</td>
</tr>
<tr class="even" valign="top">
<td>LayoutDirectionChange</td>
<td>Delivered to the widget after its layout direction has
changed.</td>
</tr>
<tr class="odd" valign="top">
<td>ContentsRectChange</td>
<td>Delivered to the widget after its contents margins/ contents
rect has changed.</td>
</tr>
</table>
<h3 class="fn"><a name="focusInEvent" />QGraphicsWidget.focusInEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#focusInEvent">QGraphicsItem.focusInEvent</a>().</p>
<h3 class="fn"><a name="focusNextPrevChild" />bool QGraphicsWidget.focusNextPrevChild (<i>self</i>, bool <i>next</i>)</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><b>See also</b> <a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a>().</p>
<h3 class="fn"><a name="focusOutEvent" />QGraphicsWidget.focusOutEvent (<i>self</i>, <a href="qfocusevent.html">QFocusEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem.focusOutEvent</a>().</p>
<h3 class="fn"><a name="focusPolicy" /><a href="qt.html#FocusPolicy-enum">Qt.FocusPolicy</a> QGraphicsWidget.focusPolicy (<i>self</i>)</h3><h3 class="fn"><a name="focusWidget" /><a href="qgraphicswidget.html">QGraphicsWidget</a> QGraphicsWidget.focusWidget (<i>self</i>)</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><b>See also</b> <a href="qgraphicsitem.html#focusItem">QGraphicsItem.focusItem</a>() and
<a href="qwidget.html#focusWidget">QWidget.focusWidget</a>().</p>
<h3 class="fn"><a name="font" /><a href="qfont.html">QFont</a> QGraphicsWidget.font (<i>self</i>)</h3><h3 class="fn"><a name="getContentsMargins" />(float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>) QGraphicsWidget.getContentsMargins (<i>self</i>)</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><b>See also</b> <a href="qgraphicswidget.html#setContentsMargins">setContentsMargins</a>().</p>
<h3 class="fn"><a name="getWindowFrameMargins" />(float <i>left</i>, float <i>top</i>, float <i>right</i>, float <i>bottom</i>) QGraphicsWidget.getWindowFrameMargins (<i>self</i>)</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><b>See also</b> <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>()
and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<h3 class="fn"><a name="grabKeyboardEvent" />QGraphicsWidget.grabKeyboardEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>This event handler, for <i>event</i>, can be reimplemented in a
subclass to receive notifications for <a href="qevent.html#Type-enum">QEvent.GrabKeyboard</a> events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>() and <a href="qgraphicsitem.html#grabMouse">grabMouse</a>().</p>
<h3 class="fn"><a name="grabMouseEvent" />QGraphicsWidget.grabMouseEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>This event handler, for <i>event</i>, can be reimplemented in a
subclass to receive notifications for <a href="qevent.html#Type-enum">QEvent.GrabMouse</a> events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#grabMouse">grabMouse</a>() and <a href="qgraphicsitem.html#grabKeyboard">grabKeyboard</a>().</p>
<h3 class="fn"><a name="grabShortcut" />int QGraphicsWidget.grabShortcut (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a> <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., 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><b>See also</b> <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(),
<a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a>(),
and <a href="qwidget.html#grabShortcut">QWidget.grabShortcut</a>().</p>
<h3 class="fn"><a name="hideEvent" />QGraphicsWidget.hideEvent (<i>self</i>, <a href="qhideevent.html">QHideEvent</a> <i>event</i>)</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><b>See also</b> <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>
<h3 class="fn"><a name="hoverLeaveEvent" />QGraphicsWidget.hoverLeaveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#hoverLeaveEvent">QGraphicsItem.hoverLeaveEvent</a>().</p>
<h3 class="fn"><a name="hoverMoveEvent" />QGraphicsWidget.hoverMoveEvent (<i>self</i>, <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> <i>event</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#hoverMoveEvent">QGraphicsItem.hoverMoveEvent</a>().</p>
<h3 class="fn"><a name="initStyleOption" />QGraphicsWidget.initStyleOption (<i>self</i>, <a href="qstyleoption.html">QStyleOption</a> <i>option</i>)</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>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Style Option Property</th>
<th>Value</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>state & <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 class="even" valign="top">
<td>state & <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 class="odd" valign="top">
<td>state & <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 class="even" valign="top">
<td>direction</td>
<td>Corresponds to <a href="qgraphicswidget.html#layoutDirection-prop">QGraphicsWidget.layoutDirection</a>().</td>
</tr>
<tr class="odd" valign="top">
<td>rect</td>
<td>Corresponds to <a href="qgraphicswidget.html#rect">QGraphicsWidget.rect</a>().toRect().</td>
</tr>
<tr class="even" valign="top">
<td>palette</td>
<td>Corresponds to <a href="qgraphicswidget.html#palette-prop">QGraphicsWidget.palette</a>().</td>
</tr>
<tr class="odd" valign="top">
<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>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<>() or test <a href="qstyleoption.html#StyleOptionType-enum">QStyleOption.Type</a>
before storing widget-specific options.</p>
<p>For example:</p>
<pre class="cpp">
<span class="type">void</span> MyGroupBoxWidget<span class="operator">.</span>initStyleOption(<span class="type"><a href="qstyleoption.html">QStyleOption</a></span> <span class="operator">*</span>option) <span class="keyword">const</span>
{
<span class="type"><a href="qgraphicswidget.html">QGraphicsWidget</a></span><span class="operator">.</span>initStyleOption(option);
<span class="keyword">if</span> (<span class="type"><a href="qstyleoptiongroupbox.html">QStyleOptionGroupBox</a></span> <span class="operator">*</span>box <span class="operator">=</span> qstyleoption_cast<span class="operator"><</span><span class="type"><a href="qstyleoptiongroupbox.html">QStyleOptionGroupBox</a></span> <span class="operator">*</span><span class="operator">></span>(option)) {
<span class="comment">// Add group box specific state.</span>
box<span class="operator">-</span><span class="operator">></span>flat <span class="operator">=</span> isFlat();
<span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
}
}
</pre>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">QStyleOption.initFrom</a>().</p>
<h3 class="fn"><a name="insertAction" />QGraphicsWidget.insertAction (<i>self</i>, <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><b>See also</b> <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>
<h3 class="fn"><a name="insertActions" />QGraphicsWidget.insertActions (<i>self</i>, <a href="qaction.html">QAction</a> <i>before</i>, list-of-QAction <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><b>See also</b> <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>
<h3 class="fn"><a name="isActiveWindow" />bool QGraphicsWidget.isActiveWindow (<i>self</i>)</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., 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><b>See also</b> <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>
<h3 class="fn"><a name="itemChange" />QVariant QGraphicsWidget.itemChange (<i>self</i>, <a href="qgraphicsitem.html#GraphicsItemChange-enum">QGraphicsItem.GraphicsItemChange</a> <i>change</i>, QVariant <i>value</i>)</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><b>See also</b> <a href="qgraphicsitem.html#itemChange">QGraphicsItem.itemChange</a>().</p>
<h3 class="fn"><a name="layout" /><a href="qgraphicslayout.html">QGraphicsLayout</a> QGraphicsWidget.layout (<i>self</i>)</h3><h3 class="fn"><a name="layoutDirection" /><a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a> QGraphicsWidget.layoutDirection (<i>self</i>)</h3><h3 class="fn"><a name="moveEvent" />QGraphicsWidget.moveEvent (<i>self</i>, <a href="qgraphicsscenemoveevent.html">QGraphicsSceneMoveEvent</a> <i>event</i>)</h3><p>This event handler, for <a href="qevent.html#Type-enum">GraphicsSceneMove</a> events, is delivered
after the widget has moved (e.g., 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><b>See also</b> <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionChange</a>
and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a>.</p>
<h3 class="fn"><a name="paint" />QGraphicsWidget.paint (<i>self</i>, <a href="qpainter.html">QPainter</a> <i>painter</i>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> <i>option</i>, <a href="qwidget.html">QWidget</a> <i>widget</i> = None)</h3><p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>().</p>
<h3 class="fn"><a name="paintWindowFrame" />QGraphicsWidget.paintWindowFrame (<i>self</i>, <a href="qpainter.html">QPainter</a> <i>painter</i>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> <i>option</i>, <a href="qwidget.html">QWidget</a> <i>widget</i> = None)</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><b>See also</b> <a href="qgraphicsitem.html#paint">QGraphicsItem.paint</a>().</p>
<h3 class="fn"><a name="palette" /><a href="qpalette.html">QPalette</a> QGraphicsWidget.palette (<i>self</i>)</h3><h3 class="fn"><a name="polishEvent" />QGraphicsWidget.polishEvent (<i>self</i>)</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>
<h3 class="fn"><a name="rect" /><a href="qrectf.html">QRectF</a> QGraphicsWidget.rect (<i>self</i>)</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><b>See also</b> <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</p>
<h3 class="fn"><a name="releaseShortcut" />QGraphicsWidget.releaseShortcut (<i>self</i>, 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><b>See also</b> <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a>(),
and <a href="qwidget.html#releaseShortcut">QWidget.releaseShortcut</a>().</p>
<h3 class="fn"><a name="removeAction" />QGraphicsWidget.removeAction (<i>self</i>, <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><b>See also</b> <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>
<h3 class="fn"><a name="resize" />QGraphicsWidget.resize (<i>self</i>, <a href="qsizef.html">QSizeF</a> <i>size</i>)</h3><h3 class="fn"><a name="resize-2" />QGraphicsWidget.resize (<i>self</i>, float <i>w</i>, float <i>h</i>)</h3><h3 class="fn"><a name="resizeEvent" />QGraphicsWidget.resizeEvent (<i>self</i>, <a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a> <i>event</i>)</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., 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><b>See also</b> <a href="qgraphicslayoutitem.html#geometry">geometry</a>() and <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<h3 class="fn"><a name="sceneEvent" />bool QGraphicsWidget.sceneEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</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><b>See also</b> <a href="qgraphicsitem.html#sceneEvent">QGraphicsItem.sceneEvent</a>().</p>
<h3 class="fn"><a name="setAttribute" />QGraphicsWidget.setAttribute (<i>self</i>, <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><b>See also</b> <a href="qgraphicswidget.html#testAttribute">testAttribute</a>() and
<a href="qwidget.html#setAttribute">QWidget.setAttribute</a>().</p>
<h3 class="fn"><a name="setAutoFillBackground" />QGraphicsWidget.setAutoFillBackground (<i>self</i>, bool <i>enabled</i>)</h3><h3 class="fn"><a name="setContentsMargins" />QGraphicsWidget.setContentsMargins (<i>self</i>, float <i>left</i>, float <i>top</i>, float <i>right</i>, float <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 particularly
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><b>See also</b> <a href="qgraphicswidget.html#getContentsMargins">getContentsMargins</a>()
and <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<h3 class="fn"><a name="setFocusPolicy" />QGraphicsWidget.setFocusPolicy (<i>self</i>, <a href="qt.html#FocusPolicy-enum">Qt.FocusPolicy</a> <i>policy</i>)</h3><h3 class="fn"><a name="setFont" />QGraphicsWidget.setFont (<i>self</i>, <a href="qfont.html">QFont</a> <i>font</i>)</h3><h3 class="fn"><a name="setGeometry" />QGraphicsWidget.setGeometry (<i>self</i>, <a href="qrectf.html">QRectF</a> <i>rect</i>)</h3><h3 class="fn"><a name="setGeometry-2" />QGraphicsWidget.setGeometry (<i>self</i>, float <i>ax</i>, float <i>ay</i>, float <i>aw</i>, float <i>ah</i>)</h3><h3 class="fn"><a name="setLayout" />QGraphicsWidget.setLayout (<i>self</i>, <a href="qgraphicslayout.html">QGraphicsLayout</a> <i>layout</i>)</h3><p>The <i>layout</i> argument has it's ownership transferred to Qt.</p><h3 class="fn"><a name="setLayoutDirection" />QGraphicsWidget.setLayoutDirection (<i>self</i>, <a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a> <i>direction</i>)</h3><h3 class="fn"><a name="setPalette" />QGraphicsWidget.setPalette (<i>self</i>, <a href="qpalette.html">QPalette</a> <i>palette</i>)</h3><h3 class="fn"><a name="setShortcutAutoRepeat" />QGraphicsWidget.setShortcutAutoRepeat (<i>self</i>, 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><b>See also</b> <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(), and
<a href="qwidget.html#setShortcutAutoRepeat">QWidget.setShortcutAutoRepeat</a>().</p>
<h3 class="fn"><a name="setShortcutEnabled" />QGraphicsWidget.setShortcutEnabled (<i>self</i>, 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><b>See also</b> <a href="qgraphicswidget.html#grabShortcut">grabShortcut</a>(), <a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a>(), and
<a href="qwidget.html#setShortcutEnabled">QWidget.setShortcutEnabled</a>().</p>
<h3 class="fn"><a name="setStyle" />QGraphicsWidget.setStyle (<i>self</i>, <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><b>See also</b> <a href="qgraphicswidget.html#style">style</a>().</p>
<h3 class="fn"><a name="setTabOrder" />QGraphicsWidget.setTabOrder (<a href="qgraphicswidget.html">QGraphicsWidget</a> <i>first</i>, <a href="qgraphicswidget.html">QGraphicsWidget</a> <i>second</i>)</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 class="cpp">
setTabOrder(a<span class="operator">,</span> b); <span class="comment">// a to b</span>
setTabOrder(b<span class="operator">,</span> c); <span class="comment">// a to b to c</span>
setTabOrder(c<span class="operator">,</span> d); <span class="comment">// a to b to c to d</span>
</pre>
<p><i>not</i> like this:</p>
<pre class="cpp">
<span class="comment">// WRONG</span>
setTabOrder(c<span class="operator">,</span> d); <span class="comment">// c to d</span>
setTabOrder(a<span class="operator">,</span> b); <span class="comment">// a to b AND c to d</span>
setTabOrder(b<span class="operator">,</span> 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., 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><b>See also</b> <a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a> and
<a href="focus.html">Keyboard Focus</a>.</p>
<h3 class="fn"><a name="setWindowFlags" />QGraphicsWidget.setWindowFlags (<i>self</i>, <a href="qt-windowflags.html">Qt.WindowFlags</a> <i>wFlags</i>)</h3><h3 class="fn"><a name="setWindowFrameMargins" />QGraphicsWidget.setWindowFrameMargins (<i>self</i>, float <i>left</i>, float <i>top</i>, float <i>right</i>, float <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><b>See also</b> <a href="qgraphicswidget.html#unsetWindowFrameMargins">unsetWindowFrameMargins</a>(),
<a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(),
and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<h3 class="fn"><a name="setWindowTitle" />QGraphicsWidget.setWindowTitle (<i>self</i>, QString <i>title</i>)</h3><h3 class="fn"><a name="shape" /><a href="qpainterpath.html">QPainterPath</a> QGraphicsWidget.shape (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem.shape</a>().</p>
<h3 class="fn"><a name="showEvent" />QGraphicsWidget.showEvent (<i>self</i>, <a href="qshowevent.html">QShowEvent</a> <i>event</i>)</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><b>See also</b> <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>
<h3 class="fn"><a name="size" /><a href="qsizef.html">QSizeF</a> QGraphicsWidget.size (<i>self</i>)</h3><h3 class="fn"><a name="sizeHint" /><a href="qsizef.html">QSizeF</a> QGraphicsWidget.sizeHint (<i>self</i>, <a href="qt.html#SizeHint-enum">Qt.SizeHint</a> <i>which</i>, <a href="qsizef.html">QSizeF</a> <i>constraint</i> = QSizeF())</h3><p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem.sizeHint</a>().</p>
<h3 class="fn"><a name="style" /><a href="qstyle.html">QStyle</a> QGraphicsWidget.style (<i>self</i>)</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><b>See also</b> <a href="qgraphicswidget.html#setStyle">setStyle</a>().</p>
<h3 class="fn"><a name="testAttribute" />bool QGraphicsWidget.testAttribute (<i>self</i>, <a href="qt.html#WidgetAttribute-enum">Qt.WidgetAttribute</a> <i>attribute</i>)</h3><p>Returns true if <i>attribute</i> is enabled for this widget;
otherwise, returns false.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#setAttribute">setAttribute</a>().</p>
<h3 class="fn"><a name="type" />int QGraphicsWidget.type (<i>self</i>)</h3><p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem.type</a>().</p>
<h3 class="fn"><a name="ungrabKeyboardEvent" />QGraphicsWidget.ungrabKeyboardEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>This event handler, for <i>event</i>, can be reimplemented in a
subclass to receive notifications for <a href="qevent.html#Type-enum">QEvent.UngrabKeyboard</a> events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>() and
<a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>().</p>
<h3 class="fn"><a name="ungrabMouseEvent" />QGraphicsWidget.ungrabMouseEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>event</i>)</h3><p>This event handler, for <i>event</i>, can be reimplemented in a
subclass to receive notifications for <a href="qevent.html#Type-enum">QEvent.UngrabMouse</a> events.</p>
<p><b>See also</b> <a href="qgraphicsitem.html#ungrabMouse">ungrabMouse</a>() and <a href="qgraphicsitem.html#ungrabKeyboard">ungrabKeyboard</a>().</p>
<h3 class="fn"><a name="unsetLayoutDirection" />QGraphicsWidget.unsetLayoutDirection (<i>self</i>)</h3><h3 class="fn"><a name="unsetWindowFrameMargins" />QGraphicsWidget.unsetWindowFrameMargins (<i>self</i>)</h3><p>Resets the window frame margins to the default value, provided
by the style.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>(),
<a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(),
and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<h3 class="fn"><a name="updateGeometry" />QGraphicsWidget.updateGeometry (<i>self</i>)</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><b>See also</b> <a href="qgraphicslayout.html#invalidate">QGraphicsLayout.invalidate</a>().</p>
<h3 class="fn"><a name="windowFlags" /><a href="qt-windowflags.html">Qt.WindowFlags</a> QGraphicsWidget.windowFlags (<i>self</i>)</h3><h3 class="fn"><a name="windowFrameEvent" />bool QGraphicsWidget.windowFrameEvent (<i>self</i>, <a href="qevent.html">QEvent</a> <i>e</i>)</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><b>See also</b> <a href="qgraphicswidget.html#event">event</a>().</p>
<h3 class="fn"><a name="windowFrameGeometry" /><a href="qrectf.html">QRectF</a> QGraphicsWidget.windowFrameGeometry (<i>self</i>)</h3><p>Returns the widget's geometry in parent coordinates including
any window frame.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>(),
<a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(),
and <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>().</p>
<h3 class="fn"><a name="windowFrameRect" /><a href="qrectf.html">QRectF</a> QGraphicsWidget.windowFrameRect (<i>self</i>)</h3><p>Returns the widget's local rect including any window frame.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a>(),
<a href="qgraphicswidget.html#getWindowFrameMargins">getWindowFrameMargins</a>(),
and <a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>().</p>
<h3 class="fn"><a name="windowFrameSectionAt" /><a href="qt.html#WindowFrameSection-enum">Qt.WindowFrameSection</a> QGraphicsWidget.windowFrameSectionAt (<i>self</i>, <a href="qpointf.html">QPointF</a> <i>pos</i>)</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><b>See also</b> <a href="qgraphicswidget.html#windowFrameEvent">windowFrameEvent</a>(),
<a href="qgraphicswidget.html#paintWindowFrame">paintWindowFrame</a>(), and
<a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a>().</p>
<h3 class="fn"><a name="windowTitle" />QString QGraphicsWidget.windowTitle (<i>self</i>)</h3><h3 class="fn"><a name="windowType" /><a href="qt.html#WindowType-enum">Qt.WindowType</a> QGraphicsWidget.windowType (<i>self</i>)</h3><p>Returns the widgets window type.</p>
<p><b>See also</b> <a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a>(), <a href="qgraphicsitem.html#isWindow">isWindow</a>(), and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="geometryChanged" />void geometryChanged ()</h3><p>This is the default overload of this signal.</p><p>This signal gets emitted whenever the geometry is changed in
<a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|