summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@nokia.com>2011-06-24 11:52:41 +0200
committerLiang Qi <liang.qi@nokia.com>2011-06-24 11:52:41 +0200
commitcf2f72f4f61f3a9e0e7573379c33bb341eeba7be (patch)
tree06fbd459f62f87344e7db973a0a9f3050cece825
parent164728f711136356a6c3482f762321b01c9d82dd (diff)
parent705b0f958a6071341b10cbd51917e1378356491b (diff)
downloadqt4-tools-cf2f72f4f61f3a9e0e7573379c33bb341eeba7be.tar.gz
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: src/gui/image/qpixmap_raster_symbian.cpp src/gui/image/qpixmapdatafactory.cpp src/gui/painting/qgraphicssystem.cpp src/gui/styles/qs60style.cpp src/network/bearer/qnetworkconfigmanager_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/bwins/QtOpenGLu.def src/s60installs/bwins/QtOpenVGu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
-rw-r--r--doc/src/declarative/elements.qdoc13
-rw-r--r--doc/src/declarative/examples.qdoc23
-rw-r--r--doc/src/declarative/pics/shaderexample.pngbin0 -> 3941 bytes
-rw-r--r--doc/src/examples/qml-examples.qdoc10
-rw-r--r--doc/src/images/qml-shadereffects-example.pngbin0 -> 271264 bytes
-rw-r--r--examples/declarative/declarative.pro3
-rwxr-xr-xexamples/declarative/shadereffects/main.cpp76
-rwxr-xr-xexamples/declarative/shadereffects/qml/Curtain.qml106
-rwxr-xr-xexamples/declarative/shadereffects/qml/CurtainEffect.qml97
-rwxr-xr-xexamples/declarative/shadereffects/qml/DropShadow.qml117
-rwxr-xr-xexamples/declarative/shadereffects/qml/DropShadowEffect.qml174
-rwxr-xr-xexamples/declarative/shadereffects/qml/Grayscale.qml77
-rwxr-xr-xexamples/declarative/shadereffects/qml/GrayscaleEffect.qml62
-rwxr-xr-xexamples/declarative/shadereffects/qml/ImageMask.qml143
-rwxr-xr-xexamples/declarative/shadereffects/qml/ImageMaskEffect.qml60
-rwxr-xr-xexamples/declarative/shadereffects/qml/RadialWave.qml85
-rwxr-xr-xexamples/declarative/shadereffects/qml/RadialWaveEffect.qml81
-rwxr-xr-xexamples/declarative/shadereffects/qml/Water.qml60
-rwxr-xr-xexamples/declarative/shadereffects/qml/WaterEffect.qml126
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/Curtain.jpgbin0 -> 16112 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/DropShadow.jpgbin0 -> 12975 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/Grayscale.jpgbin0 -> 19048 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/ImageMask.jpgbin0 -> 18751 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/RadialWave.jpgbin0 -> 41406 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/Water.jpgbin0 -> 17751 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/back.pngbin0 -> 370 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/bg.jpgbin0 -> 10189 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/desaturate.jpgbin0 -> 203942 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/drop_shadow.pngbin0 -> 219220 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/fabric.jpgbin0 -> 163431 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/flower.pngbin0 -> 219220 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/image1.jpgbin0 -> 115770 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/image2.jpgbin0 -> 45837 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/qt-logo.pngbin0 -> 22746 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/shader_effects.jpgbin0 -> 4906 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/sky.jpgbin0 -> 36734 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/toolbar.pngbin0 -> 342 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/images/wave.jpgbin0 -> 176681 bytes
-rwxr-xr-xexamples/declarative/shadereffects/qml/main.qml160
-rwxr-xr-xexamples/declarative/shadereffects/shadereffects.pro21
-rw-r--r--src/corelib/thread/qthread.cpp6
-rw-r--r--src/gui/image/image.pri4
-rw-r--r--src/gui/image/qimage.cpp8
-rw-r--r--src/gui/image/qpixmap.h2
-rw-r--r--src/gui/image/qpixmap_raster_symbian.cpp (renamed from src/gui/image/qpixmap_s60.cpp)73
-rw-r--r--src/gui/image/qpixmap_raster_symbian_p.h (renamed from src/gui/image/qpixmap_s60_p.h)23
-rw-r--r--src/gui/image/qpixmapdata.cpp5
-rw-r--r--src/gui/image/qpixmapdata_p.h4
-rw-r--r--src/gui/image/qpixmapdatafactory.cpp4
-rw-r--r--src/gui/image/qvolatileimage.cpp35
-rw-r--r--src/gui/image/qvolatileimage_p.h1
-rw-r--r--src/gui/image/qvolatileimagedata_symbian.cpp27
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp56
-rw-r--r--src/gui/kernel/qapplication_s60.cpp49
-rw-r--r--src/gui/kernel/qdesktopwidget_s60.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp54
-rw-r--r--src/gui/kernel/qt_s60_p.h3
-rw-r--r--src/gui/kernel/qwidget_s60.cpp12
-rw-r--r--src/gui/painting/painting.pri4
-rw-r--r--src/gui/painting/qgraphicssystem.cpp4
-rw-r--r--src/gui/painting/qgraphicssystem_raster.cpp4
-rw-r--r--src/gui/painting/qpaintengine_raster_symbian.cpp (renamed from src/gui/painting/qpaintengine_s60.cpp)64
-rw-r--r--src/gui/painting/qpaintengine_raster_symbian_p.h (renamed from src/gui/painting/qpaintengine_s60_p.h)18
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp14
-rw-r--r--src/gui/s60framework/qs60mainappui.cpp14
-rw-r--r--src/gui/styles/qs60style.cpp9
-rw-r--r--src/gui/styles/qs60style.h4
-rw-r--r--src/gui/styles/qs60style_p.h2
-rw-r--r--src/gui/styles/qs60style_s60.cpp10
-rw-r--r--src/gui/text/qfont_s60.cpp2
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp2
-rw-r--r--src/gui/text/qfontengine_s60.cpp2
-rw-r--r--src/imports/shaders/scenegraph/qsggeometry.cpp116
-rw-r--r--src/imports/shaders/shadereffectitem.cpp6
-rw-r--r--src/imports/shaders/shadereffectsource.cpp10
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp4
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp39
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.h3
-rw-r--r--src/opengl/qgl_symbian.cpp4
-rw-r--r--src/openvg/qpaintengine_vg.cpp9
-rw-r--r--src/openvg/qpixmapdata_vg.cpp3
-rw-r--r--src/openvg/qpixmapdata_vg_p.h2
-rw-r--r--src/openvg/qvg_symbian.cpp5
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp3
-rw-r--r--src/s60installs/bwins/QtGuiu.def7
-rw-r--r--src/s60installs/bwins/QtOpenGLu.def1
-rw-r--r--src/s60installs/bwins/QtOpenVGu.def2
-rw-r--r--src/s60installs/eabi/QtGuiu.def3
-rw-r--r--src/s60installs/eabi/QtOpenVGu.def2
-rw-r--r--src/s60installs/qt.iby3
-rw-r--r--tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp44
-rw-r--r--tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp29
92 files changed, 1963 insertions, 347 deletions
diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc
index a861a66a58..6b7a5fc8f0 100644
--- a/doc/src/declarative/elements.qdoc
+++ b/doc/src/declarative/elements.qdoc
@@ -175,6 +175,8 @@ Elements that animate properties based on data types
\o \l {ParticleMotionLinear} - Adds linear motion behavior to \l {Particles}
\o \l {ParticleMotionGravity} - Adds gravitational motion to \l {Particles}
\o \l {ParticleMotionWander} - Adds varied motions to \l {Particles}
+\o \l {ShaderEffectItem} - Enables the use of OpenGL Shading Language together with QML
+\o \l {ShaderEffectSource} - Encapsulates QML item tree as a source item for \l {ShaderEffectItem}
\endlist
\section1 Add-On Elements
@@ -321,3 +323,14 @@ should first be obtained and installed.
\generatelist{related}
*/
+
+/*!
+ \group qml-shader-elements
+ \title QML Shader Elements
+ \ingroup qml-groups
+
+ \brief Elements for using OpenGL shading language code together with the QML code.
+
+ \generatelist{related}
+
+*/
diff --git a/doc/src/declarative/examples.qdoc b/doc/src/declarative/examples.qdoc
index 0e325e2f38..1003b2269b 100644
--- a/doc/src/declarative/examples.qdoc
+++ b/doc/src/declarative/examples.qdoc
@@ -33,7 +33,7 @@
Qt includes a set of examples and demos that show how to use various aspects
-of QML. The examples are small demonstrations of particular QML components,
+of QML. The examples are small demonstrations of particular QML components,
while the demos contain more complete and functional applications.
To run the examples and demos, open them in Qt Creator or use the included
@@ -60,43 +60,43 @@ can be used to produce sophisticated interfaces and applications:
\table
\row
-\o
+\o
\l{demos/declarative/calculator}{Calculator}
\image qml-calculator-example-small.png
-\o
+\o
\l{demos/declarative/flickr}{Flickr Mobile}
\image qml-flickr-demo-small.png
-\o
+\o
\l{demos/declarative/minehunt}{Minehunt}
\image qml-minehunt-demo-small.png
\row
-\o
+\o
\l{demos/declarative/photoviewer}{Photo Viewer}
\image qml-photoviewer-demo-small.png
-\o
+\o
\l{demos/declarative/rssnews}{RSS News Reader}
\image qml-rssnews-demo-small.png
-\o
+\o
\l{demos/declarative/samegame}{Same Game}
\image qml-samegame-demo-small.png
\row
-\o
+\o
\l{demos/declarative/snake}{Snake}
\image qml-snake-demo-small.png
-\o
+\o
\l{demos/declarative/twitter}{Twitter}
\image qml-twitter-demo-small.png
-\o
+\o
\l{demos/declarative/webbrowser}{Web Browser}
\image qml-webbrowser-demo-small.png
@@ -109,7 +109,7 @@ The demos can be found in Qt's \c demos/declarative directory.
The QML examples are small, simple applications that show how to use a particular
QML component or feature. If you are new
-to QML, you may also find the \l{QML Tutorial}{Hello World} and
+to QML, you may also find the \l{QML Tutorial}{Hello World} and
\l {QML Advanced Tutorial}{Same Game} tutorials useful.
The examples can be found in Qt's \c examples/declarative directory.
@@ -234,6 +234,7 @@ The examples can be found in Qt's \c examples/declarative directory.
\list
\o \l{src/imports/folderlistmodel}{Folder List Model} - a C++ model plugin
+\o \l{declarative/shadereffects}{Shader Effects}
\endlist
*/
diff --git a/doc/src/declarative/pics/shaderexample.png b/doc/src/declarative/pics/shaderexample.png
new file mode 100644
index 0000000000..dbc7291aac
--- /dev/null
+++ b/doc/src/declarative/pics/shaderexample.png
Binary files differ
diff --git a/doc/src/examples/qml-examples.qdoc b/doc/src/examples/qml-examples.qdoc
index 00eeb4343b..a910266a9b 100644
--- a/doc/src/examples/qml-examples.qdoc
+++ b/doc/src/examples/qml-examples.qdoc
@@ -714,3 +714,13 @@
\image qml-xmlhttprequest-example.png
*/
+
+/*!
+ \title Labs: Shader Effects
+ \example declarative/shadereffects
+
+ This example shows how to create visual effects by using OpenGL shading language together with QML using \l ShaderEffectItem and \l ShaderEffectSource APIs.
+
+ \image qml-shadereffects-example.png
+*/
+
diff --git a/doc/src/images/qml-shadereffects-example.png b/doc/src/images/qml-shadereffects-example.png
new file mode 100644
index 0000000000..9649fe1f9e
--- /dev/null
+++ b/doc/src/images/qml-shadereffects-example.png
Binary files differ
diff --git a/examples/declarative/declarative.pro b/examples/declarative/declarative.pro
index e3d922c2cf..f10e7a411e 100644
--- a/examples/declarative/declarative.pro
+++ b/examples/declarative/declarative.pro
@@ -6,6 +6,9 @@ SUBDIRS = \
modelviews \
tutorials
+# OpenGL shader examples requires opengl and they contain some C++ and need to be built
+contains(QT_CONFIG, opengl): SUBDIRS += shadereffects
+
# plugins uses a 'Time' class that conflicts with symbian e32std.h also defining a class of the same name
symbian:SUBDIRS -= plugins
diff --git a/examples/declarative/shadereffects/main.cpp b/examples/declarative/shadereffects/main.cpp
new file mode 100755
index 0000000000..62bf505fdc
--- /dev/null
+++ b/examples/declarative/shadereffects/main.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtGui/QApplication>
+#include <QtOpenGL>
+#include <QDeclarativeView>
+#include <QDeclarativeEngine>
+
+int main(int argc, char *argv[])
+{
+// Depending on which is the recommended way for the platform, either use
+// opengl graphics system or paint into QGLWidget.
+#ifdef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+ QApplication::setGraphicsSystem("opengl");
+#endif
+
+ QApplication app(argc, argv);
+ QDeclarativeView view;
+
+#ifndef SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+ QGLFormat format = QGLFormat::defaultFormat();
+ format.setSampleBuffers(false);
+ format.setSwapInterval(1);
+ QGLWidget* glWidget = new QGLWidget(format);
+ glWidget->setAutoFillBackground(false);
+ view.setViewport(glWidget);
+#endif
+
+ view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ view.setAttribute(Qt::WA_OpaquePaintEvent);
+ view.setAttribute(Qt::WA_NoSystemBackground);
+ view.setSource(QUrl::fromLocalFile(QLatin1String("qml/main.qml")));
+ QObject::connect(view.engine(), SIGNAL(quit()), &view, SLOT(close()));
+
+ view.show();
+
+ return app.exec();
+}
diff --git a/examples/declarative/shadereffects/qml/Curtain.qml b/examples/declarative/shadereffects/qml/Curtain.qml
new file mode 100755
index 0000000000..8697951963
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/Curtain.qml
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ Rectangle{
+ id: bg
+ anchors.fill: parent
+ color: "black"
+ }
+
+ Image {
+ source: "images/qt-logo.png"
+ anchors.centerIn: parent
+ }
+
+ Image {
+ id: fabric
+ anchors.fill: parent
+ source: "images/fabric.jpg"
+ fillMode: Image.Tile
+ }
+
+ CurtainEffect {
+ id: curtain
+ anchors.fill: fabric
+ bottomWidth: topWidth
+ source: ShaderEffectSource { sourceItem: fabric; hideSource: true }
+
+ Behavior on bottomWidth {
+ SpringAnimation { easing.type: Easing.OutElastic; velocity: 250; mass: 1.5; spring: 0.5; damping: 0.05}
+ }
+
+ SequentialAnimation on topWidth {
+ id: topWidthAnim
+ loops: Animation.Infinite
+
+ NumberAnimation { to: 360; duration: 1000 }
+ PauseAnimation { duration: 2000 }
+ NumberAnimation { to: 180; duration: 1000 }
+ PauseAnimation { duration: 2000 }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onPressed: {
+ topWidthAnim.stop()
+ curtain.topWidth = mouseX;
+ }
+
+ onReleased: {
+ topWidthAnim.restart()
+ }
+
+ onPositionChanged: {
+ if (pressed) {
+ curtain.topWidth = mouseX;
+ }
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/CurtainEffect.qml b/examples/declarative/shadereffects/qml/CurtainEffect.qml
new file mode 100755
index 0000000000..7834a1a3ba
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/CurtainEffect.qml
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ anchors.fill: parent
+ property variant source
+ meshResolution: Qt.size(50, 50)
+
+ property real topWidth: width / 2
+ property real bottomWidth: width / 2
+ property real originalWidth: width
+ property real originalHeight: height
+ property real amplitude: 0.1
+
+ vertexShader: "
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ varying highp vec2 qt_TexCoord0;
+ varying lowp float shade;
+
+ uniform highp float topWidth;
+ uniform highp float bottomWidth;
+ uniform highp float originalWidth;
+ uniform highp float originalHeight;
+ uniform highp float amplitude;
+
+ void main() {
+ qt_TexCoord0 = qt_MultiTexCoord0;
+
+ highp vec4 shift = vec4(0, 0, 0, 0);
+ shift.x = qt_Vertex.x * ((originalWidth - topWidth) + (topWidth - bottomWidth) * (qt_Vertex.y / originalHeight)) / originalWidth;
+
+ shade = sin(21.9911486 * qt_Vertex.x / originalWidth);
+ shift.y = amplitude * (originalWidth - topWidth + (topWidth - bottomWidth) * (qt_Vertex.y / originalHeight)) * shade;
+
+ gl_Position = qt_ModelViewProjectionMatrix * (qt_Vertex - shift);
+
+ shade = 0.2 * (2.0 - shade ) * (1.0 - (bottomWidth + (topWidth - bottomWidth) * (1.0 - qt_Vertex.y / originalHeight)) / originalWidth);
+ }
+ "
+
+ fragmentShader: "
+ uniform sampler2D source;
+ varying highp vec2 qt_TexCoord0;
+ varying lowp float shade;
+ void main() {
+ highp vec4 color = texture2D(source, qt_TexCoord0);
+ color.rgb *= 1.0 - shade;
+ gl_FragColor = color;
+ }
+ "
+}
+
+
+
diff --git a/examples/declarative/shadereffects/qml/DropShadow.qml b/examples/declarative/shadereffects/qml/DropShadow.qml
new file mode 100755
index 0000000000..054f19375d
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/DropShadow.qml
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ Image {
+ id: background
+ anchors.fill: parent
+ source: "images/bg.jpg"
+ }
+
+ DropShadowEffect {
+ id: layer
+
+ property real distance: 0.0
+
+ width: photo.width
+ height: photo.height
+ sourceItem: photo
+ color: "black"
+ blur: distance / 10.0
+ opacity: 1 - distance / 50.0
+
+ Binding {
+ target: layer
+ property: "x"
+ value: -0.4 * layer.distance
+ when: !dragArea.pressed
+ }
+ Binding {
+ target: layer
+ property: "y"
+ value: 0.9 * layer.distance
+ when: !dragArea.pressed
+ }
+
+ SequentialAnimation on distance {
+ id: animation
+ running: true
+ loops: Animation.Infinite
+
+ NumberAnimation { to: 30; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ NumberAnimation { to: 0; duration: 2000 }
+ PauseAnimation { duration: 500 }
+ }
+ }
+
+ Image {
+ id: photo
+ anchors.fill: parent
+ source: "images/drop_shadow.png"
+ smooth: true
+ }
+
+ MouseArea {
+ id: dragArea
+ anchors.fill: parent
+
+ property int startX
+ property int startY
+
+ onPressed: {
+ startX = mouseX
+ startY = mouseY
+ }
+
+ onPositionChanged: {
+ layer.x += mouseX - startX
+ layer.y += mouseY - startY
+ startX = mouseX
+ startY = mouseY
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/DropShadowEffect.qml b/examples/declarative/shadereffects/qml/DropShadowEffect.qml
new file mode 100755
index 0000000000..b9903a330a
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/DropShadowEffect.qml
@@ -0,0 +1,174 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ property real blur: 0.0
+ property alias color: shadowEffectWithHBlur.color
+ property alias sourceItem: source.sourceItem
+
+ ShaderEffectSource {
+ id: source
+ smooth: true
+ hideSource: false
+ }
+
+ ShaderEffectItem {
+ id: shadowEffectWithHBlur
+ anchors.fill: parent
+
+ property color color: "grey"
+ property variant sourceTexture: source;
+ property real xStep: main.blur / main.width
+
+ vertexShader:"
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp float xStep;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main(void)
+ {
+ highp vec2 shift = vec2(xStep, 0.);
+ qt_TexCoord0 = qt_MultiTexCoord0 - 2.5 * shift;
+ qt_TexCoord1 = qt_MultiTexCoord0 - 1.5 * shift;
+ qt_TexCoord2 = qt_MultiTexCoord0 - 0.5 * shift;
+ qt_TexCoord4 = qt_MultiTexCoord0 + 0.5 * shift;
+ qt_TexCoord5 = qt_MultiTexCoord0 + 1.5 * shift;
+ qt_TexCoord6 = qt_MultiTexCoord0 + 2.5 * shift;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ fragmentShader:"
+ uniform highp vec4 color;
+ uniform lowp sampler2D sourceTexture;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main() {
+ highp vec4 sourceColor = (texture2D(sourceTexture, qt_TexCoord0) * 0.1
+ + texture2D(sourceTexture, qt_TexCoord1) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord2) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord4) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord5) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord6) * 0.1);
+ gl_FragColor = mix(vec4(0), color, sourceColor.a);
+ }
+ "
+ }
+
+ ShaderEffectSource {
+ id: hBlurredShadow
+ smooth: true
+ sourceItem: shadowEffectWithHBlur
+ hideSource: true
+ }
+
+ ShaderEffectItem {
+ id: finalEffect
+ anchors.fill: parent
+
+ property color color: "grey"
+ property variant sourceTexture: hBlurredShadow;
+ property real yStep: main.blur / main.height
+
+ vertexShader:"
+ uniform highp mat4 qt_ModelViewProjectionMatrix;
+ attribute highp vec4 qt_Vertex;
+ attribute highp vec2 qt_MultiTexCoord0;
+ uniform highp float yStep;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main(void)
+ {
+ highp vec2 shift = vec2(0., yStep);
+ qt_TexCoord0 = qt_MultiTexCoord0 - 2.5 * shift;
+ qt_TexCoord1 = qt_MultiTexCoord0 - 1.5 * shift;
+ qt_TexCoord2 = qt_MultiTexCoord0 - 0.5 * shift;
+ qt_TexCoord4 = qt_MultiTexCoord0 + 0.5 * shift;
+ qt_TexCoord5 = qt_MultiTexCoord0 + 1.5 * shift;
+ qt_TexCoord6 = qt_MultiTexCoord0 + 2.5 * shift;
+ gl_Position = qt_ModelViewProjectionMatrix * qt_Vertex;
+ }
+ "
+
+ fragmentShader:"
+ uniform highp vec4 color;
+ uniform lowp sampler2D sourceTexture;
+ uniform highp float qt_Opacity;
+ varying highp vec2 qt_TexCoord0;
+ varying highp vec2 qt_TexCoord1;
+ varying highp vec2 qt_TexCoord2;
+ varying highp vec2 qt_TexCoord4;
+ varying highp vec2 qt_TexCoord5;
+ varying highp vec2 qt_TexCoord6;
+
+ void main() {
+ highp vec4 sourceColor = (texture2D(sourceTexture, qt_TexCoord0) * 0.1
+ + texture2D(sourceTexture, qt_TexCoord1) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord2) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord4) * 0.25
+ + texture2D(sourceTexture, qt_TexCoord5) * 0.15
+ + texture2D(sourceTexture, qt_TexCoord6) * 0.1);
+ gl_FragColor = sourceColor * qt_Opacity;
+ }
+ "
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/Grayscale.qml b/examples/declarative/shadereffects/qml/Grayscale.qml
new file mode 100755
index 0000000000..d819a5de3f
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/Grayscale.qml
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ GrayscaleEffect {
+ id: layer
+ anchors.fill: parent
+
+ source: ShaderEffectSource {
+ sourceItem: Image { source: "images/desaturate.jpg" }
+ live: false
+ hideSource: true
+ }
+
+ SequentialAnimation on ratio {
+ id: ratioAnimation
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ easing.type: Easing.Linear
+ to: 0.0
+ duration: 1500
+ }
+ PauseAnimation { duration: 1000 }
+ NumberAnimation {
+ easing.type: Easing.Linear
+ to: 1.0
+ duration: 1500
+ }
+ PauseAnimation { duration: 1000 }
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/GrayscaleEffect.qml b/examples/declarative/shadereffects/qml/GrayscaleEffect.qml
new file mode 100755
index 0000000000..34505ff098
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/GrayscaleEffect.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+ property real ratio: 1.0
+ property variant source: 0
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float ratio;
+ void main(void)
+ {
+ lowp vec4 textureColor = texture2D(source, qt_TexCoord0.st);
+ lowp float gray = dot(textureColor, vec4(0.299, 0.587, 0.114, 0.0));
+ gl_FragColor = vec4(gray * ratio + textureColor.r * (1.0 - ratio), gray * ratio + textureColor.g * (1.0 - ratio), gray * ratio + textureColor.b * (1.0 - ratio), textureColor.a);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/ImageMask.qml b/examples/declarative/shadereffects/qml/ImageMask.qml
new file mode 100755
index 0000000000..ea9fa0adc9
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/ImageMask.qml
@@ -0,0 +1,143 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent
+
+ Image {
+ id: bg
+ anchors.fill: parent
+ source: "images/image2.jpg"
+ }
+
+ Item {
+ id: mask
+ anchors.fill: parent
+
+ Text {
+ text: "Mask text"
+ font.pixelSize: 50
+ font.bold: true
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ NumberAnimation on rotation {
+ running: true
+ loops: Animation.Infinite
+ from: 0
+ to: 360
+ duration: 3000
+ }
+
+ SequentialAnimation on y {
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.height
+ duration: 3000
+ }
+ NumberAnimation {
+ to: 0
+ duration: 3000
+ }
+ }
+ }
+
+ Rectangle {
+ id: opaqueBox
+ width: 60
+ height: parent.height
+ SequentialAnimation on x {
+ running: true
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.width
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ }
+ }
+
+ Rectangle {
+ width: 100
+ opacity: 0.5
+ height: parent.height
+ SequentialAnimation on x {
+ PauseAnimation { duration: 100 }
+
+ SequentialAnimation {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: main.width
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutCubic
+ }
+ }
+ }
+ }
+ }
+
+ ImageMaskEffect {
+ anchors.fill: parent
+ image: ShaderEffectSource {
+ sourceItem: Image { source: "images/image1.jpg" }
+ live: false
+ hideSource: true
+ }
+ mask: ShaderEffectSource {
+ sourceItem: mask
+ live: true
+ hideSource: true
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/ImageMaskEffect.qml b/examples/declarative/shadereffects/qml/ImageMaskEffect.qml
new file mode 100755
index 0000000000..2dc0e7578e
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/ImageMaskEffect.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+ property variant image: 0
+ property variant mask: 0
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D image;
+ uniform sampler2D mask;
+ void main(void)
+ {
+ gl_FragColor = texture2D(image, qt_TexCoord0.st) * (texture2D(mask, qt_TexCoord0.st).a);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/RadialWave.qml b/examples/declarative/shadereffects/qml/RadialWave.qml
new file mode 100755
index 0000000000..4487293854
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/RadialWave.qml
@@ -0,0 +1,85 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ anchors.fill: parent
+
+ ShaderEffectSource {
+ id: thesource
+ sourceItem: Image { source: "images/wave.jpg" }
+ live: false
+ hideSource: true
+ }
+
+ RadialWaveEffect {
+ id: layer
+ anchors.fill: parent;
+ source: thesource
+
+ wave: 0.0
+ waveOriginX: 0.5
+ waveOriginY: 0.5
+ waveWidth: 0.01
+
+ NumberAnimation on wave {
+ id: waveAnim
+ running: true
+ loops: Animation.Infinite
+ easing.type: "Linear"
+ from: 0.0000; to: 2.0000;
+ duration: 2500
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onPressed: {
+ waveAnim.stop()
+ layer.waveOriginX = mouseX / main.width
+ layer.waveOriginY = mouseY / main.height
+ waveAnim.start()
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/RadialWaveEffect.qml b/examples/declarative/shadereffects/qml/RadialWaveEffect.qml
new file mode 100755
index 0000000000..c415f69783
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/RadialWaveEffect.qml
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+ShaderEffectItem {
+ id: effect
+
+ property real wave: 0.3
+ property real waveOriginX: 0.5
+ property real waveOriginY: 0.5
+ property real waveWidth: 0.01
+ property real aspectRatio: width/height
+ property variant source: 0
+
+ fragmentShader:
+ "
+ varying mediump vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform highp float wave;
+ uniform highp float waveWidth;
+ uniform highp float waveOriginX;
+ uniform highp float waveOriginY;
+ uniform highp float aspectRatio;
+
+ void main(void)
+ {
+ mediump vec2 texCoord2 = qt_TexCoord0;
+ mediump vec2 origin = vec2(waveOriginX, (1.0 - waveOriginY) / aspectRatio);
+
+ highp float fragmentDistance = distance(vec2(texCoord2.s, texCoord2.t / aspectRatio), origin);
+ highp float waveLength = waveWidth + fragmentDistance * 0.25;
+
+ if ( fragmentDistance > wave && fragmentDistance < wave + waveLength) {
+ highp float distanceFromWaveEdge = min(abs(wave - fragmentDistance), abs(wave + waveLength - fragmentDistance));
+ texCoord2 += sin(1.57075 * distanceFromWaveEdge / waveLength) * distanceFromWaveEdge * 0.08 / fragmentDistance;
+ }
+
+ gl_FragColor = texture2D(source, texCoord2.st);
+ }
+ "
+}
diff --git a/examples/declarative/shadereffects/qml/Water.qml b/examples/declarative/shadereffects/qml/Water.qml
new file mode 100755
index 0000000000..8ad6c6a7fd
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/Water.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ anchors.fill: parent
+
+ Image {
+ id: image
+ width: parent.width
+ height: parent.height * 0.65
+ source: "images/sky.jpg"
+ smooth: true
+ }
+ WaterEffect {
+ sourceItem: image
+ intensity: 5
+ height: parent.height - image.height
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/WaterEffect.qml b/examples/declarative/shadereffects/qml/WaterEffect.qml
new file mode 100755
index 0000000000..84989eb8d9
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/WaterEffect.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: root
+ property alias sourceItem: effectsource.sourceItem
+ property real intensity: 1
+ property bool waving: true
+ anchors.top: sourceItem.bottom
+ width: sourceItem.width
+ height: sourceItem.height
+
+ ShaderEffectItem {
+ anchors.fill: parent
+ property variant source: effectsource
+ property real f: 0
+ property real f2: 0
+ property alias intensity: root.intensity
+ smooth: true
+
+ ShaderEffectSource {
+ id: effectsource
+ hideSource: false
+ smooth: true
+ }
+
+ fragmentShader:
+ "
+ varying highp vec2 qt_TexCoord0;
+ uniform sampler2D source;
+ uniform lowp float qt_Opacity;
+ uniform highp float f;
+ uniform highp float f2;
+ uniform highp float intensity;
+
+ void main() {
+ const highp float twopi = 3.141592653589 * 2.0;
+
+ highp float distanceFactorToPhase = pow(qt_TexCoord0.y + 0.5, 8.0) * 5.0;
+ highp float ofx = sin(f * twopi + distanceFactorToPhase) / 100.0;
+ highp float ofy = sin(f2 * twopi + distanceFactorToPhase * qt_TexCoord0.x) / 60.0;
+
+ highp float intensityDampingFactor = (qt_TexCoord0.x + 0.1) * (qt_TexCoord0.y + 0.2);
+ highp float distanceFactor = (1.0 - qt_TexCoord0.y) * 4.0 * intensity * intensityDampingFactor;
+
+ ofx *= distanceFactor;
+ ofy *= distanceFactor;
+
+ highp float x = qt_TexCoord0.x + ofx;
+ highp float y = 1.0 - qt_TexCoord0.y + ofy;
+
+ highp float fake = (sin((ofy + ofx) * twopi) + 0.5) * 0.05 * (1.2 - qt_TexCoord0.y) * intensity * intensityDampingFactor;
+
+ highp vec4 pix =
+ texture2D(source, vec2(x, y)) * 0.6 +
+ texture2D(source, vec2(x-fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y-fake)) * 0.15 +
+ texture2D(source, vec2(x+fake, y)) * 0.15 +
+ texture2D(source, vec2(x, y+fake)) * 0.15;
+
+ highp float darken = 0.6 - (ofx - ofy) / 2.0;
+ pix.b *= 1.2 * darken;
+ pix.r *= 0.9 * darken;
+ pix.g *= darken;
+
+ gl_FragColor = qt_Opacity * vec4(pix.r, pix.g, pix.b, 1.0);
+ }
+ "
+
+ NumberAnimation on f {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 2410
+ }
+ NumberAnimation on f2 {
+ running: root.waving
+ loops: Animation.Infinite
+ from: 0
+ to: 1
+ duration: 1754
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/qml/images/Curtain.jpg b/examples/declarative/shadereffects/qml/images/Curtain.jpg
new file mode 100755
index 0000000000..40003cbb0f
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/Curtain.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/DropShadow.jpg b/examples/declarative/shadereffects/qml/images/DropShadow.jpg
new file mode 100755
index 0000000000..c1e693a5f4
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/DropShadow.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/Grayscale.jpg b/examples/declarative/shadereffects/qml/images/Grayscale.jpg
new file mode 100755
index 0000000000..c95cab47bd
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/Grayscale.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/ImageMask.jpg b/examples/declarative/shadereffects/qml/images/ImageMask.jpg
new file mode 100755
index 0000000000..0da4c0da3f
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/ImageMask.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/RadialWave.jpg b/examples/declarative/shadereffects/qml/images/RadialWave.jpg
new file mode 100755
index 0000000000..fc51efcc9c
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/RadialWave.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/Water.jpg b/examples/declarative/shadereffects/qml/images/Water.jpg
new file mode 100755
index 0000000000..38615c139d
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/Water.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/back.png b/examples/declarative/shadereffects/qml/images/back.png
new file mode 100755
index 0000000000..5dd3d22608
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/back.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/bg.jpg b/examples/declarative/shadereffects/qml/images/bg.jpg
new file mode 100755
index 0000000000..4d22143810
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/bg.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/desaturate.jpg b/examples/declarative/shadereffects/qml/images/desaturate.jpg
new file mode 100755
index 0000000000..e5e99bb943
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/desaturate.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/drop_shadow.png b/examples/declarative/shadereffects/qml/images/drop_shadow.png
new file mode 100755
index 0000000000..144c02d548
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/drop_shadow.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/fabric.jpg b/examples/declarative/shadereffects/qml/images/fabric.jpg
new file mode 100755
index 0000000000..ab654093a3
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/fabric.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/flower.png b/examples/declarative/shadereffects/qml/images/flower.png
new file mode 100755
index 0000000000..144c02d548
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/flower.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/image1.jpg b/examples/declarative/shadereffects/qml/images/image1.jpg
new file mode 100755
index 0000000000..3442e77591
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/image1.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/image2.jpg b/examples/declarative/shadereffects/qml/images/image2.jpg
new file mode 100755
index 0000000000..23e5c5c1cf
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/image2.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/qt-logo.png b/examples/declarative/shadereffects/qml/images/qt-logo.png
new file mode 100755
index 0000000000..41a304b44b
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/qt-logo.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/shader_effects.jpg b/examples/declarative/shadereffects/qml/images/shader_effects.jpg
new file mode 100755
index 0000000000..19e8a3999a
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/shader_effects.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/sky.jpg b/examples/declarative/shadereffects/qml/images/sky.jpg
new file mode 100755
index 0000000000..8fc19ed1be
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/sky.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/toolbar.png b/examples/declarative/shadereffects/qml/images/toolbar.png
new file mode 100755
index 0000000000..773e3ea1bc
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/toolbar.png
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/images/wave.jpg b/examples/declarative/shadereffects/qml/images/wave.jpg
new file mode 100755
index 0000000000..c8083bbad1
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/images/wave.jpg
Binary files differ
diff --git a/examples/declarative/shadereffects/qml/main.qml b/examples/declarative/shadereffects/qml/main.qml
new file mode 100755
index 0000000000..ee85570302
--- /dev/null
+++ b/examples/declarative/shadereffects/qml/main.qml
@@ -0,0 +1,160 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+import Qt.labs.shaders 1.0
+
+Item {
+ id: main
+ width: 360
+ height: 640
+
+ Rectangle {
+ anchors.fill: parent
+ color: "black"
+ }
+
+ Image {
+ id: header
+ source: "images/shader_effects.jpg"
+ }
+
+ ListModel {
+ id: demoModel
+ ListElement { name: "ImageMask" }
+ ListElement { name: "RadialWave" }
+ ListElement { name: "Water" }
+ ListElement { name: "Grayscale" }
+ ListElement { name: "DropShadow" }
+ ListElement { name: "Curtain" }
+ }
+
+ Grid {
+ id: menuGrid
+ anchors.top: header.bottom
+ anchors.bottom: toolbar.top
+ width: parent.width
+ columns: 2
+ Repeater {
+ model: demoModel
+ Item {
+ width: main.width / 2
+ height: menuGrid.height / 3
+ clip: true
+ Image {
+ width: parent.width
+ height: width
+ source: "images/" + name + ".jpg"
+ opacity: mouseArea.pressed ? 0.6 : 1.0
+ }
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: {
+ demoLoader.source = name + ".qml"
+ main.state = "showDemo"
+ }
+ }
+ }
+ }
+ }
+
+ Loader {
+ anchors.fill: parent
+ id: demoLoader
+ visible: false
+ Behavior on opacity {
+ NumberAnimation { duration: 300 }
+ }
+ }
+
+ Image {
+ id: toolbar
+ source: "images/toolbar.png"
+ width: parent.width
+ anchors.bottom: parent.bottom
+ }
+
+ Rectangle {
+ id: translucentToolbar
+ color: "black"
+ opacity: 0.3
+ anchors.fill: toolbar
+ visible: !toolbar.visible
+ }
+
+ Item {
+ height: toolbar.height
+ width: height
+ anchors.bottom: parent.bottom
+
+ Image {
+ source: "images/back.png"
+ anchors.centerIn: parent
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (main.state == "") Qt.quit(); else {
+ main.state = ""
+ demoLoader.source = ""
+ }
+ }
+ }
+ }
+
+ states: State {
+ name: "showDemo"
+ PropertyChanges {
+ target: menuGrid
+ visible: false
+ }
+ PropertyChanges {
+ target: demoLoader
+ visible: true
+ }
+ PropertyChanges {
+ target: toolbar
+ visible: false
+ }
+ }
+}
diff --git a/examples/declarative/shadereffects/shadereffects.pro b/examples/declarative/shadereffects/shadereffects.pro
new file mode 100755
index 0000000000..1107887263
--- /dev/null
+++ b/examples/declarative/shadereffects/shadereffects.pro
@@ -0,0 +1,21 @@
+TEMPLATE = app
+TARGET = shadereffects
+DEPENDPATH += .
+INCLUDEPATH += .
+QT += declarative opengl
+
+# Input
+SOURCES += main.cpp
+
+symbian {
+ DEFINES += SHADEREFFECTS_USE_OPENGL_GRAPHICSSYSTEM
+}
+
+
+target.path = $$[QT_INSTALL_EXAMPLES]/declarative/shadereffects
+sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS shadereffects.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/declarative/shadereffects
+qmlfiles.files = qml
+qmlfiles.path = $$[QT_INSTALL_EXAMPLES]/declarative/shadereffects
+
+INSTALLS += target sources qmlfiles
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 02a63bb92d..5dfc946b5b 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -434,6 +434,12 @@ bool QThread::isRunning() const
{
Q_D(const QThread);
QMutexLocker locker(&d->mutex);
+#ifdef Q_OS_SYMBIAN
+ // app shutdown on Symbian can terminate threads and invalidate their stacks without notification,
+ // check the thread is still alive.
+ if (d->data->symbian_thread_handle.Handle() && d->data->symbian_thread_handle.ExitType() != EExitPending)
+ return false;
+#endif
return d->running;
}
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 72738c9fa8..17b7da3acc 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -77,8 +77,8 @@ else:mac {
SOURCES += image/qpixmap_mac.cpp
}
else:symbian {
- HEADERS += image/qpixmap_s60_p.h
- SOURCES += image/qpixmap_s60.cpp
+ HEADERS += image/qpixmap_raster_symbian_p.h
+ SOURCES += image/qpixmap_raster_symbian.cpp
}
!symbian|contains(S60_VERSION, 3.1)|contains(S60_VERSION, 3.2) {
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 14322dc929..a3378de443 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -62,7 +62,11 @@
#include <qhash.h>
+#if defined(Q_OS_SYMBIAN)
+#include <private/qpaintengine_raster_symbian_p.h>
+#else
#include <private/qpaintengine_raster_p.h>
+#endif
#include <private/qimage_p.h>
#include <private/qfont_p.h>
@@ -5779,7 +5783,11 @@ QPaintEngine *QImage::paintEngine() const
return 0;
if (!d->paintEngine) {
+#ifdef Q_OS_SYMBIAN
+ d->paintEngine = new QSymbianRasterPaintEngine(const_cast<QImage *>(this));
+#else
d->paintEngine = new QRasterPaintEngine(const_cast<QImage *>(this));
+#endif
}
return d->paintEngine;
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index 76c23c8ce2..46689134c4 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -271,7 +271,7 @@ private:
friend class QPixmapData;
friend class QX11PixmapData;
friend class QMacPixmapData;
- friend class QS60PixmapData;
+ friend class QSymbianRasterPixmapData;
friend class QBitmap;
friend class QPaintDevice;
friend class QPainter;
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_raster_symbian.cpp
index ac29f5dea4..ae2682ba91 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_raster_symbian.cpp
@@ -45,13 +45,13 @@
#include <private/qapplication_p.h>
#include <private/qgraphicssystem_p.h>
#include <private/qt_s60_p.h>
-#include <private/qpaintengine_s60_p.h>
#include <private/qfont_p.h>
+#include <private/qpaintengine_raster_symbian_p.h>
#include "qpixmap.h"
#include "qpixmap_raster_p.h"
#include <qwidget.h>
-#include "qpixmap_s60_p.h"
+#include "qpixmap_raster_symbian_p.h"
#include "qnativeimage_p.h"
#include "qbitmap.h"
#include "qimage.h"
@@ -65,10 +65,10 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80 };
static bool cleanup_function_registered = false;
-static QS60PixmapData *firstPixmap = 0;
+static QSymbianRasterPixmapData *firstPixmap = 0;
// static
-void QS60PixmapData::qt_symbian_register_pixmap(QS60PixmapData *pd)
+void QSymbianRasterPixmapData::qt_symbian_register_pixmap(QSymbianRasterPixmapData *pd)
{
if (!cleanup_function_registered) {
qAddPostRoutine(qt_symbian_release_pixmaps);
@@ -83,7 +83,7 @@ void QS60PixmapData::qt_symbian_register_pixmap(QS60PixmapData *pd)
}
// static
-void QS60PixmapData::qt_symbian_unregister_pixmap(QS60PixmapData *pd)
+void QSymbianRasterPixmapData::qt_symbian_unregister_pixmap(QSymbianRasterPixmapData *pd)
{
if (pd->next)
pd->next->prev = pd->prev;
@@ -94,10 +94,10 @@ void QS60PixmapData::qt_symbian_unregister_pixmap(QS60PixmapData *pd)
}
// static
-void QS60PixmapData::qt_symbian_release_pixmaps()
+void QSymbianRasterPixmapData::qt_symbian_release_pixmaps()
{
- // Scan all QS60PixmapData objects in the system and destroy them.
- QS60PixmapData *pd = firstPixmap;
+ // Scan all QSymbianRasterPixmapData objects in the system and destroy them.
+ QSymbianRasterPixmapData *pd = firstPixmap;
while (pd != 0) {
pd->release();
pd = pd->next;
@@ -393,7 +393,7 @@ QPixmap QPixmap::fromSymbianCFbsBitmap(CFbsBitmap *bitmap)
return pixmap;
}
-QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
+QSymbianRasterPixmapData::QSymbianRasterPixmapData(PixelType type) : QRasterPixmapData(type),
symbianBitmapDataAccess(new QSymbianBitmapDataAccess),
cfbsBitmap(0),
pengine(0),
@@ -405,14 +405,14 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
qt_symbian_register_pixmap(this);
}
-QS60PixmapData::~QS60PixmapData()
+QSymbianRasterPixmapData::~QSymbianRasterPixmapData()
{
release();
delete symbianBitmapDataAccess;
qt_symbian_unregister_pixmap(this);
}
-void QS60PixmapData::resize(int width, int height)
+void QSymbianRasterPixmapData::resize(int width, int height)
{
if (width <= 0 || height <= 0) {
w = width;
@@ -446,7 +446,7 @@ void QS60PixmapData::resize(int width, int height)
}
}
-void QS60PixmapData::release()
+void QSymbianRasterPixmapData::release()
{
if (cfbsBitmap) {
QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
@@ -464,7 +464,7 @@ void QS60PixmapData::release()
/*!
* Takes ownership of bitmap. Used by window surface
*/
-void QS60PixmapData::fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat)
+void QSymbianRasterPixmapData::fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat)
{
Q_ASSERT(bitmap);
@@ -496,9 +496,9 @@ void QS60PixmapData::fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat)
}
}
-QImage QS60PixmapData::toImage(const QRect &r) const
+QImage QSymbianRasterPixmapData::toImage(const QRect &r) const
{
- QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
+ QSymbianRasterPixmapData *that = const_cast<QSymbianRasterPixmapData*>(this);
that->beginDataAccess();
QImage copy = that->image.copy(r);
that->endDataAccess();
@@ -506,7 +506,7 @@ QImage QS60PixmapData::toImage(const QRect &r) const
return copy;
}
-void QS60PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
+void QSymbianRasterPixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags)
{
release();
@@ -588,13 +588,13 @@ void QS60PixmapData::fromImage(const QImage &img, Qt::ImageConversionFlags flags
}
}
-void QS60PixmapData::copy(const QPixmapData *data, const QRect &rect)
+void QSymbianRasterPixmapData::copy(const QPixmapData *data, const QRect &rect)
{
- const QS60PixmapData *s60Data = static_cast<const QS60PixmapData*>(data);
+ const QSymbianRasterPixmapData *s60Data = static_cast<const QSymbianRasterPixmapData*>(data);
fromImage(s60Data->toImage(rect), Qt::AutoColor | Qt::OrderedAlphaDither);
}
-bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect)
+bool QSymbianRasterPixmapData::scroll(int dx, int dy, const QRect &rect)
{
beginDataAccess();
bool res = QRasterPixmapData::scroll(dx, dy, rect);
@@ -602,7 +602,10 @@ bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect)
return res;
}
-int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
+Q_GUI_EXPORT int qt_defaultDpiX();
+Q_GUI_EXPORT int qt_defaultDpiY();
+
+int QSymbianRasterPixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
{
if (!cfbsBitmap)
return 0;
@@ -633,7 +636,7 @@ int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
}
-void QS60PixmapData::fill(const QColor &color)
+void QSymbianRasterPixmapData::fill(const QColor &color)
{
if (color.alpha() != 255) {
QImage im(width(), height(), QImage::Format_ARGB32_Premultiplied);
@@ -647,7 +650,7 @@ void QS60PixmapData::fill(const QColor &color)
}
}
-void QS60PixmapData::setMask(const QBitmap &mask)
+void QSymbianRasterPixmapData::setMask(const QBitmap &mask)
{
if (mask.size().isEmpty()) {
if (image.depth() != 1) {
@@ -678,7 +681,7 @@ void QS60PixmapData::setMask(const QBitmap &mask)
}
}
-void QS60PixmapData::setAlphaChannel(const QPixmap &alphaChannel)
+void QSymbianRasterPixmapData::setAlphaChannel(const QPixmap &alphaChannel)
{
QImage img(toImage());
img.setAlphaChannel(alphaChannel.toImage());
@@ -686,21 +689,21 @@ void QS60PixmapData::setAlphaChannel(const QPixmap &alphaChannel)
fromImage(img, Qt::OrderedDither | Qt::OrderedAlphaDither);
}
-QImage QS60PixmapData::toImage() const
+QImage QSymbianRasterPixmapData::toImage() const
{
return toImage(QRect());
}
-QPaintEngine* QS60PixmapData::paintEngine() const
+QPaintEngine* QSymbianRasterPixmapData::paintEngine() const
{
if (!pengine) {
- QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
- that->pengine = new QS60PaintEngine(&that->image, that);
+ QSymbianRasterPixmapData *that = const_cast<QSymbianRasterPixmapData*>(this);
+ that->pengine = new QSymbianRasterPaintEngine(&that->image, that);
}
return pengine;
}
-void QS60PixmapData::beginDataAccess()
+void QSymbianRasterPixmapData::beginDataAccess()
{
if(!cfbsBitmap)
return;
@@ -740,12 +743,12 @@ void QS60PixmapData::beginDataAccess()
is_null = (w <= 0 || h <= 0);
if (pengine) {
- QS60PaintEngine *engine = static_cast<QS60PaintEngine *>(pengine);
+ QSymbianRasterPaintEngine *engine = static_cast<QSymbianRasterPaintEngine *>(pengine);
engine->prepare(&image);
}
}
-void QS60PixmapData::endDataAccess(bool readOnly) const
+void QSymbianRasterPixmapData::endDataAccess(bool readOnly) const
{
Q_UNUSED(readOnly);
@@ -812,7 +815,7 @@ RSgImage *QPixmap::toSymbianRSgImage() const
return sgImage;
}
-void* QS60PixmapData::toNativeType(NativeType type)
+void* QSymbianRasterPixmapData::toNativeType(NativeType type)
{
if (type == QPixmapData::SgImage) {
return 0;
@@ -895,7 +898,7 @@ void* QS60PixmapData::toNativeType(NativeType type)
return 0;
}
-void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType)
+void QSymbianRasterPixmapData::fromNativeType(void* pixmap, NativeType nativeType)
{
if (nativeType == QPixmapData::SgImage) {
return;
@@ -1005,7 +1008,7 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType)
}
}
-void QS60PixmapData::convertToDisplayMode(int mode)
+void QSymbianRasterPixmapData::convertToDisplayMode(int mode)
{
const TDisplayMode displayMode = static_cast<TDisplayMode>(mode);
if (!cfbsBitmap || cfbsBitmap->DisplayMode() == displayMode)
@@ -1032,9 +1035,9 @@ void QS60PixmapData::convertToDisplayMode(int mode)
UPDATE_BUFFER();
}
-QPixmapData *QS60PixmapData::createCompatiblePixmapData() const
+QPixmapData *QSymbianRasterPixmapData::createCompatiblePixmapData() const
{
- return new QS60PixmapData(pixelType());
+ return new QSymbianRasterPixmapData(pixelType());
}
QT_END_NAMESPACE
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_raster_symbian_p.h
index e48154963b..7f4e53a15b 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_raster_symbian_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QPIXMAPDATA_S60_P_H
-#define QPIXMAPDATA_S60_P_H
+#ifndef QPIXMAP_RASTER_SYMBIAN_P_H
+#define QPIXMAP_RASTER_SYMBIAN_P_H
//
// W A R N I N G
@@ -81,11 +81,11 @@ private:
bool wasLocked;
};
-class QS60PixmapData : public QRasterPixmapData
+class QSymbianRasterPixmapData : public QRasterPixmapData
{
public:
- QS60PixmapData(PixelType type);
- ~QS60PixmapData();
+ QSymbianRasterPixmapData(PixelType type);
+ ~QSymbianRasterPixmapData();
QPixmapData *createCompatiblePixmapData() const;
@@ -122,20 +122,19 @@ private:
bool formatLocked;
- QS60PixmapData *next;
- QS60PixmapData *prev;
+ QSymbianRasterPixmapData *next;
+ QSymbianRasterPixmapData *prev;
- static void qt_symbian_register_pixmap(QS60PixmapData *pd);
- static void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_register_pixmap(QSymbianRasterPixmapData *pd);
+ static void qt_symbian_unregister_pixmap(QSymbianRasterPixmapData *pd);
static void qt_symbian_release_pixmaps();
friend class QPixmap;
friend class QS60WindowSurface;
- friend class QS60PaintEngine;
+ friend class QSymbianRasterPaintEngine;
friend class QS60Data;
};
QT_END_NAMESPACE
-#endif // QPIXMAPDATA_S60_P_H
-
+#endif // QPIXMAP_RASTER_SYMBIAN_P_H
diff --git a/src/gui/image/qpixmapdata.cpp b/src/gui/image/qpixmapdata.cpp
index c46429cf40..934dbb8764 100644
--- a/src/gui/image/qpixmapdata.cpp
+++ b/src/gui/image/qpixmapdata.cpp
@@ -276,6 +276,11 @@ QImage* QPixmapData::buffer()
}
#if defined(Q_OS_SYMBIAN)
+QVolatileImage QPixmapData::toVolatileImage() const
+{
+ return QVolatileImage();
+}
+
void* QPixmapData::toNativeType(NativeType /* type */)
{
return 0;
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index f07843dee2..960eb8fbcb 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -139,7 +139,7 @@ public:
}
#if defined(Q_OS_SYMBIAN)
- virtual QVolatileImage toVolatileImage() const { return QVolatileImage(); }
+ virtual QVolatileImage toVolatileImage() const;
virtual void* toNativeType(NativeType type);
virtual void fromNativeType(void* pixmap, NativeType type);
#endif
@@ -159,7 +159,7 @@ protected:
private:
friend class QPixmap;
friend class QX11PixmapData;
- friend class QS60PixmapData;
+ friend class QSymbianRasterPixmapData;
friend class QImagePixmapCleanupHooks; // Needs to set is_cached
friend class QGLTextureCache; //Needs to check the reference count
friend class QExplicitlySharedDataPointer<QPixmapData>;
diff --git a/src/gui/image/qpixmapdatafactory.cpp b/src/gui/image/qpixmapdatafactory.cpp
index f7c79880ca..ebe89e4e7c 100644
--- a/src/gui/image/qpixmapdatafactory.cpp
+++ b/src/gui/image/qpixmapdatafactory.cpp
@@ -57,7 +57,7 @@
# include <private/qpixmap_raster_p.h>
#endif
#ifdef Q_OS_SYMBIAN
-# include <private/qpixmap_s60_p.h>
+# include <private/qpixmap_raster_symbian_p.h>
#endif
#include "private/qapplication_p.h"
@@ -88,7 +88,7 @@ QPixmapData* QSimplePixmapDataFactory::create(QPixmapData::PixelType type)
#elif defined(Q_WS_QPA)
return new QRasterPixmapData(type);
#elif defined(Q_OS_SYMBIAN)
- return new QS60PixmapData(type);
+ return new QSymbianRasterPixmapData(type);
#else
#error QSimplePixmapDataFactory::create() not implemented
#endif
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
index b8612b128f..9734c82494 100644
--- a/src/gui/image/qvolatileimage.cpp
+++ b/src/gui/image/qvolatileimage.cpp
@@ -200,6 +200,16 @@ QImage &QVolatileImage::imageRef() // non-const, in order to cause a detach
return d->image;
}
+/*!
+ Non-detaching version, for read-only access only.
+ Must be guarded by begin/endDataAccess().
+ */
+const QImage &QVolatileImage::constImageRef() const
+{
+ const_cast<QVolatileImageData *>(d.data())->ensureImage();
+ return d->image;
+}
+
void *QVolatileImage::duplicateNativeImage() const
{
return d->duplicateNativeImage();
@@ -289,12 +299,14 @@ bool QVolatileImagePaintEngine::end()
void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
#ifdef Q_OS_SYMBIAN
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(p, img->imageRef());
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ // imageRef() would detach and since we received the QVolatileImage from
+ // toVolatileImage() by value, it would cause a copy which would ruin
+ // our goal. So use constImageRef() instead.
+ QRasterPaintEngine::drawImage(p, img.constImageRef());
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(p, pm);
}
@@ -306,12 +318,11 @@ void QVolatileImagePaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
void QVolatileImagePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
#ifdef Q_OS_SYMBIAN
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img.constImageRef(), sr);
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(r, pm, sr);
}
diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h
index 97d6ea65a9..bed2e915ab 100644
--- a/src/gui/image/qvolatileimage_p.h
+++ b/src/gui/image/qvolatileimage_p.h
@@ -87,6 +87,7 @@ public:
bool ensureFormat(QImage::Format format);
QImage toImage() const;
QImage &imageRef();
+ const QImage &constImageRef() const;
QPaintEngine *paintEngine();
void setAlphaChannel(const QPixmap &alphaChannel);
void fill(uint pixelValue);
diff --git a/src/gui/image/qvolatileimagedata_symbian.cpp b/src/gui/image/qvolatileimagedata_symbian.cpp
index 6984722c0f..c20c417b16 100644
--- a/src/gui/image/qvolatileimagedata_symbian.cpp
+++ b/src/gui/image/qvolatileimagedata_symbian.cpp
@@ -53,8 +53,11 @@ static CFbsBitmap *rasterizeBitmap(CFbsBitmap *bitmap, TDisplayMode newMode)
return 0;
}
QScopedPointer<CFbsBitmap> newBitmap(new CFbsBitmap);
- if (newBitmap->Create(bitmap->SizeInPixels(), newMode) != KErrNone) {
- qWarning("QVolatileImage: Failed to create new bitmap");
+ const TSize size = bitmap->SizeInPixels();
+ TInt err = newBitmap->Create(size, newMode);
+ if (err != KErrNone) {
+ qWarning("QVolatileImage: Failed to create new bitmap (w %d h %d dispmode %d err %d)",
+ size.iWidth, size.iHeight, newMode, err);
return 0;
}
CFbsBitmapDevice *bitmapDevice = 0;
@@ -97,6 +100,7 @@ static inline TDisplayMode format2TDisplayMode(QImage::Format format)
mode = Q_SYMBIAN_ECOLOR16MAP;
break;
default:
+ qWarning("QVolatileImage: Unknown image format %d", format);
mode = ENone;
break;
}
@@ -109,8 +113,9 @@ static CFbsBitmap *imageToBitmap(const QImage &image)
return 0;
}
CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Create(TSize(image.width(), image.height()),
- format2TDisplayMode(image.format())) == KErrNone) {
+ TInt err = bitmap->Create(TSize(image.width(), image.height()),
+ format2TDisplayMode(image.format()));
+ if (err == KErrNone) {
bitmap->BeginDataAccess();
uchar *dptr = reinterpret_cast<uchar *>(bitmap->DataAddress());
int bmpLineLen = bitmap->DataStride();
@@ -128,7 +133,8 @@ static CFbsBitmap *imageToBitmap(const QImage &image)
}
bitmap->EndDataAccess();
} else {
- qWarning("QVolatileImage: Failed to create source bitmap");
+ qWarning("QVolatileImage: Failed to create source bitmap (w %d h %d fmt %d err %d)",
+ image.width(), image.height(), image.format(), err);
delete bitmap;
bitmap = 0;
}
@@ -155,8 +161,9 @@ static CFbsBitmap *convertData(const QVolatileImageData &source, QImage::Format
static CFbsBitmap *duplicateBitmap(const CFbsBitmap &sourceBitmap)
{
CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Duplicate(sourceBitmap.Handle()) != KErrNone) {
- qWarning("QVolatileImage: Failed to duplicate source bitmap");
+ TInt err = bitmap->Duplicate(sourceBitmap.Handle());
+ if (err != KErrNone) {
+ qWarning("QVolatileImage: Failed to duplicate source bitmap (%d)", err);
delete bitmap;
bitmap = 0;
}
@@ -166,8 +173,10 @@ static CFbsBitmap *duplicateBitmap(const CFbsBitmap &sourceBitmap)
static CFbsBitmap *createBitmap(int w, int h, QImage::Format format)
{
CFbsBitmap *bitmap = new CFbsBitmap;
- if (bitmap->Create(TSize(w, h), format2TDisplayMode(format)) != KErrNone) {
- qWarning("QVolatileImage: Failed to create source bitmap %d,%d (%d)", w, h, format);
+ TInt err = bitmap->Create(TSize(w, h), format2TDisplayMode(format));
+ if (err != KErrNone) {
+ qWarning("QVolatileImage: Failed to create source bitmap (w %d h %d fmt %d err %d)",
+ w, h, format, err);
delete bitmap;
bitmap = 0;
}
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index d6035401a0..f8d7e28387 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -366,7 +366,8 @@ bool QCoeFepInputContext::symbianFilterEvent(QWidget *keyWidget, const QSymbianE
}
if (event->type() == QSymbianEvent::ResourceChangeEvent
- && event->resourceChangeType() == KEikMessageFadeAllWindows) {
+ && (event->resourceChangeType() == KEikMessageFadeAllWindows
+ || event->resourceChangeType() == KEikDynamicLayoutVariantSwitch)) {
reset();
}
@@ -467,7 +468,10 @@ void QCoeFepInputContext::resetSplitViewWidget(bool keepInputWidget)
}
} else {
if (m_splitViewResizeBy)
- gv->resize(gv->rect().width(), m_splitViewResizeBy);
+ if (m_splitViewPreviousWindowStates & Qt::WindowFullScreen)
+ gv->resize(gv->rect().width(), qApp->desktop()->height());
+ else
+ gv->resize(gv->rect().width(), m_splitViewResizeBy);
}
// Resizing might have led to widget losing its original windowstate.
// Restore previous window state.
@@ -699,11 +703,6 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
}
else if (anynumbermodes) {
flags |= EAknEditorNumericInputMode;
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0
- && ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly))) {
- //workaround - the * key does not launch the symbols menu, making it impossible to use these modes unless text mode is enabled.
- flags |= EAknEditorTextInputMode;
- }
}
else if (anytextmodes) {
flags |= EAknEditorTextInputMode;
@@ -784,8 +783,6 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints)
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG);
} else if (needsCharMap) {
m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG);
- } else if ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly)) {
- m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG);
} else {
m_fepState->SetSpecialCharacterTableResourceId(0);
}
@@ -896,19 +893,40 @@ void QCoeFepInputContext::translateInputWidget()
m_transformation = (rootItem->transform().isTranslating()) ? QRectF(0,0, gv->width(), rootItem->transform().dy()) : QRectF();
- // Do nothing if the cursor is visible in the splitview area.
- if (splitViewRect.contains(cursorP.boundingRect()))
+ // Adjust cursor bounding rect to be lower, so that view translates if the cursor gets near
+ // the splitview border.
+ QRect cursorRect = cursorP.boundingRect().adjusted(0, cursor.height(), 0, cursor.height());
+ if (splitViewRect.contains(cursorRect))
return;
- // New Y position should be ideally at the center of the splitview area.
- // If that would expose unpainted canvas, limit the tranformation to the visible scene bottom.
-
- const qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom() + m_transformation.height();
- qreal dy = -(qMin(maxY, (cursor.bottom() - vkbRect.top() / 2)));
-
- // Do not allow transform above screen top.
- if (m_transformation.height() + dy > 0)
+ // New Y position should be ideally just above the keyboard.
+ // If that would expose unpainted canvas, limit the tranformation to the visible scene rect or
+ // to the focus item's shape/clip path.
+
+ const QPainterPath path = gv->scene()->focusItem()->isClipped() ?
+ gv->scene()->focusItem()->clipPath() : gv->scene()->focusItem()->shape();
+ const qreal itemHeight = path.boundingRect().height();
+
+ // Limit the maximum translation so that underlaying window content is not exposed.
+ qreal maxY = gv->sceneRect().bottom() - splitViewRect.bottom();
+ maxY = m_transformation.height() ? (qMin(itemHeight, maxY) + m_transformation.height()) : maxY;
+ if (maxY < 0)
+ maxY = 0;
+
+ // Translation should happen row-by-row, but initially it needs to ensure that cursor is visible.
+ const qreal translation = m_transformation.height() ?
+ cursor.height() : (cursorRect.bottom() - vkbRect.top());
+ const qreal dy = -(qMin(maxY, translation));
+
+ // Do not allow transform above screen top, nor beyond scenerect
+ if (m_transformation.height() + dy > 0 || gv->sceneRect().bottom() + m_transformation.height() < 0) {
+ // If we already have some transformation, remove it.
+ if (m_transformation.height() < 0 || gv->sceneRect().bottom() + m_transformation.height() < 0) {
+ rootItem->resetTransform();
+ translateInputWidget();
+ }
return;
+ }
rootItem->setTransform(QTransform::fromTranslate(0, dy), true);
}
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 086cfeca2e..5ac98037d1 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -134,7 +134,7 @@ void QS60Data::setStatusPaneAndButtonGroupVisibility(bool statusPaneVisible, boo
s->MakeVisible(statusPaneVisible);
}
if (buttonGroupVisibilityChanged || statusPaneVisibilityChanged) {
- const QSize size = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect()).size();
+ const QSize size = qt_TRect2QRect(S60->clientRect()).size();
const QSize oldSize; // note that QDesktopWidget::resizeEvent ignores the QResizeEvent contents
QResizeEvent event(size, oldSize);
QApplication::instance()->sendEvent(QApplication::desktop(), &event);
@@ -231,6 +231,28 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible)
}
}
+TRect QS60Data::clientRect()
+{
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ if (S60->partialKeyboardOpen) {
+ // Adjust client rect when splitview is open, since for some curious reason
+ // native side insists that clientRect starts from (0,0) even though status
+ // pane might be visible.
+ TRect statusPaneRect;
+ TRect mainRect;
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EStatusPane, statusPaneRect);
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainRect);
+ int clientAreaHeight = mainRect.Height();
+ CEikStatusPane *const s = S60->statusPane();
+ if (s && s->IsVisible())
+ r.Move(0, statusPaneRect.Height());
+ else
+ clientAreaHeight += statusPaneRect.Height();
+ r.SetHeight(clientAreaHeight);
+ }
+ return r;
+}
+
bool qt_nograb() // application no-grab option
{
#if defined(QT_DEBUG)
@@ -908,6 +930,15 @@ TKeyResponse QSymbianControl::sendSymbianKeyEvent(const TKeyEvent &keyEvent, QEv
}
Qt::KeyboardModifiers mods = mapToQtModifiers(keyEvent.iModifiers);
+
+ TInt code = keyEvent.iCode;
+
+ if (mods == Qt::ControlModifier) {
+ //only support ctrl+a .. ctrl+z, 0x40 is the key value before Qt::Key_A
+ if (code > 0 && code < 27)
+ keyCode = 0x40 + code;
+ }
+
QKeyEventEx qKeyEvent(type, keyCode, mods, qt_keymapper_private()->translateKeyEvent(keyCode, mods),
(keyEvent.iRepeats != 0), 1, keyEvent.iScanCode, s60Keysym, keyEvent.iModifiers);
QWidget *widget;
@@ -1435,7 +1466,9 @@ void QSymbianControl::handleClientAreaChange()
if (qwidget->isFullScreen() && !cbaVisibilityHint) {
SetExtentToWholeScreen();
} else if (qwidget->isMaximized() || (qwidget->isFullScreen() && cbaVisibilityHint)) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ // Note that if there is S60->splitViewLastWidget, it means the resizing is done
+ // by input context handling and we can use just default ClientRect.
+ TRect r = (!S60->splitViewLastWidget) ? S60->clientRect() : static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
SetExtent(r.iTl, r.Size());
} else if (!qwidget->isMinimized()) { // Normal geometry
if (!qwidget->testAttribute(Qt::WA_Resized)) {
@@ -1443,7 +1476,7 @@ void QSymbianControl::handleClientAreaChange()
qwidget->setAttribute(Qt::WA_Resized, false); //not a user resize
}
if (!qwidget->testAttribute(Qt::WA_Moved) && qwidget->windowType() != Qt::Dialog) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ TRect r = S60->clientRect();
SetPosition(r.iTl);
qwidget->setAttribute(Qt::WA_Moved, false); // not really an explicit position
}
@@ -1489,13 +1522,14 @@ void QSymbianControl::HandleResourceChange(int resourceType)
if (!ic) {
ic = qobject_cast<QCoeFepInputContext *>(qApp->inputContext());
}
- if (ic && isSplitViewWidget(widget)) {
+ if (ic) {
if (resourceType == KSplitViewCloseEvent) {
S60->partialKeyboardOpen = false;
ic->resetSplitViewWidget();
} else {
S60->partialKeyboardOpen = true;
- ic->ensureFocusWidgetVisible(widget);
+ if (isSplitViewWidget(widget))
+ ic->ensureFocusWidgetVisible(widget);
}
}
}
@@ -1508,7 +1542,8 @@ void QSymbianControl::HandleResourceChange(int resourceType)
// client area.
if (S60->statusPane() && (S60->statusPane()->IsVisible() || m_lastStatusPaneVisibility)) {
m_lastStatusPaneVisibility = S60->statusPane()->IsVisible();
- handleClientAreaChange();
+ if (S60->handleStatusPaneResizeNotifications)
+ handleClientAreaChange();
}
if (IsFocused() && IsVisible()) {
qwidget->d_func()->setWindowIcon_sys(true);
@@ -1912,7 +1947,7 @@ void qt_cleanup()
qt_S60Beep = 0;
}
QFontCache::cleanup(); // Has to happen now, since QFontEngineS60 has FBS handles
- QPixmapCache::clear(); // Has to happen now, since QS60PixmapData has FBS handles
+ QPixmapCache::clear(); // Has to happen now, since QSymbianRasterPixmapData has FBS handles
#ifdef QT_NO_FREETYPE
qt_cleanup_symbianFontDatabase();
diff --git a/src/gui/kernel/qdesktopwidget_s60.cpp b/src/gui/kernel/qdesktopwidget_s60.cpp
index 156c9700ed..86d8f3f54f 100644
--- a/src/gui/kernel/qdesktopwidget_s60.cpp
+++ b/src/gui/kernel/qdesktopwidget_s60.cpp
@@ -161,7 +161,7 @@ void QDesktopWidgetPrivate::init(QDesktopWidget *that)
(*rects)[i] = r;
QRect wr;
if (i == 0)
- wr = qt_TRect2QRect(static_cast<CEikAppUi*>(S60->appUi())->ClientRect());
+ wr = qt_TRect2QRect(S60->clientRect());
else
wr = rects->at(i);
(*workrects)[i].setRect(wr.x(), wr.y(), wr.width(), wr.height());
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index acdb0e5838..b5d01015f5 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -53,6 +53,10 @@
#include <eiksoftkeyimage.h>
#include <eikcmbut.h>
+#ifndef QT_NO_STYLE_S60
+#include <qs60style.h>
+#endif
+
#ifndef QT_NO_SOFTKEYMANAGER
QT_BEGIN_NAMESPACE
@@ -220,26 +224,42 @@ bool QSoftKeyManagerPrivateS60::isOrientationLandscape()
QSize QSoftKeyManagerPrivateS60::cbaIconSize(CEikButtonGroupContainer *cba, int position)
{
-
int index = position;
index += isOrientationLandscape() ? 0 : 1;
if(cachedCbaIconSize[index].isNull()) {
- // Only way I figured out to get CBA icon size without RnD SDK, was
- // to set some dummy icon to CBA first and then ask CBA button CCoeControl::Size()
- // The returned value is cached to avoid unnecessary icon setting every time.
- const bool left = (position == LSK_POSITION);
- if(position == LSK_POSITION || position == RSK_POSITION) {
- CEikImage* tmpImage = NULL;
- QT_TRAP_THROWING(tmpImage = new (ELeave) CEikImage);
- EikSoftkeyImage::SetImage(cba, *tmpImage, left); // Takes myimage ownership
- int command = S60_COMMAND_START + position;
- setNativeSoftkey(*cba, position, command, KNullDesC());
- cachedCbaIconSize[index] = qt_TSize2QSize(cba->ControlOrNull(command)->Size());
- EikSoftkeyImage::SetLabel(cba, left);
-
- if(cachedCbaIconSize[index] == QSize(138,72)) {
- // Hack for S60 5.0 (5800) landscape orientation, which return wrong icon size
- cachedCbaIconSize[index] = QSize(60,60);
+ if (QSysInfo::s60Version() >= QSysInfo::SV_S60_5_3) {
+ // S60 5.3 and later have fixed icon size on softkeys, while the button
+ // itself is bigger, so the automatic check doesn't work.
+ // Use custom pixel metrics to deduce the CBA icon size
+ int iconHeight = 30;
+ int iconWidth = 30;
+#ifndef QT_NO_STYLE_S60
+ QS60Style *s60Style = 0;
+ s60Style = qobject_cast<QS60Style *>(QApplication::style());
+ if (s60Style) {
+ iconWidth = s60Style->pixelMetric((QStyle::PixelMetric)PM_CbaIconWidth);
+ iconHeight = s60Style->pixelMetric((QStyle::PixelMetric)PM_CbaIconHeight);
+ }
+#endif
+ cachedCbaIconSize[index] = QSize(iconWidth, iconHeight);
+ } else {
+ // Only way I figured out to get CBA icon size without RnD SDK, was
+ // to set some dummy icon to CBA first and then ask CBA button CCoeControl::Size()
+ // The returned value is cached to avoid unnecessary icon setting every time.
+ const bool left = (position == LSK_POSITION);
+ if (position == LSK_POSITION || position == RSK_POSITION) {
+ CEikImage* tmpImage = NULL;
+ QT_TRAP_THROWING(tmpImage = new (ELeave) CEikImage);
+ EikSoftkeyImage::SetImage(cba, *tmpImage, left); // Takes tmpImage ownership
+ int command = S60_COMMAND_START + position;
+ setNativeSoftkey(*cba, position, command, KNullDesC());
+ cachedCbaIconSize[index] = qt_TSize2QSize(cba->ControlOrNull(command)->Size());
+ EikSoftkeyImage::SetLabel(cba, left);
+
+ if (cachedCbaIconSize[index] == QSize(138,72)) {
+ // Hack for S60 5.0 landscape orientation, which return wrong icon size
+ cachedCbaIconSize[index] = QSize(60,60);
+ }
}
}
}
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 67eb07b1fd..c429b04fee 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -161,6 +161,7 @@ public:
int partial_keyboard : 1;
int partial_keyboardAutoTranslation : 1;
int partialKeyboardOpen : 1;
+ int handleStatusPaneResizeNotifications : 1;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
QPointer<QWidget> splitViewLastWidget;
@@ -198,6 +199,7 @@ public:
static bool setRecursiveDecorationsVisibility(QWidget *window, Qt::WindowStates newState);
#endif
static void controlVisibilityChanged(CCoeControl *control, bool visible);
+ static TRect clientRect();
#ifdef Q_OS_SYMBIAN
TTrapHandler *s60InstalledTrapHandler;
@@ -353,6 +355,7 @@ inline QS60Data::QS60Data()
partial_keyboard(0),
partial_keyboardAutoTranslation(1),
partialKeyboardOpen(0),
+ handleStatusPaneResizeNotifications(1),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 5672686055..d6aaa3f4f2 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -359,7 +359,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
if (popup)
flags |= Qt::WindowStaysOnTopHint; // a popup stays on top
- TRect clientRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ TRect clientRect = S60->clientRect();
int sw = clientRect.Width();
int sh = clientRect.Height();
@@ -538,8 +538,6 @@ void QWidgetPrivate::show_sys()
QT_TRAP_THROWING(
factory->CreateResourceIndependentFurnitureL(ui);
- TRect boundingRect = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
-
CEikButtonGroupContainer *cba = CEikButtonGroupContainer::NewL(CEikButtonGroupContainer::ECba,
CEikButtonGroupContainer::EHorizontal,ui,R_AVKON_SOFTKEYS_EMPTY_WITH_IDS);
if (isFullscreen && !cbaRequested)
@@ -592,11 +590,13 @@ void QWidgetPrivate::show_sys()
// Fill client area if maximized OR
// Put window below status pane unless the window has an explicit position.
if (!isFullscreen) {
+ // Use QS60Data::clientRect to take into account that native keyboard
+ // might affect ClientRect() return value.
if (q->windowState() & Qt::WindowMaximized) {
- TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ TRect r = S60->clientRect();
id->SetExtent(r.iTl, r.Size());
} else if (!q->testAttribute(Qt::WA_Moved) && q->windowType() != Qt::Dialog) {
- id->SetPosition(static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl);
+ id->SetPosition(S60->clientRect().iTl);
}
}
@@ -1267,7 +1267,7 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
// normal mode after showing the status pane, the geometry would overlap so we should
// move it if it never had an explicit position.
if (!wasMoved && S60->statusPane() && decorationsVisible) {
- TPoint tl = static_cast<CEikAppUi*>(S60->appUi())->ClientRect().iTl;
+ TPoint tl = S60->clientRect().iTl;
normalGeometry.setTopLeft(QPoint(tl.iX, tl.iY));
}
#endif
diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
index d5ae364e7d..27b1bf21d4 100644
--- a/src/gui/painting/painting.pri
+++ b/src/gui/painting/painting.pri
@@ -198,12 +198,12 @@ qpa {
symbian {
SOURCES += \
- painting/qpaintengine_s60.cpp \
+ painting/qpaintengine_raster_symbian.cpp \
painting/qregion_s60.cpp \
painting/qcolormap_s60.cpp
HEADERS += \
- painting/qpaintengine_s60_p.h
+ painting/qpaintengine_raster_symbian_p.h
}
x11|embedded|qpa {
diff --git a/src/gui/painting/qgraphicssystem.cpp b/src/gui/painting/qgraphicssystem.cpp
index d4a8015307..04e45d2378 100644
--- a/src/gui/painting/qgraphicssystem.cpp
+++ b/src/gui/painting/qgraphicssystem.cpp
@@ -54,7 +54,7 @@
# include <QtGui/private/qapplication_p.h>
#endif
#ifdef Q_OS_SYMBIAN
-# include <private/qpixmap_s60_p.h>
+# include <private/qpixmap_raster_symbian_p.h>
# include <private/qgraphicssystemex_symbian_p.h>
#else
# include <private/qgraphicssystemex_p.h>
@@ -80,7 +80,7 @@ QPixmapData *QGraphicsSystem::createDefaultPixmapData(QPixmapData::PixelType typ
#elif defined(Q_WS_QPA)
return QApplicationPrivate::platformIntegration()->createPixmapData(type);
#elif defined(Q_OS_SYMBIAN)
- return new QS60PixmapData(type);
+ return new QSymbianRasterPixmapData(type);
#elif !defined(Q_WS_QWS)
#error QGraphicsSystem::createDefaultPixmapData() not implemented
#endif
diff --git a/src/gui/painting/qgraphicssystem_raster.cpp b/src/gui/painting/qgraphicssystem_raster.cpp
index 0edbe9f5a3..addfff7619 100644
--- a/src/gui/painting/qgraphicssystem_raster.cpp
+++ b/src/gui/painting/qgraphicssystem_raster.cpp
@@ -42,7 +42,7 @@
#include "qgraphicssystem_raster_p.h"
#ifdef Q_OS_SYMBIAN
-#include "private/qpixmap_s60_p.h"
+#include "private/qpixmap_raster_symbian_p.h"
#include "private/qwindowsurface_s60_p.h"
#else
#include "private/qpixmap_raster_p.h"
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
QPixmapData *QRasterGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const
{
#ifdef Q_OS_SYMBIAN
- return new QS60PixmapData(type);
+ return new QSymbianRasterPixmapData(type);
#else
return new QRasterPixmapData(type);
#endif
diff --git a/src/gui/painting/qpaintengine_s60.cpp b/src/gui/painting/qpaintengine_raster_symbian.cpp
index 091e2e65a4..3b2707702f 100644
--- a/src/gui/painting/qpaintengine_s60.cpp
+++ b/src/gui/painting/qpaintengine_raster_symbian.cpp
@@ -38,29 +38,30 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-#include <private/qpaintengine_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+
+#include <private/qpaintengine_raster_symbian_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qt_s60_p.h>
#include <private/qvolatileimage_p.h>
QT_BEGIN_NAMESPACE
-class QS60PaintEnginePrivate : public QRasterPaintEnginePrivate
+class QSymbianRasterPaintEnginePrivate : public QRasterPaintEnginePrivate
{
public:
- QS60PaintEnginePrivate() {}
+ QSymbianRasterPaintEnginePrivate() {}
};
-QS60PaintEngine::QS60PaintEngine(QPaintDevice *device, QS60PixmapData *data)
- : QRasterPaintEngine(*(new QS60PaintEnginePrivate), device), pixmapData(data)
+QSymbianRasterPaintEngine::QSymbianRasterPaintEngine(QPaintDevice *device, QSymbianRasterPixmapData *data)
+ : QRasterPaintEngine(*(new QSymbianRasterPaintEnginePrivate), device), pixmapData(data)
{
}
-bool QS60PaintEngine::begin(QPaintDevice *device)
+bool QSymbianRasterPaintEngine::begin(QPaintDevice *device)
{
- Q_D(QS60PaintEngine);
+ Q_D(QSymbianRasterPaintEngine);
- if (pixmapData->classId() == QPixmapData::RasterClass) {
+ if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) {
pixmapData->beginDataAccess();
bool ret = QRasterPaintEngine::begin(device);
// Make sure QPaintEngine::paintDevice() returns the proper device.
@@ -69,13 +70,12 @@ bool QS60PaintEngine::begin(QPaintDevice *device)
d->pdev = device;
return ret;
}
-
return QRasterPaintEngine::begin(device);
}
-bool QS60PaintEngine::end()
+bool QSymbianRasterPaintEngine::end()
{
- if (pixmapData->classId() == QPixmapData::RasterClass) {
+ if (pixmapData && pixmapData->classId() == QPixmapData::RasterClass) {
bool ret = QRasterPaintEngine::end();
pixmapData->endDataAccess();
return ret;
@@ -83,50 +83,51 @@ bool QS60PaintEngine::end()
return QRasterPaintEngine::end();
}
-void QS60PaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
+void QSymbianRasterPaintEngine::drawPixmap(const QPointF &p, const QPixmap &pm)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(p, pm);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(p, img->imageRef());
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ // imageRef() would detach and since we received the QVolatileImage
+ // from toVolatileImage() by value, it would cause a copy which
+ // would ruin our goal. So use constImageRef() instead.
+ QRasterPaintEngine::drawImage(p, img.constImageRef());
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(p, pm);
}
}
}
-void QS60PaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
+void QSymbianRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawPixmap(r, pm, sr);
srcData->endDataAccess();
} else {
- void *nativeData = pm.pixmapData()->toNativeType(QPixmapData::VolatileImage);
- if (nativeData) {
- QVolatileImage *img = static_cast<QVolatileImage *>(nativeData);
- img->beginDataAccess();
- QRasterPaintEngine::drawImage(r, img->imageRef(), sr);
- img->endDataAccess(true);
+ QVolatileImage img = pm.pixmapData()->toVolatileImage();
+ if (!img.isNull()) {
+ img.beginDataAccess();
+ QRasterPaintEngine::drawImage(r, img.constImageRef(), sr);
+ img.endDataAccess(true);
} else {
QRasterPaintEngine::drawPixmap(r, pm, sr);
}
}
}
-void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
+void QSymbianRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr)
{
if (pm.pixmapData()->classId() == QPixmapData::RasterClass) {
- QS60PixmapData *srcData = static_cast<QS60PixmapData *>(pm.pixmapData());
+ QSymbianRasterPixmapData *srcData = static_cast<QSymbianRasterPixmapData *>(pm.pixmapData());
srcData->beginDataAccess();
QRasterPaintEngine::drawTiledPixmap(r, pm, sr);
srcData->endDataAccess();
@@ -135,7 +136,8 @@ void QS60PaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const
}
}
-void QS60PaintEngine::prepare(QImage *image)
+// used by QSymbianRasterPixmapData::beginDataAccess()
+void QSymbianRasterPaintEngine::prepare(QImage *image)
{
QRasterBuffer *buffer = d_func()->rasterBuffer.data();
if (buffer)
diff --git a/src/gui/painting/qpaintengine_s60_p.h b/src/gui/painting/qpaintengine_raster_symbian_p.h
index 2a3b443db3..cb51ecb48e 100644
--- a/src/gui/painting/qpaintengine_s60_p.h
+++ b/src/gui/painting/qpaintengine_raster_symbian_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QPAINTENGINE_S60_P_H
-#define QPAINTENGINE_S60_P_H
+#ifndef QPAINTENGINE_RASTER_SYMBIAN_P_H
+#define QPAINTENGINE_RASTER_SYMBIAN_P_H
//
// W A R N I N G
@@ -57,15 +57,15 @@
QT_BEGIN_NAMESPACE
-class QS60PaintEnginePrivate;
-class QS60PixmapData;
+class QSymbianRasterPaintEnginePrivate;
+class QSymbianRasterPixmapData;
-class QS60PaintEngine : public QRasterPaintEngine
+class QSymbianRasterPaintEngine : public QRasterPaintEngine
{
- Q_DECLARE_PRIVATE(QS60PaintEngine)
+ Q_DECLARE_PRIVATE(QSymbianRasterPaintEngine)
public:
- QS60PaintEngine(QPaintDevice *device, QS60PixmapData* data);
+ QSymbianRasterPaintEngine(QPaintDevice *device, QSymbianRasterPixmapData *data = 0);
bool begin(QPaintDevice *device);
bool end();
@@ -76,9 +76,9 @@ public:
void prepare(QImage* image);
private:
- QS60PixmapData *pixmapData;
+ QSymbianRasterPixmapData *pixmapData;
};
QT_END_NAMESPACE
-#endif // QPAINTENGINE_S60_P_H
+#endif // QPAINTENGINE_RASTER_SYMBIAN_P_H
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 8801d75f0f..d1ac926347 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -44,7 +44,7 @@
#include <QtGui/qpaintdevice.h>
#include <private/qwidget_p.h>
#include <private/qwindowsurface_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qt_s60_p.h>
#include <private/qapplication_p.h>
#include <private/qdrawhelper_p.h>
@@ -92,7 +92,7 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget)
Q_CHECK_PTR(bitmap);
qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) );
- QS60PixmapData *data = new QS60PixmapData(QPixmapData::PixmapType);
+ QSymbianRasterPixmapData *data = new QSymbianRasterPixmapData(QPixmapData::PixmapType);
if (data) {
data->fromSymbianBitmap(bitmap, true);
d_ptr->device = QPixmap(data);
@@ -131,7 +131,7 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
QWidgetPrivate *windowPrivate = qt_widget_private(window());
if (!windowPrivate->isOpaque || blitWriteAlpha(windowPrivate)) {
- QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *pixmapData = static_cast<QSymbianRasterPixmapData *>(d_ptr->device.data_ptr().data());
TDisplayMode mode = displayMode(false);
if (pixmapData->cfbsBitmap->DisplayMode() != mode)
@@ -169,7 +169,7 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget)
return 0;
const QPoint off = offset(widget);
- QImage *img = &(static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image);
+ QImage *img = &(static_cast<QSymbianRasterPixmapData *>(d_ptr->device.data_ptr().data())->image);
QRect rect(off, widget->size());
rect &= QRect(QPoint(), img->size());
@@ -217,7 +217,7 @@ bool QS60WindowSurface::scroll(const QRegion &area, int dx, int dy)
if (d_ptr->device.isNull())
return false;
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
data->scroll(dx, dy, rect);
return true;
@@ -233,7 +233,7 @@ void QS60WindowSurface::setGeometry(const QRect& rect)
if (rect == geometry())
return;
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
data->resize(rect.width(), rect.height());
QWindowSurface::setGeometry(rect);
@@ -246,7 +246,7 @@ QWindowSurface::WindowSurfaceFeatures QS60WindowSurface::features() const
CFbsBitmap* QS60WindowSurface::symbianBitmap() const
{
- QS60PixmapData *data = static_cast<QS60PixmapData*>(d_ptr->device.data_ptr().data());
+ QSymbianRasterPixmapData *data = static_cast<QSymbianRasterPixmapData*>(d_ptr->device.data_ptr().data());
return data->cfbsBitmap;
}
diff --git a/src/gui/s60framework/qs60mainappui.cpp b/src/gui/s60framework/qs60mainappui.cpp
index bfd18256e1..ec97f7b9f0 100644
--- a/src/gui/s60framework/qs60mainappui.cpp
+++ b/src/gui/s60framework/qs60mainappui.cpp
@@ -316,7 +316,21 @@ TRect QS60MainAppUi::ApplicationRect() const
*/
void QS60MainAppUi::HandleScreenDeviceChangedL()
{
+ // This function triggers AppUi relayout which also generates
+ // HandleStatusPaneSizeChange(). We don't want to handle
+ // status pane resizes at this point because it causes
+ // Qt window resize and thus EGL surface resize in the middle of
+ // incomplete layout process causing unnecessary overhead.
+ // To prevent status pane resize handling while layout is still
+ // in progress, we guard relayouting with handleStatusPaneResizeNotifications
+ // flag. QSymbianControl checks this flag before doing Qt window
+ // resize due to status pane change.
+ // Eventually when layout is ready, Symbian framework calls
+ // HandleResourceChangeL(KEikDynamicLayoutVariantSwitch) which triggers
+ // resize to Qt window and to its EGL surface.
+ S60->handleStatusPaneResizeNotifications = false;
QS60MainAppUiBase::HandleScreenDeviceChangedL();
+ S60->handleStatusPaneResizeNotifications = true;
}
/*!
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index 219b963d3f..b0ea0d1d27 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -101,9 +101,12 @@ const int QS60StylePrivate::m_numberOfLayouts =
const short QS60StylePrivate::data[][MAX_PIXELMETRICS] = {
// *** generated pixel metrics ***
-{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,13,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
-{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,12,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135},
-{9,0,-909,0,0,2,0,5,-1,34,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,19,19,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184}
+{5,0,-909,0,0,2,0,2,-1,7,12,22,15,15,7,198,-909,-909,-909,20,13,2,0,0,21,7,18,30,3,3,1,-909,-909,0,1,0,0,12,20,15,15,18,18,1,115,18,0,-909,-909,-909,-909,0,0,16,2,-909,0,0,-909,16,-909,-909,-909,-909,32,18,55,24,55,4,4,4,9,13,-909,5,51,11,5,0,3,3,6,8,3,3,-909,2,-909,-909,-909,-909,5,5,3,1,106,30,30},
+{5,0,-909,0,0,1,0,2,-1,8,14,22,15,15,7,164,-909,-909,-909,19,15,2,0,0,21,8,27,28,4,4,1,-909,-909,0,7,6,0,13,23,17,17,21,21,7,115,21,0,-909,-909,-909,-909,0,0,15,1,-909,0,0,-909,15,-909,-909,-909,-909,32,21,65,27,65,3,3,5,10,15,-909,5,58,13,5,0,4,4,7,9,4,4,-909,2,-909,-909,-909,-909,6,6,3,1,106,30,30},
+{7,0,-909,0,0,2,0,5,-1,25,69,46,37,37,9,258,-909,-909,-909,23,19,11,0,0,32,25,72,44,5,5,2,-909,-909,0,7,21,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,25,2,-909,0,0,-909,25,-909,-909,-909,-909,87,27,77,35,77,3,3,6,8,19,-909,7,74,19,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
+{7,0,-909,0,0,2,0,5,-1,25,68,46,37,37,9,258,-909,-909,-909,31,19,13,0,0,32,25,60,52,5,5,2,-909,-909,0,7,32,0,17,29,22,22,27,27,7,173,29,0,-909,-909,-909,-909,0,0,26,2,-909,0,0,-909,26,-909,-909,-909,-909,87,27,96,35,96,3,3,6,8,19,-909,7,74,22,7,0,5,5,8,12,5,5,-909,3,-909,-909,-909,-909,7,7,3,1,135,30,30},
+{7,0,-909,0,0,2,0,2,-1,10,20,27,18,18,9,301,-909,-909,-909,29,18,5,0,0,35,7,32,30,5,5,2,-909,-909,0,2,8,0,16,28,21,21,26,26,2,170,26,0,-909,-909,-909,-909,0,0,21,6,-909,0,0,-909,-909,-909,-909,-909,-909,54,26,265,34,265,5,5,6,3,18,-909,7,72,19,7,0,5,6,8,11,6,5,-909,2,-909,-909,-909,-909,5,5,3,1,106,30,30},
+{9,0,-909,0,0,2,0,5,-1,30,99,76,51,51,25,352,-909,-909,-909,29,25,7,0,0,43,34,42,76,7,7,2,-909,-909,0,9,14,0,23,39,30,30,37,37,9,391,40,0,-909,-909,-909,-909,0,0,29,2,-909,0,0,-909,29,-909,-909,-909,-909,115,37,96,48,96,2,2,9,1,25,-909,9,101,24,9,0,7,7,7,16,7,7,-909,3,-909,-909,-909,-909,9,9,3,1,184,30,30}
// *** End of generated data ***
};
diff --git a/src/gui/styles/qs60style.h b/src/gui/styles/qs60style.h
index 6993bf4aab..8ec5eb9225 100644
--- a/src/gui/styles/qs60style.h
+++ b/src/gui/styles/qs60style.h
@@ -57,7 +57,9 @@ enum {
PM_FrameCornerHeight,
PM_BoldLineWidth,
PM_ThinLineWidth,
- PM_MessageBoxHeight
+ PM_MessageBoxHeight,
+ PM_CbaIconWidth,
+ PM_CbaIconHeight
};
class QS60StylePrivate;
diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h
index 1cf069bd52..62c4b00ad6 100644
--- a/src/gui/styles/qs60style_p.h
+++ b/src/gui/styles/qs60style_p.h
@@ -60,7 +60,7 @@
QT_BEGIN_NAMESPACE
const int MAX_NON_CUSTOM_PIXELMETRICS = 92;
-const int CUSTOMVALUESCOUNT = 5;
+const int CUSTOMVALUESCOUNT = 7;
const int MAX_PIXELMETRICS = MAX_NON_CUSTOM_PIXELMETRICS + CUSTOMVALUESCOUNT;
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 58d70a4897..2d2710c3c8 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -45,7 +45,7 @@
#include "qstyleoption.h"
#include "qstyle.h"
#include "private/qt_s60_p.h"
-#include "private/qpixmap_s60_p.h"
+#include "private/qpixmap_raster_symbian_p.h"
#include "private/qcore_symbian_p.h"
#include "private/qvolatileimage_p.h"
#include "qapplication.h"
@@ -1059,6 +1059,14 @@ void QS60StyleModeSpecifics::frameIdAndCenterId(QS60StylePrivate::SkinFrameEleme
centerId.Set(KAknsIIDQsnFrPopupCenterSubmenu);
frameId.Set(KAknsIIDQsnFrPopupSub);
break;
+ case QS60StylePrivate::SF_SettingsList:
+ // Starting from S60_5_3, the root theme has been changed so that KAknsIIDQsnFrSetOpt is empty.
+ // Set the theme ID to None, to avoid theme server trying to draw the empty frame.
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_2) {
+ centerId.Set(KAknsIIDNone);
+ frameId.Set(KAknsIIDNone);
+ }
+ break;
case QS60StylePrivate::SF_PanelBackground:
// remove center piece for panel graphics, so that only border is drawn
centerId.Set(KAknsIIDNone);
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index e0f4bad527..0fc8a977fd 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -42,7 +42,7 @@
#include "qfont.h"
#include "qfont_p.h"
#include <private/qt_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include "qmutex.h"
QT_BEGIN_NAMESPACE
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index eea075fc47..980b5de1a7 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -47,7 +47,7 @@
#include "qdesktopservices.h"
#include "qtemporaryfile.h"
#include "qtextcodec.h"
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qt_s60_p.h>
#include "qendian.h"
#include <private/qcore_symbian_p.h>
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 2bcee0157c..b0824cb7d4 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -46,7 +46,7 @@
#include <private/qapplication_p.h>
#include "qimage.h"
#include <private/qt_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <e32base.h>
#include <e32std.h>
diff --git a/src/imports/shaders/scenegraph/qsggeometry.cpp b/src/imports/shaders/scenegraph/qsggeometry.cpp
index 05c111aca5..08ac10edea 100644
--- a/src/imports/shaders/scenegraph/qsggeometry.cpp
+++ b/src/imports/shaders/scenegraph/qsggeometry.cpp
@@ -44,11 +44,6 @@
QT_BEGIN_NAMESPACE
-/*!
- Convenience function which returns attributes to be used for 2D solid
- color drawing.
- */
-
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
{
static Attribute data[] = {
@@ -58,9 +53,6 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_Point2D()
return attrs;
}
-/*!
- Convenience function which returns attributes to be used for textured 2D drawing.
- */
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D()
{
@@ -72,9 +64,6 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_TexturedPoint2D(
return attrs;
}
-/*!
- Convenience function which returns attributes to be used for per vertex colored 2D drawing.
- */
const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
{
@@ -87,29 +76,6 @@ const QSGGeometry::AttributeSet &QSGGeometry::defaultAttributes_ColoredPoint2D()
}
-/*!
- \class QSGGeometry
- \brief The QSGGeometry class provides low-level storage for graphics primitives
- in the QML Scene Graph.
-
- The QSGGeometry class provides a few convenience attributes and attribute accessors
- by default. The defaultAttributes_Point2D() function returns attributes to be used
- in normal solid color rectangles, while the defaultAttributes_TexturedPoint2D function
- returns attributes to be used for the common pixmap usecase.
- */
-
-
-/*!
- Constructs a geometry object based on \a attributes.
-
- The object allocate space for \a vertexCount vertices based on the accumulated
- size in \a attributes and for \a indexCount.
-
- Geometry objects are constructed with GL_TRIANGLE_STRIP as default drawing mode.
-
- The attribute structure is assumed to be POD and the geometry object
- assumes this will not go away. There is no memory management involved.
- */
QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
int vertexCount,
@@ -138,41 +104,6 @@ QSGGeometry::~QSGGeometry()
qFree(m_data);
}
-/*!
- \fn int QSGGeometry::vertexCount() const
-
- Returns the number of vertices in this geometry object.
- */
-
-/*!
- \fn int QSGGeometry::indexCount() const
-
- Returns the number of indices in this geometry object.
- */
-
-
-
-/*!
- \fn void *QSGGeometry::vertexData()
-
- Returns a pointer to the raw vertex data of this geometry object.
-
- \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D
- */
-
-/*!
- \fn const void *QSGGeometry::vertexData() const
-
- Returns a pointer to the raw vertex data of this geometry object.
-
- \sa vertexDataAsPoint2D(), vertexDataAsTexturedPoint2D
- */
-
-/*!
- Returns a pointer to the raw index data of this geometry object.
-
- \sa indexDataAsUShort(), indexDataAsUInt()
- */
void *QSGGeometry::indexData()
{
return m_index_data_offset < 0
@@ -180,11 +111,6 @@ void *QSGGeometry::indexData()
: ((char *) m_data + m_index_data_offset);
}
-/*!
- Returns a pointer to the raw index data of this geometry object.
-
- \sa indexDataAsUShort(), indexDataAsUInt()
- */
const void *QSGGeometry::indexData() const
{
return m_index_data_offset < 0
@@ -192,38 +118,11 @@ const void *QSGGeometry::indexData() const
: ((char *) m_data + m_index_data_offset);
}
-/*!
- Sets the drawing mode to be used for this geometry.
-
- The default value is GL_TRIANGLE_STRIP.
- */
void QSGGeometry::setDrawingMode(GLenum mode)
{
m_drawing_mode = mode;
}
-/*!
- \fn int QSGGeometry::drawingMode() const
-
- Returns the drawing mode of this geometry.
-
- The default value is GL_TRIANGLE_STRIP.
- */
-
-/*!
- \fn int QSGGeometry::indexType() const
-
- Returns the primitive type used for indices in this
- geometry object.
- */
-
-
-/*!
- Resizes the vertex and index data of this geometry object to fit \a vertexCount
- vertices and \a indexCount indices.
-
- Vertex and index data will be invalidated after this call and the caller must
- */
void QSGGeometry::allocate(int vertexCount, int indexCount)
{
if (vertexCount == m_vertex_count && indexCount == m_index_count)
@@ -252,12 +151,6 @@ void QSGGeometry::allocate(int vertexCount, int indexCount)
}
-/*!
- Updates the geometry \a g with the coordinates in \a rect.
-
- The function assumes the geometry object contains a single triangle strip
- of QSGGeometry::Point2D vertices
- */
void QSGGeometry::updateRectGeometry(QSGGeometry *g, const QRectF &rect)
{
Point2D *v = g->vertexDataAsPoint2D();
@@ -274,15 +167,6 @@ void QSGGeometry::updateRectGeometry(QSGGeometry *g, const QRectF &rect)
v[3].y = rect.bottom();
}
-/*!
- Updates the geometry \a g with the coordinates in \a rect and texture
- coordinates from \a textureRect.
-
- \a textureRect should be in normalized coordinates.
-
- \a g is assumed to be a triangle strip of four vertices of type
- QSGGeometry::TexturedPoint2D.
- */
void QSGGeometry::updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &textureRect)
{
TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();
diff --git a/src/imports/shaders/shadereffectitem.cpp b/src/imports/shaders/shadereffectitem.cpp
index 5bb906ccfb..48c842ac3c 100644
--- a/src/imports/shaders/shadereffectitem.cpp
+++ b/src/imports/shaders/shadereffectitem.cpp
@@ -72,7 +72,7 @@ static const char qt_emptyAttributeName[] = "";
/*!
\qmlclass ShaderEffectItem ShaderEffectItem
- \ingroup qmlshadersplugin
+ \ingroup qml-shader-elements
\brief The ShaderEffectItem object alters the output of given item with OpenGL shaders.
\inherits Item
@@ -84,7 +84,7 @@ static const char qt_emptyAttributeName[] = "";
and may be heavily changed or removed in later versions.
Requirement for the use of shaders is that the application is either using
- Qt OpenGL graphicssystem or is forced to use OpenGL by setting QGLWidget as the viewport to QDeclarativeView (recommened way).
+ Qt OpenGL graphicssystem or is using OpenGL by setting QGLWidget as the viewport to QDeclarativeView (depending on which one is the recommened way in the targeted platform).
ShaderEffectItem internal behaviour is such that during the paint event it first renders its
ShaderEffectSource items into a OpenGL framebuffer object which can be used as a texture. If the ShaderEffectSource is defined to be an image,
@@ -195,7 +195,7 @@ Rectangle {
}
}
\endqml
- \image Example1.png
+ \image shaderexample.png
*/
diff --git a/src/imports/shaders/shadereffectsource.cpp b/src/imports/shaders/shadereffectsource.cpp
index dec3bb040e..e6dbc7342d 100644
--- a/src/imports/shaders/shadereffectsource.cpp
+++ b/src/imports/shaders/shadereffectsource.cpp
@@ -48,7 +48,7 @@
/*!
\qmlclass ShaderEffectSource ShaderEffectSource
- \ingroup qmlshadersplugin
+ \ingroup qml-shader-elements
\brief The ShaderEffectSource object encapsulates the source content for the ShaderEffectItem.
ShaderEffectSource is available in the \bold{Qt.labs.shaders 1.0} module.
@@ -273,10 +273,10 @@ void ShaderEffectSource::setHideSource(bool hide)
This property defines the wrap parameter for the source after it has been mapped as a texture.
\list
- \o WrapMode.ClampToEdge - Causes texturecoordinates to be clamped to the range [ 1/2*N , 1 - 1/2*N ], where N is the texture width.
- \o WrapMode.RepeatHorizontally - Causes the integer part of the horizontal texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a horizontal repeating pattern.
- \o WrapMode.RepeatVertically - Causes the integer part of the vertical texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a vertical repeating pattern.
- \o WrapMode.Repeat - Causes the integer part of both the horizontal and vertical texturecoordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern.
+ \o ShaderEffectSource.ClampToEdge - Causes texturecoordinates to be clamped to the range [ 1/2*N , 1 - 1/2*N ], where N is the texture width.
+ \o ShaderEffectSource.RepeatHorizontally - Causes the integer part of the horizontal texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a horizontal repeating pattern.
+ \o ShaderEffectSource.RepeatVertically - Causes the integer part of the vertical texturecoordinate to be ignored; the GL uses only the fractional part, thereby creating a vertical repeating pattern.
+ \o ShaderEffectSource.Repeat - Causes the integer part of both the horizontal and vertical texturecoordinates to be ignored; the GL uses only the fractional part, thereby creating a repeating pattern.
\endlist
The default value is ClampToEdge.
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 666aba7e82..fdb36e8af2 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
= { Q_BASIC_ATOMIC_INITIALIZER(0), false }; \
static void NAME##_cleanup() \
{ \
- delete this_##NAME.pointer; \
+ this_##NAME.pointer->cleanup(); \
this_##NAME.pointer = 0; \
} \
static TYPE *NAME() \
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
delete x; \
else { \
qAddPostRoutine(NAME##_cleanup); \
- this_##NAME.pointer->updateConfigurations(); \
+ this_##NAME.pointer->initialize(); \
} \
} \
return this_##NAME.pointer; \
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index d468bc4cfd..18e29afd7a 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -66,11 +66,31 @@ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
qRegisterMetaType<QNetworkConfigurationPrivatePointer>("QNetworkConfigurationPrivatePointer");
}
+void QNetworkConfigurationManagerPrivate::initialize()
+{
+ //Two stage construction, because we only want to do this heavyweight work for the winner of the Q_GLOBAL_STATIC race.
+ bearerThread = new QThread();
+ bearerThread->moveToThread(QCoreApplicationPrivate::mainThread()); // because cleanup() is called in main thread context.
+ moveToThread(bearerThread);
+ bearerThread->start();
+ updateConfigurations();
+}
+
QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate()
{
QMutexLocker locker(&mutex);
qDeleteAll(sessionEngines);
+ if (bearerThread)
+ bearerThread->quit();
+}
+
+void QNetworkConfigurationManagerPrivate::cleanup()
+{
+ QThread* thread = bearerThread;
+ deleteLater();
+ if(thread->wait(5000))
+ delete thread;
}
QNetworkConfiguration QNetworkConfigurationManagerPrivate::defaultConfiguration() const
@@ -350,13 +370,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
if (qobject_cast<QBearerEngine *>(sender()))
return;
- if (thread() != QCoreApplicationPrivate::mainThread()) {
- if (thread() != QThread::currentThread())
- return;
-
- moveToThread(QCoreApplicationPrivate::mainThread());
- }
-
updating = false;
#ifndef QT_NO_LIBRARY
@@ -375,7 +388,7 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
else
sessionEngines.append(engine);
- engine->moveToThread(QCoreApplicationPrivate::mainThread());
+ engine->moveToThread(bearerThread);
connect(engine, SIGNAL(updateCompleted()),
this, SLOT(updateConfigurations()));
@@ -385,8 +398,6 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
this, SLOT(configurationRemoved(QNetworkConfigurationPrivatePointer)));
connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)));
-
- QMetaObject::invokeMethod(engine, "initialize");
}
}
@@ -410,8 +421,14 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
startPolling();
}
- if (firstUpdate)
+ if (firstUpdate) {
firstUpdate = false;
+ QList<QBearerEngine*> enginesToInitialize = sessionEngines; //shallow copy the list in case it is modified when we unlock mutex
+ locker.unlock();
+ foreach (QBearerEngine* engine, enginesToInitialize) {
+ QMetaObject::invokeMethod(engine, "initialize", Qt::BlockingQueuedConnection);
+ }
+ }
}
void QNetworkConfigurationManagerPrivate::performAsyncConfigurationUpdate()
diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h
index 04cce202c5..56f66b475a 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.h
+++ b/src/network/bearer/qnetworkconfigmanager_p.h
@@ -89,6 +89,8 @@ public:
void enablePolling();
void disablePolling();
+ void initialize();
+ void cleanup();
public Q_SLOTS:
void updateConfigurations();
@@ -109,6 +111,7 @@ private Q_SLOTS:
private:
Q_INVOKABLE void startPolling();
QTimer *pollTimer;
+ QThread *bearerThread;
private:
mutable QMutex mutex;
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index 86176c947f..21671a6716 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -39,11 +39,10 @@
**
****************************************************************************/
-
#include "qgl.h"
#include <fbs.h>
#include <private/qt_s60_p.h>
-#include <private/qpixmap_s60_p.h>
+#include <private/qpixmap_raster_symbian_p.h>
#include <private/qimagepixmapcleanuphooks_p.h>
#include <private/qgl_p.h>
#include <private/qpaintengine_opengl_p.h>
@@ -437,7 +436,6 @@ void* QGLPixmapData::toNativeType(NativeType type)
m_source = QVolatileImage(w, h, QImage::Format_ARGB32_Premultiplied);
return m_source.duplicateNativeImage();
}
-
return 0;
}
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 8bf329d261..de8ea88e3c 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3213,7 +3213,7 @@ static void drawImageTiled(QVGPaintEnginePrivate *d,
VGImage tileWithOpacity = VG_INVALID_HANDLE;
if (d->opacity != 1) {
tileWithOpacity = pool->createPermanentImage(VG_sARGB_8888_PRE,
- tileWidth, tileHeight, VG_IMAGE_QUALITY_FASTER);
+ tileWidth, tileHeight, VG_IMAGE_QUALITY_NONANTIALIASED);
if (tileWithOpacity == VG_INVALID_HANDLE)
qWarning("drawImageTiled: Failed to create extra tile, ignoring opacity");
}
@@ -3226,6 +3226,10 @@ static void drawImageTiled(QVGPaintEnginePrivate *d,
VGfloat scaleY = r.height() / sourceRect.height();
d->setImageOptions();
+ VGImageQuality oldImageQuality = d->imageQuality;
+ VGRenderingQuality oldRenderingQuality = d->renderingQuality;
+ d->setImageQuality(VG_IMAGE_QUALITY_NONANTIALIASED);
+ d->setRenderingQuality(VG_RENDERING_QUALITY_NONANTIALIASED);
for (int y = sourceRect.y(); y < sourceRect.height(); y += tileHeight) {
int h = qMin(tileHeight, sourceRect.height() - y);
@@ -3265,6 +3269,9 @@ static void drawImageTiled(QVGPaintEnginePrivate *d,
vgDestroyImage(tile);
if (tileWithOpacity != VG_INVALID_HANDLE)
vgDestroyImage(tileWithOpacity);
+
+ d->setImageQuality(oldImageQuality);
+ d->setRenderingQuality(oldRenderingQuality);
}
// Used by qpixmapfilter_vg.cpp to draw filtered VGImage's.
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index f3ca57c00a..597f3fa47b 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -249,9 +249,10 @@ void QVGPixmapData::createPixmapForImage(QImage &image, Qt::ImageConversionFlags
// same. Detaching is needed to prevent issues with painting
// onto this QPixmap later on.
convertedImage.detach();
+ if (convertedImage.isNull())
+ qWarning("QVGPixmapData: Failed to convert image data (out of memory? try increasing heap size)");
source = QVolatileImage(convertedImage);
}
-
recreate = true;
}
diff --git a/src/openvg/qpixmapdata_vg_p.h b/src/openvg/qpixmapdata_vg_p.h
index 18846f3088..4a969c0e46 100644
--- a/src/openvg/qpixmapdata_vg_p.h
+++ b/src/openvg/qpixmapdata_vg_p.h
@@ -138,7 +138,7 @@ public:
QSize size() const { return QSize(w, h); }
#if defined(Q_OS_SYMBIAN)
- QVolatileImage toVolatileImage() const { return source; }
+ QVolatileImage toVolatileImage() const;
void* toNativeType(NativeType type);
void fromNativeType(void* pixmap, NativeType type);
bool initFromNativeImageHandle(void *handle, const QString &type);
diff --git a/src/openvg/qvg_symbian.cpp b/src/openvg/qvg_symbian.cpp
index 249b05387a..98a5869f92 100644
--- a/src/openvg/qvg_symbian.cpp
+++ b/src/openvg/qvg_symbian.cpp
@@ -288,6 +288,11 @@ void* QVGPixmapData::toNativeType(NativeType type)
return 0;
}
+QVolatileImage QVGPixmapData::toVolatileImage() const
+{
+ return source;
+}
+
QSymbianVGFontGlyphCache::QSymbianVGFontGlyphCache() : QVGFontGlyphCache()
{
#ifdef QT_SYMBIAN_HARDWARE_GLYPH_CACHE
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index 7e97ffef5b..13f2b4c8f3 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -147,6 +147,9 @@ static QNetworkConfiguration::BearerType qGetInterfaceType(const QString &interf
QGenericEngine::QGenericEngine(QObject *parent)
: QBearerEngineImpl(parent)
{
+ //workaround for deadlock in __cxa_guard_acquire with webkit on macos x
+ //initialise the Q_GLOBAL_STATIC in same thread as the AtomicallyInitializedStatic
+ (void)QNetworkInterface::interfaceFromIndex(0);
}
QGenericEngine::~QGenericEngine()
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 90bef7b641..318f16fac5 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -5028,6 +5028,7 @@ EXPORTS
?hasSelection@QItemSelectionModel@@QBE_NXZ @ 5027 NONAME ; bool QItemSelectionModel::hasSelection(void) const
?hasSelection@QTextCursor@@QBE_NXZ @ 5028 NONAME ; bool QTextCursor::hasSelection(void) const
?hasStaticContents@QWindowSurface@@IBE_NXZ @ 5029 NONAME ; bool QWindowSurface::hasStaticContents(void) const
+ ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 5030 NONAME ABSENT ; bool QWindowSurface::hasStaticContentsSupport(void) const
?hasStaticContentsSupport@QWindowSurface@@UBE_NXZ @ 5030 NONAME ABSENT ; bool QWindowSurface::hasStaticContentsSupport(void) const
?hasThemeIcon@QIcon@@SA_NABVQString@@@Z @ 5031 NONAME ; bool QIcon::hasThemeIcon(class QString const &)
?hasTracking@QAbstractSlider@@QBE_NXZ @ 5032 NONAME ; bool QAbstractSlider::hasTracking(void) const
@@ -12853,6 +12854,7 @@ EXPORTS
?updateAll@QGraphicsViewPrivate@@QAEXXZ @ 12852 NONAME ; void QGraphicsViewPrivate::updateAll(void)
?updateMicroFocus@QGraphicsItem@@IAEXXZ @ 12853 NONAME ; void QGraphicsItem::updateMicroFocus(void)
?populate@QTextureGlyphCache@@QAEXPAVQFontEngine@@HPBIPBUQFixedPoint@@@Z @ 12854 NONAME ABSENT ; void QTextureGlyphCache::populate(class QFontEngine *, int, unsigned int const *, struct QFixedPoint const *)
+ ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 12855 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const
?hasPartialUpdateSupport@QWindowSurface@@UBE_NXZ @ 12855 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const
?scroll@QRuntimePixmapData@@UAE_NHHABVQRect@@@Z @ 12856 NONAME ; bool QRuntimePixmapData::scroll(int, int, class QRect const &)
?qt_draw_glyphs@@YAXPAVQPainter@@PBIPBVQPointF@@H@Z @ 12857 NONAME ABSENT ; void qt_draw_glyphs(class QPainter *, unsigned int const *, class QPointF const *, int)
@@ -14034,12 +14036,11 @@ EXPORTS
?releaseAllGpuResources@QSymbianGraphicsSystemEx@@UAEXXZ @ 14033 NONAME ; void QSymbianGraphicsSystemEx::releaseAllGpuResources(void)
?cursorMoveStyle@QLineControl@@QBE?AW4CursorMoveStyle@Qt@@XZ @ 14034 NONAME ; enum Qt::CursorMoveStyle QLineControl::cursorMoveStyle(void) const
?hasBCM2727@QSymbianGraphicsSystemEx@@UAE_NXZ @ 14035 NONAME ABSENT ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
- ?hasStaticContentsSupport@QWindowSurface@@QBE_NXZ @ 14036 NONAME ABSENT ; bool QWindowSurface::hasStaticContentsSupport(void) const
- ?hasPartialUpdateSupport@QWindowSurface@@QBE_NXZ @ 14037 NONAME ABSENT ; bool QWindowSurface::hasPartialUpdateSupport(void) const
??0QSymbianGraphicsSystemEx@@QAE@XZ @ 14038 NONAME ABSENT ; QSymbianGraphicsSystemEx::QSymbianGraphicsSystemEx(void)
?hasBCM2727@QSymbianGraphicsSystemEx@@SA_NXZ @ 14039 NONAME ; bool QSymbianGraphicsSystemEx::hasBCM2727(void)
?getClusterLength@QTextEngine@@AAEHPAGPBUHB_CharAttributes@@HHHPAH@Z @ 14040 NONAME ; int QTextEngine::getClusterLength(unsigned short *, struct HB_CharAttributes const *, int, int, int, int *)
?positionInLigature@QTextEngine@@QAEHPBUQScriptItem@@HUQFixed@@1H_N@Z @ 14041 NONAME ; int QTextEngine::positionInLigature(struct QScriptItem const *, int, struct QFixed, struct QFixed, int, bool)
?supportsTransformations@QPaintEngineEx@@UBE_NMABVQTransform@@@Z @ 14042 NONAME ; bool QPaintEngineEx::supportsTransformations(float, class QTransform const &) const
?drawStaticTextItem@QPaintEngineEx@@UAEXPAVQStaticTextItem@@@Z @ 14043 NONAME ; void QPaintEngineEx::drawStaticTextItem(class QStaticTextItem *)
-
+ ?constImageRef@QVolatileImage@@QBEABVQImage@@XZ @ 14044 NONAME ; class QImage const & QVolatileImage::constImageRef(void) const
+ ?toVolatileImage@QPixmapData@@UBE?AVQVolatileImage@@XZ @ 14045 NONAME ; class QVolatileImage QPixmapData::toVolatileImage(void) const
diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def
index f1edc231be..22ba8f3e28 100644
--- a/src/s60installs/bwins/QtOpenGLu.def
+++ b/src/s60installs/bwins/QtOpenGLu.def
@@ -876,3 +876,4 @@ EXPORTS
?qt_static_metacall@QGLShaderProgram@@CAXPAVQObject@@W4Call@QMetaObject@@HPAPAX@Z @ 875 NONAME ; void QGLShaderProgram::qt_static_metacall(class QObject *, enum QMetaObject::Call, int, void * *)
?platformExtension@QGLGraphicsSystem@@UAEPAVQGraphicsSystemEx@@XZ @ 876 NONAME ; class QGraphicsSystemEx * QGLGraphicsSystem::platformExtension(void)
?releaseCachedGpuResources@QGLGraphicsSystem@@UAEXXZ @ 877 NONAME ; void QGLGraphicsSystem::releaseCachedGpuResources(void)
+ ?toVolatileImage@QGLPixmapData@@UBE?AVQVolatileImage@@XZ @ 878 NONAME ; class QVolatileImage QGLPixmapData::toVolatileImage(void) const
diff --git a/src/s60installs/bwins/QtOpenVGu.def b/src/s60installs/bwins/QtOpenVGu.def
index eb4c7bce98..811f863a7d 100644
--- a/src/s60installs/bwins/QtOpenVGu.def
+++ b/src/s60installs/bwins/QtOpenVGu.def
@@ -186,4 +186,4 @@ EXPORTS
?forceToImage@QVGPixmapData@@IAEX_N@Z @ 185 NONAME ; void QVGPixmapData::forceToImage(bool)
?features@QVGWindowSurface@@UBE?AV?$QFlags@W4WindowSurfaceFeature@QWindowSurface@@@@XZ @ 186 NONAME ; class QFlags<enum QWindowSurface::WindowSurfaceFeature> QVGWindowSurface::features(void) const
?supportsTransformations@QVGPaintEngine@@UBE_NMABVQTransform@@@Z @ 187 NONAME ; bool QVGPaintEngine::supportsTransformations(float, class QTransform const &) const
-
+ ?toVolatileImage@QVGPixmapData@@UBE?AVQVolatileImage@@XZ @ 188 NONAME ; class QVolatileImage QVGPixmapData::toVolatileImage(void) const
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 4ca71e905f..95a5dbd178 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12753,4 +12753,5 @@ EXPORTS
_ZN11QTextEngine18positionInLigatureEPK11QScriptItemi6QFixedS3_ib @ 12752 NONAME
_ZN14QPaintEngineEx18drawStaticTextItemEP15QStaticTextItem @ 12753 NONAME
_ZNK14QPaintEngineEx23supportsTransformationsEfRK10QTransform @ 12754 NONAME
-
+ _ZNK11QPixmapData15toVolatileImageEv @ 12755 NONAME
+ _ZNK14QVolatileImage13constImageRefEv @ 12756 NONAME
diff --git a/src/s60installs/eabi/QtOpenVGu.def b/src/s60installs/eabi/QtOpenVGu.def
index 5b083bd6a9..e2cdbcfa32 100644
--- a/src/s60installs/eabi/QtOpenVGu.def
+++ b/src/s60installs/eabi/QtOpenVGu.def
@@ -215,4 +215,4 @@ EXPORTS
_ZN13QVGPixmapData35createFromNativeImageHandleProviderEv @ 214 NONAME
_ZN13QVGPixmapData12forceToImageEb @ 215 NONAME
_ZNK16QVGWindowSurface8featuresEv @ 216 NONAME
-
+ _ZNK13QVGPixmapData15toVolatileImageEv @ 217 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index bddabd5821..4f2a3b4364 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -70,14 +70,17 @@ data=EPOCROOT##epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin
file=ABI_DIR\BUILD_DIR\qmlfolderlistmodelplugin.dll SHARED_LIB_DIR\qmlfolderlistmodelplugin.dll
file=ABI_DIR\BUILD_DIR\qmlgesturesplugin.dll SHARED_LIB_DIR\qmlgesturesplugin.dll
file=ABI_DIR\BUILD_DIR\qmlparticlesplugin.dll SHARED_LIB_DIR\qmlparticlesplugin.dll
+file=ABI_DIR\BUILD_DIR\qmlshadersplugin.dll SHARED_LIB_DIR\qmlshadersplugin.dll
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin resource\qt\imports\Qt\labs\folderlistmodel\qmlfolderlistmodelplugin.qtplugin
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin resource\qt\imports\Qt\labs\gestures\qmlgesturesplugin.qtplugin
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin resource\qt\imports\Qt\labs\particles\qmlparticlesplugin.qtplugin
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\shaders\qmlshadersplugin.qtplugin resource\qt\imports\Qt\labs\shaders\qmlshadersplugin.qtplugin
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\folderlistmodel\qmldir resource\qt\imports\Qt\labs\folderlistmodel\qmldir
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\gestures\qmldir resource\qt\imports\Qt\labs\gestures\qmldir
data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\particles\qmldir resource\qt\imports\Qt\labs\particles\qmldir
+data=EPOCROOT##epoc32\data\z\resource\qt\imports\Qt\labs\shaders\qmldir resource\qt\imports\Qt\labs\shaders\qmldir
// graphicssystems
data=EPOCROOT##epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
diff --git a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
index 57bf5836a7..d29ef77347 100644
--- a/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
+++ b/tests/auto/qnetworkconfigurationmanager/tst_qnetworkconfigurationmanager.cpp
@@ -62,6 +62,7 @@ public slots:
void cleanup();
private slots:
+ void usedInThread(); // this test must be first, or it will falsely pass
void allConfigurations();
void defaultConfiguration();
void configurationFromIdentifier();
@@ -329,6 +330,49 @@ void tst_QNetworkConfigurationManager::configurationFromIdentifier()
QVERIFY(!invalid.isValid());
}
+class QNCMTestThread : public QThread
+{
+protected:
+ virtual void run()
+ {
+ QNetworkConfigurationManager manager;
+ preScanConfigs = manager.allConfigurations();
+ QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
+ manager.updateConfigurations(); //initiate scans
+ QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ configs = manager.allConfigurations();
+ }
+public:
+ QList<QNetworkConfiguration> configs;
+ QList<QNetworkConfiguration> preScanConfigs;
+};
+
+// regression test for QTBUG-18795
+void tst_QNetworkConfigurationManager::usedInThread()
+{
+#if defined Q_OS_MAC && !defined (QT_NO_COREWLAN)
+ QSKIP("QTBUG-19070 Mac CoreWlan plugin is broken", SkipAll);
+#else
+ QNCMTestThread thread;
+ connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ thread.start();
+ QTestEventLoop::instance().enterLoop(100); //QTRY_VERIFY could take ~90 seconds to time out in the thread
+ QVERIFY(!QTestEventLoop::instance().timeout());
+ qDebug() << "prescan:" << thread.preScanConfigs.count();
+ qDebug() << "postscan:" << thread.configs.count();
+
+ QNetworkConfigurationManager manager;
+ QList<QNetworkConfiguration> preScanConfigs = manager.allConfigurations();
+ QSignalSpy spy(&manager, SIGNAL(updateCompleted()));
+ manager.updateConfigurations(); //initiate scans
+ QTRY_VERIFY(spy.count() == 1); //wait for scan to complete
+ QList<QNetworkConfiguration> configs = manager.allConfigurations();
+ QCOMPARE(thread.configs, configs);
+ //Don't compare pre scan configs, because these may be cached and therefore give different results
+ //which makes the test unstable. The post scan results should have all configurations every time
+ //QCOMPARE(thread.preScanConfigs, preScanConfigs);
+#endif
+}
QTEST_MAIN(tst_QNetworkConfigurationManager)
#include "tst_qnetworkconfigurationmanager.moc"
diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index 45464caa17..839612e3aa 100644
--- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -41,6 +41,7 @@
#include <QtTest/QTest>
+#include <QtTest/QTestEventLoop>
#include <qcoreapplication.h>
#include <qdebug.h>
@@ -52,6 +53,7 @@
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QList>
+#include <QThread>
Q_DECLARE_METATYPE(QNetworkConfiguration);
Q_DECLARE_METATYPE(QList<QNetworkProxy>);
@@ -76,6 +78,7 @@ public:
};
private slots:
+ void systemProxyForQueryCalledFromThread();
void systemProxyForQuery() const;
#ifndef QT_NO_BEARERMANAGEMENT
void fromConfigurations();
@@ -241,5 +244,31 @@ void tst_QNetworkProxyFactory::inNetworkAccessManager()
#endif //QT_NO_BEARERMANAGEMENT
+class QSPFQThread : public QThread
+{
+protected:
+ virtual void run()
+ {
+ proxies = QNetworkProxyFactory::systemProxyForQuery(query);
+ }
+public:
+ QNetworkProxyQuery query;
+ QList<QNetworkProxy> proxies;
+};
+
+//regression test for QTBUG-18799
+void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread()
+{
+ QUrl url(QLatin1String("http://qt.nokia.com"));
+ QNetworkProxyQuery query(url);
+ QSPFQThread thread;
+ thread.query = query;
+ connect(&thread, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ thread.start();
+ QTestEventLoop::instance().enterLoop(5);
+ QVERIFY(thread.isFinished());
+ QCOMPARE(thread.proxies, QNetworkProxyFactory::systemProxyForQuery(query));
+}
+
QTEST_MAIN(tst_QNetworkProxyFactory)
#include "tst_qnetworkproxyfactory.moc"