summaryrefslogtreecommitdiffstats
path: root/examples/script
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-06-23 13:17:14 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-06-23 13:17:14 (GMT)
commit1d67e109bcb75271bfbe6ffaefac87cec19f1e42 (patch)
tree027fe288d6586d757dc84c4b06e1eac39d54b89b /examples/script
parent3ddac6c652c07b33a458a1b19bf7ec4ada1f259e (diff)
downloadQt-1d67e109bcb75271bfbe6ffaefac87cec19f1e42.zip
Qt-1d67e109bcb75271bfbe6ffaefac87cec19f1e42.tar.gz
Qt-1d67e109bcb75271bfbe6ffaefac87cec19f1e42.tar.bz2
Draw white rect into canvas to distinguish the script graphic from theme background.
Diffstat (limited to 'examples/script')
-rw-r--r--examples/script/context2d/qcontext2dcanvas.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/script/context2d/qcontext2dcanvas.cpp b/examples/script/context2d/qcontext2dcanvas.cpp
index 30bb3eb..c6772ce 100644
--- a/examples/script/context2d/qcontext2dcanvas.cpp
+++ b/examples/script/context2d/qcontext2dcanvas.cpp
@@ -85,6 +85,11 @@ void QContext2DCanvas::contentsChanged(const QImage &image)
void QContext2DCanvas::paintEvent(QPaintEvent *e)
{
QPainter p(this);
+#ifdef Q_WS_S60
+// Draw white rect first since in with some themes the js-file content will produce black-on-black.
+ QBrush whiteBgBrush(Qt::white);
+ p.fillRect(e->rect(), whiteBgBrush);
+#endif
p.setClipRect(e->rect());
p.drawImage(0, 0, m_image);
}