Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4189

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qgraphicsproxywidget.cpp -->
<head>
  <title>Qt 4.6: QGraphicsProxyWidget Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QGraphicsProxyWidget"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QGraphicsProxyWidget Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QGraphicsProxyWidget class provides a proxy layer for embedding a <a href="qwidget.html">QWidget</a> in a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsProxyWidget&gt;</pre><p>Inherits <a href="qgraphicswidget.html">QGraphicsWidget</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="qgraphicsproxywidget-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#QGraphicsProxyWidget">QGraphicsProxyWidget</a></b> ( QGraphicsItem * <i>parent</i> = 0, Qt::WindowFlags <i>wFlags</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#dtor.QGraphicsProxyWidget">~QGraphicsProxyWidget</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QGraphicsProxyWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#createProxyForChildWidget">createProxyForChildWidget</a></b> ( QWidget * <i>child</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#setWidget">setWidget</a></b> ( QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QRectF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#subWidgetRect">subWidgetRect</a></b> ( const QWidget * <i>widget</i> ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">QWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#widget">widget</a></b> () const</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#paint">paint</a></b> ( QPainter * <i>painter</i>, const QStyleOptionGraphicsItem * <i>option</i>, QWidget * <i>widget</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#setGeometry">setGeometry</a></b> ( const QRectF &amp; <i>rect</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#type">type</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>51 public functions inherited from <a href="qgraphicswidget.html#public-functions">QGraphicsWidget</a></li>
<li><div bar="2" class="fn"></div>2 public functions inherited from <a href="qgraphicsobject.html#public-functions">QGraphicsObject</a></li>
<li><div bar="2" class="fn"></div>35 public functions inherited from <a href="qgraphicslayoutitem.html#public-functions">QGraphicsLayoutItem</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>177 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<hr />
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#contextMenuEvent">contextMenuEvent</a></b> ( QGraphicsSceneContextMenuEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#dragEnterEvent">dragEnterEvent</a></b> ( QGraphicsSceneDragDropEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#dragLeaveEvent">dragLeaveEvent</a></b> ( QGraphicsSceneDragDropEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#dragMoveEvent">dragMoveEvent</a></b> ( QGraphicsSceneDragDropEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#dropEvent">dropEvent</a></b> ( QGraphicsSceneDragDropEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#eventFilter">eventFilter</a></b> ( QObject * <i>object</i>, QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#focusNextPrevChild">focusNextPrevChild</a></b> ( bool <i>next</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#grabMouseEvent">grabMouseEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#hideEvent">hideEvent</a></b> ( QHideEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#hoverEnterEvent">hoverEnterEvent</a></b> ( QGraphicsSceneHoverEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#hoverLeaveEvent">hoverLeaveEvent</a></b> ( QGraphicsSceneHoverEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#hoverMoveEvent">hoverMoveEvent</a></b> ( QGraphicsSceneHoverEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QVariant </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#itemChange">itemChange</a></b> ( GraphicsItemChange <i>change</i>, const QVariant &amp; <i>value</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#keyReleaseEvent">keyReleaseEvent</a></b> ( QKeyEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#mouseDoubleClickEvent">mouseDoubleClickEvent</a></b> ( QGraphicsSceneMouseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QGraphicsSceneMouseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#mousePressEvent">mousePressEvent</a></b> ( QGraphicsSceneMouseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QGraphicsSceneMouseEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#resizeEvent">resizeEvent</a></b> ( QGraphicsSceneResizeEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#showEvent">showEvent</a></b> ( QShowEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QSizeF </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#sizeHint">sizeHint</a></b> ( Qt::SizeHint <i>which</i>, const QSizeF &amp; <i>constraint</i> = QSizeF() ) const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#ungrabMouseEvent">ungrabMouseEvent</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#wheelEvent">wheelEvent</a></b> ( QGraphicsSceneWheelEvent * <i>event</i> )</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>24 protected functions inherited from <a href="qgraphicswidget.html#protected-functions">QGraphicsWidget</a></li>
<li><div bar="2" class="fn"></div>3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
<li><div bar="2" class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<hr />
<a name="protected-slots"></a>
<h2>Protected Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">QGraphicsProxyWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qgraphicsproxywidget.html#newProxyWidget">newProxyWidget</a></b> ( const QWidget * <i>child</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>12 properties inherited from <a href="qgraphicswidget.html#properties">QGraphicsWidget</a></li>
<li><div class="fn"></div>11 properties inherited from <a href="qgraphicsobject.html#properties">QGraphicsObject</a></li>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qgraphicswidget.html#public-slots">QGraphicsWidget</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>9 signals inherited from <a href="qgraphicsobject.html#signals">QGraphicsObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>1 static public member inherited from <a href="qgraphicswidget.html#static-public-members">QGraphicsWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>2 static public members inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"></div>24 protected functions inherited from <a href="qgraphicswidget.html#protected-functions">QGraphicsWidget</a></li>
<li><div class="fn"></div>3 protected functions inherited from <a href="qgraphicslayoutitem.html#protected-functions">QGraphicsLayoutItem</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QGraphicsProxyWidget class provides a proxy layer for embedding a <a href="qwidget.html">QWidget</a> in a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>QGraphicsProxyWidget embeds <a href="qwidget.html">QWidget</a>-based widgets, for example, a <a href="qpushbutton.html">QPushButton</a>, <a href="qfontcombobox.html">QFontComboBox</a>, or even <a href="qfiledialog.html">QFileDialog</a>, into <a href="qgraphicsscene.html">QGraphicsScene</a>. It forwards events between the two objects and translates between <a href="qwidget.html">QWidget</a>'s integer-based geometry and <a href="qgraphicswidget.html">QGraphicsWidget</a>'s qreal-based geometry. QGraphicsProxyWidget supports all core features of <a href="qwidget.html">QWidget</a>, including tab focus, keyboard input, Drag &amp; Drop, and popups. You can also embed complex widgets, e.g&#x2e;, widgets with subwidgets.</p>
<p>Example:</p>
<pre> int main(int argc, char **argv)
 {
     QApplication app(argc, argv);

     QTabWidget *tabWidget = new QTabWidget;

     QGraphicsScene scene;
     QGraphicsProxyWidget *proxy = scene.addWidget(tabWidget);

     QGraphicsView view(&amp;scene);
     view.show();

     return app.exec();
 }</pre>
<p>QGraphicsProxyWidget takes care of automatically embedding popup children of embedded widgets through creating a child proxy for each popup. This means that when an embedded <a href="qcombobox.html">QComboBox</a> shows its popup list, a new QGraphicsProxyWidget is created automatically, embedding the popup, and positioning it correctly. This only works if the popup is child of the embedded widget (for example <a href="qtoolbutton.html#setMenu">QToolButton::setMenu</a>() requires the <a href="qmenu.html">QMenu</a> instance to be child of the <a href="qtoolbutton.html">QToolButton</a>).</p>
<a name="embedding-a-widget-with-qgraphicsproxywidget"></a>
<h3>Embedding a Widget with QGraphicsProxyWidget</h3>
<p>There are two ways to embed a widget using QGraphicsProxyWidget. The most common way is to pass a widget pointer to <a href="qgraphicsscene.html#addWidget">QGraphicsScene::addWidget</a>() together with any relevant <a href="qt.html#WindowType-enum">Qt::WindowFlags</a>. This function returns a pointer to a QGraphicsProxyWidget. You can then choose to reparent or position either the proxy, or the embedded widget itself.</p>
<p>For example, in the code snippet below, we embed a group box into the proxy:</p>
<pre> QGroupBox *groupBox = new QGroupBox(&quot;Contact Details&quot;);
 QLabel *numberLabel = new QLabel(&quot;Telephone number&quot;);
 QLineEdit *numberEdit = new QLineEdit;

 QFormLayout *layout = new QFormLayout;
 layout-&gt;addRow(numberLabel, numberEdit);
 groupBox-&gt;setLayout(layout);

 QGraphicsScene scene;
 QGraphicsProxyWidget *proxy = scene.addWidget(groupBox);

 QGraphicsView view(&amp;scene);
 view.show();</pre>
<p>The image below is the output obtained with its contents margin and contents rect labeled.</p>
<p align="center"><img src="images/qgraphicsproxywidget-embed.png" /></p><p>Alternatively, you can start by creating a new QGraphicsProxyWidget item, and then call <a href="qgraphicsproxywidget.html#setWidget">setWidget</a>() to embed a <a href="qwidget.html">QWidget</a> later. The <a href="qgraphicsproxywidget.html#widget">widget</a>() function returns a pointer to the embedded widget. QGraphicsProxyWidget shares ownership with <a href="qwidget.html">QWidget</a>, so if either of the two widgets are destroyed, the other widget will be automatically destroyed as well.</p>
<a name="synchronizing-widget-states"></a>
<h3>Synchronizing Widget States</h3>
<p>QGraphicsProxyWidget keeps its state in sync with the embedded widget. For example, if the proxy is hidden or disabled, the embedded widget will be hidden or disabled as well, and vice versa. When the widget is embedded by calling addWidget(), QGraphicsProxyWidget copies the state from the widget into the proxy, and after that, the two will stay synchronized where possible. By default, when you embed a widget into a proxy, both the widget and the proxy will be visible because a <a href="qgraphicswidget.html">QGraphicsWidget</a> is visible when created (you do not have to call <a href="qgraphicsitem.html#show">show</a>()). If you explicitly hide the embedded widget, the proxy will also become invisible.</p>
<p>Example:</p>
<pre> QGraphicsScene scene;

 QLineEdit *edit = new QLineEdit;
 QGraphicsProxyWidget *proxy = scene.addWidget(edit);

 edit-&gt;isVisible();  <span class="comment">// returns true</span>
 proxy-&gt;isVisible(); <span class="comment">// also returns true</span>

 edit-&gt;hide();

 edit-&gt;isVisible();  <span class="comment">// returns false</span>
 proxy-&gt;isVisible(); <span class="comment">// also returns false</span></pre>
<p>QGraphicsProxyWidget maintains symmetry for the following states:</p>
<p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th><a href="qwidget.html">QWidget</a> state</th><th>QGraphicsProxyWidget state</th><th>Notes</th></tr></thead>
<tr valign="top" class="odd"><td><a href="qwidget.html#enabled-prop">QWidget::enabled</a></td><td><a href="qgraphicsobject.html#enabled-prop">QGraphicsProxyWidget::enabled</a></td><td></td></tr>
<tr valign="top" class="even"><td><a href="qwidget.html#visible-prop">QWidget::visible</a></td><td><a href="qgraphicsobject.html#visible-prop">QGraphicsProxyWidget::visible</a></td><td>The explicit state is also symmetric.</td></tr>
<tr valign="top" class="odd"><td><a href="qwidget.html#geometry-prop">QWidget::geometry</a></td><td><a href="qgraphicswidget.html#geometry-prop">QGraphicsProxyWidget::geometry</a></td><td>Geometry is only guaranteed to be symmetric while the embedded widget is visible.</td></tr>
<tr valign="top" class="even"><td><a href="qwidget.html#layoutDirection-prop">QWidget::layoutDirection</a></td><td><a href="qgraphicswidget.html#layoutDirection-prop">QGraphicsProxyWidget::layoutDirection</a></td><td></td></tr>
<tr valign="top" class="odd"><td>QWidget::style</td><td>QGraphicsProxyWidget::style</td><td></td></tr>
<tr valign="top" class="even"><td><a href="qwidget.html#palette-prop">QWidget::palette</a></td><td><a href="qgraphicswidget.html#palette-prop">QGraphicsProxyWidget::palette</a></td><td></td></tr>
<tr valign="top" class="odd"><td><a href="qwidget.html#font-prop">QWidget::font</a></td><td><a href="qgraphicswidget.html#font-prop">QGraphicsProxyWidget::font</a></td><td></td></tr>
<tr valign="top" class="even"><td><a href="qwidget.html#cursor-prop">QWidget::cursor</a></td><td>QGraphicsProxyWidget::cursor</td><td>The embedded widget overrides the proxy widget cursor. The proxy cursor changes depending on which embedded subwidget is currently under the mouse.</td></tr>
<tr valign="top" class="odd"><td><a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>()</td><td><a href="qgraphicsproxywidget.html#sizeHint">QGraphicsProxyWidget::sizeHint</a>()</td><td>All size hint functionality from the embedded widget is forwarded by the proxy.</td></tr>
<tr valign="top" class="even"><td><a href="qwidget.html#getContentsMargins">QWidget::getContentsMargins</a>()</td><td><a href="qgraphicswidget.html#getContentsMargins">QGraphicsProxyWidget::getContentsMargins</a>()</td><td>Updated once by <a href="qgraphicsproxywidget.html#setWidget">setWidget</a>().</td></tr>
<tr valign="top" class="odd"><td><a href="qwidget.html#windowTitle-prop">QWidget::windowTitle</a></td><td><a href="qgraphicswidget.html#windowTitle-prop">QGraphicsProxyWidget::windowTitle</a></td><td>Updated once by <a href="qgraphicsproxywidget.html#setWidget">setWidget</a>().</td></tr>
</table></p>
<p><b>Note:</b> <a href="qgraphicsscene.html">QGraphicsScene</a> keeps the embedded widget in a special state that prevents it from disturbing other widgets (both embedded and not embedded) while the widget is embedded. In this state, the widget may differ slightly in behavior from when it is not embedded.</p>
<p><b>Warning:</b> This class is provided for convenience when bridging QWidgets and QGraphicsItems, it should not be used for high-performance scenarios.</p>
<p>See also <a href="qgraphicsscene.html#addWidget">QGraphicsScene::addWidget</a>() and <a href="qgraphicswidget.html">QGraphicsWidget</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/QGraphicsProxyWidget"></a>
<h3 class="fn"><a name="QGraphicsProxyWidget"></a>QGraphicsProxyWidget::QGraphicsProxyWidget ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0, <a href="qt.html#WindowType-enum">Qt::WindowFlags</a> <i>wFlags</i> = 0 )</h3>
<p>Constructs a new QGraphicsProxy widget. <i>parent</i> and <i>wFlags</i> are passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/~QGraphicsProxyWidget"></a>
<h3 class="fn"><a name="dtor.QGraphicsProxyWidget"></a>QGraphicsProxyWidget::~QGraphicsProxyWidget ()</h3>
<p>Destroys the proxy widget and any embedded widget.</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/contextMenuEvent"></a>
<h3 class="fn"><a name="contextMenuEvent"></a>void QGraphicsProxyWidget::contextMenuEvent ( <a href="qgraphicsscenecontextmenuevent.html">QGraphicsSceneContextMenuEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#contextMenuEvent">QGraphicsItem::contextMenuEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/createProxyForChildWidget"></a>
<h3 class="fn"><a name="createProxyForChildWidget"></a>QGraphicsProxyWidget * QGraphicsProxyWidget::createProxyForChildWidget ( <a href="qwidget.html">QWidget</a> * <i>child</i> )</h3>
<p>Creates a proxy widget for the given <i>child</i> of the widget contained in this proxy.</p>
<p>This function makes it possible to aquire proxies for non top-level widgets. For instance, you can embed a dialog, and then transform only one of its widgets.</p>
<p>If the widget is already embedded, return the existing proxy widget.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicsproxywidget.html#newProxyWidget">newProxyWidget</a>() and <a href="qgraphicsscene.html#addWidget">QGraphicsScene::addWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/dragEnterEvent"></a>
<h3 class="fn"><a name="dragEnterEvent"></a>void QGraphicsProxyWidget::dragEnterEvent ( <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#dragEnterEvent">QGraphicsItem::dragEnterEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/dragLeaveEvent"></a>
<h3 class="fn"><a name="dragLeaveEvent"></a>void QGraphicsProxyWidget::dragLeaveEvent ( <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#dragLeaveEvent">QGraphicsItem::dragLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/dragMoveEvent"></a>
<h3 class="fn"><a name="dragMoveEvent"></a>void QGraphicsProxyWidget::dragMoveEvent ( <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#dragMoveEvent">QGraphicsItem::dragMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/dropEvent"></a>
<h3 class="fn"><a name="dropEvent"></a>void QGraphicsProxyWidget::dropEvent ( <a href="qgraphicsscenedragdropevent.html">QGraphicsSceneDragDropEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#dropEvent">QGraphicsItem::dropEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/event"></a>
<h3 class="fn"><a name="event"></a>bool QGraphicsProxyWidget::event ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/eventFilter"></a>
<h3 class="fn"><a name="eventFilter"></a>bool QGraphicsProxyWidget::eventFilter ( <a href="qobject.html">QObject</a> * <i>object</i>, <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#eventFilter">QObject::eventFilter</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/focusInEvent"></a>
<h3 class="fn"><a name="focusInEvent"></a>void QGraphicsProxyWidget::focusInEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusInEvent">QGraphicsItem::focusInEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/focusNextPrevChild"></a>
<h3 class="fn"><a name="focusNextPrevChild"></a>bool QGraphicsProxyWidget::focusNextPrevChild ( bool <i>next</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#focusNextPrevChild">QGraphicsWidget::focusNextPrevChild</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/focusOutEvent"></a>
<h3 class="fn"><a name="focusOutEvent"></a>void QGraphicsProxyWidget::focusOutEvent ( <a href="qfocusevent.html">QFocusEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#focusOutEvent">QGraphicsItem::focusOutEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/grabMouseEvent"></a>
<h3 class="fn"><a name="grabMouseEvent"></a>void QGraphicsProxyWidget::grabMouseEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#grabMouseEvent">QGraphicsWidget::grabMouseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/hideEvent"></a>
<h3 class="fn"><a name="hideEvent"></a>void QGraphicsProxyWidget::hideEvent ( <a href="qhideevent.html">QHideEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#hideEvent">QGraphicsWidget::hideEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/hoverEnterEvent"></a>
<h3 class="fn"><a name="hoverEnterEvent"></a>void QGraphicsProxyWidget::hoverEnterEvent ( <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverEnterEvent">QGraphicsItem::hoverEnterEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/hoverLeaveEvent"></a>
<h3 class="fn"><a name="hoverLeaveEvent"></a>void QGraphicsProxyWidget::hoverLeaveEvent ( <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverLeaveEvent">QGraphicsItem::hoverLeaveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/hoverMoveEvent"></a>
<h3 class="fn"><a name="hoverMoveEvent"></a>void QGraphicsProxyWidget::hoverMoveEvent ( <a href="qgraphicsscenehoverevent.html">QGraphicsSceneHoverEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#hoverMoveEvent">QGraphicsItem::hoverMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/itemChange"></a>
<h3 class="fn"><a name="itemChange"></a><a href="qvariant.html">QVariant</a> QGraphicsProxyWidget::itemChange ( <a href="qgraphicsitem.html#GraphicsItemChange-enum">GraphicsItemChange</a> <i>change</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#itemChange">QGraphicsItem::itemChange</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/keyPressEvent"></a>
<h3 class="fn"><a name="keyPressEvent"></a>void QGraphicsProxyWidget::keyPressEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#keyPressEvent">QGraphicsItem::keyPressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/keyReleaseEvent"></a>
<h3 class="fn"><a name="keyReleaseEvent"></a>void QGraphicsProxyWidget::keyReleaseEvent ( <a href="qkeyevent.html">QKeyEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#keyReleaseEvent">QGraphicsItem::keyReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/mouseDoubleClickEvent"></a>
<h3 class="fn"><a name="mouseDoubleClickEvent"></a>void QGraphicsProxyWidget::mouseDoubleClickEvent ( <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#mouseDoubleClickEvent">QGraphicsItem::mouseDoubleClickEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/mouseMoveEvent"></a>
<h3 class="fn"><a name="mouseMoveEvent"></a>void QGraphicsProxyWidget::mouseMoveEvent ( <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#mouseMoveEvent">QGraphicsItem::mouseMoveEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/mousePressEvent"></a>
<h3 class="fn"><a name="mousePressEvent"></a>void QGraphicsProxyWidget::mousePressEvent ( <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#mousePressEvent">QGraphicsItem::mousePressEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/mouseReleaseEvent"></a>
<h3 class="fn"><a name="mouseReleaseEvent"></a>void QGraphicsProxyWidget::mouseReleaseEvent ( <a href="qgraphicsscenemouseevent.html">QGraphicsSceneMouseEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#mouseReleaseEvent">QGraphicsItem::mouseReleaseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/newProxyWidget"></a>
<h3 class="fn"><a name="newProxyWidget"></a>QGraphicsProxyWidget * QGraphicsProxyWidget::newProxyWidget ( const <a href="qwidget.html">QWidget</a> * <i>child</i> )&nbsp;&nbsp;<tt> [protected slot]</tt></h3>
<p>Creates a proxy widget for the given <i>child</i> of the widget contained in this proxy.</p>
<p>You should not call this function directly; use <a href="qgraphicsproxywidget.html#createProxyForChildWidget">QGraphicsProxyWidget::createProxyForChildWidget</a>() instead.</p>
<p>This function is a fake virtual slot that you can reimplement in your subclass in order to control how new proxy widgets are created. The default implementation returns a proxy created with the <a href="qgraphicsproxywidget.html#QGraphicsProxyWidget">QGraphicsProxyWidget</a>() constructor with this proxy widget as the parent.</p>
<p>This function was introduced in Qt 4.5.</p>
<p>See also <a href="qgraphicsproxywidget.html#createProxyForChildWidget">createProxyForChildWidget</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/paint"></a>
<h3 class="fn"><a name="paint"></a>void QGraphicsProxyWidget::paint ( <a href="qpainter.html">QPainter</a> * <i>painter</i>, const <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a> * <i>option</i>, <a href="qwidget.html">QWidget</a> * <i>widget</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#paint">QGraphicsItem::paint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/resizeEvent"></a>
<h3 class="fn"><a name="resizeEvent"></a>void QGraphicsProxyWidget::resizeEvent ( <a href="qgraphicssceneresizeevent.html">QGraphicsSceneResizeEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#resizeEvent">QGraphicsWidget::resizeEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/setGeometry"></a>
<h3 class="fn"><a name="setGeometry"></a>void QGraphicsProxyWidget::setGeometry ( const <a href="qrectf.html">QRectF</a> &amp; <i>rect</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#setGeometry">QGraphicsLayoutItem::setGeometry</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/setWidget"></a>
<h3 class="fn"><a name="setWidget"></a>void QGraphicsProxyWidget::setWidget ( <a href="qwidget.html">QWidget</a> * <i>widget</i> )</h3>
<p>Embeds <i>widget</i> into this proxy widget. The embedded widget must reside exclusively either inside or outside of Graphics View. You cannot embed a widget as long as it is is visible elsewhere in the UI, at the same time.</p>
<p><i>widget</i> must be a top-level widget whose parent is 0.</p>
<p>When the widget is embedded, its state (e.g&#x2e;, visible, enabled, geometry, size hints) is copied into the proxy widget. If the embedded widget is explicitly hidden or disabled, the proxy widget will become explicitly hidden or disabled after embedding is complete. The class documentation has a full overview over the shared state.</p>
<p><a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a>'s window flags determine whether the widget, after embedding, will be given window decorations or not.</p>
<p>After this function returns, <a href="qgraphicsproxywidget.html">QGraphicsProxyWidget</a> will keep its state synchronized with that of <i>widget</i> whenever possible.</p>
<p>If a widget is already embedded by this proxy when this function is called, that widget will first be automatically unembedded. Passing 0 for the <i>widget</i> argument will only unembed the widget, and the ownership of the currently embedded widget will be passed on to the caller. Every child widget that are embedded will also be embedded and their proxy widget destroyed.</p>
<p>Note that widgets with the <a href="qt.html#WidgetAttribute-enum">Qt::WA_PaintOnScreen</a> widget attribute set and widgets that wrap an external application or controller cannot be embedded. Examples are <a href="qglwidget.html">QGLWidget</a> and <a href="qaxwidget.html">QAxWidget</a>.</p>
<p>See also <a href="qgraphicsproxywidget.html#widget">widget</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/showEvent"></a>
<h3 class="fn"><a name="showEvent"></a>void QGraphicsProxyWidget::showEvent ( <a href="qshowevent.html">QShowEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#showEvent">QGraphicsWidget::showEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/sizeHint"></a>
<h3 class="fn"><a name="sizeHint"></a><a href="qsizef.html">QSizeF</a> QGraphicsProxyWidget::sizeHint ( <a href="qt.html#SizeHint-enum">Qt::SizeHint</a> <i>which</i>, const <a href="qsizef.html">QSizeF</a> &amp; <i>constraint</i> = QSizeF() ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicslayoutitem.html#sizeHint">QGraphicsLayoutItem::sizeHint</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/subWidgetRect"></a>
<h3 class="fn"><a name="subWidgetRect"></a><a href="qrectf.html">QRectF</a> QGraphicsProxyWidget::subWidgetRect ( const <a href="qwidget.html">QWidget</a> * <i>widget</i> ) const</h3>
<p>Returns the rectangle for <i>widget</i>, which must be a descendant of <a href="qgraphicsproxywidget.html#widget">widget</a>(), or <a href="qgraphicsproxywidget.html#widget">widget</a>() itself, in this proxy item's local coordinates.</p>
<p>If no widget is embedded, <i>widget</i> is 0, or <i>widget</i> is not a descendant of the embedded widget, this function returns an empty <a href="qrectf.html">QRectF</a>.</p>
<p>See also <a href="qgraphicsproxywidget.html#widget">widget</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/type"></a>
<h3 class="fn"><a name="type"></a>int QGraphicsProxyWidget::type () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#type">QGraphicsItem::type</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/ungrabMouseEvent"></a>
<h3 class="fn"><a name="ungrabMouseEvent"></a>void QGraphicsProxyWidget::ungrabMouseEvent ( <a href="qevent.html">QEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicswidget.html#ungrabMouseEvent">QGraphicsWidget::ungrabMouseEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/wheelEvent"></a>
<h3 class="fn"><a name="wheelEvent"></a>void QGraphicsProxyWidget::wheelEvent ( <a href="qgraphicsscenewheelevent.html">QGraphicsSceneWheelEvent</a> * <i>event</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qgraphicsitem.html#wheelEvent">QGraphicsItem::wheelEvent</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsProxyWidget/widget"></a>
<h3 class="fn"><a name="widget"></a><a href="qwidget.html">QWidget</a> * QGraphicsProxyWidget::widget () const</h3>
<p>Returns a pointer to the embedded widget.</p>
<p>See also <a href="qgraphicsproxywidget.html#setWidget">setWidget</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>