summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-26 14:50:06 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-26 14:50:06 (GMT)
commit282d2a2aef76d13f5c493e77907c5122ab54f3af (patch)
treefe3e0afd119882cb3a267a821185eb91a4aa7b36
parent74c9e76e0c53e60ad340bb002c4efa6ecd57cd58 (diff)
parent00ab5c0d690f5cbb1f588adf0d469e5e9c54051c (diff)
downloadQt-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.
-rwxr-xr-xbin/patch_capabilities.pl3
-rw-r--r--demos/symbianpkgrules.pri4
-rw-r--r--examples/symbianpkgrules.pri5
-rw-r--r--src/3rdparty/phonon/mmf/videowidget.cpp2
-rw-r--r--src/gui/kernel/qwidget.cpp40
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp3
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp24
8 files changed, 72 insertions, 10 deletions
diff --git a/bin/patch_capabilities.pl b/bin/patch_capabilities.pl
index 06ab116..5230480 100755
--- a/bin/patch_capabilities.pl
+++ b/bin/patch_capabilities.pl
@@ -269,6 +269,9 @@ if (@ARGV)
if (@capabilitiesSpecified)
{
$commandToExecute = sprintf($baseCommandToExecute, join(" ", @capabilitiesSpecified));
+ $executeNeeded = 1;
+ my $capString = join(" ", @capabilitiesSpecified);
+ print ("Patching: Patching the the Vendor ID to 0 and the capabilities used to: \"$capString\" in \"$binaryBaseName\".\n");
} else {
# Test which capabilities are present and then restrict them to the allowed set.
# This avoid raising the capabilities of apps that already have none.
diff --git a/demos/symbianpkgrules.pri b/demos/symbianpkgrules.pri
index d42f188..c9cc492 100644
--- a/demos/symbianpkgrules.pri
+++ b/demos/symbianpkgrules.pri
@@ -13,4 +13,6 @@ vendorinfo = \
demos_deployment.pkg_prerules += vendorinfo
DEPLOYMENT += demos_deployment
-contains(TEMPLATE,app):isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") {
+ ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+}
diff --git a/examples/symbianpkgrules.pri b/examples/symbianpkgrules.pri
index b22ca85..0f615c7 100644
--- a/examples/symbianpkgrules.pri
+++ b/examples/symbianpkgrules.pri
@@ -13,4 +13,7 @@ vendorinfo = \
examples_deployment.pkg_prerules += vendorinfo
DEPLOYMENT += examples_deployment
-contains(TEMPLATE,app):isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") {
+ ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg
+}
+
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);
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 2f221d2..09af941 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9718,14 +9718,25 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
child.setAutoFillBackground(true);
child.setPalette(Qt::blue);
+ QWidget grandChild(&child);
+ grandChild.setAutoFillBackground(true);
+ grandChild.setPalette(Qt::yellow);
+
QVBoxLayout layout(&parent);
layout.setContentsMargins(10, 10, 10, 10);
layout.addWidget(&child);
parent.setLayout(&layout);
- child.winId();
+ QVBoxLayout childLayout(&child);
+ childLayout.setContentsMargins(10, 10, 10, 10);
+ childLayout.addWidget(&grandChild);
+ child.setLayout(&childLayout);
+
+ // Ensure that this widget and all its ancestors are native
+ grandChild.winId();
parent.show();
+
QTest::qWaitForWindowShown(&parent);
// Check that child window does not obscure parent window
@@ -9734,18 +9745,24 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
// Native child widget should share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
// Make child widget full screen
child.setWindowFlags((child.windowFlags() | Qt::Window) ^ Qt::SubWindow);
child.setWindowState(child.windowState() | Qt::WindowFullScreen);
child.show();
+
+ // Paint into the child to ensure that it gets a backing store
+ QPainter painter(&child);
+ painter.fillRect(QRect(0, 0, 90, 90), Qt::white);
+
QTest::qWaitForWindowShown(&child);
// Ensure that 'window hidden' event is received by parent
qApp->processEvents();
// Check that child window obscures parent window
- QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Now that extent of child widget goes beyond parent's extent,
// a new backing store should be created for the child widget.
@@ -9761,11 +9778,12 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QTest::qWaitForWindowShown(&child);
// Check that parent is now visible again
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Native child widget should once again share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
}
// 6. Partial reveal followed by full reveal