summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2010-04-07 14:13:19 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-04-07 14:14:05 (GMT)
commitc13076a30e5ae3d0f6795261ad00ca1eb73ad0b9 (patch)
tree081619d235389411f5ba7a16d96e37f477e7b2c0 /src/gui/kernel/qwidget.cpp
parentfcec5d444f1e37e7b53ab503fa46b4d7f7d90b41 (diff)
downloadQt-c13076a30e5ae3d0f6795261ad00ca1eb73ad0b9.zip
Qt-c13076a30e5ae3d0f6795261ad00ca1eb73ad0b9.tar.gz
Qt-c13076a30e5ae3d0f6795261ad00ca1eb73ad0b9.tar.bz2
Added QPlatformWindow
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 3ca7591..4bcec93 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -11836,6 +11836,44 @@ QWindowSurface *QWidget::windowSurface() const
return bs ? bs->windowSurface : 0;
}
+/*!
+ \preliminary
+
+ Sets the window to be the \a window specified.
+ The QWidget takes ownership of the \a surface.
+*/
+void QWidget::setPlatformWindow(QPlatformWindow *window)
+{
+#ifndef Q_BACKINGSTORE_SUBSURFACES
+ if (!isTopLevel())
+ return;
+#endif
+
+ Q_D(QWidget);
+
+ QTLWExtra *topData = d->topData();
+ if (topData->platformWindow == window)
+ return;
+
+ delete topData->platformWindow;
+ topData->platformWindow = window;
+}
+
+/*!
+ \preliminary
+
+ Returns the QPlatformWindow this widget will be drawn into.
+*/
+QPlatformWindow *QWidget::platformWindow() const
+{
+ Q_D(const QWidget);
+ QTLWExtra *extra = d->maybeTopData();
+ if (extra && extra->platformWindow)
+ return extra->platformWindow;
+
+ return 0;
+}
+
void QWidgetPrivate::getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const
{
if (left)