Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3877

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qgraphicswidget.cpp -->
  <title>QGraphicsWidget Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QGraphicsWidget</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QGraphicsWidget Class</h1>
<!-- $$$QGraphicsWidget-brief -->
<p>The <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> class is the base class for all widget items in a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<!-- @@@QGraphicsWidget -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QGraphicsWidget&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qgraphicsobject.html">QGraphicsObject</a> and <a href="qgraphicslayoutitem.html">QGraphicsLayoutItem</a></td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a></p>
</td></tr></table></div><ul>
<li><a href="qgraphicswidget-members.html">List of all members, including inherited members</a></li>
<li><a href="qgraphicswidget-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#anonymous-enum">anonymous</a></b> { Type }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qgraphicswidget.html#autoFillBackground-prop">autoFillBackground</a></b> : bool</li>
<li class="fn"><b><a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a></b> : Qt::FocusPolicy</li>
<li class="fn"><b><a href="qgraphicswidget.html#font-prop">font</a></b> : QFont</li>
<li class="fn"><b><a href="qgraphicswidget.html#geometry-prop">geometry</a></b> : QRectF</li>
<li class="fn"><b><a href="qgraphicswidget.html#layout-prop">layout</a></b> : QGraphicsLayout*</li>
<li class="fn"><b><a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection</a></b> : Qt::LayoutDirection</li>
<li class="fn"><b><a href="qgraphicswidget.html#maximumSize-prop">maximumSize</a></b> : const QSizeF</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qgraphicswidget.html#minimumSize-prop">minimumSize</a></b> : const QSizeF</li>
<li class="fn"><b><a href="qgraphicswidget.html#palette-prop">palette</a></b> : QPalette</li>
<li class="fn"><b><a href="qgraphicswidget.html#preferredSize-prop">preferredSize</a></b> : const QSizeF</li>
<li class="fn"><b><a href="qgraphicswidget.html#size-prop">size</a></b> : QSizeF</li>
<li class="fn"><b><a href="qgraphicswidget.html#sizePolicy-prop">sizePolicy</a></b> : const QSizePolicy</li>
<li class="fn"><b><a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a></b> : Qt::WindowFlags</li>
<li class="fn"><b><a href="qgraphicswidget.html#windowTitle-prop">windowTitle</a></b> : QString</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">12 properties inherited from <a href="qgraphicsobject.html#properties">QGraphicsObject</a></li>
<li class="fn">1 property inherited from <a href="../qtcore/qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#QGraphicsWidget">QGraphicsWidget</a></b>(QGraphicsItem *<i>parent</i> = nullptr, Qt::WindowFlags <i>wFlags</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#dtor.QGraphicsWidget">~QGraphicsWidget</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAction *&gt; </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#actions">actions</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#addAction">addAction</a></b>(QAction *<i>action</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#addActions">addActions</a></b>(QList&lt;QAction *&gt; <i>actions</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#adjustSize">adjustSize</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#autoFillBackground-prop">autoFillBackground</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::FocusPolicy </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsWidget *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusWidget">focusWidget</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFont </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#font-prop">font</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#insertAction">insertAction</a></b>(QAction *<i>before</i>, QAction *<i>action</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#isActiveWindow">isActiveWindow</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QGraphicsLayout *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#layout">layout</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#layoutDirection-prop">layoutDirection</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#paintWindowFrame">paintWindowFrame</a></b>(QPainter *<i>painter</i>, const QStyleOptionGraphicsItem *<i>option</i>, QWidget *<i>widget</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#palette-prop">palette</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#rect">rect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#releaseShortcut">releaseShortcut</a></b>(int <i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#removeAction">removeAction</a></b>(QAction *<i>action</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#size-prop">resize</a></b>(const QSizeF &amp;<i>size</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#resize-1">resize</a></b>(qreal <i>w</i>, qreal <i>h</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#autoFillBackground-prop">setAutoFillBackground</a></b>(bool <i>enabled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusPolicy-prop">setFocusPolicy</a></b>(Qt::FocusPolicy <i>policy</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#font-prop">setFont</a></b>(const QFont &amp;<i>font</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setGeometry-1">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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setLayout">setLayout</a></b>(QGraphicsLayout *<i>layout</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#layoutDirection-prop">setLayoutDirection</a></b>(Qt::LayoutDirection <i>direction</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#palette-prop">setPalette</a></b>(const QPalette &amp;<i>palette</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setShortcutAutoRepeat">setShortcutAutoRepeat</a></b>(int <i>id</i>, bool <i>enabled</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setShortcutEnabled">setShortcutEnabled</a></b>(int <i>id</i>, bool <i>enabled</i> = true)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setStyle">setStyle</a></b>(QStyle *<i>style</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFlags-prop">setWindowFlags</a></b>(Qt::WindowFlags <i>wFlags</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><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 rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowTitle-prop">setWindowTitle</a></b>(const QString &amp;<i>title</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#size-prop">size</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStyle *</td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#style">style</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#testAttribute">testAttribute</a></b>(Qt::WidgetAttribute <i>attribute</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#layoutDirection-prop">unsetLayoutDirection</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#unsetWindowFrameMargins">unsetWindowFrameMargins</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::WindowFlags </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFlags-prop">windowFlags</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFrameGeometry">windowFrameGeometry</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowTitle-prop">windowTitle</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Qt::WindowType </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowType">windowType</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QRectF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#boundingRect">boundingRect</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><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 override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#paint">paint</a></b>(QPainter *<i>painter</i>, const QStyleOptionGraphicsItem *<i>option</i>, QWidget *<i>widget</i> = nullptr) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#geometry-prop">setGeometry</a></b>(const QRectF &amp;<i>rect</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QPainterPath </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#shape">shape</a></b>() const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#type">type</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">2 public functions inherited from <a href="qgraphicsobject.html#public-functions">QGraphicsObject</a></li>
<li class="fn">35 public functions inherited from <a href="qgraphicslayoutitem.html#public-functions">QGraphicsLayoutItem</a></li>
<li class="fn">31 public functions inherited from <a href="../qtcore/qobject.html#public-functions">QObject</a></li>
<li class="fn">176 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#close">close</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">1 public slot inherited from <a href="../qtcore/qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#geometryChanged">geometryChanged</a></b>()</td></tr>
</table></div>
<ul>
<li class="fn">9 signals inherited from <a href="qgraphicsobject.html#signals">QGraphicsObject</a></li>
<li class="fn">2 signals inherited from <a href="../qtcore/qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#setTabOrder">setTabOrder</a></b>(QGraphicsWidget *<i>first</i>, QGraphicsWidget *<i>second</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<ul>
<li class="fn">9 static public members inherited from <a href="../qtcore/qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#changeEvent">changeEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#closeEvent">closeEvent</a></b>(QCloseEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusNextPrevChild">focusNextPrevChild</a></b>(bool <i>next</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#grabKeyboardEvent">grabKeyboardEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#grabMouseEvent">grabMouseEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#hideEvent">hideEvent</a></b>(QHideEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#initStyleOption">initStyleOption</a></b>(QStyleOption *<i>option</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#moveEvent">moveEvent</a></b>(QGraphicsSceneMoveEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#polishEvent">polishEvent</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#resizeEvent">resizeEvent</a></b>(QGraphicsSceneResizeEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#showEvent">showEvent</a></b>(QShowEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#ungrabKeyboardEvent">ungrabKeyboardEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#ungrabMouseEvent">ungrabMouseEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFrameEvent">windowFrameEvent</a></b>(QEvent *<i>event</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual Qt::WindowFrameSection </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#windowFrameSectionAt">windowFrameSectionAt</a></b>(const QPointF &amp;<i>pos</i>) const</td></tr>
</table></div>
<a name="reimplemented-protected-functions"></a>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#event">event</a></b>(QEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusInEvent">focusInEvent</a></b>(QFocusEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#focusOutEvent">focusOutEvent</a></b>(QFocusEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#hoverLeaveEvent">hoverLeaveEvent</a></b>(QGraphicsSceneHoverEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#hoverMoveEvent">hoverMoveEvent</a></b>(QGraphicsSceneHoverEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVariant </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#itemChange">itemChange</a></b>(QGraphicsItem::GraphicsItemChange <i>change</i>, const QVariant &amp;<i>value</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#sceneEvent">sceneEvent</a></b>(QEvent *<i>event</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#sizeHint">sizeHint</a></b>(Qt::SizeHint <i>which</i>, const QSizeF &amp;<i>constraint</i> = QSizeF()) const override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicswidget.html#updateGeometry">updateGeometry</a></b>() override</td></tr>
</table></div>
<ul>
<li class="fn">1 protected function inherited from <a href="qgraphicsobject.html#protected-functions">QGraphicsObject</a></li>
<li class="fn">3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
<li class="fn">9 protected functions inherited from <a href="../qtcore/qobject.html#protected-functions">QObject</a></li>
<li class="fn">24 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 protected slot inherited from <a href="qgraphicsobject.html#protected-slots">QGraphicsObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QGraphicsWidget-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> class is the base class for all widget items in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p><a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> 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="stylesheet-reference.html#font">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>, <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> is not an abstract class; you can create instances of a <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> 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><a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> 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 <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> 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 <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a>, 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 <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> and <a href="qwidget.html">QWidget</a> are:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th ><a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a></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="../qtcore/qpoint.html">QPoint</a>, <a href="../qtcore/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 <a href="qgraphicsscene.html#style">QGraphicsScene::style</a></td><td >A top-level widget's style defaults to <a href="qapplication.html#style">QApplication::style</a></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></div>
<p><a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> supports a subset of Qt's widget attributes, (<a href="../qtcore/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>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Widget Attribute</th><th >Usage</th></tr></thead>
<tr valign="top" class="odd"><td ><a href="../qtcore/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="../qtcore/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="../qtcore/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="../qtcore/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="../qtcore/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="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_SetFont</a></td><td >Set by <a href="qgraphicswidget.html#font-prop">setFont</a>().</td></tr>
<tr valign="top" class="odd"><td ><a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_WindowPropagation</a></td><td >Enables propagation to window widgets.</td></tr>
</table></div>
<p>Although <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> inherits from both <a href="../qtcore/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="../qtcore/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="../qtcore/qobject.html#parent">QObject::parent</a>() should always return 0 for QGraphicsWidgets, but this policy is not strictly defined.</p></div>
<p><b>See also </b><a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a>, <a href="qgraphicsitem.html">QGraphicsItem</a>, and <a href="graphicsview.html#widgets-and-layouts">Widgets and Layouts</a>.</p>
<!-- @@@QGraphicsWidget -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$anonymous$$$Type -->
<h3 class="fn" id="anonymous-enum"><a name="anonymous-enum"></a>enum QGraphicsWidget::<span class="name">anonymous</span></h3>
<p>The value returned by the virtual <a href="qgraphicswidget.html#type">type</a>() function.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QGraphicsWidget::Type</code></td><td class="topAlign tblval"><code>11</code></td><td class="topAlign">A graphics widget item</td></tr>
</table></div>
<!-- @@@anonymous -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$autoFillBackground-prop$$$autoFillBackground$$$setAutoFillBackgroundbool -->
<h3 class="fn" id="autoFillBackground-prop"><a name="autoFillBackground-prop"></a><span class="name">autoFillBackground</span> : <span class="type">bool</span></h3>
<p>This property holds whether the widget background is filled automatically</p>
<p>If enabled, this property will cause Qt to fill the background of the widget before invoking the <a href="qgraphicswidget.html#paint">paint</a>() method. The color used is defined by the <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::Window</a> color role from the widget's <a href="../qtgui/qpalette.html">palette</a>.</p>
<p>In addition, Windows are always filled with <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::Window</a>, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.</p>
<p>By default, this property is <code>false</code>.</p>
<p>This property was introduced in  Qt 4.7.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>autoFillBackground</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAutoFillBackground</b></span>(bool <i>enabled</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_OpaquePaintEvent</a> and <a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_NoSystemBackground</a>.</p>
<!-- @@@autoFillBackground -->
<!-- $$$focusPolicy-prop$$$focusPolicy$$$setFocusPolicyQt::FocusPolicy -->
<h3 class="fn" id="focusPolicy-prop"><a name="focusPolicy-prop"></a><span class="name">focusPolicy</span> : <span class="type"><a href="../qtcore/qt.html#FocusPolicy-enum">Qt::FocusPolicy</a></span></h3>
<p>This property holds the way the widget accepts keyboard focus</p>
<p>The focus policy is <a href="../qtcore/qt.html#FocusPolicy-enum">Qt::TabFocus</a> if the widget accepts keyboard focus by tabbing, <a href="../qtcore/qt.html#FocusPolicy-enum">Qt::ClickFocus</a> if the widget accepts focus by clicking, <a href="../qtcore/qt.html#FocusPolicy-enum">Qt::StrongFocus</a> if it accepts both, and <a href="../qtcore/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="../qtcore/qt.html#FocusPolicy-enum">Qt::StrongFocus</a>).</p>
<p>If you enable a focus policy (i.e&#x2e;, not <a href="../qtcore/qt.html#FocusPolicy-enum">Qt::NoFocus</a>), <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> will automatically enable the <a href="qgraphicsitem.html#GraphicsItemFlag-enum">ItemIsFocusable</a> flag. Setting <a href="../qtcore/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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::FocusPolicy </td><td class="memItemRight bottomAlign"><span class="name"><b>focusPolicy</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFocusPolicy</b></span>(Qt::FocusPolicy <i>policy</i>)</td></tr>
</table></div>
<p><b>See also </b><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>
<!-- @@@focusPolicy -->
<!-- $$$font-prop$$$font$$$setFontconstQFont& -->
<h3 class="fn" id="font-prop"><a name="font-prop"></a><span class="name">font</span> : <span class="type"><a href="../qtgui/qfont.html">QFont</a></span></h3>
<p>This property holds the widgets' font</p>
<p>This property provides the widget's font.</p>
<p><a href="../qtgui/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="../qtcore/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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QFont </td><td class="memItemRight bottomAlign"><span class="name"><b>font</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setFont</b></span>(const QFont &amp;<i>font</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qapplication.html#font">QApplication::font</a>(), <a href="qgraphicsscene.html#font-prop">QGraphicsScene::font</a>, and <a href="../qtgui/qfont.html#resolve">QFont::resolve</a>().</p>
<!-- @@@font -->
<!-- $$$geometry-prop$$$setGeometryconstQRectF&$$$setGeometryqrealqrealqrealqreal$$$geometryChanged -->
<h3 class="fn" id="geometry-prop"><a name="geometry-prop"></a><span class="name">geometry</span> : <span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span></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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> virtual void </td><td class="memItemRight bottomAlign"><span class="name"><b>setGeometry</b></span>(const QRectF &amp;<i>rect</i>) override</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#setGeometry-1">setGeometry</a></b></span>(qreal <i>x</i>, qreal <i>y</i>, qreal <i>w</i>, qreal <i>h</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#geometryChanged">geometryChanged</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicslayoutitem.html#geometry">geometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</p>
<!-- @@@geometry -->
<!-- $$$layout-prop$$$layout$$$setLayoutQGraphicsLayout* -->
<h3 class="fn" id="layout-prop"><a name="layout-prop"></a><span class="name">layout</span> : <span class="type"><a href="qgraphicslayout.html">QGraphicsLayout</a></span>*</h3>
<p>This property holds the layout of the widget</p>
<p>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><a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> takes ownership of <i>layout</i>.</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>If no layout is currently managing this widget, <a href="qgraphicswidget.html#layout">layout</a>() will return 0.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QGraphicsLayout *</td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#layout">layout</a></b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#setLayout">setLayout</a></b></span>(QGraphicsLayout *<i>layout</i>)</td></tr>
</table></div>
<!-- @@@layout -->
<!-- $$$layoutDirection-prop$$$layoutDirection$$$setLayoutDirectionQt::LayoutDirection$$$unsetLayoutDirection -->
<h3 class="fn" id="layoutDirection-prop"><a name="layoutDirection-prop"></a><span class="name">layoutDirection</span> : <span class="type"><a href="../qtcore/qt.html#LayoutDirection-enum">Qt::LayoutDirection</a></span></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="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_RightToLeft</a> attribute. It also sets this widget's <a href="../qtcore/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="../qtcore/qt.html#LayoutDirection-enum">Qt::LeftToRight</a>, the layout starts placing subwidgets from the left side of this widget towards the right. <a href="../qtcore/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="../qtcore/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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::LayoutDirection </td><td class="memItemRight bottomAlign"><span class="name"><b>layoutDirection</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setLayoutDirection</b></span>(Qt::LayoutDirection <i>direction</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>unsetLayoutDirection</b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qwidget.html#layoutDirection-prop">QWidget::layoutDirection</a> and <a href="../qtgui/qguiapplication.html#layoutDirection-prop">QApplication::layoutDirection</a>.</p>
<!-- @@@layoutDirection -->
<!-- $$$maximumSize-prop -->
<h3 class="fn" id="maximumSize-prop"><a name="maximumSize-prop"></a><span class="name">maximumSize</span> : const <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span></h3>
<p>This property holds the maximum size of the widget</p>
<p><b>See also </b><a href="qgraphicslayoutitem.html#setMaximumSize">setMaximumSize</a>(), <a href="qgraphicslayoutitem.html#maximumSize">maximumSize</a>(), <a href="qgraphicswidget.html#minimumSize-prop">minimumSize</a>, and <a href="qgraphicswidget.html#preferredSize-prop">preferredSize</a>.</p>
<!-- @@@maximumSize -->
<!-- $$$minimumSize-prop -->
<h3 class="fn" id="minimumSize-prop"><a name="minimumSize-prop"></a><span class="name">minimumSize</span> : const <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span></h3>
<p>This property holds the minimum size of the widget</p>
<p><b>See also </b><a href="qgraphicslayoutitem.html#setMinimumSize">setMinimumSize</a>(), <a href="qgraphicslayoutitem.html#minimumSize">minimumSize</a>(), <a href="qgraphicswidget.html#preferredSize-prop">preferredSize</a>, and <a href="qgraphicswidget.html#maximumSize-prop">maximumSize</a>.</p>
<!-- @@@minimumSize -->
<!-- $$$palette-prop$$$palette$$$setPaletteconstQPalette& -->
<h3 class="fn" id="palette-prop"><a name="palette-prop"></a><span class="name">palette</span> : <span class="type"><a href="../qtgui/qpalette.html">QPalette</a></span></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="../qtgui/qpalette.html#ColorRole-enum">QPalette::Button</a>) and states (e.g&#x2e;, <a href="../qtgui/qpalette.html#ColorGroup-enum">QPalette::Inactive</a>), loosely defining the general look of the widget and its children.</p>
<p><a href="../qtgui/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="../qtcore/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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QPalette </td><td class="memItemRight bottomAlign"><span class="name"><b>palette</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPalette</b></span>(const QPalette &amp;<i>palette</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qapplication.html#palette">QApplication::palette</a>(), <a href="qgraphicsscene.html#palette-prop">QGraphicsScene::palette</a>, and <a href="../qtgui/qpalette.html#resolve">QPalette::resolve</a>().</p>
<!-- @@@palette -->
<!-- $$$preferredSize-prop -->
<h3 class="fn" id="preferredSize-prop"><a name="preferredSize-prop"></a><span class="name">preferredSize</span> : const <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span></h3>
<p>This property holds the preferred size of the widget</p>
<p><b>See also </b><a href="qgraphicslayoutitem.html#setPreferredSize">setPreferredSize</a>(), <a href="qgraphicslayoutitem.html#preferredSize">preferredSize</a>(), <a href="qgraphicswidget.html#minimumSize-prop">minimumSize</a>, and <a href="qgraphicswidget.html#maximumSize-prop">maximumSize</a>.</p>
<!-- @@@preferredSize -->
<!-- $$$size-prop$$$size$$$resizeconstQSizeF&$$$resizeqrealqreal$$$geometryChanged -->
<h3 class="fn" id="size-prop"><a name="size-prop"></a><span class="name">size</span> : <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span></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="../qtcore/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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QSizeF </td><td class="memItemRight bottomAlign"><span class="name"><b>size</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>resize</b></span>(const QSizeF &amp;<i>size</i>)</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#resize-1">resize</a></b></span>(qreal <i>w</i>, qreal <i>h</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicswidget.html#geometryChanged">geometryChanged</a></b></span>()</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicswidget.html#geometry-prop">setGeometry</a>(), <a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a>, and <a href="graphicsview.html#qgraphicslayout">QGraphicsLayout</a>.</p>
<!-- @@@size -->
<!-- $$$sizePolicy-prop -->
<h3 class="fn" id="sizePolicy-prop"><a name="sizePolicy-prop"></a><span class="name">sizePolicy</span> : const <span class="type"><a href="qsizepolicy.html">QSizePolicy</a></span></h3>
<p>This property holds the size policy for the widget</p>
<p><b>See also </b><a href="qgraphicslayoutitem.html#sizePolicy">sizePolicy</a>(), <a href="qgraphicslayoutitem.html#setSizePolicy">setSizePolicy</a>(), and <a href="qwidget.html#sizePolicy-prop">QWidget::sizePolicy</a>().</p>
<!-- @@@sizePolicy -->
<!-- $$$windowFlags-prop$$$windowFlags$$$setWindowFlagsQt::WindowFlags -->
<h3 class="fn" id="windowFlags-prop"><a name="windowFlags-prop"></a><span class="name">windowFlags</span> : <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span></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="../qtcore/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="../qtcore/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="../qtcore/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="../qtcore/qt.html#WindowType-enum">Qt::Window</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Qt::WindowFlags </td><td class="memItemRight bottomAlign"><span class="name"><b>windowFlags</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWindowFlags</b></span>(Qt::WindowFlags <i>wFlags</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qgraphicsitem.html#isWindow">isWindow</a>() and <a href="qgraphicsitem.html#isPanel">isPanel</a>().</p>
<!-- @@@windowFlags -->
<!-- $$$windowTitle-prop$$$windowTitle$$$setWindowTitleconstQString& -->
<h3 class="fn" id="windowTitle-prop"><a name="windowTitle-prop"></a><span class="name">windowTitle</span> : <span class="type"><a href="../qtcore/qstring.html">QString</a></span></h3>
<p>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>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>windowTitle</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setWindowTitle</b></span>(const QString &amp;<i>title</i>)</td></tr>
</table></div>
<!-- @@@windowTitle -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QGraphicsWidget[overload1]$$$QGraphicsWidgetQGraphicsItem*Qt::WindowFlags -->
<h3 class="fn" id="QGraphicsWidget"><a name="QGraphicsWidget"></a>QGraphicsWidget::<span class="name">QGraphicsWidget</span>(<span class="type"><a href="qgraphicsitem.html#QGraphicsItem">QGraphicsItem</a></span> *<i>parent</i> = nullptr, <span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>wFlags</i> = ...)</h3>
<p>Constructs a <a href="graphicsview.html#qgraphicswidget">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>
<!-- @@@QGraphicsWidget -->
<!-- $$$~QGraphicsWidget[overload1]$$$~QGraphicsWidget -->
<h3 class="fn" id="dtor.QGraphicsWidget"><a name="dtor.QGraphicsWidget"></a><code>[virtual] </code>QGraphicsWidget::<span class="name">~QGraphicsWidget</span>()</h3>
<p>Destroys the <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> instance.</p>
<!-- @@@~QGraphicsWidget -->
<!-- $$$actions[overload1]$$$actions -->
<h3 class="fn" id="actions"><a name="actions"></a><span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qaction.html">QAction</a></span> *&gt; QGraphicsWidget::<span class="name">actions</span>() 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><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>
<!-- @@@actions -->
<!-- $$$addAction[overload1]$$$addActionQAction* -->
<h3 class="fn" id="addAction"><a name="addAction"></a><span class="type">void</span> QGraphicsWidget::<span class="name">addAction</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<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="graphicsview.html#qgraphicswidget">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>
<!-- @@@addAction -->
<!-- $$$addActions[overload1]$$$addActionsQList<QAction*> -->
<h3 class="fn" id="addActions"><a name="addActions"></a><span class="type">void</span> QGraphicsWidget::<span class="name">addActions</span>(<span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qaction.html">QAction</a></span> *&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><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>
<!-- @@@addActions -->
<!-- $$$adjustSize[overload1]$$$adjustSize -->
<h3 class="fn" id="adjustSize"><a name="adjustSize"></a><span class="type">void</span> QGraphicsWidget::<span class="name">adjustSize</span>()</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="../qtcore/qt.html#SizeHint-enum">Qt::MinimumSize</a>.</p>
<!-- @@@adjustSize -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn" id="boundingRect"><a name="boundingRect"></a><code>[override virtual] </code><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsWidget::<span class="name">boundingRect</span>() const</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#boundingRect">QGraphicsItem::boundingRect</a>().</p>
<!-- @@@boundingRect -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn" id="changeEvent"><a name="changeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">changeEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<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="../qtcore/qevent.html#Type-enum">QEvent::ActivationChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::EnabledChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::FontChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::StyleChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::PaletteChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::ParentChange</a>, <a href="../qtcore/qevent.html#Type-enum">QEvent::LayoutDirectionChange</a>, and <a href="../qtcore/qevent.html#Type-enum">QEvent::ContentsRectChange</a>.</p>
<!-- @@@changeEvent -->
<!-- $$$close[overload1]$$$close -->
<h3 class="fn" id="close"><a name="close"></a><code>[slot] </code><span class="type">bool</span> QGraphicsWidget::<span class="name">close</span>()</h3>
<p>Call this function to close the widget.</p>
<p>Returns <code>true</code> if the widget was closed; otherwise returns <code>false</code>. This slot will first send a <a href="../qtgui/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="../qtcore/qt.html#WidgetAttribute-enum">Qt::WA_DeleteOnClose</a> attribute set it will be deleted.</p>
<!-- @@@close -->
<!-- $$$closeEvent[overload1]$$$closeEventQCloseEvent* -->
<h3 class="fn" id="closeEvent"><a name="closeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">closeEvent</span>(<span class="type"><a href="../qtgui/qcloseevent.html">QCloseEvent</a></span> *<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="../qtgui/qcloseevent.html">QCloseEvent</a>.</p>
<!-- @@@closeEvent -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" id="event"><a name="event"></a><code>[override virtual protected] </code><span class="type">bool</span> QGraphicsWidget::<span class="name">event</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsobject.html#event">QGraphicsObject::event</a>().</p>
<p>Handles the <i>event</i>. <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> handles the following events:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Event</th><th >Usage</th></tr></thead>
<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></div>
<!-- @@@event -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn" id="focusInEvent"><a name="focusInEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">focusInEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusInEvent">QGraphicsItem::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusNextPrevChild[overload1]$$$focusNextPrevChildbool -->
<h3 class="fn" id="focusNextPrevChild"><a name="focusNextPrevChild"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsWidget::<span class="name">focusNextPrevChild</span>(<span class="type">bool</span> <i>next</i>)</h3>
<p>Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns <code>true</code> if it can find a new widget; returns <code>false</code> 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>
<!-- @@@focusNextPrevChild -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn" id="focusOutEvent"><a name="focusOutEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">focusOutEvent</span>(<span class="type"><a href="../qtgui/qfocusevent.html">QFocusEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$focusWidget[overload1]$$$focusWidget -->
<h3 class="fn" id="focusWidget"><a name="focusWidget"></a><span class="type"><a href="qgraphicswidget.html#QGraphicsWidget">QGraphicsWidget</a></span> *QGraphicsWidget::<span class="name">focusWidget</span>() 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><b>See also </b><a href="qgraphicsitem.html#focusItem">QGraphicsItem::focusItem</a>() and <a href="qwidget.html#focusWidget">QWidget::focusWidget</a>().</p>
<!-- @@@focusWidget -->
<!-- $$$geometryChanged -->
<h3 class="fn" id="geometryChanged"><a name="geometryChanged"></a><code>[signal] </code><span class="type">void</span> QGraphicsWidget::<span class="name">geometryChanged</span>()</h3>
<p>This signal gets emitted whenever the geometry is changed in <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>().</p>
<p><b>Note:</b> Notifier signal for property <a href="qgraphicswidget.html#geometry-prop">geometry</a>. Notifier signal for property <a href="qgraphicswidget.html#size-prop">size</a>. </p><!-- @@@geometryChanged -->
<!-- $$$getContentsMargins[overload1]$$$getContentsMarginsqreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getContentsMargins"><a name="getContentsMargins"></a><code>[override virtual] </code><span class="type">void</span> QGraphicsWidget::<span class="name">getContentsMargins</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>left</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>top</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>right</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>bottom</i>) const</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>
<!-- @@@getContentsMargins -->
<!-- $$$getWindowFrameMargins[overload1]$$$getWindowFrameMarginsqreal*qreal*qreal*qreal* -->
<h3 class="fn" id="getWindowFrameMargins"><a name="getWindowFrameMargins"></a><span class="type">void</span> QGraphicsWidget::<span class="name">getWindowFrameMargins</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>left</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>top</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<i>right</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> *<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><b>See also </b><a href="qgraphicswidget.html#setWindowFrameMargins">setWindowFrameMargins</a>() and <a href="qgraphicswidget.html#windowFrameRect">windowFrameRect</a>().</p>
<!-- @@@getWindowFrameMargins -->
<!-- $$$grabKeyboardEvent[overload1]$$$grabKeyboardEventQEvent* -->
<h3 class="fn" id="grabKeyboardEvent"><a name="grabKeyboardEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">grabKeyboardEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for <a href="../qtcore/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>
<!-- @@@grabKeyboardEvent -->
<!-- $$$grabMouseEvent[overload1]$$$grabMouseEventQEvent* -->
<h3 class="fn" id="grabMouseEvent"><a name="grabMouseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">grabMouseEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for <a href="../qtcore/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>
<!-- @@@grabMouseEvent -->
<!-- $$$grabShortcut[overload1]$$$grabShortcutconstQKeySequence&Qt::ShortcutContext -->
<h3 class="fn" id="grabShortcut"><a name="grabShortcut"></a><span class="type">int</span> QGraphicsWidget::<span class="name">grabShortcut</span>(const <span class="type"><a href="../qtgui/qkeysequence.html">QKeySequence</a></span> &amp;<i>sequence</i>, <span class="type"><a href="../qtcore/qt.html#ShortcutContext-enum">Qt::ShortcutContext</a></span> <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="../qtcore/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="../qtcore/qt.html#ShortcutContext-enum">Qt::WidgetShortcut</a>, or to the window itself, <a href="../qtcore/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="../qtcore/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="../qtcore/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>
<!-- @@@grabShortcut -->
<!-- $$$hideEvent[overload1]$$$hideEventQHideEvent* -->
<h3 class="fn" id="hideEvent"><a name="hideEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">hideEvent</span>(<span class="type"><a href="../qtgui/qhideevent.html">QHideEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <a href="../qtcore/qevent.html#Type-enum">Hide</a> events, is delivered after the widget has been hidden, for example, <a href="qgraphicsitem.html#setVisible">setVisible</a>(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="../qtcore/qevent.html#accept">QEvent::accept</a>() or <a href="../qtcore/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>
<!-- @@@hideEvent -->
<!-- $$$hoverLeaveEvent[overload1]$$$hoverLeaveEventQGraphicsSceneHoverEvent* -->
<h3 class="fn" id="hoverLeaveEvent"><a name="hoverLeaveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">hoverLeaveEvent</span>(<span class="type"><a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverLeaveEvent">QGraphicsItem::hoverLeaveEvent</a>().</p>
<!-- @@@hoverLeaveEvent -->
<!-- $$$hoverMoveEvent[overload1]$$$hoverMoveEventQGraphicsSceneHoverEvent* -->
<h3 class="fn" id="hoverMoveEvent"><a name="hoverMoveEvent"></a><code>[override virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">hoverMoveEvent</span>(<span class="type"><a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverMoveEvent">QGraphicsItem::hoverMoveEvent</a>().</p>
<!-- @@@hoverMoveEvent -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOption* -->
<h3 class="fn" id="initStyleOption"><a name="initStyleOption"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">initStyleOption</span>(<span class="type"><a href="qstyleoption.html">QStyleOption</a></span> *<i>option</i>) const</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>
<div class="table"><table class="generic">
 <thead><tr 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="../qtgui/qfontmetrics.html">QFontMetrics</a>(<a href="qgraphicswidget.html#font-prop">QGraphicsWidget::font</a>()).</td></tr>
</table></div>
<p>Subclasses of <a href="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> should call the base implementation, and then test the type of <i>option</i> using <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>&lt;&gt;() 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">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">&lt;</span><span class="type"><a href="qstyleoptiongroupbox.html">QStyleOptionGroupBox</a></span> <span class="operator">*</span><span class="operator">&gt;</span>(option)) {
          <span class="comment">// Add group box specific state.</span>
          box<span class="operator">-</span><span class="operator">&gt;</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>
<!-- @@@initStyleOption -->
<!-- $$$insertAction[overload1]$$$insertActionQAction*QAction* -->
<h3 class="fn" id="insertAction"><a name="insertAction"></a><span class="type">void</span> QGraphicsWidget::<span class="name">insertAction</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<i>before</i>, <span class="type"><a href="qaction.html">QAction</a></span> *<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="graphicsview.html#qgraphicswidget">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>
<!-- @@@insertAction -->
<!-- $$$insertActions[overload1]$$$insertActionsQAction*QList<QAction*> -->
<h3 class="fn" id="insertActions"><a name="insertActions"></a><span class="type">void</span> QGraphicsWidget::<span class="name">insertActions</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<i>before</i>, <span class="type"><a href="../qtcore/qlist.html">QList</a></span>&lt;<span class="type"><a href="qaction.html">QAction</a></span> *&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="graphicsview.html#qgraphicswidget">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>
<!-- @@@insertActions -->
<!-- $$$isActiveWindow[overload1]$$$isActiveWindow -->
<h3 class="fn" id="isActiveWindow"><a name="isActiveWindow"></a><span class="type">bool</span> QGraphicsWidget::<span class="name">isActiveWindow</span>() const</h3>
<p>Returns <code>true</code> 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><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>
<!-- @@@isActiveWindow -->
<!-- $$$itemChange[overload1]$$$itemChangeQGraphicsItem::GraphicsItemChangeconstQVariant& -->
<h3 class="fn" id="itemChange"><a name="itemChange"></a><code>[override virtual protected] </code><span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> QGraphicsWidget::<span class="name">itemChange</span>(<span class="type"><a href="qgraphicsitem.html#GraphicsItemChange-enum">QGraphicsItem::GraphicsItemChange</a></span> <i>change</i>, const <span class="type"><a href="../qtcore/qvariant.html">QVariant</a></span> &amp;<i>value</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#itemChange">QGraphicsItem::itemChange</a>().</p>
<p><a href="graphicsview.html#qgraphicswidget">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="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> uses <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemVisibleChange</a> to deliver <a href="../qtcore/qevent.html#Type-enum">Show</a> and <a href="../qtcore/qevent.html#Type-enum">Hide</a> events, <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemPositionHasChanged</a> to deliver <a href="../qtcore/qevent.html#Type-enum">Move</a> events, and <a href="qgraphicsitem.html#GraphicsItemChange-enum">ItemParentChange</a> both to deliver <a href="../qtcore/qevent.html#Type-enum">ParentChange</a> events, and for managing the focus chain.</p>
<p><a href="graphicsview.html#qgraphicswidget">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>
<!-- @@@itemChange -->
<!-- $$$layout -->
<h3 class="fn" id="layout"><a name="layout"></a><span class="type"><a href="qgraphicslayout.html">QGraphicsLayout</a></span> *QGraphicsWidget::<span class="name">layout</span>() const</h3>
<p>Returns this widget's layout, or 0 if no layout is currently managing this widget.</p>
<p><b>Note:</b> Getter function for property <a href="qgraphicswidget.html#layout-prop">layout</a>. </p><p><b>See also </b><a href="qgraphicswidget.html#setLayout">setLayout</a>().</p>
<!-- @@@layout -->
<!-- $$$moveEvent[overload1]$$$moveEventQGraphicsSceneMoveEvent* -->
<h3 class="fn" id="moveEvent"><a name="moveEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">moveEvent</span>(<span class="type"><a href="qgraphicsscenemoveevent.html">QGraphicsSceneMoveEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <a href="../qtcore/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="../qtcore/qevent.html#accept">QEvent::accept</a>() or <a href="../qtcore/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>
<!-- @@@moveEvent -->
<!-- $$$paint[overload1]$$$paintQPainter*constQStyleOptionGraphicsItem*QWidget* -->
<h3 class="fn" id="paint"><a name="paint"></a><code>[override virtual] </code><span class="type">void</span> QGraphicsWidget::<span class="name">paint</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> *<i>option</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i> = nullptr)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<!-- @@@paint -->
<!-- $$$paintWindowFrame[overload1]$$$paintWindowFrameQPainter*constQStyleOptionGraphicsItem*QWidget* -->
<h3 class="fn" id="paintWindowFrame"><a name="paintWindowFrame"></a><code>[virtual] </code><span class="type">void</span> QGraphicsWidget::<span class="name">paintWindowFrame</span>(<span class="type"><a href="../qtgui/qpainter.html">QPainter</a></span> *<i>painter</i>, const <span class="type"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></span> *<i>option</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> *<i>widget</i> = nullptr)</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="graphicsview.html#qgraphicswidget">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>
<!-- @@@paintWindowFrame -->
<!-- $$$polishEvent[overload1]$$$polishEvent -->
<h3 class="fn" id="polishEvent"><a name="polishEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">polishEvent</span>()</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>
<!-- @@@polishEvent -->
<!-- $$$rect[overload1]$$$rect -->
<h3 class="fn" id="rect"><a name="rect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsWidget::<span class="name">rect</span>() const</h3>
<p>Returns the item's local rect as a <a href="../qtcore/qrectf.html">QRectF</a>. This function is equivalent to <a href="../qtcore/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>
<!-- @@@rect -->
<!-- $$$releaseShortcut[overload1]$$$releaseShortcutint -->
<h3 class="fn" id="releaseShortcut"><a name="releaseShortcut"></a><span class="type">void</span> QGraphicsWidget::<span class="name">releaseShortcut</span>(<span class="type">int</span> <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="../qtcore/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>
<!-- @@@releaseShortcut -->
<!-- $$$removeAction[overload1]$$$removeActionQAction* -->
<h3 class="fn" id="removeAction"><a name="removeAction"></a><span class="type">void</span> QGraphicsWidget::<span class="name">removeAction</span>(<span class="type"><a href="qaction.html">QAction</a></span> *<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>
<!-- @@@removeAction -->
<!-- $$$resize -->
<h3 class="fn" id="resize-1"><a name="resize-1"></a><span class="type">void</span> QGraphicsWidget::<span class="name">resize</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>)</h3>
<p>This is an overloaded function.</p>
<p>Constructs a resize with the given <code>width</code> (<i>w</i>) and <code>height</code> (<i>h</i>). This convenience function is equivalent to calling resize(<a href="../qtcore/qsizef.html">QSizeF</a>(w, h)).</p>
<p><b>Note:</b> Setter function for property <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="qgraphicsitem.html#setTransform">setTransform</a>().</p>
<!-- @@@resize -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQGraphicsSceneResizeEvent* -->
<h3 class="fn" id="resizeEvent"><a name="resizeEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">resizeEvent</span>(<span class="type"><a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <a href="../qtcore/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="../qtcore/qevent.html#accept">QEvent::accept</a>() or <a href="../qtcore/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>
<!-- @@@resizeEvent -->
<!-- $$$sceneEvent[overload1]$$$sceneEventQEvent* -->
<h3 class="fn" id="sceneEvent"><a name="sceneEvent"></a><code>[override virtual protected] </code><span class="type">bool</span> QGraphicsWidget::<span class="name">sceneEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#sceneEvent">QGraphicsItem::sceneEvent</a>().</p>
<p><a href="graphicsview.html#qgraphicswidget">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="graphicsview.html#qgraphicswidget">QGraphicsWidget</a>.</p>
<p><b>See also </b><a href="qgraphicsitem.html#sceneEvent">QGraphicsItem::sceneEvent</a>().</p>
<!-- @@@sceneEvent -->
<!-- $$$setAttribute[overload1]$$$setAttributeQt::WidgetAttributebool -->
<h3 class="fn" id="setAttribute"><a name="setAttribute"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setAttribute</span>(<span class="type"><a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a></span> <i>attribute</i>, <span class="type">bool</span> <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="graphicsview.html#qgraphicswidget">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>
<!-- @@@setAttribute -->
<!-- $$$setContentsMargins[overload1]$$$setContentsMarginsqrealqrealqrealqreal -->
<h3 class="fn" id="setContentsMargins"><a name="setContentsMargins"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setContentsMargins</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>left</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>top</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>right</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <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="../qtcore/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>
<!-- @@@setContentsMargins -->
<!-- $$$setGeometry -->
<h3 class="fn" id="setGeometry-1"><a name="setGeometry-1"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setGeometry</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>w</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>h</i>)</h3>
<p>This convenience function is equivalent to calling <a href="qgraphicswidget.html#geometry-prop">setGeometry</a>(<a href="../qtcore/qrectf.html">QRectF</a>( <i>x</i>, <i>y</i>, <i>w</i>, <i>h</i>)).</p>
<p><b>Note:</b> Setter function for property <a href="qgraphicswidget.html#geometry-prop">geometry</a>. </p><p><b>See also </b><a href="qgraphicslayoutitem.html#geometry">geometry</a>() and <a href="qgraphicswidget.html#size-prop">resize</a>().</p>
<!-- @@@setGeometry -->
<!-- $$$setLayout -->
<h3 class="fn" id="setLayout"><a name="setLayout"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setLayout</span>(<span class="type"><a href="qgraphicslayout.html">QGraphicsLayout</a></span> *<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="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> takes ownership of <i>layout</i>.</p>
<p><b>Note:</b> Setter function for property <a href="qgraphicswidget.html#layout-prop">layout</a>. </p><p><b>See also </b><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>
<!-- @@@setLayout -->
<!-- $$$setShortcutAutoRepeat[overload1]$$$setShortcutAutoRepeatintbool -->
<h3 class="fn" id="setShortcutAutoRepeat"><a name="setShortcutAutoRepeat"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setShortcutAutoRepeat</span>(<span class="type">int</span> <i>id</i>, <span class="type">bool</span> <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>
<!-- @@@setShortcutAutoRepeat -->
<!-- $$$setShortcutEnabled[overload1]$$$setShortcutEnabledintbool -->
<h3 class="fn" id="setShortcutEnabled"><a name="setShortcutEnabled"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setShortcutEnabled</span>(<span class="type">int</span> <i>id</i>, <span class="type">bool</span> <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>
<!-- @@@setShortcutEnabled -->
<!-- $$$setStyle[overload1]$$$setStyleQStyle* -->
<h3 class="fn" id="setStyle"><a name="setStyle"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setStyle</span>(<span class="type"><a href="qstyle.html">QStyle</a></span> *<i>style</i>)</h3>
<p>Sets the widget's style to <i>style</i>. <a href="graphicsview.html#qgraphicswidget">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="../qtcore/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>
<!-- @@@setStyle -->
<!-- $$$setTabOrder[overload1]$$$setTabOrderQGraphicsWidget*QGraphicsWidget* -->
<h3 class="fn" id="setTabOrder"><a name="setTabOrder"></a><code>[static] </code><span class="type">void</span> QGraphicsWidget::<span class="name">setTabOrder</span>(<span class="type"><a href="qgraphicswidget.html#QGraphicsWidget">QGraphicsWidget</a></span> *<i>first</i>, <span class="type"><a href="qgraphicswidget.html#QGraphicsWidget">QGraphicsWidget</a></span> *<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&#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><b>See also </b><a href="qgraphicswidget.html#focusPolicy-prop">focusPolicy</a> and <a href="focus.html">Keyboard Focus in Widgets</a>.</p>
<!-- @@@setTabOrder -->
<!-- $$$setWindowFrameMargins[overload1]$$$setWindowFrameMarginsqrealqrealqrealqreal -->
<h3 class="fn" id="setWindowFrameMargins"><a name="setWindowFrameMargins"></a><span class="type">void</span> QGraphicsWidget::<span class="name">setWindowFrameMargins</span>(<span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>left</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>top</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <i>right</i>, <span class="type"><a href="../qtcore/qtglobal.html#qreal-typedef">qreal</a></span> <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>
<!-- @@@setWindowFrameMargins -->
<!-- $$$shape[overload1]$$$shape -->
<h3 class="fn" id="shape"><a name="shape"></a><code>[override virtual] </code><span class="type"><a href="../qtgui/qpainterpath.html">QPainterPath</a></span> QGraphicsWidget::<span class="name">shape</span>() const</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#shape">QGraphicsItem::shape</a>().</p>
<!-- @@@shape -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn" id="showEvent"><a name="showEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">showEvent</span>(<span class="type"><a href="../qtgui/qshowevent.html">QShowEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <a href="../qtcore/qevent.html#Type-enum">Show</a> events, is delivered before the widget has been shown, for example, <a href="qgraphicsitem.html#setVisible">setVisible</a>(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="../qtcore/qevent.html#accept">QEvent::accept</a>() or <a href="../qtcore/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>
<!-- @@@showEvent -->
<!-- $$$sizeHint[overload1]$$$sizeHintQt::SizeHintconstQSizeF& -->
<h3 class="fn" id="sizeHint"><a name="sizeHint"></a><code>[override virtual protected] </code><span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span> QGraphicsWidget::<span class="name">sizeHint</span>(<span class="type"><a href="../qtcore/qt.html#SizeHint-enum">Qt::SizeHint</a></span> <i>which</i>, const <span class="type"><a href="../qtcore/qsizef.html">QSizeF</a></span> &amp;<i>constraint</i> = QSizeF()) const</h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$style[overload1]$$$style -->
<h3 class="fn" id="style"><a name="style"></a><span class="type"><a href="qstyle.html">QStyle</a></span> *QGraphicsWidget::<span class="name">style</span>() 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><b>See also </b><a href="qgraphicswidget.html#setStyle">setStyle</a>().</p>
<!-- @@@style -->
<!-- $$$testAttribute[overload1]$$$testAttributeQt::WidgetAttribute -->
<h3 class="fn" id="testAttribute"><a name="testAttribute"></a><span class="type">bool</span> QGraphicsWidget::<span class="name">testAttribute</span>(<span class="type"><a href="../qtcore/qt.html#WidgetAttribute-enum">Qt::WidgetAttribute</a></span> <i>attribute</i>) const</h3>
<p>Returns <code>true</code> if <i>attribute</i> is enabled for this widget; otherwise, returns <code>false</code>.</p>
<p><b>See also </b><a href="qgraphicswidget.html#setAttribute">setAttribute</a>().</p>
<!-- @@@testAttribute -->
<!-- $$$type[overload1]$$$type -->
<h3 class="fn" id="type"><a name="type"></a><code>[override virtual] </code><span class="type">int</span> QGraphicsWidget::<span class="name">type</span>() const</h3>
<p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>().</p>
<!-- @@@type -->
<!-- $$$ungrabKeyboardEvent[overload1]$$$ungrabKeyboardEventQEvent* -->
<h3 class="fn" id="ungrabKeyboardEvent"><a name="ungrabKeyboardEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">ungrabKeyboardEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for <a href="../qtcore/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>
<!-- @@@ungrabKeyboardEvent -->
<!-- $$$ungrabMouseEvent[overload1]$$$ungrabMouseEventQEvent* -->
<h3 class="fn" id="ungrabMouseEvent"><a name="ungrabMouseEvent"></a><code>[virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">ungrabMouseEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</i>)</h3>
<p>This event handler, for <i>event</i>, can be reimplemented in a subclass to receive notifications for <a href="../qtcore/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>
<!-- @@@ungrabMouseEvent -->
<!-- $$$unsetWindowFrameMargins[overload1]$$$unsetWindowFrameMargins -->
<h3 class="fn" id="unsetWindowFrameMargins"><a name="unsetWindowFrameMargins"></a><span class="type">void</span> QGraphicsWidget::<span class="name">unsetWindowFrameMargins</span>()</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>
<!-- @@@unsetWindowFrameMargins -->
<!-- $$$updateGeometry[overload1]$$$updateGeometry -->
<h3 class="fn" id="updateGeometry"><a name="updateGeometry"></a><code>[override virtual protected] </code><span class="type">void</span> QGraphicsWidget::<span class="name">updateGeometry</span>()</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>
<!-- @@@updateGeometry -->
<!-- $$$windowFrameEvent[overload1]$$$windowFrameEventQEvent* -->
<h3 class="fn" id="windowFrameEvent"><a name="windowFrameEvent"></a><code>[virtual protected] </code><span class="type">bool</span> QGraphicsWidget::<span class="name">windowFrameEvent</span>(<span class="type"><a href="../qtcore/qevent.html">QEvent</a></span> *<i>event</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="graphicsview.html#qgraphicswidget">QGraphicsWidget</a> to provide your own custom window frame interaction support.</p>
<p>Returns <code>true</code> if <i>event</i> has been recognized and processed; otherwise, returns <code>false</code>.</p>
<p><b>See also </b><a href="qgraphicswidget.html#event">event</a>().</p>
<!-- @@@windowFrameEvent -->
<!-- $$$windowFrameGeometry[overload1]$$$windowFrameGeometry -->
<h3 class="fn" id="windowFrameGeometry"><a name="windowFrameGeometry"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsWidget::<span class="name">windowFrameGeometry</span>() const</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>
<!-- @@@windowFrameGeometry -->
<!-- $$$windowFrameRect[overload1]$$$windowFrameRect -->
<h3 class="fn" id="windowFrameRect"><a name="windowFrameRect"></a><span class="type"><a href="../qtcore/qrectf.html">QRectF</a></span> QGraphicsWidget::<span class="name">windowFrameRect</span>() const</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>
<!-- @@@windowFrameRect -->
<!-- $$$windowFrameSectionAt[overload1]$$$windowFrameSectionAtconstQPointF& -->
<h3 class="fn" id="windowFrameSectionAt"><a name="windowFrameSectionAt"></a><code>[virtual protected] </code><span class="type"><a href="../qtcore/qt.html#WindowFrameSection-enum">Qt::WindowFrameSection</a></span> QGraphicsWidget::<span class="name">windowFrameSectionAt</span>(const <span class="type"><a href="../qtcore/qpointf.html">QPointF</a></span> &amp;<i>pos</i>) const</h3>
<p>Returns the window frame section at position <i>pos</i>, or <a href="../qtcore/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="graphicsview.html#qgraphicswidget">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="../qtcore/qt.html#WindowFrameSection-enum">Qt::NoSection</a> for all sections except <a href="../qtcore/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>
<!-- @@@windowFrameSectionAt -->
<!-- $$$windowType[overload1]$$$windowType -->
<h3 class="fn" id="windowType"><a name="windowType"></a><span class="type"><a href="../qtcore/qt.html#WindowType-enum">Qt::WindowType</a></span> QGraphicsWidget::<span class="name">windowType</span>() const</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>
<!-- @@@windowType -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>