diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-26 14:50:06 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-10-26 14:50:06 (GMT) |
commit | 282d2a2aef76d13f5c493e77907c5122ab54f3af (patch) | |
tree | fe3e0afd119882cb3a267a821185eb91a4aa7b36 /src | |
parent | 74c9e76e0c53e60ad340bb002c4efa6ecd57cd58 (diff) | |
parent | 00ab5c0d690f5cbb1f588adf0d469e5e9c54051c (diff) | |
download | Qt-282d2a2aef76d13f5c493e77907c5122ab54f3af.zip Qt-282d2a2aef76d13f5c493e77907c5122ab54f3af.tar.gz Qt-282d2a2aef76d13f5c493e77907c5122ab54f3af.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Phonon MMF backend: set _q_DummyWindowSurface property on VideoWidget
Create dummy window surface if if _q_DummyWindowSurface property is set
Remove widget subtree from backing store tracker when reparented
Suppress call to controlVisibilityChanged for null control pointer
Fix patch_capabilities.pl script for explicit set of capabilities
Fix empty mifconv TARGETFILE in some edge cases.
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/phonon/mmf/videowidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 40 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 3 |
4 files changed, 41 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 122094e..d59e82a 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -65,6 +65,8 @@ MMF::VideoWidget::VideoWidget(QWidget *parent) TRACE_CONTEXT(VideoWidget::VideoWidget, EVideoApi); TRACE_ENTRY_0(); + parent->setProperty("_q_DummyWindowSurface", true); + TRACE_EXIT_0(); } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 9b44f15..e22ec55 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -236,6 +236,17 @@ void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w) } } +/*! + \internal + Recursively remove widget and all of its descendents. + */ +void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget) +{ + unregisterWidget(widget); + foreach (QObject *child, widget->children()) + if (QWidget *childWidget = qobject_cast<QWidget *>(child)) + unregisterWidgetSubtree(childWidget); +} QWidgetPrivate::QWidgetPrivate(int version) : QObjectPrivate(version) @@ -326,15 +337,27 @@ QWidgetPrivate::~QWidgetPrivate() #endif //QT_NO_GRAPHICSEFFECT } +class QDummyWindowSurface : public QWindowSurface +{ +public: + QDummyWindowSurface(QWidget *window) : QWindowSurface(window) {} + QPaintDevice *paintDevice() { return window(); } + void flush(QWidget *, const QRegion &, const QPoint &) {} +}; + QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() { Q_Q(QWidget); QWindowSurface *surface; - if (QApplicationPrivate::graphicsSystem()) - surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); - else - surface = createDefaultWindowSurface_sys(); + if (q->property("_q_DummyWindowSurface").toBool()) { + surface = new QDummyWindowSurface(q); + } else { + if (QApplicationPrivate::graphicsSystem()) + surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); + else + surface = createDefaultWindowSurface_sys(); + } return surface; } @@ -10031,7 +10054,16 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) if (newParent && isAncestorOf(focusWidget())) focusWidget()->clearFocus(); + QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData(); + QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStore : 0; + d->setParent_sys(parent, f); + + QTLWExtra *topExtra = window()->d_func()->maybeTopData(); + QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStore : 0; + if (oldBsTracker && oldBsTracker != bsTracker) + oldBsTracker->unregisterWidgetSubtree(this); + if (desktopWidget) parent = 0; diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index 6c89659..ca1e3fc 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -122,6 +122,7 @@ public: void registerWidget(QWidget *w); void unregisterWidget(QWidget *w); + void unregisterWidgetSubtree(QWidget *w); inline QWidgetBackingStore* data() { diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 031892d..cf4bdf1 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -709,7 +709,8 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f) // old_winid may not have received a 'not visible' visibility // changed event before being destroyed; make sure that it is // removed from the backing store's list of visible windows. - S60->controlVisibilityChanged(old_winid, false); + if (old_winid) + S60->controlVisibilityChanged(old_winid, false); setWinId(0); |