summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2011-03-17 04:24:50 (GMT)
committerMartin Jones <martin.jones@nokia.com>2011-03-17 04:59:25 (GMT)
commit82a53835a71a8e1902774c67e792bf6d7d6385de (patch)
tree2ee7954d5c0951a41d833a0b0106cbc185fe620f
parent50c0c6a032ef2c0af8c93f52f5c2f86ca145e852 (diff)
downloadQt-82a53835a71a8e1902774c67e792bf6d7d6385de.zip
Qt-82a53835a71a8e1902774c67e792bf6d7d6385de.tar.gz
Qt-82a53835a71a8e1902774c67e792bf6d7d6385de.tar.bz2
QDeclarativeView flickers when composited on MeeGo
Set Qt::WA_OpaquePaintEvent and Qt::WA_NoSystemBackground for QDeclarativeView on meego. Change-Id: I301d2381ae831485d205ff42b0c15b3fa7a73424 Task-number: QTBUG-17173 Reviewed-by: Michael Brasser
-rw-r--r--doc/src/declarative/qdeclarativeperformance.qdoc11
-rw-r--r--src/declarative/declarative.pro2
-rw-r--r--src/declarative/util/qdeclarativeview.cpp7
3 files changed, 20 insertions, 0 deletions
diff --git a/doc/src/declarative/qdeclarativeperformance.qdoc b/doc/src/declarative/qdeclarativeperformance.qdoc
index 36b4878..6760869 100644
--- a/doc/src/declarative/qdeclarativeperformance.qdoc
+++ b/doc/src/declarative/qdeclarativeperformance.qdoc
@@ -136,4 +136,15 @@ The QML Viewer uses the raster graphics system by default for X11 and OS X. It a
includes a \c -opengl command line option which sets a QGLWidget as the viewport of the
view. On OS X, a QGLWidget is always used.
+You can also prevent QDeclarativeView from painting its window background if
+you will provide the background of your application using QML, e.g.
+
+\code
+QDeclarativeView window;
+window.setAttribute(Qt::WA_OpaquePaintEvent);
+window.setAttribute(Qt::WA_NoSystemBackground);
+window.viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+window.viewport()->setAttribute(Qt::WA_NoSystemBackground);
+\endcode
+
*/
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro
index 1ad888b..f3a7db9 100644
--- a/src/declarative/declarative.pro
+++ b/src/declarative/declarative.pro
@@ -29,6 +29,8 @@ symbian: {
LIBS += -lefsrv
}
+linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND
+
DEFINES += QT_NO_OPENTYPE
INCLUDEPATH += ../3rdparty/harfbuzz/src
diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp
index c2e5efe..13880c2 100644
--- a/src/declarative/util/qdeclarativeview.cpp
+++ b/src/declarative/util/qdeclarativeview.cpp
@@ -293,6 +293,13 @@ void QDeclarativeViewPrivate::init()
q->setFocusPolicy(Qt::StrongFocus);
q->scene()->setStickyFocus(true); //### needed for correct focus handling
+
+#ifdef QDECLARATIVEVIEW_NOBACKGROUND
+ q->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->setAttribute(Qt::WA_NoSystemBackground);
+ q->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
+ q->viewport()->setAttribute(Qt::WA_NoSystemBackground);
+#endif
}
/*!