summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2009-11-04 16:58:55 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2009-11-04 16:58:55 +0100
commit5ff97be22a5246c11851c2c6471a0b7ee2399425 (patch)
tree4318dec329f4b3401184c9df80272c09e242bec3
parent0009fa533e4d5ca1a75ba3b56af082cdcfee55cc (diff)
parent56b8d24c337d30c6bcdda101fbc664c4fd6d642d (diff)
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
-rwxr-xr-xconfigure2
-rwxr-xr-xconfigure.exebin1171968 -> 1172480 bytes
-rw-r--r--dist/changes-4.6.029
-rw-r--r--doc/src/examples/imagegestures.qdoc116
-rw-r--r--doc/src/frameworks-technologies/gestures.qdoc18
-rw-r--r--examples/gestures/imagegestures/imagegestures.pro6
-rw-r--r--examples/gestures/imagegestures/imagewidget.cpp30
-rw-r--r--examples/opengl/hellogl_es/hellogl_es.pro9
-rw-r--r--examples/opengl/hellogl_es2/hellogl_es2.pro6
-rw-r--r--mkspecs/common/wince/qmake.conf1
-rw-r--r--mkspecs/features/egl.prf32
-rw-r--r--mkspecs/features/win32/opengl.prf12
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-arabic.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos.c6
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c3
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp117
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-open.c2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shape.h2
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.h41
-rw-r--r--src/3rdparty/harfbuzz/tests/shaping/main.cpp76
-rwxr-xr-xsrc/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp88
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp4
-rw-r--r--src/corelib/arch/qatomic_symbian.h12
-rw-r--r--src/corelib/global/qglobal.cpp22
-rw-r--r--src/corelib/global/qglobal.h17
-rw-r--r--src/corelib/global/qnamespace.h11
-rw-r--r--src/corelib/global/qnamespace.qdoc36
-rw-r--r--src/gui/dialogs/qfiledialog.cpp10
-rw-r--r--src/gui/dialogs/qfiledialog_mac.mm10
-rw-r--r--src/gui/egl/egl.pri10
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp23
-rw-r--r--src/gui/graphicsview/qgraphicsitem.h3
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp109
-rw-r--r--src/gui/graphicsview/qgraphicsscene_p.h1
-rw-r--r--src/gui/image/qimage.cpp3
-rw-r--r--src/gui/image/qpixmap_s60.cpp24
-rw-r--r--src/gui/image/qpixmap_x11.cpp4
-rw-r--r--src/gui/itemviews/qabstractitemview.h1
-rw-r--r--src/gui/kernel/qapplication.cpp58
-rw-r--r--src/gui/kernel/qapplication.h4
-rw-r--r--src/gui/kernel/qapplication_p.h3
-rw-r--r--src/gui/kernel/qapplication_s60.cpp29
-rw-r--r--src/gui/kernel/qapplication_win.cpp36
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac.mm23
-rw-r--r--src/gui/kernel/qcocoawindowdelegate_mac_p.h2
-rw-r--r--src/gui/kernel/qevent.cpp27
-rw-r--r--src/gui/kernel/qevent.h4
-rw-r--r--src/gui/kernel/qgesture.cpp91
-rw-r--r--src/gui/kernel/qgesture.h22
-rw-r--r--src/gui/kernel/qgesture_p.h15
-rw-r--r--src/gui/kernel/qgesturemanager.cpp96
-rw-r--r--src/gui/kernel/qgesturemanager_p.h5
-rw-r--r--src/gui/kernel/qgesturerecognizer.cpp86
-rw-r--r--src/gui/kernel/qgesturerecognizer.h25
-rw-r--r--src/gui/kernel/qmacgesturerecognizer_mac.mm57
-rw-r--r--src/gui/kernel/qmacgesturerecognizer_mac_p.h13
-rw-r--r--src/gui/kernel/qsound_s60.cpp94
-rw-r--r--src/gui/kernel/qstandardgestures.cpp216
-rw-r--r--src/gui/kernel/qstandardgestures_p.h14
-rw-r--r--src/gui/kernel/qwidget.cpp13
-rw-r--r--src/gui/kernel/qwidget.h2
-rw-r--r--src/gui/kernel/qwidget_mac.mm9
-rw-r--r--src/gui/kernel/qwidget_p.h2
-rw-r--r--src/gui/kernel/qwidget_win.cpp15
-rw-r--r--src/gui/kernel/qwinnativepangesturerecognizer_win.cpp29
-rw-r--r--src/gui/kernel/qwinnativepangesturerecognizer_win_p.h5
-rw-r--r--src/gui/s60framework/s60framework.pri11
-rw-r--r--src/gui/s60framework/s60main.rss (renamed from src/s60main/s60main.rss)0
-rw-r--r--src/gui/styles/qcommonstyle.cpp183
-rw-r--r--src/gui/styles/qs60style.cpp113
-rw-r--r--src/gui/styles/qs60style_s60.cpp14
-rw-r--r--src/gui/styles/qs60style_simulated.cpp2
-rw-r--r--src/gui/text/qtextcontrol.cpp3
-rw-r--r--src/gui/util/qdesktopservices.cpp9
-rw-r--r--src/gui/util/qdesktopservices_mac.cpp9
-rw-r--r--src/gui/widgets/qabstractscrollarea.cpp55
-rw-r--r--src/gui/widgets/qlinecontrol.cpp3
-rw-r--r--src/gui/widgets/qplaintextedit.cpp53
-rw-r--r--src/gui/widgets/qtextedit.cpp6
-rw-r--r--src/opengl/opengl.pro25
-rw-r--r--src/opengl/qglpixmapfilter.cpp2
-rw-r--r--src/opengl/qglshaderprogram.cpp50
-rw-r--r--src/opengl/qglshaderprogram.h11
-rw-r--r--src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro6
-rw-r--r--src/s60installs/s60installs.pro26
-rw-r--r--src/s60main/qts60main_mcrt0.cpp8
-rw-r--r--src/s60main/s60main.pro20
-rw-r--r--src/xmlpatterns/acceltree/qacceltree_p.h2
-rw-r--r--src/xmlpatterns/acceltree/qcompressedwhitespace_p.h2
-rw-r--r--tests/auto/checkxmlfiles/checkxmlfiles.pro2
-rw-r--r--tests/auto/gestures/tst_gestures.cpp357
-rw-r--r--tests/auto/q3filedialog/tst_q3filedialog.cpp4
-rw-r--r--tests/auto/qclipboard/test/test.pro15
-rw-r--r--tests/auto/qdatetime/tst_qdatetime.cpp5
-rw-r--r--tests/auto/qsound/tst_qsound.cpp26
-rw-r--r--tests/auto/qtextscriptengine/generate/generate.pro1
-rw-r--r--tests/auto/qtextscriptengine/generate/main.cpp4
-rw-r--r--tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp87
-rw-r--r--tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp2
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp14
-rw-r--r--tests/auto/qxmlschema/tst_qxmlschema.cpp4
-rw-r--r--tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp12
-rw-r--r--tests/auto/qxmlserializer/tst_qxmlserializer.cpp4
-rw-r--r--tests/auto/xmlpatterns.pri5
-rw-r--r--tests/auto/xmlpatterns/tst_xmlpatterns.cpp10
-rw-r--r--tests/auto/xmlpatterns/xmlpatterns.pro6
-rw-r--r--tests/auto/xmlpatternsdiagnosticsts/test/test.pro4
-rw-r--r--tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro5
-rw-r--r--tests/auto/xmlpatternsxqts/lib/Global.h2
-rw-r--r--tests/auto/xmlpatternsxqts/lib/lib.pro6
-rw-r--r--tests/manual/gestures/graphicsview/gestures.cpp24
-rw-r--r--tests/manual/gestures/graphicsview/gestures.h8
-rw-r--r--tests/manual/gestures/graphicsview/main.cpp10
-rw-r--r--tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp25
-rw-r--r--tests/manual/gestures/graphicsview/mousepangesturerecognizer.h4
-rw-r--r--tests/manual/gestures/scrollarea/main.cpp50
-rw-r--r--tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp37
-rw-r--r--tests/manual/gestures/scrollarea/mousepangesturerecognizer.h4
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp2
-rw-r--r--tools/configure/configureapp.cpp2
-rw-r--r--tools/qdoc3/test/qt-html-templates.qdocconf4
125 files changed, 2069 insertions, 1192 deletions
diff --git a/configure b/configure
index 9c3e417b3d..611f4bfad2 100755
--- a/configure
+++ b/configure
@@ -4185,7 +4185,7 @@ fi
if [ -n "$EVALKEY" ]; then
cat > "$outpath/src/corelib/global/qconfig_eval.cpp" <<EOF
/* Evaluation license key */
-static const char qt_eval_key_data [512 + 12] = "$EVALKEY";
+static const char qt_eval_key_data [512 + 12] = "qt_qevalkey=$EVALKEY";
EOF
chmod -w "$outpath/src/corelib/global/qconfig_eval.cpp"
fi
diff --git a/configure.exe b/configure.exe
index 7c11feca25..13d0673fd4 100755
--- a/configure.exe
+++ b/configure.exe
Binary files differ
diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0
index 887e93e455..61c3aa07c4 100644
--- a/dist/changes-4.6.0
+++ b/dist/changes-4.6.0
@@ -66,6 +66,29 @@ information about a particular change.
be consistent with win32-msvc200x.
****************************************************************************
+* Tools *
+****************************************************************************
+
+- Designer
+
+ - [233683] Promoted Widgets are now stored correctly in scratchpad.
+ - [249823] Added search functionality to the resource browser.
+ - [254282] Enabled the use of promoted widgets in form templates.
+ - [254824] Made it possible to override the createAction()/createWidget()
+ functions of QUiLoader.
+ - [256332] Enabled deleting all pages of a QTabWidget or QStackedWidget.
+ - [259238] Fixed menubar/menu editing in right-to-left mode.
+ - [259918] Fixed setting of object names for container pages not to use
+ localized strings.
+ - [260658] Fixed saving of alpha values set in the palette editor.
+ - It is now possible to further specify the kind of custom widget
+ string properties using XML tags.
+
+- uic3
+
+ - [128859] Fixed code generation of QLabel's wordWrap property.
+
+****************************************************************************
* DirectFB *
****************************************************************************
@@ -209,4 +232,8 @@ information about a particular change.
for all floating point numbers, and this can be changed using the new
function setFloatingPointPrecision(). Set Qt_4_5 as the version of the
QDataStream to get the behavior of previous versions.
-
+
+ - On Mac OS X, QDesktopServices::storageLocation(DataLocation) now includes
+ QCoreApplication::organizationName() and QCoreApplication::applicationName()
+ if those are set. This matches the behavior on the other platforms.
+
diff --git a/doc/src/examples/imagegestures.qdoc b/doc/src/examples/imagegestures.qdoc
new file mode 100644
index 0000000000..33c1ace93b
--- /dev/null
+++ b/doc/src/examples/imagegestures.qdoc
@@ -0,0 +1,116 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the documentation 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$
+**
+****************************************************************************/
+
+/*!
+ \example gestures/imagegestures
+ \title Image Gestures Example
+
+ This example shows how to enable gestures for a widget and use gesture input
+ to perform actions.
+
+ \image imagegestures-example.png Screenshot of the Image Gestures example.
+
+ We use two classes to create the user interface for the application: \c MainWidget
+ and \c ImageWidget. The \c MainWidget class is simply used as a container for the
+ \c ImageWidget class, which we will configure to accept gesture input. Since we
+ are interested in the way gestures are used, we will concentrate on the
+ implementation of the \c ImageWidget class.
+
+ \section1 ImageWidget Class Definition
+
+ The \c ImageWidget class is a simple QWidget subclass that reimplements the general
+ QWidget::event() handler function in addition to several more specific event handlers:
+
+ \snippet examples/gestures/imagegestures/imagewidget.h class definition begin
+ \dots
+ \snippet examples/gestures/imagegestures/imagewidget.h class definition end
+
+ We also implement a private helper function, \c gestureEvent(), to help manage
+ gesture events delivered to the widget, and three functions to perform actions
+ based on gestures: \c panTriggered(), \c pinchTriggered() and \c swipeTriggered().
+
+ \section1 ImageWidget Class Implementation
+
+ In the widget's constructor, we begin by setting up various parameters that will
+ be used to control the way images are displayed.
+
+ \snippet examples/gestures/imagegestures/imagewidget.cpp constructor
+
+ We enable three of the standard gestures for the widget by calling QWidget::grabGesture()
+ with the types of gesture we need. These will be recognized by the application's
+ default gesture recognizer, and events will be delivered to our widget.
+
+ Since QWidget does not define a specific event handler for gestures, the widget
+ needs to reimplement the general QWidget::event() to receive gesture events.
+
+ \snippet examples/gestures/imagegestures/imagewidget.cpp event handler
+
+ We implement the event handler to delegate gesture events to a private function
+ specifically written for the task, and pass all other events to QWidget's
+ implementation.
+
+ The \c gestureHandler() function examines the gestures supplied by the
+ newly-delivered QGestureEvent. Since only one gesture of a given type can be
+ used on a widget at any particular time, we can check for each gesture type
+ using the QGestureEvent::gesture() function:
+
+ \snippet examples/gestures/imagegestures/imagewidget.cpp gesture event handler
+
+ If a QGesture object is supplied for a certain type of gesture, we call a special
+ purpose function to deal with it, casting the gesture object to the appropriate
+ QGesture subclass.
+
+ To illustrate how a standard gesture can be interpreted by an application, we
+ show the implementation of the \c swipeTriggered() function, which handles the
+ gesture associated with a brushing or swiping motion on the user's display or
+ input device:
+
+ \snippet examples/gestures/imagegestures/imagewidget.cpp swipe function
+
+ The QSwipeGesture class provides specialized functions and defines a enum
+ to make it more convenient for developers to discover which direction, if
+ any, the user swiped the display. Here, we simply navigate to the previous
+ image in the collection if the user swiped upwards or to the left; otherwise
+ we navigate to the next image in the collection.
+
+ The other gestures are also handled by special purpose functions, but use
+ the values of properties held by the QGesture object passed to them.
+*/
diff --git a/doc/src/frameworks-technologies/gestures.qdoc b/doc/src/frameworks-technologies/gestures.qdoc
index a619fe8f16..2fa8dabe9a 100644
--- a/doc/src/frameworks-technologies/gestures.qdoc
+++ b/doc/src/frameworks-technologies/gestures.qdoc
@@ -122,7 +122,7 @@
\section2 Filtering Input Events
- The \l{QGestureRecognizer::}{filterEvent()} function must be reimplemented.
+ The \l{QGestureRecognizer::}{recognize()} function must be reimplemented.
This function handles and filters the incoming input events for the target objects
and determines whether or not they correspond to the gesture the recognizer is
looking for.
@@ -132,15 +132,15 @@
persistent information about the state of the recognition process in the QGesture
object supplied.
- Your \l{QGestureRecognizer::}{filterEvent()} function must return a value of
- Qt::GestureState that indicates the state of recognition for a given gesture and
+ Your \l{QGestureRecognizer::}{recognize()} function must return a value of
+ QGestureRecognizer::Result that indicates the state of recognition for a given gesture and
target object. This determines whether or not a gesture event will be delivered
to a target object.
\section2 Custom Gestures
If you choose to represent a gesture by a custom QGesture subclass, you will need to
- reimplement the \l{QGestureRecognizer::}{createGesture()} function to construct
+ reimplement the \l{QGestureRecognizer::}{create()} function to construct
instances of your gesture class instead of standard QGesture instances. Alternatively,
you may want to use standard QGesture instances, but add additional dynamic properties
to them to express specific details of the gesture you want to handle.
@@ -152,7 +152,7 @@
\l{QGestureRecognizer::}{reset()} function to perform these special tasks.
Note that QGesture objects are only created once for each combination of target object
- and gesture type, and they are reused every time the user attempts to perform the
+ and gesture type, and they might be reused every time the user attempts to perform the
same gesture type on the target object. As a result, it can be useful to reimplement
the \l{QGestureRecognizer::}{reset()} function to clean up after each previous attempt
at recognizing a gesture.
@@ -162,12 +162,12 @@
To use a gesture recognizer, construct an instance of your QGestureRecognizer
subclass, and register it with the application with
- QApplication::registerGestureRecognizer(). A recognizer for a given type of
- gesture can be removed with QApplication::unregisterGestureRecognizer().
+ QGestureRecognizer::registerRecognizer(). A recognizer for a given type of
+ gesture can be removed with QGestureRecognizer::unregisterRecognizer().
\section1 Further Reading
- The \l{Image Gestures Example} shows how to enable gestures for a widget in
- a simple image viewer application.
+ The \l{gestures/imagegestures}{Image Gestures Example} shows how to enable
+ gestures for a widget in a simple image viewer application.
*/
diff --git a/examples/gestures/imagegestures/imagegestures.pro b/examples/gestures/imagegestures/imagegestures.pro
index 7780ad9cec..8c947e41bd 100644
--- a/examples/gestures/imagegestures/imagegestures.pro
+++ b/examples/gestures/imagegestures/imagegestures.pro
@@ -5,12 +5,12 @@ SOURCES = imagewidget.cpp \
mainwidget.cpp
# install
-target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+target.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
sources.files = $$SOURCES \
$$HEADERS \
$$RESOURCES \
$$FORMS \
- imageviewer.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imageviewer
+ imagegestures.pro
+sources.path = $$[QT_INSTALL_EXAMPLES]/gestures/imagegestures
INSTALLS += target \
sources
diff --git a/examples/gestures/imagegestures/imagewidget.cpp b/examples/gestures/imagegestures/imagewidget.cpp
index 28de6da270..f615129103 100644
--- a/examples/gestures/imagegestures/imagewidget.cpp
+++ b/examples/gestures/imagegestures/imagewidget.cpp
@@ -102,17 +102,13 @@ void ImageWidget::mouseDoubleClickEvent(QMouseEvent *)
//! [gesture event handler]
bool ImageWidget::gestureEvent(QGestureEvent *event)
{
- if (QGesture *pan = event->gesture(Qt::PanGesture)) {
- panTriggered(static_cast<QPanGesture*>(pan));
- return true;
- } else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) {
- pinchTriggered(static_cast<QPinchGesture*>(pinch));
- return true;
- } else if (QGesture *swipe = event->gesture(Qt::SwipeGesture)) {
- swipeTriggered(static_cast<QSwipeGesture*>(swipe));
- return true;
- }
- return false;
+ if (QGesture *pan = event->gesture(Qt::PanGesture))
+ panTriggered(static_cast<QPanGesture *>(pan));
+ if (QGesture *pinch = event->gesture(Qt::PinchGesture))
+ pinchTriggered(static_cast<QPinchGesture *>(pinch));
+ if (QGesture *swipe = event->gesture(Qt::SwipeGesture))
+ swipeTriggered(static_cast<QSwipeGesture *>(swipe));
+ return true;
}
//! [gesture event handler]
@@ -128,21 +124,21 @@ void ImageWidget::panTriggered(QPanGesture *gesture)
setCursor(Qt::ArrowCursor);
}
#endif
- QPointF lastOffset = gesture->offset();
- horizontalOffset += lastOffset.x();
- verticalOffset += lastOffset.y();
+ QPointF delta = gesture->delta();
+ horizontalOffset += delta.x();
+ verticalOffset += delta.y();
update();
}
void ImageWidget::pinchTriggered(QPinchGesture *gesture)
{
- QPinchGesture::WhatChanged whatChanged = gesture->whatChanged();
- if (whatChanged & QPinchGesture::RotationAngleChanged) {
+ QPinchGesture::ChangeFlags changeFlags = gesture->changeFlags();
+ if (changeFlags & QPinchGesture::RotationAngleChanged) {
qreal value = gesture->property("rotationAngle").toReal();
qreal lastValue = gesture->property("lastRotationAngle").toReal();
rotationAngle += value - lastValue;
}
- if (whatChanged & QPinchGesture::ScaleFactorChanged) {
+ if (changeFlags & QPinchGesture::ScaleFactorChanged) {
qreal value = gesture->property("scaleFactor").toReal();
qreal lastValue = gesture->property("lastScaleFactor").toReal();
scaleFactor += value - lastValue;
diff --git a/examples/opengl/hellogl_es/hellogl_es.pro b/examples/opengl/hellogl_es/hellogl_es.pro
index 3168743415..80ef7df315 100644
--- a/examples/opengl/hellogl_es/hellogl_es.pro
+++ b/examples/opengl/hellogl_es/hellogl_es.pro
@@ -20,15 +20,6 @@ HEADERS += bubble.h
RESOURCES += texture.qrc
QT += opengl
-wince*:{
- contains(QT_CONFIG,opengles1) {
- QMAKE_LIBS += "libGLES_CM.lib"
- }
- contains(QT_CONFIG,opengles1cl) {
- QMAKE_LIBS += "libGLES_CL.lib"
- }
-}
-
# install
target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
diff --git a/examples/opengl/hellogl_es2/hellogl_es2.pro b/examples/opengl/hellogl_es2/hellogl_es2.pro
index d5ad4b81ec..92b42248de 100644
--- a/examples/opengl/hellogl_es2/hellogl_es2.pro
+++ b/examples/opengl/hellogl_es2/hellogl_es2.pro
@@ -25,9 +25,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/opengl/hellogl_es2
INSTALLS += target sources
-
-
-wince*: {
- QMAKE_LIBS += "libGLESv2.lib"
-
-} \ No newline at end of file
diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf
index d87be0243b..ff99f1b562 100644
--- a/mkspecs/common/wince/qmake.conf
+++ b/mkspecs/common/wince/qmake.conf
@@ -64,6 +64,7 @@ QMAKE_LIBS_NETWORK = ws2.lib
QMAKE_LIBS_OPENGL =
QMAKE_LIBS_COMPAT =
+QMAKE_LIBS_EGL = libEGL.lib
QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib
QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib
QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib
diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf
index 22002c385b..00f70d3a65 100644
--- a/mkspecs/features/egl.prf
+++ b/mkspecs/features/egl.prf
@@ -1,3 +1,29 @@
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBDIR_EGL): LIBS += -L$$QMAKE_LIBDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS += $$QMAKE_LIBS_EGL
+# On UNIX, we can use config tests to figure out if egl.h is in
+# EGL/egl.h or GLES/egl.h. Sadly, there are no config tests on WinCE
+# so we have to assume that for GLES 1.1 (CL), the EGL header is in
+# GLES/egl.h. We also assume there is no separate libEGL.lib library,
+# so we use the GL library instead.
+
+wince*:contains(QT_CONFIG, opengles1) {
+ INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1
+ LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1
+ for(p, QMAKE_LIBDIR_OPENGL_ES1) {
+ exists($$p):LIBS_PRIVATE += -L$$p
+ }
+ DEFINES += QT_GLES_EGL
+} else:wince*:contains(QT_CONFIG, opengles1cl) {
+ INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL
+ LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL
+ LIBS += $$QMAKE_LFLAGS_EGL
+ for(p, QMAKE_LIBDIR_OPENGL_ES1CL) {
+ exists($$p):LIBS_PRIVATE += -L$$p
+ }
+ DEFINES += QT_GLES_EGL
+} else {
+ INCLUDEPATH += $$QMAKE_INCDIR_EGL
+ LIBS_PRIVATE += $$QMAKE_LIBS_EGL
+ LIBS += $$QMAKE_LFLAGS_EGL
+ for(p, QMAKE_LIBDIR_EGL) {
+ exists($$p):LIBS_PRIVATE += -L$$p
+ }
+}
diff --git a/mkspecs/features/win32/opengl.prf b/mkspecs/features/win32/opengl.prf
index 30af2a3b9e..3414781c39 100644
--- a/mkspecs/features/win32/opengl.prf
+++ b/mkspecs/features/win32/opengl.prf
@@ -1,3 +1,11 @@
-QMAKE_LIBS += $$QMAKE_LIBS_OPENGL
-QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL
+# WinCE does not have a platform directory for .prf files, and the
+# win32 directory is searched for .prfs by qmake on WinCE. Ideally
+# there should be a features/wince/opengl.prf which contains the wince
+# block below.
+wince* {
+ include(../unix/opengl.prf)
+} else {
+ QMAKE_LIBS += $$QMAKE_LIBS_OPENGL
+ QMAKE_LFLAGS += $$QMAKE_LFLAGS_OPENGL
+}
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
index 0609232058..4d85c19277 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-arabic.c
@@ -1009,7 +1009,7 @@ static HB_Bool arabicSyriacOpenTypeShape(HB_ShaperItem *item, HB_Bool *ot_ok)
++l;
++properties;
}
- if (f + l < item->stringLength) {
+ if (f + l + item->item.pos < item->stringLength) {
++l;
}
getArabicProperties(uc+f, l, props);
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index c932ec2cd0..356dc01099 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -2059,15 +2059,17 @@ static void Free_BaseArray( HB_BaseArray* ba,
HB_BaseRecord *br;
HB_Anchor *bans;
- HB_UNUSED(num_classes);
-
if ( ba->BaseRecord )
{
br = ba->BaseRecord;
if ( ba->BaseCount )
{
+ HB_UShort i, count;
+ count = num_classes * ba->BaseCount;
bans = br[0].BaseAnchor;
+ for (i = 0; i < count; i++)
+ Free_Anchor (&bans[i]);
FREE( bans );
}
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
index 533a063696..2bda3868c6 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-hebrew.c
@@ -56,6 +56,8 @@ HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item)
assert(shaper_item->item.script == HB_Script_Hebrew);
+ HB_HeuristicSetGlyphAttributes(shaper_item);
+
#ifndef NO_OPENTYPE
if (HB_SelectScript(shaper_item, hebrew_features)) {
@@ -64,7 +66,6 @@ HB_Bool HB_HebrewShape(HB_ShaperItem *shaper_item)
return FALSE;
- HB_HeuristicSetGlyphAttributes(shaper_item);
HB_OpenTypeShape(shaper_item, /*properties*/0);
return HB_OpenTypePosition(shaper_item, availableGlyphs, /*doLogClusters*/TRUE);
}
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
index 7104d2af2c..48f4f908a8 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-indic.cpp
@@ -419,7 +419,7 @@ static const unsigned char indicForms[0xe00-0x900] = {
Matra, Halant, Invalid, Invalid,
Invalid, Invalid, Invalid, Invalid,
- Invalid, Invalid, Invalid, LengthMark,
+ Invalid, Invalid, Invalid, Matra,
Invalid, Invalid, Invalid, Invalid,
Invalid, Invalid, Invalid, Invalid,
@@ -1050,62 +1050,59 @@ static const IndicOrdering * const indic_order[] = {
// vowel matras that have to be split into two parts.
static const unsigned short split_matras[] = {
- // matra, split1, split2
+ // matra, split1, split2, split3
// bengalis
- 0x9cb, 0x9c7, 0x9be,
- 0x9cc, 0x9c7, 0x9d7,
+ 0x9cb, 0x9c7, 0x9be, 0x0,
+ 0x9cc, 0x9c7, 0x9d7, 0x0,
// oriya
- 0xb48, 0xb47, 0xb56,
- 0xb4b, 0xb47, 0xb3e,
- 0xb4c, 0xb47, 0xb57,
+ 0xb48, 0xb47, 0xb56, 0x0,
+ 0xb4b, 0xb47, 0xb3e, 0x0,
+ 0xb4c, 0xb47, 0xb57, 0x0,
// tamil
- 0xbca, 0xbc6, 0xbbe,
- 0xbcb, 0xbc7, 0xbbe,
- 0xbcc, 0xbc6, 0xbd7,
+ 0xbca, 0xbc6, 0xbbe, 0x0,
+ 0xbcb, 0xbc7, 0xbbe, 0x0,
+ 0xbcc, 0xbc6, 0xbd7, 0x0,
// telugu
- 0xc48, 0xc46, 0xc56,
+ 0xc48, 0xc46, 0xc56, 0x0,
// kannada
- 0xcc0, 0xcbf, 0xcd5,
- 0xcc7, 0xcc6, 0xcd5,
- 0xcc8, 0xcc6, 0xcd6,
- 0xcca, 0xcc6, 0xcc2,
- 0xccb, 0xcca, 0xcd5,
+ 0xcc0, 0xcbf, 0xcd5, 0x0,
+ 0xcc7, 0xcc6, 0xcd5, 0x0,
+ 0xcc8, 0xcc6, 0xcd6, 0x0,
+ 0xcca, 0xcc6, 0xcc2, 0x0,
+ 0xccb, 0xcc6, 0xcc2, 0xcd5,
// malayalam
- 0xd4a, 0xd46, 0xd3e,
- 0xd4b, 0xd47, 0xd3e,
- 0xd4c, 0xd46, 0xd57,
+ 0xd4a, 0xd46, 0xd3e, 0x0,
+ 0xd4b, 0xd47, 0xd3e, 0x0,
+ 0xd4c, 0xd46, 0xd57, 0x0,
// sinhala
- 0xdda, 0xdd9, 0xdca,
- 0xddc, 0xdd9, 0xdcf,
- 0xddd, 0xddc, 0xdca,
- 0xdde, 0xdd9, 0xddf,
+ 0xdda, 0xdd9, 0xdca, 0x0,
+ 0xddc, 0xdd9, 0xdcf, 0x0,
+ 0xddd, 0xdd9, 0xdcf, 0xdca,
+ 0xdde, 0xdd9, 0xddf, 0x0,
0xffff
};
-static inline void splitMatra(unsigned short *reordered, int matra, int &len, int &base)
+static inline void splitMatra(unsigned short *reordered, int matra, int &len)
{
unsigned short matra_uc = reordered[matra];
//qDebug("matra=%d, reordered[matra]=%x", matra, reordered[matra]);
const unsigned short *split = split_matras;
while (split[0] < matra_uc)
- split += 3;
+ split += 4;
assert(*split == matra_uc);
++split;
- if (indic_position(*split) == Pre) {
- reordered[matra] = split[1];
- memmove(reordered + 1, reordered, len*sizeof(unsigned short));
- reordered[0] = split[0];
- base++;
- } else {
- memmove(reordered + matra + 1, reordered + matra, (len-matra)*sizeof(unsigned short));
- reordered[matra] = split[0];
- reordered[matra+1] = split[1];
- }
- len++;
+ int added_chars = split[2] == 0x0 ? 1 : 2;
+
+ memmove(reordered + matra + added_chars, reordered + matra, (len-matra)*sizeof(unsigned short));
+ reordered[matra] = split[0];
+ reordered[matra+1] = split[1];
+ if(added_chars == 2)
+ reordered[matra+2] = split[2];
+ len += added_chars;
}
#ifndef NO_OPENTYPE
@@ -1130,12 +1127,23 @@ static const HB_OpenTypeFeature indic_features[] = {
// #define INDIC_DEBUG
#ifdef INDIC_DEBUG
-#define IDEBUG qDebug
+#define IDEBUG hb_debug
+#include <stdarg.h>
+
+static void hb_debug(const char *msg, ...)
+{
+ va_list ap;
+ va_start(ap, msg); // use variable arg list
+ vfprintf(stderr, msg, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
#else
#define IDEBUG if(0) printf
#endif
-#ifdef INDIC_DEBUG
+#if 0 //def INDIC_DEBUG
static QString propertiesToString(int properties)
{
QString res;
@@ -1386,12 +1394,12 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
// to be at the beginning of the syllable, so we just move
// them there now.
if (matra_position == Split) {
- splitMatra(uc, matra, len, base);
+ splitMatra(uc, matra, len);
// Handle three-part matras (0xccb in Kannada)
matra_position = indic_position(uc[matra]);
- if (matra_position == Split)
- splitMatra(uc, matra, len, base);
- } else if (matra_position == Pre) {
+ }
+
+ if (matra_position == Pre) {
unsigned short m = uc[matra];
while (matra--)
uc[matra+1] = uc[matra];
@@ -1609,11 +1617,11 @@ static bool indic_shape_syllable(HB_Bool openType, HB_ShaperItem *item, bool inv
// halant always applies
#ifdef INDIC_DEBUG
- {
- IDEBUG("OT properties:");
- for (int i = 0; i < len; ++i)
- qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data());
- }
+// {
+// IDEBUG("OT properties:");
+// for (int i = 0; i < len; ++i)
+// qDebug(" i: %s", ::propertiesToString(properties[i]).toLatin1().data());
+// }
#endif
// initialize
@@ -1731,6 +1739,11 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int
if (script == HB_Script_Bengali && pos == 1 &&
(uc[0] == 0x0985 || uc[0] == 0x098f))
break;
+ // Sinhala uses the Halant as a component of certain matras. Allow these, but keep the state on Matra.
+ if (script == HB_Script_Sinhala && state == Matra) {
+ ++pos;
+ continue;
+ }
goto finish;
case Nukta:
if (state == Consonant)
@@ -1741,12 +1754,16 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int
break;
// fall through
case VowelMark:
- if (state == Matra || state == IndependentVowel)
+ if (state == Matra || state == LengthMark || state == IndependentVowel)
break;
// fall through
case Matra:
if (state == Consonant || state == Nukta)
break;
+ if (state == Matra) {
+ // ### needs proper testing for correct two/three part matras
+ break;
+ }
// ### not sure if this is correct. If it is, does it apply only to Bengali or should
// it work for all Indic languages?
// the combination Independent_A + Vowel Sign AA is allowed.
@@ -1762,6 +1779,10 @@ static int indic_nextSyllableBoundary(HB_Script script, const HB_UChar16 *s, int
goto finish;
case LengthMark:
+ if (state == Matra) {
+ // ### needs proper testing for correct two/three part matras
+ break;
+ }
case IndependentVowel:
case Invalid:
case Other:
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
index cde5465384..0fe1e4ddb3 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c
@@ -1114,6 +1114,8 @@ _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd )
if ( ALLOC_ARRAY( cd->cd.cd1.ClassValueArray, 1, HB_UShort ) )
return error;
+ cd->loaded = TRUE;
+
return HB_Err_Ok;
}
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shape.h b/src/3rdparty/harfbuzz/src/harfbuzz-shape.h
index 4f714a3a91..e4b5f9ad8a 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shape.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shape.h
@@ -161,7 +161,7 @@ typedef enum {
/*
* Buffer for output
*/
-typedef struct _HB_GlyphBufer HB_GlyphBuffer;
+typedef struct _HB_GlyphBuffer HB_GlyphBuffer;
struct _HB_GlyphBuffer {
int glyph_item_size;
int total_glyphs;
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
index e8f551304d..d2357f4301 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
@@ -242,27 +242,30 @@ typedef struct HB_Font_ {
void *userData;
} HB_FontRec;
-typedef struct {
- const HB_UChar16 *string;
- hb_uint32 stringLength;
- HB_ScriptItem item;
- HB_Font font;
- HB_Face face;
- int shaperFlags; /* HB_ShaperFlags */
-
- HB_Bool glyphIndicesPresent; /* set to true if the glyph indicies are already setup in the glyphs array */
- hb_uint32 initialGlyphCount;
-
- hb_uint32 num_glyphs; /* in: available glyphs out: glyphs used/needed */
- HB_Glyph *glyphs; /* out parameter */
- HB_GlyphAttributes *attributes; /* out */
- HB_Fixed *advances; /* out */
- HB_FixedPoint *offsets; /* out */
- unsigned short *log_clusters; /* out */
+typedef struct HB_ShaperItem_ HB_ShaperItem;
+
+struct HB_ShaperItem_ {
+ const HB_UChar16 *string; /* input: the Unicode UTF16 text to be shaped */
+ hb_uint32 stringLength; /* input: the length of the input in 16-bit words */
+ HB_ScriptItem item; /* input: the current run to be shaped: a run of text all in the same script that is a substring of <string> */
+ HB_Font font; /* input: the font: scale, units and function pointers supplying glyph indices and metrics */
+ HB_Face face; /* input: the shaper state; current script, access to the OpenType tables , etc. */
+ int shaperFlags; /* input (unused) should be set to 0; intended to support flags defined in HB_ShaperFlag */
+ HB_Bool glyphIndicesPresent; /* input: true if the <glyphs> array contains glyph indices ready to be shaped */
+ hb_uint32 initialGlyphCount; /* input: if glyphIndicesPresent is true, the number of glyph indices in the <glyphs> array */
+
+ hb_uint32 num_glyphs; /* input: capacity of output arrays <glyphs>, <attributes>, <advances>, <offsets>, and <log_clusters>; */
+ /* output: required capacity (may be larger than actual capacity) */
+
+ HB_Glyph *glyphs; /* output: <num_glyphs> indices of shaped glyphs */
+ HB_GlyphAttributes *attributes; /* output: <num_glyphs> glyph attributes */
+ HB_Fixed *advances; /* output: <num_glyphs> advances */
+ HB_FixedPoint *offsets; /* output: <num_glyphs> offsets */
+ unsigned short *log_clusters; /* output: for each output glyph, the index in the input of the start of its logical cluster */
/* internal */
- HB_Bool kerning_applied; /* out: kerning applied by shaper */
-} HB_ShaperItem;
+ HB_Bool kerning_applied; /* output: true if kerning was applied by the shaper */
+};
HB_Bool HB_ShapeItem(HB_ShaperItem *item);
diff --git a/src/3rdparty/harfbuzz/tests/shaping/main.cpp b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
index 1a3ef4f705..a7ea417470 100644
--- a/src/3rdparty/harfbuzz/tests/shaping/main.cpp
+++ b/src/3rdparty/harfbuzz/tests/shaping/main.cpp
@@ -178,7 +178,7 @@ private slots:
void telugu();
void kannada();
void malayalam();
- // sinhala missing
+ void sinhala();
void khmer();
void linearB();
@@ -510,6 +510,11 @@ void tst_QScriptEngine::bengali()
{ 0x151, 0x276, 0x172, 0x143, 0x0 } },
{ { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
{ 0x151, 0x276, 0x172, 0x144, 0x0 } },
+ // test decomposed two parts matras
+ { { 0x995, 0x9c7, 0x9be, 0x0 },
+ { 0x179, 0x151, 0x172, 0x0 } },
+ { { 0x995, 0x9c7, 0x9d7, 0x0 },
+ { 0x179, 0x151, 0x17e, 0x0 } },
{ {0}, {0} }
};
@@ -638,15 +643,15 @@ void tst_QScriptEngine::bengali()
if (face) {
const ShapeTable shape_table [] = {
{ { 0x09a8, 0x09cd, 0x09af, 0x0 },
- { 0x0192, 0x0 } },
+ { 0x01ca, 0x0 } },
{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
- { 0x01d6, 0x0 } },
+ { 0x020e, 0x0 } },
{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
- { 0x01bc, 0x0 } },
+ { 0x01f4, 0x0 } },
{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
- { 0x01c6, 0x0 } },
+ { 0x01fe, 0x0 } },
{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
- { 0xd3, 0x12f, 0x0 } },
+ { 0x10b, 0x167, 0x0 } },
{ {0}, {0} }
};
@@ -823,8 +828,9 @@ void tst_QScriptEngine::telugu()
{ 0xe6, 0xb3, 0x83, 0x0 } },
{ { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
{ 0xe6, 0xb3, 0x9f, 0x0 } },
- { {0}, {0} }
-
+ { { 0xc15, 0xc46, 0xc56, 0x0 },
+ { 0xe6, 0xb3, 0x0 } },
+ { {0}, {0} }
};
const ShapeTable *s = shape_table;
@@ -867,7 +873,6 @@ void tst_QScriptEngine::kannada()
{ 0x0036, 0x00c1, 0x0 } },
{ { 0x0cb0, 0x0ccd, 0x200d, 0x0c95, 0x0 },
{ 0x0050, 0x00a7, 0x0 } },
-
{ {0}, {0} }
};
@@ -891,6 +896,17 @@ void tst_QScriptEngine::kannada()
{ 0x00b0, 0x006c, 0x0 } },
{ { 0x0cb7, 0x0ccd, 0x0 },
{ 0x0163, 0x0 } },
+ { { 0xc95, 0xcbf, 0xcd5, 0x0 },
+ { 0x114, 0x73, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcd5, 0x0 },
+ { 0x90, 0x6c, 0x73, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcd6, 0x0 },
+ { 0x90, 0x6c, 0x74, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcc2, 0x0 },
+ { 0x90, 0x6c, 0x69, 0x0 } },
+ { { 0xc95, 0xcca, 0xcd5, 0x0 },
+ { 0x90, 0x6c, 0x69, 0x73, 0x0 } },
+
{ {0}, {0} }
};
@@ -943,7 +959,14 @@ void tst_QScriptEngine::malayalam()
{ 0x009e, 0x0 } },
{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
{ 0x009e, 0x0 } },
-
+ { { 0xd15, 0xd46, 0xd3e, 0x0 },
+ { 0x5e, 0x34, 0x58, 0x0 } },
+ { { 0xd15, 0xd47, 0xd3e, 0x0 },
+ { 0x5f, 0x34, 0x58, 0x0 } },
+ { { 0xd15, 0xd46, 0xd57, 0x0 },
+ { 0x5e, 0x34, 0x65, 0x0 } },
+ { { 0xd15, 0xd57, 0x0 },
+ { 0x34, 0x65, 0x0 } },
{ {0}, {0} }
};
@@ -962,6 +985,39 @@ void tst_QScriptEngine::malayalam()
}
}
+void tst_QScriptEngine::sinhala()
+{
+ {
+ FT_Face face = loadFace("FM-MalithiUW46.ttf");
+ if (face) {
+ const ShapeTable shape_table [] = {
+ { { 0xd9a, 0xdd9, 0xdcf, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x0 } },
+ { { 0xd9a, 0xdd9, 0xddf, 0x0 },
+ { 0x4a, 0x61, 0x50, 0x0 } },
+ { { 0xd9a, 0xdd9, 0xdca, 0x0 },
+ { 0x4a, 0x62, 0x0 } },
+ { { 0xd9a, 0xddc, 0xdca, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+ { { 0xd9a, 0xdda, 0x0 },
+ { 0x4a, 0x62, 0x0 } },
+ { { 0xd9a, 0xddd, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+ { {0}, {0} }
+ };
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(face, s, HB_Script_Sinhala) );
+ ++s;
+ }
+
+ FT_Done_Face(face);
+ } else {
+ QSKIP("couln't find FM-MalithiUW46.ttf", SkipAll);
+ }
+ }
+}
void tst_QScriptEngine::khmer()
diff --git a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp
index 04124bd32c..83cf5d0892 100755
--- a/src/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp
+++ b/src/3rdparty/webkit/WebCore/accessibility/AccessibilityAllInOne.cpp
@@ -1,44 +1,44 @@
-/*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
-
-#include <AccessibilityARIAGrid.cpp>
-#include <AccessibilityARIAGridCell.cpp>
-#include <AccessibilityARIAGridRow.cpp>
-#include <AccessibilityImageMapLink.cpp>
-#include <AccessibilityList.cpp>
-#include <AccessibilityListBox.cpp>
-#include <AccessibilityListBoxOption.cpp>
-#include <AccessibilityMediaControls.cpp>
-#include <AccessibilityObject.cpp>
-#include <AccessibilityRenderObject.cpp>
-#include <AccessibilitySlider.cpp>
-#include <AccessibilityTable.cpp>
-#include <AccessibilityTableCell.cpp>
-#include <AccessibilityTableColumn.cpp>
-#include <AccessibilityTableHeaderContainer.cpp>
-#include <AccessibilityTableRow.cpp>
-#include <AXObjectCache.cpp>
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
+
+#include <AccessibilityARIAGrid.cpp>
+#include <AccessibilityARIAGridCell.cpp>
+#include <AccessibilityARIAGridRow.cpp>
+#include <AccessibilityImageMapLink.cpp>
+#include <AccessibilityList.cpp>
+#include <AccessibilityListBox.cpp>
+#include <AccessibilityListBoxOption.cpp>
+#include <AccessibilityMediaControls.cpp>
+#include <AccessibilityObject.cpp>
+#include <AccessibilityRenderObject.cpp>
+#include <AccessibilitySlider.cpp>
+#include <AccessibilityTable.cpp>
+#include <AccessibilityTableCell.cpp>
+#include <AccessibilityTableColumn.cpp>
+#include <AccessibilityTableHeaderContainer.cpp>
+#include <AccessibilityTableRow.cpp>
+#include <AXObjectCache.cpp>
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
index 0e540e5746..b8734cd751 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/qwebframe.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qwebframe.cpp
RESOURCES += qwebframe.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/resources\\\"
symbian {
TARGET.UID3 = 0xA000E53D
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 5445ce8691..d304d3ef80 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -38,6 +38,10 @@
#endif
#include "../util.h"
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
//TESTED_CLASS=
//TESTED_FILES=
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
index 6b28efd93c..7853b28767 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/qwebpage.pro
@@ -5,7 +5,7 @@ SOURCES += tst_qwebpage.cpp
RESOURCES += tst_qwebpage.qrc
QT += testlib network
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
+!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
symbian {
TARGET.UID3 = 0xA000E53E
diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 0cf85eefee..8373e045b8 100644
--- a/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -37,6 +37,10 @@
#include <QPushButton>
#include <QDir>
+#if defined(Q_OS_SYMBIAN)
+# define SRCDIR ""
+#endif
+
// Will try to wait for the condition while allowing event processing
#define QTRY_COMPARE(__expr, __expected) \
do { \
diff --git a/src/corelib/arch/qatomic_symbian.h b/src/corelib/arch/qatomic_symbian.h
index 5880120871..3721acab30 100644
--- a/src/corelib/arch/qatomic_symbian.h
+++ b/src/corelib/arch/qatomic_symbian.h
@@ -42,8 +42,6 @@
#ifndef QATOMIC_SYMBIAN_H
#define QATOMIC_SYMBIAN_H
-QT_BEGIN_HEADER
-
#if defined(Q_CC_RVCT)
# define QT_NO_ARM_EABI
# include <QtCore/qatomic_arm.h>
@@ -51,6 +49,16 @@ QT_BEGIN_HEADER
# include <QtCore/qatomic_generic.h>
#endif
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Core)
+
+// Empty, but needed to avoid warnings
+
+QT_END_NAMESPACE
+
QT_END_HEADER
#endif // QATOMIC_SYMBIAN_H
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 33c6a34f12..5578091936 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -960,7 +960,7 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Turns the major, minor and patch numbers of a version into an
- integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
+ integer, 0xMMNNPP (MM = major, NN = minor, PP = patch). This can
be compared with another similarly processed version id.
\sa QT_VERSION
@@ -1795,7 +1795,7 @@ QSysInfo::S60Version QSysInfo::s60Version()
TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents);
if (err == KErrNone) {
err = contents->Sort(EDescending|ESortByName);
- if (err == KErrNone) {
+ if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) {
TInt major = (*contents)[0].iName[9] - '0';
TInt minor = (*contents)[0].iName[11] - '0';
if (major == 3) {
@@ -1808,6 +1808,12 @@ QSysInfo::S60Version QSysInfo::s60Version()
if (minor == 0) {
return cachedS60Version = SV_S60_5_0;
}
+ else if (minor == 1) {
+ return cachedS60Version = SV_S60_5_1;
+ }
+ else if (minor == 2) {
+ return cachedS60Version = SV_S60_5_2;
+ }
}
}
delete contents;
@@ -1822,12 +1828,10 @@ QSysInfo::S60Version QSysInfo::s60Version()
return cachedS60Version = SV_S60_3_2;
# elif defined(__S60_50__)
return cachedS60Version = SV_S60_5_0;
-# else
- return cachedS60Version = SV_S60_Unknown;
# endif
-# else
- return cachedS60Version = SV_S60_Unknown;
# endif
+ //If reaching here, it was not possible to determine the version
+ return cachedS60Version = SV_S60_Unknown;
}
QSysInfo::SymbianVersion QSysInfo::symbianVersion()
{
@@ -1838,6 +1842,10 @@ QSysInfo::SymbianVersion QSysInfo::symbianVersion()
return SV_9_3;
case SV_S60_5_0:
return SV_9_4;
+ case SV_S60_5_1:
+ return SV_9_4;
+ case SV_S60_5_2:
+ return SV_9_4;
default:
return SV_Unknown;
}
@@ -2572,7 +2580,7 @@ void qsrand()
seed = GetTickCount();
srand(seed);
-#else
+#else
// Symbian?
#endif // defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD) && !defined(Q_OS_SYMBIAN)
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1dbdc6d971..d113e021a5 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1486,17 +1486,26 @@ public:
#ifdef Q_OS_SYMBIAN
enum SymbianVersion {
SV_Unknown = 0x0000,
+ //These are the Symbian Ltd versions 9.2-9.4
SV_9_2 = 10,
SV_9_3 = 20,
- SV_9_4 = 30
+ SV_9_4 = 30,
+ //Following values are the symbian foundation versions, i.e. Symbian^1 == SV_SF_1
+ SV_SF_1 = SV_9_4,
+ SV_SF_2 = 40,
+ SV_SF_3 = 50,
+ SV_SF_4 = 60
};
static SymbianVersion symbianVersion();
enum S60Version {
SV_S60_None = 0,
SV_S60_Unknown = 1,
- SV_S60_3_1 = 10,
- SV_S60_3_2 = 20,
- SV_S60_5_0 = 30
+ SV_S60_3_1 = SV_9_2,
+ SV_S60_3_2 = SV_9_3,
+ SV_S60_5_0 = SV_9_4,
+ //versions beyond 5.0 are to be confirmed - it is better to use symbian version
+ SV_S60_5_1 = SV_SF_2,
+ SV_S60_5_2 = SV_SF_3
};
static S60Version s60Version();
#endif
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index b198276fa3..0ee9cd2923 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -1715,14 +1715,12 @@ public:
LastGestureType = ~0u
};
- enum GestureContext
+ enum GestureFlag
{
- WidgetGesture = 0,
- WidgetWithChildrenGesture = 3,
-
- ItemGesture = WidgetGesture,
- ItemWithChildrenGesture = WidgetWithChildrenGesture
+ DontStartGestureOnChildren = 0x01,
+ ReceivePartialGestures = 0x02
};
+ Q_DECLARE_FLAGS(GestureFlags, GestureFlag)
enum NavigationMode
{
@@ -1752,6 +1750,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::MatchFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TextInteractionFlags)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::InputMethodHints)
Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::TouchPointStates)
+Q_DECLARE_OPERATORS_FOR_FLAGS(Qt::GestureFlags)
typedef bool (*qInternalCallback)(void **);
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index c6f32d25c0..5ac3675a93 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -2910,34 +2910,36 @@
\value PanGesture A Pan gesture.
\value PinchGesture A Pinch gesture.
\value SwipeGesture A Swipe gesture.
- \value CustomGesture User-defined gesture ID.
- \value LastGestureType Last user gesture ID.
+ \value CustomGesture A flag that can be used to test if the gesture is a
+ user-defined gesture ID.
+ \omitvalue LastGestureType
User-defined gestures are registered with the
- QApplication::registerGestureRecognizer() function which generates a custom gesture ID
- in the range of values from CustomGesture to LastGestureType.
+ QGestureRecognizer::registerRecognizer() function which generates a custom
+ gesture ID with the Qt::CustomGesture flag set.
- \sa QGesture, QWidget::grabGesture()
+ \sa QGesture, QWidget::grabGesture(), QGraphicsObject::grabGesture()
*/
/*!
- \enum Qt::GestureContext
+ \enum Qt::GestureFlag
\since 4.6
- This enum type describes the context of a gesture.
+ This enum type describes additional flags that can be used when subscribing
+ to a gesture.
- For a QGesture to trigger, the gesture recognizer should filter events for
- a widget tree. This enum describes for which widget the gesture recognizer
- should filter events:
+ \value DontStartGestureOnChildren By default gestures can start on the
+ widget or over any of its children. Use this flag to disable this and allow
+ a gesture to start on the widget only.
- \value WidgetGesture Gestures can only start over the widget itself.
- \value WidgetWithChildrenGesture Gestures can start on the widget or over
- any of its children.
- \value ItemGesture Gestures can only start over the item itself.
- \value ItemWithChildrenGesture Gestures can start on the item or over
- any of its children.
+ \value ReceivePartialGestures Allows any ignored gesture events to be
+ propagated to parent widgets which have specified this hint. By default
+ only gestures that are in the Qt::GestureStarted state are propagated and
+ the widget always gets the full gesture sequence starting with a gesture in
+ the Qt::GestureStarted state and ending with a gesture in the
+ Qt::GestureFinished or Qt::GestureCanceled states.
- \sa QWidget::grabGesture()
+ \sa QWidget::grabGesture(), QGraphicsObject::grabGesture()
*/
/*!
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index c6b4a7755e..6bc6b76a23 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -3187,7 +3187,17 @@ void QFileDialogTreeView::keyPressEvent(QKeyEvent *e)
if (!d_ptr->itemViewKeyboardEvent(e)) {
QTreeView::keyPressEvent(e);
}
+#ifdef QT_KEYPAD_NAVIGATION
+ else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
+ || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional)
+ && !hasEditFocus()) {
+ e->ignore();
+ } else {
+ e->accept();
+ }
+#else
e->accept();
+#endif
}
QSize QFileDialogTreeView::sizeHint() const
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index d9bec27794..4af5688d5b 100644
--- a/src/gui/dialogs/qfiledialog_mac.mm
+++ b/src/gui/dialogs/qfiledialog_mac.mm
@@ -399,9 +399,13 @@ QT_USE_NAMESPACE
- (void)panelSelectionDidChange:(id)sender
{
Q_UNUSED(sender);
- *mCurrentSelection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
- if (mPriv)
- mPriv->QNSOpenSavePanelDelegate_selectionChanged(*mCurrentSelection);
+ if (mPriv) {
+ QString selection = QT_PREPEND_NAMESPACE(qt_mac_NSStringToQString([mSavePanel filename]));
+ if (selection != mCurrentSelection) {
+ *mCurrentSelection = selection;
+ mPriv->QNSOpenSavePanelDelegate_selectionChanged(selection);
+ }
+ }
}
- (void)openPanelDidEnd:(NSOpenPanel *)panel returnCode:(int)returnCode contextInfo:(void *)contextInfo
diff --git a/src/gui/egl/egl.pri b/src/gui/egl/egl.pri
index 627d511154..669d311d97 100644
--- a/src/gui/egl/egl.pri
+++ b/src/gui/egl/egl.pri
@@ -1,3 +1,5 @@
+CONFIG += egl
+
HEADERS += \
egl/qegl_p.h \
egl/qeglproperties_p.h
@@ -19,11 +21,3 @@ unix {
}
}
}
-
-for(p, QMAKE_LIBDIR_EGL) {
- exists($$p):LIBS_PRIVATE += -L$$p
-}
-
-!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
-!isEmpty(QMAKE_LIBS_EGL): LIBS_PRIVATE += $$QMAKE_LIBS_EGL
-!isEmpty(QMAKE_LFLAGS_EGL): LIBS += $$QMAKE_LFLAGS_EGL
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index d70b03954f..2fd499dc90 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7343,19 +7343,32 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
}
/*!
- Subscribes the graphics object to the given \a gesture for the specified \a context.
+ Subscribes the graphics object to the given \a gesture with specific \a flags.
- \sa QGestureEvent
+ \sa ungrabGesture(), QGestureEvent
*/
-
-void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureContext context)
+void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)
{
QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
- d->gestureContext.insert(gesture, context);
+ d->gestureContext.insert(gesture, flags);
(void)QGestureManager::instance(); // create a gesture manager
}
/*!
+ Unsubscribes the graphics object from the given \a gesture.
+
+ \sa grabGesture(), QGestureEvent
+*/
+void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
+{
+ QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
+ if (d->gestureContext.remove(gesture)) {
+ QGestureManager *manager = QGestureManager::instance();
+ manager->cleanupCachedGestures(this, gesture);
+ }
+}
+
+/*!
\property QGraphicsObject::parent
\brief the parent of the item
diff --git a/src/gui/graphicsview/qgraphicsitem.h b/src/gui/graphicsview/qgraphicsitem.h
index f3fe99c18b..f091e34a6a 100644
--- a/src/gui/graphicsview/qgraphicsitem.h
+++ b/src/gui/graphicsview/qgraphicsitem.h
@@ -555,7 +555,8 @@ public:
using QObject::children;
#endif
- void grabGesture(Qt::GestureType type, Qt::GestureContext context = Qt::ItemWithChildrenGesture);
+ void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
+ void ungrabGesture(Qt::GestureType type);
Q_SIGNALS:
void parentChanged();
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index ca56c18b39..51d2ffd005 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -453,7 +453,7 @@ public:
QGraphicsItem *focusScopeItem;
Qt::InputMethodHints imHints;
QGraphicsItem::PanelModality panelModality;
- QMap<Qt::GestureType, Qt::GestureContext> gestureContext;
+ QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
// Packed 32 bits
quint32 acceptedMouseButtons : 5;
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index f982f4beb5..dc036f84c8 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -1064,9 +1064,8 @@ bool QGraphicsScenePrivate::filterEvent(QGraphicsItem *item, QEvent *event)
bool QGraphicsScenePrivate::sendEvent(QGraphicsItem *item, QEvent *event)
{
if (QGraphicsObject *object = item->toGraphicsObject()) {
- QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- if (qAppPriv->gestureManager) {
- if (qAppPriv->gestureManager->filterEvent(object, event))
+ if (qt_gestureManager) {
+ if (qt_gestureManager->filterEvent(object, event))
return true;
}
}
@@ -5765,7 +5764,7 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
QWidget *viewport = event->widget();
if (!viewport)
return;
- QList<QGesture *> allGestures = event->allGestures();
+ QList<QGesture *> allGestures = event->gestures();
DEBUG() << "QGraphicsScenePrivate::gestureEventHandler:"
<< "Delivering gestures:" << allGestures;
@@ -5904,7 +5903,12 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
QGraphicsItemPrivate *gid = item->QGraphicsItem::d_func();
foreach(QGesture *g, alreadyIgnoredGestures) {
- if (gid->gestureContext.contains(g->gestureType()))
+ QMap<Qt::GestureType, Qt::GestureFlags>::iterator contextit =
+ gid->gestureContext.find(g->gestureType());
+ bool deliver = contextit != gid->gestureContext.end() &&
+ (g->state() == Qt::GestureStarted ||
+ (contextit.value() & Qt::ReceivePartialGestures));
+ if (deliver)
gestures += g;
}
if (gestures.isEmpty())
@@ -5917,8 +5921,12 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
sendEvent(item, &ev);
QSet<QGesture *> ignoredGestures;
foreach (QGesture *g, gestures) {
- if (!ev.isAccepted() && !ev.isAccepted(g))
+ if (!ev.isAccepted() && !ev.isAccepted(g)) {
ignoredGestures.insert(g);
+ } else {
+ if (g->state() == Qt::GestureStarted)
+ gestureTargets[g] = item;
+ }
}
if (!ignoredGestures.isEmpty()) {
// get a list of items under the (current) hotspot of each ignored
@@ -5945,6 +5953,13 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
continue;
}
}
+ foreach (QGesture *g, startedGestures) {
+ if (g->gestureCancelPolicy() == QGesture::CancelAllInContext) {
+ DEBUG() << "lets try to cancel some";
+ // find gestures in context in Qt::GestureStarted or Qt::GestureUpdated state and cancel them
+ cancelGesturesForChildren(g, event->widget());
+ }
+ }
// forget about targets for gestures that have ended
foreach (QGesture *g, allGestures) {
@@ -5959,6 +5974,88 @@ void QGraphicsScenePrivate::gestureEventHandler(QGestureEvent *event)
}
}
+void QGraphicsScenePrivate::cancelGesturesForChildren(QGesture *original, QWidget *viewport)
+{
+ Q_ASSERT(original);
+ QGraphicsItem *originalItem = gestureTargets.value(original);
+ Q_ASSERT(originalItem);
+
+ // iterate over all active gestures and for each find the owner
+ // if the owner is part of our sub-hierarchy, cancel it.
+
+ QSet<QGesture *> canceledGestures;
+ QHash<QGesture *, QGraphicsObject *>::Iterator iter = gestureTargets.begin();
+ while (iter != gestureTargets.end()) {
+ QGraphicsObject *item = iter.value();
+ // note that we don't touch the gestures for our originalItem
+ if (item != originalItem && originalItem->isAncestorOf(item)) {
+ DEBUG() << " found a gesture to cancel" << iter.key();
+ iter.key()->d_func()->state = Qt::GestureCanceled;
+ canceledGestures << iter.key();
+ }
+ ++iter;
+ }
+
+ // sort them per target item by cherry picking from almostCanceledGestures and delivering
+ QSet<QGesture *> almostCanceledGestures = canceledGestures;
+ QSet<QGesture *>::Iterator setIter;
+ while (!almostCanceledGestures.isEmpty()) {
+ QGraphicsObject *target = 0;
+ QSet<QGesture*> gestures;
+ setIter = almostCanceledGestures.begin();
+ // sort per target item
+ while (setIter != almostCanceledGestures.end()) {
+ QGraphicsObject *item = gestureTargets.value(*setIter);
+ if (target == 0)
+ target = item;
+ if (target == item) {
+ gestures << *setIter;
+ setIter = almostCanceledGestures.erase(setIter);
+ } else {
+ ++setIter;
+ }
+ }
+ Q_ASSERT(target);
+
+ QList<QGesture *> list = gestures.toList();
+ QGestureEvent ev(list);
+ sendEvent(target, &ev);
+
+ foreach (QGesture *g, list) {
+ if (ev.isAccepted() || ev.isAccepted(g))
+ gestures.remove(g);
+ }
+
+ foreach (QGesture *g, gestures) {
+ if (!g->hasHotSpot())
+ continue;
+
+ QPoint screenPos = g->hotSpot().toPoint();
+ QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport);
+ for (int j = 0; j < items.size(); ++j) {
+ QGraphicsObject *item = items.at(j)->toGraphicsObject();
+ if (!item)
+ continue;
+ QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
+ if (d->gestureContext.contains(g->gestureType())) {
+ QList<QGesture *> list;
+ list << g;
+ QGestureEvent ev(list);
+ sendEvent(item, &ev);
+ if (ev.isAccepted() || ev.isAccepted(g))
+ break; // successfully delivered
+ }
+ }
+ }
+ }
+
+ Q_ASSERT(qt_gestureManager); // it would be very odd if we got called without a manager.
+ for (setIter = canceledGestures.begin(); setIter != canceledGestures.end(); ++setIter) {
+ qt_gestureManager->recycle(*setIter);
+ gestureTargets.remove(*setIter);
+ }
+}
+
QT_END_NAMESPACE
#include "moc_qgraphicsscene.cpp"
diff --git a/src/gui/graphicsview/qgraphicsscene_p.h b/src/gui/graphicsview/qgraphicsscene_p.h
index cd20fd038f..f8db08401e 100644
--- a/src/gui/graphicsview/qgraphicsscene_p.h
+++ b/src/gui/graphicsview/qgraphicsscene_p.h
@@ -288,6 +288,7 @@ public:
QMap<Qt::GestureType, QGesture *> *conflictedGestures,
QList<QList<QGraphicsObject *> > *conflictedItems,
QHash<QGesture *, QGraphicsObject *> *normalGestures);
+ void cancelGesturesForChildren(QGesture *original, QWidget *viewport);
void updateInputMethodSensitivityInViews();
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 571ef9d6ed..21ca1e366d 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -4083,7 +4083,8 @@ QImage QImage::createAlphaMask(Qt::ImageConversionFlags flags) const
}
QImage mask(d->width, d->height, Format_MonoLSB);
- dither_to_Mono(mask.d, d, flags, true);
+ if (!mask.isNull())
+ dither_to_Mono(mask.d, d, flags, true);
return mask;
}
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 7f0a504122..cd8a4d4ded 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -73,27 +73,27 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
used to lock the global bitmap heap. Only used in
S60 v3.1 and S60 v3.2.
*/
+_LIT(KFBSERVLargeBitmapAccessName,"FbsLargeBitmapAccess");
class QSymbianFbsClient
{
public:
- QSymbianFbsClient() : heapLock(0), heapLocked(false)
+ QSymbianFbsClient() : heapLocked(false)
{
- QT_TRAP_THROWING(heapLock = new(ELeave) CFbsBitmap);
- heapLock->Create(TSize(0,0), S60->screenDevice()->DisplayMode());
+ heapLock.OpenGlobal(KFBSERVLargeBitmapAccessName);
}
~QSymbianFbsClient()
{
- delete heapLock;
+ heapLock.Close();
}
bool lockHeap()
{
bool wasLocked = heapLocked;
- if (heapLock && !heapLocked) {
- heapLock->LockHeap(ETrue);
+ if (heapLock.Handle() && !heapLocked) {
+ heapLock.Wait();
heapLocked = true;
}
@@ -104,8 +104,8 @@ public:
{
bool wasLocked = heapLocked;
- if (heapLock && heapLocked) {
- heapLock->UnlockHeap(ETrue);
+ if (heapLock.Handle() && heapLocked) {
+ heapLock.Signal();
heapLocked = false;
}
@@ -115,7 +115,7 @@ public:
private:
- CFbsBitmap *heapLock;
+ RMutex heapLock;
bool heapLocked;
};
@@ -169,7 +169,7 @@ public:
inline void beginDataAccess(CFbsBitmap *bitmap)
{
- if (symbianVersion == QSysInfo::SV_9_2 || symbianVersion == QSysInfo::SV_9_3)
+ if (symbianVersion == QSysInfo::SV_9_2)
heapWasLocked = qt_symbianFbsClient()->lockHeap();
else
bitmap->LockHeap(ETrue);
@@ -177,7 +177,7 @@ public:
inline void endDataAccess(CFbsBitmap *bitmap)
{
- if (symbianVersion == QSysInfo::SV_9_2 || symbianVersion == QSysInfo::SV_9_3) {
+ if (symbianVersion == QSysInfo::SV_9_2) {
if (!heapWasLocked)
qt_symbianFbsClient()->unlockHeap();
} else {
@@ -753,7 +753,7 @@ QPixmap QPixmap::fromSymbianRSgImage(RSgImage *sgImage)
return QPixmap();
QScopedPointer<QS60PixmapData> data(new QS60PixmapData(QPixmapData::PixmapType));
- data->fromNativeType(reinterpret_cast<void*>(bitmap), QPixmapData::SgImage);
+ data->fromNativeType(reinterpret_cast<void*>(sgImage), QPixmapData::SgImage);
QPixmap pixmap(data.take());
return pixmap;
}
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 8a0120a5fe..c735031415 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1916,8 +1916,8 @@ QPixmap QX11PixmapData::transformed(const QTransform &transform,
free(dptr);
return bm;
} else { // color pixmap
- QPixmap pm;
- QX11PixmapData *x11Data = static_cast<QX11PixmapData*>(pm.data.data());
+ QX11PixmapData *x11Data = new QX11PixmapData(QPixmapData::PixmapType);
+ QPixmap pm(x11Data);
x11Data->flags &= ~QX11PixmapData::Uninitialized;
x11Data->xinfo = xinfo;
x11Data->d = d;
diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h
index 7a0509bdb7..ea5d259f06 100644
--- a/src/gui/itemviews/qabstractitemview.h
+++ b/src/gui/itemviews/qabstractitemview.h
@@ -363,6 +363,7 @@ private:
friend class QTreeViewPrivate; // needed to compile with MSVC
friend class QAccessibleItemRow;
friend class QListModeViewBase;
+ friend class QListViewPrivate; // needed to compile for Symbian emulator
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractItemView::EditTriggers)
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 1694434173..987aa26bcb 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -154,14 +154,6 @@ bool QApplicationPrivate::autoSipEnabled = false;
bool QApplicationPrivate::autoSipEnabled = true;
#endif
-QGestureManager* QGestureManager::instance()
-{
- QApplicationPrivate *d = qApp->d_func();
- if (!d->gestureManager)
- d->gestureManager = new QGestureManager(qApp);
- return d->gestureManager;
-}
-
QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::Type type)
: QCoreApplicationPrivate(argc, argv)
{
@@ -185,7 +177,7 @@ QApplicationPrivate::QApplicationPrivate(int &argc, char **argv, QApplication::T
directPainters = 0;
#endif
- gestureManager = 0;
+ gestureWidget = 0;
if (!self)
self = this;
@@ -3634,12 +3626,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
}
// walk through parents and check for gestures
- if (d->gestureManager) {
+ if (qt_gestureManager) {
if (receiver->isWidgetType()) {
- if (d->gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
+ if (qt_gestureManager->filterEvent(static_cast<QWidget *>(receiver), e))
return true;
} else if (QGesture *gesture = qobject_cast<QGesture *>(receiver)) {
- if (d->gestureManager->filterEvent(gesture, e))
+ if (qt_gestureManager->filterEvent(gesture, e))
return true;
}
}
@@ -4152,7 +4144,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
if (receiver->isWidgetType()) {
QWidget *w = static_cast<QWidget *>(receiver);
QGestureEvent *gestureEvent = static_cast<QGestureEvent *>(e);
- QList<QGesture *> allGestures = gestureEvent->allGestures();
+ QList<QGesture *> allGestures = gestureEvent->gestures();
bool eventAccepted = gestureEvent->isAccepted();
bool wasAccepted = eventAccepted;
@@ -4163,7 +4155,12 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
for (int i = 0; i < allGestures.size();) {
QGesture *g = allGestures.at(i);
Qt::GestureType type = g->gestureType();
- if (wd->gestureContext.contains(type)) {
+ QMap<Qt::GestureType, Qt::GestureFlags>::iterator contextit =
+ wd->gestureContext.find(type);
+ bool deliver = contextit != wd->gestureContext.end() &&
+ (g->state() == Qt::GestureStarted || w == receiver ||
+ (contextit.value() & Qt::ReceivePartialGestures));
+ if (deliver) {
allGestures.removeAt(i);
gestures.append(g);
} else {
@@ -5613,39 +5610,6 @@ Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window,
QApplicationPrivate::translateRawTouchEvent(window, deviceType, touchPoints);
}
-/*!
- \since 4.6
-
- Registers the given \a recognizer in the gesture framework and returns a gesture ID
- for it.
-
- The application takes ownership of the \a recognizer and returns the gesture type
- ID associated with it. For gesture recognizers which handle custom QGesture
- objects (i.e., those which return Qt::CustomGesture in a QGesture::gestureType()
- function) the return value is a gesture ID between Qt::CustomGesture and
- Qt::LastGestureType, inclusive.
-
- \sa unregisterGestureRecognizer(), QGestureRecognizer::createGesture(), QGesture
-*/
-Qt::GestureType QApplication::registerGestureRecognizer(QGestureRecognizer *recognizer)
-{
- return QGestureManager::instance()->registerGestureRecognizer(recognizer);
-}
-
-/*!
- \since 4.6
-
- Unregisters all gesture recognizers of the specified \a type.
-
- \sa registerGestureRecognizer()
-*/
-void QApplication::unregisterGestureRecognizer(Qt::GestureType type)
-{
- QApplicationPrivate *d = qApp->d_func();
- if (d->gestureManager)
- d->gestureManager->unregisterGestureRecognizer(type);
-}
-
QT_END_NAMESPACE
#include "moc_qapplication.cpp"
diff --git a/src/gui/kernel/qapplication.h b/src/gui/kernel/qapplication.h
index 5877ba45ce..e8c1281591 100644
--- a/src/gui/kernel/qapplication.h
+++ b/src/gui/kernel/qapplication.h
@@ -86,7 +86,6 @@ class QSymbianEvent;
class QApplication;
class QApplicationPrivate;
-class QGestureRecognizer;
#if defined(qApp)
#undef qApp
#endif
@@ -288,9 +287,6 @@ public:
static Qt::NavigationMode navigationMode();
#endif
- static Qt::GestureType registerGestureRecognizer(QGestureRecognizer *recognizer);
- static void unregisterGestureRecognizer(Qt::GestureType type);
-
Q_SIGNALS:
void lastWindowClosed();
void focusChanged(QWidget *old, QWidget *now);
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 0fa726972a..8df4d081ff 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -84,7 +84,6 @@ class QInputContext;
class QObject;
class QWidget;
class QSocketNotifier;
-class QGestureManager;
extern bool qt_is_gui_used;
#ifndef QT_NO_CLIPBOARD
@@ -510,7 +509,7 @@ public:
void sendSyntheticEnterLeave(QWidget *widget);
#endif
- QGestureManager *gestureManager;
+ QWidget *gestureWidget;
QMap<int, QWidget *> widgetForTouchPointId;
QMap<int, QTouchEvent::TouchPoint> appCurrentTouchPoints;
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 30bf99a4f3..1b0659a186 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -836,7 +836,7 @@ void QSymbianControl::Draw(const TRect& controlRect) const
if (qwidget->d_func()->isOpaque)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
- }
+ }
} else {
surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
}
@@ -910,9 +910,9 @@ void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
CEikStatusPane* statusPane = S60->statusPane();
CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
- if (statusPane && (statusPane->IsVisible() == isFullscreen))
+ if (statusPane && (bool)statusPane->IsVisible() == isFullscreen)
statusPane->MakeVisible(!isFullscreen);
- if (buttonGroup && (buttonGroup->IsVisible() == isFullscreen))
+ if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen)
buttonGroup->MakeVisible(!isFullscreen);
#endif
} else if (QApplication::activeWindow() == qwidget->window()) {
@@ -925,6 +925,12 @@ void QSymbianControl::HandleResourceChange(int resourceType)
{
switch (resourceType) {
case KInternalStatusPaneChange:
+ if (qwidget->isFullScreen()) {
+ SetExtentToWholeScreen();
+ } else if (qwidget->isMaximized()) {
+ TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
+ SetExtent(r.iTl, r.Size());
+ }
qwidget->d_func()->setWindowIcon_sys(true);
break;
case KUidValueCoeFontChangeEvent:
@@ -1046,8 +1052,17 @@ void qt_init(QApplicationPrivate * /* priv */, int)
// After this construction, CEikonEnv will be available from CEikonEnv::Static().
// (much like our qApp).
CEikonEnv* coe = new CEikonEnv;
- QT_TRAP_THROWING(coe->ConstructAppFromCommandLineL(factory,*commandLine));
+ //not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there.
+ if(err == KErrNone)
+ TRAP(err, coe->ConstructAppFromCommandLineL(factory,*commandLine));
delete commandLine;
+ if(err != KErrNone) {
+ qWarning() << "qt_init: Eikon application construct failed ("
+ << err
+ << "), maybe missing resource file on S60 3.1?";
+ delete coe;
+ qt_symbian_throwIfError(err);
+ }
S60->s60InstalledTrapHandler = User::SetTrapHandler(origTrapHandler);
@@ -1080,9 +1095,9 @@ void qt_init(QApplicationPrivate * /* priv */, int)
// enable focus events - used to re-enable mouse after focus changed between mouse and non mouse app,
// and for dimming behind modal windows
- S60->windowGroup().EnableFocusChangeEvents();
+ S60->windowGroup().EnableFocusChangeEvents();
- //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this)
+ //Check if mouse interaction is supported (either EMouse=1 in the HAL, or EMachineUID is one of the phones known to support this)
const TInt KMachineUidSamsungI8510 = 0x2000C51E;
// HAL::Get(HALData::EPen, TInt& result) may set 'result' to 1 on some 3.1 systems (e.g. N95).
// But we know that S60 systems below 5.0 did not support touch.
@@ -1560,7 +1575,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
}
#endif
break;
- default:
+ default:
break;
}
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index d98ecbb811..387c29b5d1 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -2499,24 +2499,24 @@ LRESULT CALLBACK QtWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam
if (qAppPriv->GetGestureInfo)
bResult = qAppPriv->GetGestureInfo((HANDLE)msg.lParam, &gi);
if (bResult) {
-// if (gi.dwID == GID_BEGIN) {
-// // find the alien widget for the gesture position.
-// // This might not be accurate as the position is the center
-// // point of two fingers for multi-finger gestures.
-// QPoint pt(gi.ptsLocation.x, gi.ptsLocation.y);
-// QWidget *w = widget->childAt(widget->mapFromGlobal(pt));
-// qAppPriv->gestureWidget = w ? w : widget;
-// }
-// if (qAppPriv->gestureWidget)
-// static_cast<QETWidget*>(qAppPriv->gestureWidget)->translateGestureEvent(msg, gi);
-// if (qAppPriv->CloseGestureInfoHandle)
-// qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam);
-// if (gi.dwID == GID_END)
-// qAppPriv->gestureWidget = 0;
-// } else {
-// DWORD dwErr = GetLastError();
-// if (dwErr > 0)
-// qWarning() << "translateGestureEvent: error = " << dwErr;
+ if (gi.dwID == GID_BEGIN) {
+ // find the alien widget for the gesture position.
+ // This might not be accurate as the position is the center
+ // point of two fingers for multi-finger gestures.
+ QPoint pt(gi.ptsLocation.x, gi.ptsLocation.y);
+ QWidget *w = widget->childAt(widget->mapFromGlobal(pt));
+ qAppPriv->gestureWidget = w ? w : widget;
+ }
+ if (qAppPriv->gestureWidget)
+ static_cast<QETWidget*>(qAppPriv->gestureWidget)->translateGestureEvent(msg, gi);
+ if (qAppPriv->CloseGestureInfoHandle)
+ qAppPriv->CloseGestureInfoHandle((HANDLE)msg.lParam);
+ if (gi.dwID == GID_END)
+ qAppPriv->gestureWidget = 0;
+ } else {
+ DWORD dwErr = GetLastError();
+ if (dwErr > 0)
+ qWarning() << "translateGestureEvent: error = " << dwErr;
}
result = true;
break;
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac.mm b/src/gui/kernel/qcocoawindowdelegate_mac.mm
index 95c89e5b5e..803a1b1c83 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac.mm
+++ b/src/gui/kernel/qcocoawindowdelegate_mac.mm
@@ -346,5 +346,28 @@ static void cleanupCocoaWindowDelegate()
m_drawerHash->remove(drawer);
}
+- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
+{
+ Q_UNUSED(menu);
+ QWidget *qwidget = m_windowHash->value(window);
+ if (qwidget && !qwidget->windowFilePath().isEmpty()) {
+ return YES;
+ }
+ return NO;
+}
+
+- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event
+ from:(NSPoint)dragImageLocation
+ withPasteboard:(NSPasteboard *)pasteboard
+{
+ Q_UNUSED(event);
+ Q_UNUSED(dragImageLocation);
+ Q_UNUSED(pasteboard);
+ QWidget *qwidget = m_windowHash->value(window);
+ if (qwidget && !qwidget->windowFilePath().isEmpty()) {
+ return YES;
+ }
+ return NO;
+}
@end
#endif// QT_MAC_USE_COCOA
diff --git a/src/gui/kernel/qcocoawindowdelegate_mac_p.h b/src/gui/kernel/qcocoawindowdelegate_mac_p.h
index a06c516720..3728002fc4 100644
--- a/src/gui/kernel/qcocoawindowdelegate_mac_p.h
+++ b/src/gui/kernel/qcocoawindowdelegate_mac_p.h
@@ -76,6 +76,8 @@ QT_FORWARD_DECLARE_CLASS(QWidgetData)
- (void)windowDidResignMain:(NSNotification*)notification;
- (void)windowDidBecomeKey:(NSNotification*)notification;
- (void)windowDidResignKey:(NSNotification*)notification;
+- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu;
+- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard;
@end
@protocol NSDrawerDelegate <NSObject>
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 55a329c8fd..bcebe06ca1 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -4202,7 +4202,7 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T
\brief The QGestureEvent class provides the description of triggered gestures.
The QGestureEvent class contains a list of gestures, which can be obtained using the
- allGestures() function.
+ gestures() function.
The gestures are either active or canceled. A list of those that are currently being
executed can be obtained using the activeGestures() function. A list of those which
@@ -4211,10 +4211,11 @@ QTouchEvent::TouchPoint &QTouchEvent::TouchPoint::operator=(const QTouchEvent::T
focus, for example, or because of a timeout, or for other reasons.
If the event handler does not accept the event by calling the generic
- QEvent::accept() function, all individual QGesture object that were not accepted
- will be propagated up the parent widget chain until a widget accepts them
- individually, by calling QGestureEvent::accept() for each of them, or an event
- filter consumes the event.
+ QEvent::accept() function, all individual QGesture object that were not
+ accepted and in the Qt::GestureStarted state will be propagated up the
+ parent widget chain until a widget accepts them individually, by calling
+ QGestureEvent::accept() for each of them, or an event filter consumes the
+ event.
\sa QGesture, QGestureRecognizer,
QWidget::grabGesture(), QGraphicsObject::grabGesture()
@@ -4240,7 +4241,7 @@ QGestureEvent::~QGestureEvent()
/*!
Returns all gestures that are delivered in the event.
*/
-QList<QGesture *> QGestureEvent::allGestures() const
+QList<QGesture *> QGestureEvent::gestures() const
{
return d_func()->gestures;
}
@@ -4344,8 +4345,9 @@ bool QGestureEvent::isAccepted(QGesture *gesture) const
Sets the accept flag of the given \a gestureType object to the specified
\a value.
- Setting the accept flag indicates that the event receiver wants the \a gesture.
- Unwanted gestures may be propagated to the parent widget.
+ Setting the accept flag indicates that the event receiver wants the gesture
+ of type \a gestureType. Unwanted gestures may be propagated to the parent
+ widget.
By default, gestures in events of type QEvent::Gesture are accepted, and
gestures in QEvent::GestureOverride events are ignored.
@@ -4417,11 +4419,16 @@ QWidget *QGestureEvent::widget() const
#ifndef QT_NO_GRAPHICSVIEW
/*!
- Returns the scene-local coordinates if the \a gesturePoint is inside a graphics view.
+ Returns the scene-local coordinates if the \a gesturePoint is inside a
+ graphics view.
+
+ This functional might be useful when the gesture event is delivered to a
+ QGraphicsObject to translate a point in screen coordinates to scene-local
+ coordinates.
\sa QPointF::isNull().
*/
-QPointF QGestureEvent::mapToScene(const QPointF &gesturePoint) const
+QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const
{
QWidget *w = widget();
if (w) // we get the viewport as widget, not the graphics view
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 141ccad03f..b9512fa78d 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -827,7 +827,7 @@ public:
QGestureEvent(const QList<QGesture *> &gestures);
~QGestureEvent();
- QList<QGesture *> allGestures() const;
+ QList<QGesture *> gestures() const;
QGesture *gesture(Qt::GestureType type) const;
QList<QGesture *> activeGestures() const;
@@ -860,7 +860,7 @@ public:
QWidget *widget() const;
#ifndef QT_NO_GRAPHICSVIEW
- QPointF mapToScene(const QPointF &gesturePoint) const;
+ QPointF mapToGraphicsScene(const QPointF &gesturePoint) const;
#endif
private:
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 850f22c6af..e322af25f3 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
Gesture objects are not constructed directly by developers. They are created by
the QGestureRecognizer object that is registered with the application; see
- QApplication::registerGestureRecognizer().
+ QGestureRecognizer::registerRecognizer().
\section1 Gesture Properties
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
destroy particular instances of them and create new ones to replace them.
The registered gesture recognizer monitors the input events for the target
- object via its \l{QGestureRecognizer::}{filterEvent()} function, updating the
+ object via its \l{QGestureRecognizer::}{recognize()} function, updating the
properties of the gesture object as required.
The gesture object may be delivered to the target object in a QGestureEvent if
@@ -90,7 +90,7 @@ QT_BEGIN_NAMESPACE
Constructs a new gesture object with the given \a parent.
QGesture objects are created by gesture recognizers in the
- QGestureRecognizer::createGesture() function.
+ QGestureRecognizer::create() function.
*/
QGesture::QGesture(QObject *parent)
: QObject(*new QGesturePrivate, parent)
@@ -129,7 +129,7 @@ QGesture::~QGesture()
\brief The point that is used to find the receiver for the gesture event.
The hot-spot is a point in the global coordinate system, use
- QWidget::mapFromGlobal() or QGestureEvent::mapToScene() to get a
+ QWidget::mapFromGlobal() or QGestureEvent::mapToGraphicsScene() to get a
local hot-spot.
The hot-spot should be set by the gesture recognizer to allow gesture event
@@ -180,8 +180,10 @@ void QGesture::unsetHotSpot()
automatically.
\value CancelNone On accepting this gesture no other gestures will be affected.
- \value CancelAllInContext On accepting this gesture all gestures that are active
- in the context (Qt::GestureContext) will be cancelled.
+
+ \value CancelAllInContext On accepting this gesture all gestures that are
+ active in the context (respecting the Qt::GestureFlag that were specified
+ when subscribed to the gesture) will be cancelled.
*/
void QGesture::setGestureCancelPolicy(GestureCancelPolicy policy)
@@ -208,16 +210,7 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const
*/
/*!
- \property QPanGesture::totalOffset
- \brief the total offset from the first input position to the current input
- position
-
- The total offset measures the total change in position of the user's input
- covered by the gesture on the input device.
-*/
-
-/*!
- \property QGesture::GestureCancelPolicy
+ \property QGesture::gestureCancelPolicy
\brief the policy for deciding what happens on accepting a gesture
On accepting one gesture Qt can automatically cancel other gestures
@@ -241,11 +234,19 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const
/*!
\property QPanGesture::offset
- \brief the offset from the previous input position to the current input
+ \brief the total offset from the first input position to the current input
position
- The offset measures the change in position of the user's input on the
- input device.
+ The offset measures the total change in position of the user's input
+ covered by the gesture on the input device.
+*/
+
+/*!
+ \property QPanGesture::delta
+ \brief the offset from the previous input position to the current input
+
+ This is essentially the same as the difference between offset() and
+ lastOffset().
*/
/*!
@@ -261,10 +262,6 @@ QPanGesture::QPanGesture(QObject *parent)
d_func()->gestureType = Qt::PanGesture;
}
-QPointF QPanGesture::totalOffset() const
-{
- return d_func()->totalOffset;
-}
QPointF QPanGesture::lastOffset() const
{
@@ -276,15 +273,15 @@ QPointF QPanGesture::offset() const
return d_func()->offset;
}
-qreal QPanGesture::acceleration() const
+QPointF QPanGesture::delta() const
{
- return d_func()->acceleration;
+ Q_D(const QPanGesture);
+ return d->offset - d->lastOffset;
}
-
-void QPanGesture::setTotalOffset(const QPointF &value)
+qreal QPanGesture::acceleration() const
{
- d_func()->totalOffset = value;
+ return d_func()->acceleration;
}
void QPanGesture::setLastOffset(const QPointF &value)
@@ -326,7 +323,7 @@ void QPanGesture::setAcceleration(qreal value)
*/
/*!
- \enum QPinchGesture::WhatChange
+ \enum QPinchGesture::ChangeFlag
This enum describes the changes that can occur to the properties of
the gesture object.
@@ -335,19 +332,30 @@ void QPanGesture::setAcceleration(qreal value)
\value RotationAngleChanged The rotation angle held by rotationAngle changed.
\value CenterPointChanged The center point held by centerPoint changed.
- \sa whatChanged
+ \sa changeFlags, totalChangeFlags
+*/
+
+/*!
+ \property QPinchGesture::totalChangeFlags
+ \brief the property of the gesture that has change
+
+ This property indicates which of the other properties has changed since the
+ gesture has started. You can use this information to determine which aspect
+ of your user interface needs to be updated.
+
+ \sa changeFlags, scaleFactor, rotationAngle, centerPoint
*/
/*!
- \property QPinchGesture::whatChanged
- \brief the property of the gesture that has changed
+ \property QPinchGesture::changeFlags
+ \brief the property of the gesture that has changed in the current step
This property indicates which of the other properties has changed since
the previous gesture event included information about this gesture. You
can use this information to determine which aspect of your user interface
needs to be updated.
- \sa scaleFactor, rotationAngle, centerPoint
+ \sa totalChangeFlags, scaleFactor, rotationAngle, centerPoint
*/
/*!
@@ -441,16 +449,25 @@ QPinchGesture::QPinchGesture(QObject *parent)
d_func()->gestureType = Qt::PinchGesture;
}
-QPinchGesture::WhatChanged QPinchGesture::whatChanged() const
+QPinchGesture::ChangeFlags QPinchGesture::totalChangeFlags() const
+{
+ return d_func()->totalChangeFlags;
+}
+
+void QPinchGesture::setTotalChangeFlags(QPinchGesture::ChangeFlags value)
{
- return d_func()->whatChanged;
+ d_func()->totalChangeFlags = value;
}
-void QPinchGesture::setWhatChanged(QPinchGesture::WhatChanged value)
+QPinchGesture::ChangeFlags QPinchGesture::changeFlags() const
{
- d_func()->whatChanged = value;
+ return d_func()->changeFlags;
}
+void QPinchGesture::setChangeFlags(QPinchGesture::ChangeFlags value)
+{
+ d_func()->changeFlags = value;
+}
QPointF QPinchGesture::startCenterPoint() const
{
diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h
index 524d26e1d2..dd322adac9 100644
--- a/src/gui/kernel/qgesture.h
+++ b/src/gui/kernel/qgesture.h
@@ -97,6 +97,7 @@ private:
friend class QGestureEvent;
friend class QGestureRecognizer;
friend class QGestureManager;
+ friend class QGraphicsScenePrivate;
};
class QPanGesturePrivate;
@@ -105,20 +106,19 @@ class Q_GUI_EXPORT QPanGesture : public QGesture
Q_OBJECT
Q_DECLARE_PRIVATE(QPanGesture)
- Q_PROPERTY(QPointF totalOffset READ totalOffset WRITE setTotalOffset)
Q_PROPERTY(QPointF lastOffset READ lastOffset WRITE setLastOffset)
Q_PROPERTY(QPointF offset READ offset WRITE setOffset)
+ Q_PROPERTY(QPointF delta READ delta STORED false)
Q_PROPERTY(qreal acceleration READ acceleration WRITE setAcceleration)
public:
QPanGesture(QObject *parent = 0);
- QPointF totalOffset() const;
QPointF lastOffset() const;
QPointF offset() const;
+ QPointF delta() const;
qreal acceleration() const;
- void setTotalOffset(const QPointF &value);
void setLastOffset(const QPointF &value);
void setOffset(const QPointF &value);
void setAcceleration(qreal value);
@@ -134,14 +134,15 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture
Q_DECLARE_PRIVATE(QPinchGesture)
public:
- enum WhatChange {
+ enum ChangeFlag {
ScaleFactorChanged = 0x1,
RotationAngleChanged = 0x2,
CenterPointChanged = 0x4
};
- Q_DECLARE_FLAGS(WhatChanged, WhatChange)
+ Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag)
- Q_PROPERTY(WhatChanged whatChanged READ whatChanged WRITE setWhatChanged)
+ Q_PROPERTY(ChangeFlags totalChangeFlags READ totalChangeFlags WRITE setTotalChangeFlags)
+ Q_PROPERTY(ChangeFlags changeFlags READ changeFlags WRITE setChangeFlags)
Q_PROPERTY(qreal totalScaleFactor READ totalScaleFactor WRITE setTotalScaleFactor)
Q_PROPERTY(qreal lastScaleFactor READ lastScaleFactor WRITE setLastScaleFactor)
@@ -158,8 +159,11 @@ public:
public:
QPinchGesture(QObject *parent = 0);
- WhatChanged whatChanged() const;
- void setWhatChanged(WhatChanged value);
+ ChangeFlags totalChangeFlags() const;
+ void setTotalChangeFlags(ChangeFlags value);
+
+ ChangeFlags changeFlags() const;
+ void setChangeFlags(ChangeFlags value);
QPointF startCenterPoint() const;
QPointF lastCenterPoint() const;
@@ -187,7 +191,7 @@ public:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QPinchGesture::WhatChanged)
+Q_DECLARE_METATYPE(QPinchGesture::ChangeFlags)
QT_BEGIN_NAMESPACE
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index 34fbb26c87..ae2e28715f 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -90,10 +90,9 @@ public:
{
}
- QPointF totalOffset;
QPointF lastOffset;
QPointF offset;
- QPoint lastPosition;
+ QPoint startPosition;
qreal acceleration;
};
@@ -103,12 +102,15 @@ class QPinchGesturePrivate : public QGesturePrivate
public:
QPinchGesturePrivate()
- : whatChanged(0), totalScaleFactor(0), lastScaleFactor(0), scaleFactor(0),
- totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0)
+ : totalChangeFlags(0), changeFlags(0),
+ totalScaleFactor(0), lastScaleFactor(0), scaleFactor(0),
+ totalRotationAngle(0), lastRotationAngle(0), rotationAngle(0),
+ isNewSequence(true)
{
}
- QPinchGesture::WhatChanged whatChanged;
+ QPinchGesture::ChangeFlags totalChangeFlags;
+ QPinchGesture::ChangeFlags changeFlags;
QPointF startCenterPoint;
QPointF lastCenterPoint;
@@ -121,6 +123,9 @@ public:
qreal totalRotationAngle;
qreal lastRotationAngle;
qreal rotationAngle;
+
+ bool isNewSequence;
+ QPointF startPosition[2];
};
class QSwipeGesturePrivate : public QGesturePrivate
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 0a88a24724..628892d4d1 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -52,6 +52,9 @@
#ifdef Q_WS_MAC
#include "qmacgesturerecognizer_mac_p.h"
#endif
+#if defined(Q_OS_WIN)
+#include "qwinnativepangesturerecognizer_win_p.h"
+#endif
#include "qdebug.h"
@@ -64,6 +67,15 @@
QT_BEGIN_NAMESPACE
+QGestureManager *qt_gestureManager = 0;
+
+QGestureManager* QGestureManager::instance()
+{
+ if (!qt_gestureManager)
+ qt_gestureManager = new QGestureManager(qApp);
+ return qt_gestureManager;
+}
+
QGestureManager::QGestureManager(QObject *parent)
: QObject(parent), state(NotGesture), m_lastCustomGestureId(0)
{
@@ -77,6 +89,10 @@ QGestureManager::QGestureManager(QObject *parent)
#endif
#else
registerGestureRecognizer(new QPanGestureRecognizer);
+ registerGestureRecognizer(new QPinchGestureRecognizer);
+#if defined(Q_OS_WIN)
+ registerGestureRecognizer(new QWinNativePanGestureRecognizer);
+#endif
#endif
}
@@ -92,7 +108,7 @@ QGestureManager::~QGestureManager()
Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *recognizer)
{
- QGesture *dummy = recognizer->createGesture(0);
+ QGesture *dummy = recognizer->create(0);
if (!dummy) {
qWarning("QGestureManager::registerGestureRecognizer: "
"the recognizer fails to create a gesture object, skipping registration.");
@@ -172,7 +188,7 @@ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recogni
}
Q_ASSERT(recognizer);
- QGesture *state = recognizer->createGesture(object);
+ QGesture *state = recognizer->create(object);
if (!state)
return 0;
state->setParent(this);
@@ -219,18 +235,19 @@ bool QGestureManager::filterEventThroughContexts(const QMultiHash<QObject *,
QGesture *state = getState(target, recognizer, gestureType);
if (!state)
continue;
- QGestureRecognizer::Result result = recognizer->filterEvent(state, target, event);
+ QGestureRecognizer::Result result = recognizer->recognize(state, target, event);
QGestureRecognizer::Result type = result & QGestureRecognizer::ResultState_Mask;
- if (type == QGestureRecognizer::GestureTriggered) {
+ result &= QGestureRecognizer::ResultHint_Mask;
+ if (type == QGestureRecognizer::TriggerGesture) {
DEBUG() << "QGestureManager:Recognizer: gesture triggered: " << state;
triggeredGestures << state;
- } else if (type == QGestureRecognizer::GestureFinished) {
+ } else if (type == QGestureRecognizer::FinishGesture) {
DEBUG() << "QGestureManager:Recognizer: gesture finished: " << state;
finishedGestures << state;
- } else if (type == QGestureRecognizer::MaybeGesture) {
+ } else if (type == QGestureRecognizer::MayBeGesture) {
DEBUG() << "QGestureManager:Recognizer: maybe gesture: " << state;
newMaybeGestures << state;
- } else if (type == QGestureRecognizer::NotGesture) {
+ } else if (type == QGestureRecognizer::CancelGesture) {
DEBUG() << "QGestureManager:Recognizer: not gesture: " << state;
notGestures << state;
} else if (type == QGestureRecognizer::Ignore) {
@@ -346,12 +363,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiHash<QObject *,
QSet<QGesture *> endedGestures =
finishedGestures + canceledGestures + undeliveredGestures;
foreach (QGesture *gesture, endedGestures) {
- if (QGestureRecognizer *recognizer = m_gestureToRecognizer.value(gesture, 0)) {
- gesture->setGestureCancelPolicy(QGesture::CancelNone);
- recognizer->reset(gesture);
- } else {
- cleanupGesturesForRemovedRecognizer(gesture);
- }
+ recycle(gesture);
m_gestureTargets.remove(gesture);
}
return ret;
@@ -409,15 +421,8 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original)
deliverEvents(gestures, &undeliveredGestures);
}
- for (iter = cancelledGestures.begin(); iter != cancelledGestures.end(); ++iter) {
- QGestureRecognizer *recognizer = m_gestureToRecognizer.value(*iter, 0);
- if (recognizer) {
- (*iter)->setGestureCancelPolicy(QGesture::CancelNone);
- recognizer->reset(*iter);
- } else {
- cleanupGesturesForRemovedRecognizer(*iter);
- }
- }
+ for (iter = cancelledGestures.begin(); iter != cancelledGestures.end(); ++iter)
+ recycle(*iter);
}
void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
@@ -439,7 +444,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
QSet<Qt::GestureType> types;
QMultiHash<QObject *, Qt::GestureType> contexts;
QWidget *w = receiver;
- typedef QMap<Qt::GestureType, Qt::GestureContext>::const_iterator ContextIterator;
+ typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator;
if (!w->d_func()->gestureContext.isEmpty()) {
for(ContextIterator it = w->d_func()->gestureContext.begin(),
e = w->d_func()->gestureContext.end(); it != e; ++it) {
@@ -453,7 +458,7 @@ bool QGestureManager::filterEvent(QWidget *receiver, QEvent *event)
{
for (ContextIterator it = w->d_func()->gestureContext.begin(),
e = w->d_func()->gestureContext.end(); it != e; ++it) {
- if (it.value() == Qt::WidgetWithChildrenGesture) {
+ if (!(it.value() & Qt::DontStartGestureOnChildren)) {
if (!types.contains(it.key())) {
types.insert(it.key());
contexts.insertMulti(w, it.key());
@@ -474,7 +479,7 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
QMultiHash<QObject *, Qt::GestureType> contexts;
QGraphicsObject *item = receiver;
if (!item->QGraphicsItem::d_func()->gestureContext.isEmpty()) {
- typedef QMap<Qt::GestureType, Qt::GestureContext>::const_iterator ContextIterator;
+ typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator;
for(ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.begin(),
e = item->QGraphicsItem::d_func()->gestureContext.end(); it != e; ++it) {
types.insert(it.key());
@@ -485,10 +490,10 @@ bool QGestureManager::filterEvent(QGraphicsObject *receiver, QEvent *event)
item = item->parentObject();
while (item)
{
- typedef QMap<Qt::GestureType, Qt::GestureContext>::const_iterator ContextIterator;
+ typedef QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator ContextIterator;
for (ContextIterator it = item->QGraphicsItem::d_func()->gestureContext.begin(),
e = item->QGraphicsItem::d_func()->gestureContext.end(); it != e; ++it) {
- if (it.value() == Qt::ItemWithChildrenGesture) {
+ if (!(it.value() & Qt::DontStartGestureOnChildren)) {
if (!types.contains(it.key())) {
types.insert(it.key());
contexts.insertMulti(item, it.key());
@@ -528,12 +533,12 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures,
foreach (QWidget *widget, gestures.keys()) {
QWidget *w = widget->parentWidget();
while (w) {
- QMap<Qt::GestureType, Qt::GestureContext>::const_iterator it
+ QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator it
= w->d_func()->gestureContext.find(type);
if (it != w->d_func()->gestureContext.end()) {
// i.e. 'w' listens to gesture 'type'
- Qt::GestureContext context = it.value();
- if (context == Qt::WidgetWithChildrenGesture && w != widget) {
+ Qt::GestureFlags flags = it.value();
+ if (!(it.value() & Qt::DontStartGestureOnChildren) && w != widget) {
// conflicting gesture!
(*conflicts)[widget].append(gestures[widget]);
break;
@@ -627,7 +632,7 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
QApplication::sendEvent(receiver, &event);
bool eventAccepted = event.isAccepted();
- foreach(QGesture *gesture, event.allGestures()) {
+ foreach(QGesture *gesture, event.gestures()) {
if (eventAccepted || event.isAccepted(gesture)) {
QWidget *w = event.d_func()->targetWidgets.value(gesture->gestureType(), 0);
Q_ASSERT(w);
@@ -652,6 +657,16 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
<< "gestures:" << it.value();
QGestureEvent event(it.value());
QApplication::sendEvent(it.key(), &event);
+ bool eventAccepted = event.isAccepted();
+ foreach (QGesture *gesture, event.gestures()) {
+ if (gesture->state() == Qt::GestureStarted &&
+ (eventAccepted || event.isAccepted(gesture))) {
+ QWidget *w = event.d_func()->targetWidgets.value(gesture->gestureType(), 0);
+ Q_ASSERT(w);
+ DEBUG() << "started gesture was delivered and accepted by" << w;
+ m_gestureTargets[gesture] = w;
+ }
+ }
}
}
}
@@ -669,19 +684,24 @@ void QGestureManager::timerEvent(QTimerEvent *event)
it = m_maybeGestures.erase(it);
DEBUG() << "QGestureManager::timerEvent: gesture stopped due to timeout:"
<< gesture;
- QGestureRecognizer *recognizer = m_gestureToRecognizer.value(gesture, 0);
- if (recognizer) {
- gesture->setGestureCancelPolicy(QGesture::CancelNone);
- recognizer->reset(gesture);
- } else {
- cleanupGesturesForRemovedRecognizer(gesture);
- }
+ recycle(gesture);
} else {
++it;
}
}
}
+void QGestureManager::recycle(QGesture *gesture)
+{
+ QGestureRecognizer *recognizer = m_gestureToRecognizer.value(gesture, 0);
+ if (recognizer) {
+ gesture->setGestureCancelPolicy(QGesture::CancelNone);
+ recognizer->reset(gesture);
+ } else {
+ cleanupGesturesForRemovedRecognizer(gesture);
+ }
+}
+
QT_END_NAMESPACE
#include "moc_qgesturemanager_p.cpp"
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index 1e0734bdfe..4efa10b0c0 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -78,11 +78,12 @@ public:
bool filterEvent(QGraphicsObject *receiver, QEvent *event);
#endif //QT_NO_GRAPHICSVIEW
- // declared in qapplication.cpp
static QGestureManager* instance();
void cleanupCachedGestures(QObject *target, Qt::GestureType type);
+ void recycle(QGesture *gesture);
+
protected:
void timerEvent(QTimerEvent *event);
bool filterEventThroughContexts(const QMultiHash<QObject *, Qt::GestureType> &contexts,
@@ -141,6 +142,8 @@ private:
void cancelGesturesForChildren(QGesture *originatingGesture);
};
+extern QGestureManager *qt_gestureManager;
+
QT_END_NAMESPACE
#endif // QGESTUREMANAGER_P_H
diff --git a/src/gui/kernel/qgesturerecognizer.cpp b/src/gui/kernel/qgesturerecognizer.cpp
index 2673be35cb..ed0bdcca9f 100644
--- a/src/gui/kernel/qgesturerecognizer.cpp
+++ b/src/gui/kernel/qgesturerecognizer.cpp
@@ -42,6 +42,7 @@
#include "qgesturerecognizer.h"
#include "private/qgesture_p.h"
+#include "private/qgesturemanager_p.h"
QT_BEGIN_NAMESPACE
@@ -65,12 +66,12 @@ QT_BEGIN_NAMESPACE
objects, and modifying the associated QGesture objects to include relevant information
about the user's input.
- Gestures are created when the framework calls createGesture() to handle user input
+ Gestures are created when the framework calls create() to handle user input
for a particular instance of a QWidget or QGraphicsObject subclass. A QGesture object
is created for each widget or item that is configured to use gestures.
Once a QGesture has been created for a target object, the gesture recognizer will
- receive events for it in its filterEvent() handler function.
+ receive events for it in its recognize() handler function.
When a gesture is canceled, the reset() function is called, giving the recognizer the
chance to update the appropriate properties in the corresponding QGesture object.
@@ -79,20 +80,22 @@ QT_BEGIN_NAMESPACE
To add support for new gestures, you need to derive from QGestureRecognizer to create
a custom recognizer class, construct an instance of this class, and register it with
- the application by calling QApplication::registerGestureRecognizer(). You can also
+ the application by calling QGestureRecognizer::registerRecognizer(). You can also
subclass QGesture to create a custom gesture class, or rely on dynamic properties
to express specific details of the gesture you want to handle.
- Your custom QGestureRecognizer subclass needs to reimplement the filterEvent() function
- to handle and filter the incoming input events for QWidget and QGraphicsObject subclasses.
- Although the logic for gesture recognition is implemented in this function, you can
- store persistent information about the state of the recognition process in the QGesture
- object supplied. The filterEvent() function must return a value of Qt::GestureState that
- indicates the state of recognition for a given gesture and target object. This determines
- whether or not a gesture event will be delivered to a target object.
+ Your custom QGestureRecognizer subclass needs to reimplement the recognize()
+ function to handle and filter the incoming input events for QWidget and
+ QGraphicsObject subclasses. Although the logic for gesture recognition is
+ implemented in this function, you can store persistent information about the
+ state of the recognition process in the QGesture object supplied. The
+ recognize() function must return a value of QGestureRecognizer::Result that
+ indicates the state of recognition for a given gesture and target object.
+ This determines whether or not a gesture event will be delivered to a target
+ object.
If you choose to represent a gesture by a custom QGesture subclass, you will need to
- reimplement the createGesture() function to construct instances of your gesture class.
+ reimplement the create() function to construct instances of your gesture class.
Similarly, you may need to reimplement the reset() function if your custom gesture
objects need to be specially handled when a gesture is canceled.
@@ -105,37 +108,37 @@ QT_BEGIN_NAMESPACE
This enum describes the result of the current event filtering step in
a gesture recognizer state machine.
- The result consists of a state value (one of Ignore, NotGesture,
- MaybeGesture, GestureTriggered, GestureFinished) and an optional hint
+ The result consists of a state value (one of Ignore, MayBeGesture,
+ TriggerGesture, FinishGesture, CancelGesture) and an optional hint
(ConsumeEventHint).
\value Ignore The event does not change the state of the recognizer.
- \value NotGesture The event made it clear that it is not a gesture. If the
- gesture recognizer was in GestureTriggered state before, then the gesture
- is canceled and the appropriate QGesture object will be delivered to the
- target as a part of a QGestureEvent.
-
- \value MaybeGesture The event changed the internal state of the recognizer,
+ \value MayBeGesture The event changed the internal state of the recognizer,
but it isn't clear yet if it is a gesture or not. The recognizer needs to
- filter more events to decide. Gesture recognizers in the MaybeGesture state
+ filter more events to decide. Gesture recognizers in the MayBeGesture state
may be reset automatically if they take too long to recognize gestures.
- \value GestureTriggered The gesture has been triggered and the appropriate
+ \value TriggerGesture The gesture has been triggered and the appropriate
QGesture object will be delivered to the target as a part of a
QGestureEvent.
- \value GestureFinished The gesture has been finished successfully and the
+ \value FinishGesture The gesture has been finished successfully and the
appropriate QGesture object will be delivered to the target as a part of a
QGestureEvent.
- \value ConsumeEventHint This hint specifies that the gesture framework should
- consume the filtered event and not deliver it to the receiver.
+ \value CancelGesture The event made it clear that it is not a gesture. If
+ the gesture recognizer was in GestureTriggered state before, then the
+ gesture is canceled and the appropriate QGesture object will be delivered
+ to the target as a part of a QGestureEvent.
+
+ \value ConsumeEventHint This hint specifies that the gesture framework
+ should consume the filtered event and not deliver it to the receiver.
\omitvalue ResultState_Mask
\omitvalue ResultHint_Mask
- \sa QGestureRecognizer::filterEvent()
+ \sa QGestureRecognizer::recognize()
*/
/*!
@@ -159,7 +162,7 @@ QGestureRecognizer::~QGestureRecognizer()
Reimplement this function to create a custom QGesture-derived gesture
object if necessary.
*/
-QGesture *QGestureRecognizer::createGesture(QObject *target)
+QGesture *QGestureRecognizer::create(QObject *target)
{
Q_UNUSED(target);
return new QGesture;
@@ -183,7 +186,7 @@ void QGestureRecognizer::reset(QGesture *gesture)
}
/*!
- \fn QGestureRecognizer::filterEvent(QGesture *gesture, QObject *watched, QEvent *event)
+ \fn QGestureRecognizer::recognize(QGesture *gesture, QObject *watched, QEvent *event)
Handles the given \a event for the \a watched object, updating the state of the \a gesture
object as required, and returns a suitable result for the current recognition step.
@@ -194,7 +197,34 @@ void QGestureRecognizer::reset(QGesture *gesture)
The result reflects how much of the gesture has been recognized. The state of the
\a gesture object is set depending on the result.
- \sa Qt::GestureState
+ \sa QGestureRecognizer::Result
+*/
+
+/*!
+ Registers the given \a recognizer in the gesture framework and returns a gesture ID
+ for it.
+
+ The application takes ownership of the \a recognizer and returns the gesture type
+ ID associated with it. For gesture recognizers which handle custom QGesture
+ objects (i.e., those which return Qt::CustomGesture in a QGesture::gestureType()
+ function) the return value is a generated gesture ID with the Qt::CustomGesture
+ flag set.
+
+ \sa unregisterRecognizer(), QGestureRecognizer::create(), QGesture
*/
+Qt::GestureType QGestureRecognizer::registerRecognizer(QGestureRecognizer *recognizer)
+{
+ return QGestureManager::instance()->registerGestureRecognizer(recognizer);
+}
+
+/*!
+ Unregisters all gesture recognizers of the specified \a type.
+
+ \sa registerRecognizer()
+*/
+void QGestureRecognizer::unregisterRecognizer(Qt::GestureType type)
+{
+ QGestureManager::instance()->unregisterGestureRecognizer(type);
+}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qgesturerecognizer.h b/src/gui/kernel/qgesturerecognizer.h
index a3c990db8b..4eebf7cf3f 100644
--- a/src/gui/kernel/qgesturerecognizer.h
+++ b/src/gui/kernel/qgesturerecognizer.h
@@ -43,6 +43,7 @@
#define QGESTURERECOGNIZER_H
#include <QtCore/qglobal.h>
+#include <QtCore/qnamespace.h>
QT_BEGIN_HEADER
@@ -58,30 +59,34 @@ class Q_GUI_EXPORT QGestureRecognizer
public:
enum ResultFlag
{
- Ignore = 0x0001,
- NotGesture = 0x0002,
- MaybeGesture = 0x0004,
- GestureTriggered = 0x0008, // Gesture started or updated
- GestureFinished = 0x0010,
+ Ignore = 0x0001,
- ResultState_Mask = 0x00ff,
+ MayBeGesture = 0x0002,
+ TriggerGesture = 0x0004,
+ FinishGesture = 0x0008,
+ CancelGesture = 0x0010,
+
+ ResultState_Mask = 0x00ff,
ConsumeEventHint = 0x0100,
// StoreEventHint = 0x0200,
// ReplayStoredEventsHint = 0x0400,
// DiscardStoredEventsHint = 0x0800,
- ResultHint_Mask = 0xff00
+ ResultHint_Mask = 0xff00
};
Q_DECLARE_FLAGS(Result, ResultFlag)
QGestureRecognizer();
virtual ~QGestureRecognizer();
- virtual QGesture *createGesture(QObject *target);
- virtual QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event) = 0;
-
+ virtual QGesture *create(QObject *target);
+ virtual Result recognize(QGesture *state, QObject *watched,
+ QEvent *event) = 0;
virtual void reset(QGesture *state);
+
+ static Qt::GestureType registerRecognizer(QGestureRecognizer *recognizer);
+ static void unregisterRecognizer(Qt::GestureType type);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result)
diff --git a/src/gui/kernel/qmacgesturerecognizer_mac.mm b/src/gui/kernel/qmacgesturerecognizer_mac.mm
index 70195809a6..d842322a24 100644
--- a/src/gui/kernel/qmacgesturerecognizer_mac.mm
+++ b/src/gui/kernel/qmacgesturerecognizer_mac.mm
@@ -53,13 +53,13 @@ QMacSwipeGestureRecognizer::QMacSwipeGestureRecognizer()
{
}
-QGesture *QMacSwipeGestureRecognizer::createGesture(QObject * /*target*/)
+QGesture *QMacSwipeGestureRecognizer::create(QObject * /*target*/)
{
return new QSwipeGesture;
}
QGestureRecognizer::Result
-QMacSwipeGestureRecognizer::filterEvent(QGesture *gesture, QObject *obj, QEvent *event)
+QMacSwipeGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *event)
{
if (event->type() == QEvent::NativeGesture && obj->isWidgetType()) {
QNativeGestureEvent *ev = static_cast<QNativeGestureEvent*>(event);
@@ -67,7 +67,7 @@ QMacSwipeGestureRecognizer::filterEvent(QGesture *gesture, QObject *obj, QEvent
case QNativeGestureEvent::Swipe: {
QSwipeGesture *g = static_cast<QSwipeGesture *>(gesture);
g->setSwipeAngle(ev->angle);
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
break; }
default:
break;
@@ -90,13 +90,13 @@ QMacPinchGestureRecognizer::QMacPinchGestureRecognizer()
{
}
-QGesture *QMacPinchGestureRecognizer::createGesture(QObject * /*target*/)
+QGesture *QMacPinchGestureRecognizer::create(QObject * /*target*/)
{
return new QPinchGesture;
}
QGestureRecognizer::Result
-QMacPinchGestureRecognizer::filterEvent(QGesture *gesture, QObject *obj, QEvent *event)
+QMacPinchGestureRecognizer::recognize(QGesture *gesture, QObject *obj, QEvent *event)
{
if (event->type() == QEvent::NativeGesture && obj->isWidgetType()) {
QPinchGesture *g = static_cast<QPinchGesture *>(gesture);
@@ -106,26 +106,26 @@ QMacPinchGestureRecognizer::filterEvent(QGesture *gesture, QObject *obj, QEvent
reset(gesture);
g->setStartCenterPoint(static_cast<QWidget*>(obj)->mapFromGlobal(ev->position));
g->setCenterPoint(g->startCenterPoint());
- g->setWhatChanged(QPinchGesture::CenterPointChanged);
- return QGestureRecognizer::MaybeGesture | QGestureRecognizer::ConsumeEventHint;
+ g->setChangeFlags(QPinchGesture::CenterPointChanged);
+ g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ return QGestureRecognizer::MayBeGesture | QGestureRecognizer::ConsumeEventHint;
case QNativeGestureEvent::Rotate: {
g->setLastScaleFactor(g->scaleFactor());
g->setLastRotationAngle(g->rotationAngle());
g->setRotationAngle(g->rotationAngle() + ev->percentage);
- g->setWhatChanged(QPinchGesture::RotationAngleChanged);
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
- break;
+ g->setChangeFlags(QPinchGesture::RotationAngleChanged);
+ g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
case QNativeGestureEvent::Zoom:
g->setLastScaleFactor(g->scaleFactor());
g->setLastRotationAngle(g->rotationAngle());
g->setScaleFactor(g->scaleFactor() + ev->percentage);
- g->setWhatChanged(QPinchGesture::ScaleFactorChanged);
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
- break;
+ g->setChangeFlags(QPinchGesture::ScaleFactorChanged);
+ g->setTotalChangeFlags(g->totalChangeFlags() | g->changeFlags());
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
case QNativeGestureEvent::GestureEnd:
- return QGestureRecognizer::GestureFinished | QGestureRecognizer::ConsumeEventHint;
- break;
+ return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
default:
break;
}
@@ -137,7 +137,8 @@ QMacPinchGestureRecognizer::filterEvent(QGesture *gesture, QObject *obj, QEvent
void QMacPinchGestureRecognizer::reset(QGesture *gesture)
{
QPinchGesture *g = static_cast<QPinchGesture *>(gesture);
- g->setWhatChanged(0);
+ g->setChangeFlags(0);
+ g->setTotalChangeFlags(0);
g->setScaleFactor(1.0f);
g->setTotalScaleFactor(1.0f);
g->setLastScaleFactor(1.0f);
@@ -158,7 +159,7 @@ QMacPanGestureRecognizer::QMacPanGestureRecognizer() : _panCanceled(true)
{
}
-QGesture *QMacPanGestureRecognizer::createGesture(QObject *target)
+QGesture *QMacPanGestureRecognizer::create(QObject *target)
{
if (!target)
return new QPanGesture;
@@ -172,7 +173,7 @@ QGesture *QMacPanGestureRecognizer::createGesture(QObject *target)
}
QGestureRecognizer::Result
-QMacPanGestureRecognizer::filterEvent(QGesture *gesture, QObject *target, QEvent *event)
+QMacPanGestureRecognizer::recognize(QGesture *gesture, QObject *target, QEvent *event)
{
const int panBeginDelay = 300;
const int panBeginRadius = 3;
@@ -185,10 +186,9 @@ QMacPanGestureRecognizer::filterEvent(QGesture *gesture, QObject *target, QEvent
if (ev->touchPoints().size() == 1) {
reset(gesture);
_startPos = QCursor::pos();
- _lastPos = _startPos;
_panTimer.start(panBeginDelay, target);
_panCanceled = false;
- return QGestureRecognizer::MaybeGesture;
+ return QGestureRecognizer::MayBeGesture;
}
break;}
case QEvent::TouchEnd: {
@@ -197,7 +197,7 @@ QMacPanGestureRecognizer::filterEvent(QGesture *gesture, QObject *target, QEvent
const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
if (ev->touchPoints().size() == 1)
- return QGestureRecognizer::GestureFinished;
+ return QGestureRecognizer::FinishGesture;
break;}
case QEvent::TouchUpdate: {
if (_panCanceled)
@@ -212,23 +212,21 @@ QMacPanGestureRecognizer::filterEvent(QGesture *gesture, QObject *target, QEvent
if ((p - _startPos).manhattanLength() > panBeginRadius) {
_panCanceled = true;
_panTimer.stop();
- return QGestureRecognizer::NotGesture;
+ return QGestureRecognizer::CancelGesture;
}
} else {
const QPointF p = QCursor::pos();
- const QPointF posOffset = p - _lastPos;
+ const QPointF posOffset = p - _startPos;
g->setLastOffset(g->offset());
g->setOffset(QPointF(posOffset.x(), posOffset.y()));
- g->setTotalOffset(g->lastOffset() + g->offset());
- _lastPos = p;
- return QGestureRecognizer::GestureTriggered;
+ return QGestureRecognizer::TriggerGesture;
}
} else if (_panTimer.isActive()) {
// I only want to cancel the pan if the user is pressing
// more than one finger, and the pan hasn't started yet:
_panCanceled = true;
_panTimer.stop();
- return QGestureRecognizer::NotGesture;
+ return QGestureRecognizer::CancelGesture;
}
break;}
case QEvent::Timer: {
@@ -239,8 +237,7 @@ QMacPanGestureRecognizer::filterEvent(QGesture *gesture, QObject *target, QEvent
break;
// Begin new pan session!
_startPos = QCursor::pos();
- _lastPos = _startPos;
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
break; }
default:
@@ -254,11 +251,9 @@ void QMacPanGestureRecognizer::reset(QGesture *gesture)
{
QPanGesture *g = static_cast<QPanGesture *>(gesture);
_startPos = QPointF();
- _lastPos = QPointF();
_panCanceled = true;
g->setOffset(QPointF(0, 0));
g->setLastOffset(QPointF(0, 0));
- g->setTotalOffset(QPointF(0, 0));
g->setAcceleration(qreal(1));
QGestureRecognizer::reset(gesture);
}
diff --git a/src/gui/kernel/qmacgesturerecognizer_mac_p.h b/src/gui/kernel/qmacgesturerecognizer_mac_p.h
index bdc2e081a9..2dac56a833 100644
--- a/src/gui/kernel/qmacgesturerecognizer_mac_p.h
+++ b/src/gui/kernel/qmacgesturerecognizer_mac_p.h
@@ -64,8 +64,8 @@ class QMacSwipeGestureRecognizer : public QGestureRecognizer
public:
QMacSwipeGestureRecognizer();
- QGesture *createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *gesture, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
};
@@ -74,8 +74,8 @@ class QMacPinchGestureRecognizer : public QGestureRecognizer
public:
QMacPinchGestureRecognizer();
- QGesture *createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *gesture, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
};
@@ -86,12 +86,11 @@ class QMacPanGestureRecognizer : public QObject, public QGestureRecognizer
public:
QMacPanGestureRecognizer();
- QGesture *createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *gesture, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *gesture, QObject *watched, QEvent *event);
void reset(QGesture *gesture);
private:
QPointF _startPos;
- QPointF _lastPos;
QBasicTimer _panTimer;
bool _panCanceled;
};
diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp
index 352580e57c..e4b7cecb69 100644
--- a/src/gui/kernel/qsound_s60.cpp
+++ b/src/gui/kernel/qsound_s60.cpp
@@ -60,13 +60,13 @@ class QAuServerS60;
class QAuBucketS60 : public QAuBucket, public MMdaAudioPlayerCallback
{
public:
- QAuBucketS60( QAuServerS60 *server, QSound *sound);
+ QAuBucketS60(QAuServerS60 *server, QSound *sound);
~QAuBucketS60();
void play();
void stop();
- inline QSound* sound() const { return m_sound; }
+ inline QSound *sound() const { return m_sound; }
public: // from MMdaAudioPlayerCallback
void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& aDuration);
@@ -77,88 +77,106 @@ private:
QAuServerS60 *m_server;
bool m_prepared;
bool m_playCalled;
- CMdaAudioPlayerUtility* m_playUtility;
+ CMdaAudioPlayerUtility *m_playUtility;
};
class QAuServerS60 : public QAuServer
{
public:
- QAuServerS60( QObject* parent );
+ QAuServerS60(QObject *parent);
- void init( QSound* s )
+ void init(QSound *s)
{
- QAuBucketS60 *bucket = new QAuBucketS60( this, s );
- setBucket( s, bucket );
+ QAuBucketS60 *bucket = new QAuBucketS60(this, s);
+ setBucket(s, bucket);
}
- void play( QSound* s )
+ void play(QSound *s)
{
- bucket( s )->play();
+ bucket(s)->play();
}
- void stop( QSound* s )
+ void stop(QSound *s)
{
- bucket( s )->stop();
+ bucket(s)->stop();
}
bool okay() { return true; }
+ void play(const QString& filename);
+
protected:
- void playCompleted(QAuBucketS60* bucket, int error)
- {
- QSound *sound = bucket->sound();
- if(!error) {
- // We need to handle repeats by ourselves, since with Symbian API we don't
- // know how many loops have been played when user asks it
- if( decLoop( sound ) ) {
- play( sound );
- }
- } else {
- // We don't have a way to inform about errors -> just decrement loops
- // in order that QSound::isFinished will return true;
- while(decLoop(sound)) {}
- }
- }
+ void playCompleted(QAuBucketS60 *bucket, int error);
protected:
- QAuBucketS60* bucket( QSound *s )
+ QAuBucketS60 *bucket(QSound *s)
{
- return (QAuBucketS60*)QAuServer::bucket( s );
+ return (QAuBucketS60 *)QAuServer::bucket( s );
}
friend class QAuBucketS60;
+ // static QSound::play(filename) cannot be stopped, meaning that playCompleted
+ // will get always called and QSound gets removed form this list.
+ QList<QSound *> staticPlayingSounds;
};
-QAuServerS60::QAuServerS60(QObject* parent) :
+QAuServerS60::QAuServerS60(QObject *parent) :
QAuServer(parent)
{
setObjectName(QLatin1String("QAuServerS60"));
}
+void QAuServerS60::play(const QString& filename)
+{
+ QSound *s = new QSound(filename);
+ staticPlayingSounds.append(s);
+ play(s);
+}
+
+void QAuServerS60::playCompleted(QAuBucketS60 *bucket, int error)
+{
+ QSound *sound = bucket->sound();
+ if (!error) {
+ // We need to handle repeats by ourselves, since with Symbian API we don't
+ // know how many loops have been played when user asks it
+ if (decLoop(sound)) {
+ play(sound);
+ } else {
+ if (staticPlayingSounds.removeAll(sound))
+ delete sound;
+ }
+ } else {
+ // We don't have a way to inform about errors -> just decrement loops
+ // in order that QSound::isFinished will return true;
+ while (decLoop(sound)) {}
+ if (staticPlayingSounds.removeAll(sound))
+ delete sound;
+ }
+}
-QAuServer* qt_new_audio_server()
+QAuServer *qt_new_audio_server()
{
return new QAuServerS60(qApp);
}
-QAuBucketS60::QAuBucketS60( QAuServerS60 *server, QSound *sound )
- : m_sound( sound ), m_server( server ), m_prepared(false), m_playCalled(false)
+QAuBucketS60::QAuBucketS60(QAuServerS60 *server, QSound *sound)
+ : m_sound(sound), m_server(server), m_prepared(false), m_playCalled(false)
{
- QString filepath = QFileInfo( m_sound->fileName() ).absoluteFilePath();
+ QString filepath = QFileInfo(m_sound->fileName()).absoluteFilePath();
filepath = QDir::toNativeSeparators(filepath);
TPtrC filepathPtr(qt_QString2TPtrC(filepath));
TRAPD(err, m_playUtility = CMdaAudioPlayerUtility::NewL(*this);
m_playUtility->OpenFileL(filepathPtr));
- if(err){
+ if (err) {
m_server->playCompleted(this, err);
}
}
void QAuBucketS60::play()
{
- if(m_prepared) {
+ if (m_prepared) {
// OpenFileL call is completed we can start playing immediately
m_playUtility->Play();
} else {
@@ -180,11 +198,11 @@ void QAuBucketS60::MapcPlayComplete(TInt aError)
void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
{
- if(aError) {
+ if (aError) {
m_server->playCompleted(this, aError);
} else {
m_prepared = true;
- if(m_playCalled){
+ if (m_playCalled){
play();
}
}
@@ -192,7 +210,7 @@ void QAuBucketS60::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds
QAuBucketS60::~QAuBucketS60()
{
- if(m_playUtility){
+ if (m_playUtility){
m_playUtility->Stop();
m_playUtility->Close();
}
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index dec2311da2..dfd49eb752 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -44,6 +44,7 @@
#include "qgesture_p.h"
#include "qevent.h"
#include "qwidget.h"
+#include "qabstractscrollarea.h"
QT_BEGIN_NAMESPACE
@@ -51,29 +52,34 @@ QPanGestureRecognizer::QPanGestureRecognizer()
{
}
-QGesture *QPanGestureRecognizer::createGesture(QObject *target)
+QGesture *QPanGestureRecognizer::create(QObject *target)
{
if (target && target->isWidgetType()) {
+#if defined(Q_OS_WIN)
+ // for scroll areas on Windows we want to use native gestures instead
+ if (!qobject_cast<QAbstractScrollArea *>(target->parent()))
+ static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
+#else
static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
+#endif
}
return new QPanGesture;
}
-QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result QPanGestureRecognizer::recognize(QGesture *state, QObject *, QEvent *event)
{
- QPanGesture *q = static_cast<QPanGesture*>(state);
+ QPanGesture *q = static_cast<QPanGesture *>(state);
QPanGesturePrivate *d = q->d_func();
- const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
+ const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
QGestureRecognizer::Result result;
switch (event->type()) {
case QEvent::TouchBegin: {
- result = QGestureRecognizer::MaybeGesture;
+ result = QGestureRecognizer::MayBeGesture;
QTouchEvent::TouchPoint p = ev->touchPoints().at(0);
- d->lastPosition = p.pos().toPoint();
- d->lastOffset = d->totalOffset = d->offset = QPointF();
+ d->lastOffset = d->offset = QPointF();
break;
}
case QEvent::TouchEnd: {
@@ -83,13 +89,12 @@ QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, Q
QTouchEvent::TouchPoint p2 = ev->touchPoints().at(1);
d->lastOffset = d->offset;
d->offset =
- QPointF(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
- p1.pos().y() - p1.lastPos().y() + p2.pos().y() - p2.lastPos().y()) / 2;
- d->totalOffset += d->offset;
+ QPointF(p1.pos().x() - p1.startPos().x() + p2.pos().x() - p2.startPos().x(),
+ p1.pos().y() - p1.startPos().y() + p2.pos().y() - p2.startPos().y()) / 2;
}
- result = QGestureRecognizer::GestureFinished;
+ result = QGestureRecognizer::FinishGesture;
} else {
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
}
break;
}
@@ -99,14 +104,13 @@ QGestureRecognizer::Result QPanGestureRecognizer::filterEvent(QGesture *state, Q
QTouchEvent::TouchPoint p2 = ev->touchPoints().at(1);
d->lastOffset = d->offset;
d->offset =
- QPointF(p1.pos().x() - p1.lastPos().x() + p2.pos().x() - p2.lastPos().x(),
- p1.pos().y() - p1.lastPos().y() + p2.pos().y() - p2.lastPos().y()) / 2;
- d->totalOffset += d->offset;
- if (d->totalOffset.x() > 10 || d->totalOffset.y() > 10 ||
- d->totalOffset.x() < -10 || d->totalOffset.y() < -10) {
- result = QGestureRecognizer::GestureTriggered;
+ QPointF(p1.pos().x() - p1.startPos().x() + p2.pos().x() - p2.startPos().x(),
+ p1.pos().y() - p1.startPos().y() + p2.pos().y() - p2.startPos().y()) / 2;
+ if (d->offset.x() > 10 || d->offset.y() > 10 ||
+ d->offset.x() < -10 || d->offset.y() < -10) {
+ result = QGestureRecognizer::TriggerGesture;
} else {
- result = QGestureRecognizer::MaybeGesture;
+ result = QGestureRecognizer::MayBeGesture;
}
}
break;
@@ -128,108 +132,128 @@ void QPanGestureRecognizer::reset(QGesture *state)
QPanGesture *pan = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = pan->d_func();
- d->totalOffset = d->lastOffset = d->offset = QPointF();
- d->lastPosition = QPoint();
+ d->lastOffset = d->offset = QPointF();
d->acceleration = 0;
-//#if defined(QT_MAC_USE_COCOA)
-// d->singleTouchPanTimer.stop();
-// d->prevMousePos = QPointF(0, 0);
-//#endif
-
QGestureRecognizer::reset(state);
}
-/*
-bool QPanGestureRecognizer::event(QEvent *event)
+
+//
+// QPinchGestureRecognizer
+//
+
+QPinchGestureRecognizer::QPinchGestureRecognizer()
{
-#if defined(QT_MAC_USE_COCOA)
- Q_D(QPanGesture);
- if (event->type() == QEvent::Timer) {
- const QTimerEvent *te = static_cast<QTimerEvent *>(event);
- if (te->timerId() == d->singleTouchPanTimer.timerId()) {
- d->singleTouchPanTimer.stop();
- updateState(Qt::GestureStarted);
- }
+}
+
+QGesture *QPinchGestureRecognizer::create(QObject *target)
+{
+ if (target && target->isWidgetType()) {
+ static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);
}
-#endif
+ return new QPinchGesture;
+}
- bool consume = false;
+QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state, QObject *, QEvent *event)
+{
+ QPinchGesture *q = static_cast<QPinchGesture *>(state);
+ QPinchGesturePrivate *d = q->d_func();
+
+ const QTouchEvent *ev = static_cast<const QTouchEvent *>(event);
-#if defined(Q_WS_WIN)
-#elif defined(QT_MAC_USE_COCOA)
- // The following implements single touch
- // panning on Mac:
- const int panBeginDelay = 300;
- const int panBeginRadius = 3;
- const QTouchEvent *ev = static_cast<const QTouchEvent*>(event);
+ QGestureRecognizer::Result result;
switch (event->type()) {
case QEvent::TouchBegin: {
- if (ev->touchPoints().size() == 1) {
- d->delayManager->setEnabled(true);
- consume = d->delayManager->append(d->gestureTarget, *event);
- d->lastPosition = QCursor::pos();
- d->singleTouchPanTimer.start(panBeginDelay, this);
- }
- break;}
+ result = QGestureRecognizer::MayBeGesture;
+ break;
+ }
case QEvent::TouchEnd: {
- d->delayManager->setEnabled(false);
- if (state() != Qt::NoGesture) {
- updateState(Qt::GestureFinished);
- consume = true;
- d->delayManager->clear();
+ if (q->state() != Qt::NoGesture) {
+ result = QGestureRecognizer::FinishGesture;
} else {
- d->delayManager->replay();
+ result = QGestureRecognizer::CancelGesture;
}
- reset();
- break;}
+ break;
+ }
case QEvent::TouchUpdate: {
- consume = d->delayManager->append(d->gestureTarget, *event);
- if (ev->touchPoints().size() == 1) {
- if (state() == Qt::NoGesture) {
- // INVARIANT: The singleTouchTimer has still not fired.
- // Lets check if the user moved his finger so much from
- // the starting point that it makes sense to cancel:
- const QPointF startPos = ev->touchPoints().at(0).startPos().toPoint();
- const QPointF p = ev->touchPoints().at(0).pos().toPoint();
- if ((startPos - p).manhattanLength() > panBeginRadius) {
- d->delayManager->replay();
- consume = false;
- reset();
- } else {
- d->lastPosition = QCursor::pos();
- }
+ d->changeFlags = 0;
+ if (ev->touchPoints().size() == 2) {
+ QTouchEvent::TouchPoint p1 = ev->touchPoints().at(0);
+ QTouchEvent::TouchPoint p2 = ev->touchPoints().at(1);
+
+ d->hotSpot = p1.screenPos();
+ d->isHotSpotSet = true;
+
+ if (d->isNewSequence) {
+ d->startPosition[0] = p1.screenPos();
+ d->startPosition[1] = p2.screenPos();
+ }
+ QLineF line(p1.screenPos(), p2.screenPos());
+ QLineF tmp(line);
+ tmp.setLength(line.length() / 2.);
+ QPointF centerPoint = tmp.p2();
+
+ d->lastCenterPoint = d->centerPoint;
+ d->centerPoint = centerPoint;
+ d->changeFlags |= QPinchGesture::CenterPointChanged;
+
+ const qreal scaleFactor = QLineF(p1.pos(), p2.pos()).length()
+ / QLineF(d->startPosition[0], d->startPosition[1]).length();
+ if (d->isNewSequence) {
+ d->lastScaleFactor = scaleFactor;
} else {
- d->delayManager->clear();
- QPointF mousePos = QCursor::pos();
- QPointF dist = mousePos - d->lastPosition;
- d->lastPosition = mousePos;
- d->lastOffset = d->offset;
- d->offset = QSizeF(dist.x(), dist.y());
- d->totalOffset += d->offset;
- updateState(Qt::GestureUpdated);
+ d->lastScaleFactor = d->scaleFactor;
}
- } else if (state() == Qt::NoGesture) {
- d->delayManager->replay();
- consume = false;
- reset();
+ d->scaleFactor = scaleFactor;
+ d->totalScaleFactor += d->scaleFactor - d->lastScaleFactor;
+ d->changeFlags |= QPinchGesture::ScaleFactorChanged;
+
+ const qreal rotationAngle = -line.angle();
+ if (d->isNewSequence)
+ d->lastRotationAngle = rotationAngle;
+ else
+ d->lastRotationAngle = d->rotationAngle;
+ d->rotationAngle = rotationAngle;
+ d->totalRotationAngle += d->rotationAngle - d->lastRotationAngle;
+ d->changeFlags |= QPinchGesture::RotationAngleChanged;
+
+ d->totalChangeFlags |= d->changeFlags;
+ d->isNewSequence = false;
+ result = QGestureRecognizer::TriggerGesture;
+ } else {
+ d->isNewSequence = true;
+ result = QGestureRecognizer::MayBeGesture;
}
- break;}
+ break;
+ }
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
case QEvent::MouseButtonRelease:
- if (d->delayManager->isEnabled())
- consume = d->delayManager->append(d->gestureTarget, *event);
+ result = QGestureRecognizer::Ignore;
break;
default:
- return false;
+ result = QGestureRecognizer::Ignore;
+ break;
}
-#else
- Q_UNUSED(event);
-#endif
- return QGestureRecognizer::Ignore;
+ return result;
+}
+
+void QPinchGestureRecognizer::reset(QGesture *state)
+{
+ QPinchGesture *pinch = static_cast<QPinchGesture *>(state);
+ QPinchGesturePrivate *d = pinch->d_func();
+
+ d->totalChangeFlags = d->changeFlags = 0;
+
+ d->startCenterPoint = d->lastCenterPoint = d->centerPoint = QPointF();
+ d->totalScaleFactor = d->lastScaleFactor = d->scaleFactor = 0;
+ d->totalRotationAngle = d->lastRotationAngle = d->rotationAngle = 0;
+
+ d->isNewSequence = true;
+
+ QGestureRecognizer::reset(state);
}
- */
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qstandardgestures_p.h b/src/gui/kernel/qstandardgestures_p.h
index fec5c2fbd9..e6f346c830 100644
--- a/src/gui/kernel/qstandardgestures_p.h
+++ b/src/gui/kernel/qstandardgestures_p.h
@@ -63,9 +63,19 @@ class QPanGestureRecognizer : public QGestureRecognizer
public:
QPanGestureRecognizer();
- QGesture *createGesture(QObject *target);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
+ void reset(QGesture *state);
+};
+
+class QPinchGestureRecognizer : public QGestureRecognizer
+{
+public:
+ QPinchGestureRecognizer();
+
+ QGesture *create(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 91655151b4..6a72cfa689 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -197,6 +197,7 @@ QWidgetPrivate::QWidgetPrivate(int version)
, picture(0)
#elif defined(Q_WS_WIN)
, noPaintOnScreen(0)
+ , nativeGesturePanEnabled(0)
#elif defined(Q_WS_MAC)
, needWindowChange(0)
, isGLWidget(0)
@@ -11736,22 +11737,22 @@ QGraphicsProxyWidget *QWidget::graphicsProxyWidget() const
*/
/*!
- Subscribes the widget to a given \a gesture with a \a context.
+ Subscribes the widget to a given \a gesture with specific \a flags.
- \sa QGestureEvent
+ \sa ungrabGesture(), QGestureEvent
\since 4.6
*/
-void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureContext context)
+void QWidget::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)
{
Q_D(QWidget);
- d->gestureContext.insert(gesture, context);
+ d->gestureContext.insert(gesture, flags);
(void)QGestureManager::instance(); // create a gesture manager
}
/*!
- Unsubscribes the widget to a given \a gesture type
+ Unsubscribes the widget from a given \a gesture type
- \sa QGestureEvent
+ \sa grabGesture(), QGestureEvent
\since 4.6
*/
void QWidget::ungrabGesture(Qt::GestureType gesture)
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index fce3f09753..05f0069e07 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -354,7 +354,7 @@ public:
QGraphicsEffect *graphicsEffect() const;
void setGraphicsEffect(QGraphicsEffect *effect);
- void grabGesture(Qt::GestureType type, Qt::GestureContext context = Qt::WidgetWithChildrenGesture);
+ void grabGesture(Qt::GestureType type, Qt::GestureFlags flags = Qt::GestureFlags());
void ungrabGesture(Qt::GestureType type);
public Q_SLOTS:
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 58252ca354..9270220d31 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3017,10 +3017,17 @@ void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
#else
QMacCocoaAutoReleasePool pool;
NSButton *iconButton = [qt_mac_window_for(q) standardWindowButton:NSWindowDocumentIconButton];
+ if (iconButton == nil) {
+ QCFString string(q->windowTitle());
+ const NSString *tmpString = reinterpret_cast<const NSString *>((CFStringRef)string);
+ [qt_mac_window_for(q) setRepresentedURL:[NSURL fileURLWithPath:tmpString]];
+ iconButton = [qt_mac_window_for(q) standardWindowButton:NSWindowDocumentIconButton];
+ }
if (icon.isNull()) {
[iconButton setImage:nil];
} else {
- NSImage *image = static_cast<NSImage *>(qt_mac_create_nsimage(*pm));
+ QPixmap scaled = pm->scaled(QSize(16,16), Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ NSImage *image = static_cast<NSImage *>(qt_mac_create_nsimage(scaled));
[iconButton setImage:image];
[image release];
}
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 73a7d68bda..8b03a85afa 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -630,7 +630,7 @@ public:
#ifndef QT_NO_ACTION
QList<QAction*> actions;
#endif
- QMap<Qt::GestureType, Qt::GestureContext> gestureContext;
+ QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
// Bit fields.
uint high_attributes[3]; // the low ones are in QWidget::widget_attributes
diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp
index 5bf7649198..22a94b92a8 100644
--- a/src/gui/kernel/qwidget_win.cpp
+++ b/src/gui/kernel/qwidget_win.cpp
@@ -2036,7 +2036,7 @@ void QWidgetPrivate::winSetupGestures()
if (!q || !q->isVisible())
return;
QApplicationPrivate *qAppPriv = QApplicationPrivate::instance();
- WId winid = q->effectiveWinId();
+ WId winid = q->internalWinId();
bool needh = false;
bool needv = false;
@@ -2052,6 +2052,8 @@ void QWidgetPrivate::winSetupGestures()
needv = (vbarpolicy == Qt::ScrollBarAlwaysOn ||
(vbarpolicy == Qt::ScrollBarAsNeeded && vbar->minimum() < vbar->maximum()));
singleFingerPanEnabled = asa->d_func()->singleFingerPanEnabled;
+ if (!winid)
+ winid = q->winId(); // enforces the native winid on the viewport
}
if (winid && qAppPriv->SetGestureConfig) {
GESTURECONFIG gc[1];
@@ -2071,17 +2073,6 @@ void QWidgetPrivate::winSetupGestures()
gc[0].dwBlock = GC_PAN;
}
-// gc[1].dwID = GID_ZOOM;
-// if (gestures.pinch)
-// gc[1].dwWant = GC_ZOOM;
-// else
-// gc[1].dwBlock = GC_ZOOM;
-// gc[2].dwID = GID_ROTATE;
-// if (gestures.pinch)
-// gc[2].dwWant = GC_ROTATE;
-// else
-// gc[2].dwBlock = GC_ROTATE;
-
qAppPriv->SetGestureConfig(winid, 0, sizeof(gc)/sizeof(gc[0]), gc, sizeof(gc[0]));
}
}
diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
index 12d3058188..5fceb13161 100644
--- a/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
+++ b/src/gui/kernel/qwinnativepangesturerecognizer_win.cpp
@@ -56,16 +56,16 @@ QWinNativePanGestureRecognizer::QWinNativePanGestureRecognizer()
{
}
-QGesture* QWinNativePanGestureRecognizer::createGesture(QObject *target) const
+QGesture *QWinNativePanGestureRecognizer::create(QObject *target)
{
if (!target)
return new QPanGesture; // a special case
- if (qobject_cast<QGraphicsObject*>(target))
- return 0;
if (!target->isWidgetType())
return 0;
+ if (qobject_cast<QGraphicsObject *>(target))
+ return 0;
- QWidget *q = static_cast<QWidget*>(target);
+ QWidget *q = static_cast<QWidget *>(target);
QWidgetPrivate *d = q->d_func();
d->nativeGesturePanEnabled = true;
d->winSetupGestures();
@@ -73,7 +73,9 @@ QGesture* QWinNativePanGestureRecognizer::createGesture(QObject *target) const
return new QPanGesture;
}
-QGestureRecognizer::Result QWinNativePanGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result QWinNativePanGestureRecognizer::recognize(QGesture *state,
+ QObject *,
+ QEvent *event)
{
QPanGesture *q = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = q->d_func();
@@ -85,26 +87,25 @@ QGestureRecognizer::Result QWinNativePanGestureRecognizer::filterEvent(QGesture
case QNativeGestureEvent::GestureBegin:
break;
case QNativeGestureEvent::Pan:
- result = QGestureRecognizer::GestureTriggered;
+ result = QGestureRecognizer::TriggerGesture;
event->accept();
break;
case QNativeGestureEvent::GestureEnd:
if (q->state() == Qt::NoGesture)
return QGestureRecognizer::Ignore; // some other gesture has ended
- result = QGestureRecognizer::GestureFinished;
+ result = QGestureRecognizer::FinishGesture;
break;
default:
return QGestureRecognizer::Ignore;
}
if (q->state() == Qt::NoGesture) {
- d->lastOffset = d->totalOffset = d->offset = QPointF();
+ d->lastOffset = d->offset = QPointF();
+ d->startPosition = ev->position;
} else {
d->lastOffset = d->offset;
- d->offset = QPointF(ev->position.x() - d->lastPosition.x(),
- ev->position.y() - d->lastPosition.y());
- d->totalOffset += d->offset;
+ d->offset = QPointF(ev->position.x() - d->startPosition.x(),
+ ev->position.y() - d->startPosition.y());
}
- d->lastPosition = ev->position;
}
return result;
}
@@ -114,8 +115,8 @@ void QWinNativePanGestureRecognizer::reset(QGesture *state)
QPanGesture *pan = static_cast<QPanGesture*>(state);
QPanGesturePrivate *d = pan->d_func();
- d->totalOffset = d->lastOffset = d->offset = QPointF();
- d->lastPosition = QPoint();
+ d->lastOffset = d->offset = QPointF();
+ d->startPosition = QPoint();
d->acceleration = 0;
QGestureRecognizer::reset(state);
diff --git a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
index a1e8511f66..8fb0d50b17 100644
--- a/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
+++ b/src/gui/kernel/qwinnativepangesturerecognizer_win_p.h
@@ -62,9 +62,8 @@ class QWinNativePanGestureRecognizer : public QGestureRecognizer
public:
QWinNativePanGestureRecognizer();
- QGesture* createGesture(QObject *target) const;
-
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
diff --git a/src/gui/s60framework/s60framework.pri b/src/gui/s60framework/s60framework.pri
index fea74fe58c..5884b68754 100644
--- a/src/gui/s60framework/s60framework.pri
+++ b/src/gui/s60framework/s60framework.pri
@@ -1,3 +1,14 @@
+# This block serves the minimalistic resource file for S60 3.1 platforms.
+# Note there is no way to ifdef S60 version in mmp file, that is why the resource
+# file is always compiled for WINSCW
+minimalAppResource31 = \
+ "SOURCEPATH s60framework" \
+ "START RESOURCE s60main.rss" \
+ "HEADER" \
+ "TARGETPATH resource\apps" \
+ "END"
+MMP_RULES += minimalAppResource31
+
SOURCES += s60framework/qs60mainapplication.cpp \
s60framework/qs60mainappui.cpp \
s60framework/qs60maindocument.cpp
diff --git a/src/s60main/s60main.rss b/src/gui/s60framework/s60main.rss
index 07dc6a136c..07dc6a136c 100644
--- a/src/s60main/s60main.rss
+++ b/src/gui/s60framework/s60main.rss
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index bf2f68eabe..4c9541b353 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -5656,102 +5656,103 @@ QIcon QCommonStyle::standardIconImplementation(StandardPixmap standardIcon, cons
default:
break;
}
-
+ } // if (QApplication::desktopSettingsAware() && !QIcon::themeName().isEmpty())
if (!icon.isNull())
return icon;
#if defined(Q_WS_MAC)
- OSType iconType = 0;
- switch (standardIcon) {
- case QStyle::SP_MessageBoxQuestion:
- case QStyle::SP_MessageBoxInformation:
- case QStyle::SP_MessageBoxWarning:
- case QStyle::SP_MessageBoxCritical:
- iconType = kGenericApplicationIcon;
- break;
- case SP_DesktopIcon:
- iconType = kDesktopIcon;
- break;
- case SP_TrashIcon:
- iconType = kTrashIcon;
- break;
- case SP_ComputerIcon:
- iconType = kComputerIcon;
- break;
- case SP_DriveFDIcon:
- iconType = kGenericFloppyIcon;
- break;
- case SP_DriveHDIcon:
- iconType = kGenericHardDiskIcon;
- break;
- case SP_DriveCDIcon:
- case SP_DriveDVDIcon:
- iconType = kGenericCDROMIcon;
- break;
- case SP_DriveNetIcon:
- iconType = kGenericNetworkIcon;
- break;
- case SP_DirOpenIcon:
- iconType = kOpenFolderIcon;
- break;
- case SP_DirClosedIcon:
- case SP_DirLinkIcon:
- iconType = kGenericFolderIcon;
- break;
- case SP_FileLinkIcon:
- case SP_FileIcon:
- iconType = kGenericDocumentIcon;
- break;
- case SP_DirIcon: {
- // A rather special case
- QIcon closeIcon = QStyle::standardIcon(SP_DirClosedIcon, option, widget);
- QIcon openIcon = QStyle::standardIcon(SP_DirOpenIcon, option, widget);
- closeIcon.addPixmap(openIcon.pixmap(16, 16), QIcon::Normal, QIcon::On);
- closeIcon.addPixmap(openIcon.pixmap(32, 32), QIcon::Normal, QIcon::On);
- closeIcon.addPixmap(openIcon.pixmap(64, 64), QIcon::Normal, QIcon::On);
- closeIcon.addPixmap(openIcon.pixmap(128, 128), QIcon::Normal, QIcon::On);
- return closeIcon;
- }
- case SP_TitleBarNormalButton:
- case SP_TitleBarCloseButton: {
- QIcon titleBarIcon;
- if (standardIcon == SP_TitleBarCloseButton) {
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-16.png"));
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
- } else {
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-16.png"));
- titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
+ if (QApplication::desktopSettingsAware()) {
+ OSType iconType = 0;
+ switch (standardIcon) {
+ case QStyle::SP_MessageBoxQuestion:
+ case QStyle::SP_MessageBoxInformation:
+ case QStyle::SP_MessageBoxWarning:
+ case QStyle::SP_MessageBoxCritical:
+ iconType = kGenericApplicationIcon;
+ break;
+ case SP_DesktopIcon:
+ iconType = kDesktopIcon;
+ break;
+ case SP_TrashIcon:
+ iconType = kTrashIcon;
+ break;
+ case SP_ComputerIcon:
+ iconType = kComputerIcon;
+ break;
+ case SP_DriveFDIcon:
+ iconType = kGenericFloppyIcon;
+ break;
+ case SP_DriveHDIcon:
+ iconType = kGenericHardDiskIcon;
+ break;
+ case SP_DriveCDIcon:
+ case SP_DriveDVDIcon:
+ iconType = kGenericCDROMIcon;
+ break;
+ case SP_DriveNetIcon:
+ iconType = kGenericNetworkIcon;
+ break;
+ case SP_DirOpenIcon:
+ iconType = kOpenFolderIcon;
+ break;
+ case SP_DirClosedIcon:
+ case SP_DirLinkIcon:
+ iconType = kGenericFolderIcon;
+ break;
+ case SP_FileLinkIcon:
+ case SP_FileIcon:
+ iconType = kGenericDocumentIcon;
+ break;
+ case SP_DirIcon: {
+ // A rather special case
+ QIcon closeIcon = QStyle::standardIcon(SP_DirClosedIcon, option, widget);
+ QIcon openIcon = QStyle::standardIcon(SP_DirOpenIcon, option, widget);
+ closeIcon.addPixmap(openIcon.pixmap(16, 16), QIcon::Normal, QIcon::On);
+ closeIcon.addPixmap(openIcon.pixmap(32, 32), QIcon::Normal, QIcon::On);
+ closeIcon.addPixmap(openIcon.pixmap(64, 64), QIcon::Normal, QIcon::On);
+ closeIcon.addPixmap(openIcon.pixmap(128, 128), QIcon::Normal, QIcon::On);
+ return closeIcon;
+ }
+ case SP_TitleBarNormalButton:
+ case SP_TitleBarCloseButton: {
+ QIcon titleBarIcon;
+ if (standardIcon == SP_TitleBarCloseButton) {
+ titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-16.png"));
+ titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/closedock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
+ } else {
+ titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-16.png"));
+ titleBarIcon.addFile(QLatin1String(":/trolltech/styles/macstyle/images/dockdock-down-16.png"), QSize(16, 16), QIcon::Normal, QIcon::On);
+ }
+ return titleBarIcon;
}
- return titleBarIcon;
- }
- default:
- break;
- }
- if (iconType != 0) {
- QIcon retIcon;
- IconRef icon;
- IconRef overlayIcon = 0;
- if (iconType != kGenericApplicationIcon) {
- GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon);
- } else {
- FSRef fsRef;
- ProcessSerialNumber psn = { 0, kCurrentProcess };
- GetProcessBundleLocation(&psn, &fsRef);
- GetIconRefFromFileInfo(&fsRef, 0, 0, 0, 0, kIconServicesNormalUsageFlag, &icon, 0);
- if (standardIcon == SP_MessageBoxCritical) {
- overlayIcon = icon;
- GetIconRef(kOnSystemDisk, kSystemIconsCreator, kAlertCautionIcon, &icon);
- }
- }
- if (icon) {
- qt_mac_constructQIconFromIconRef(icon, overlayIcon, &retIcon, standardIcon);
- ReleaseIconRef(icon);
- }
- if (overlayIcon)
- ReleaseIconRef(overlayIcon);
- return retIcon;
- }
+ default:
+ break;
+ }
+ if (iconType != 0) {
+ QIcon retIcon;
+ IconRef icon;
+ IconRef overlayIcon = 0;
+ if (iconType != kGenericApplicationIcon) {
+ GetIconRef(kOnSystemDisk, kSystemIconsCreator, iconType, &icon);
+ } else {
+ FSRef fsRef;
+ ProcessSerialNumber psn = { 0, kCurrentProcess };
+ GetProcessBundleLocation(&psn, &fsRef);
+ GetIconRefFromFileInfo(&fsRef, 0, 0, 0, 0, kIconServicesNormalUsageFlag, &icon, 0);
+ if (standardIcon == SP_MessageBoxCritical) {
+ overlayIcon = icon;
+ GetIconRef(kOnSystemDisk, kSystemIconsCreator, kAlertCautionIcon, &icon);
+ }
+ }
+ if (icon) {
+ qt_mac_constructQIconFromIconRef(icon, overlayIcon, &retIcon, standardIcon);
+ ReleaseIconRef(icon);
+ }
+ if (overlayIcon)
+ ReleaseIconRef(overlayIcon);
+ return retIcon;
+ }
+ } // if (QApplication::desktopSettingsAware())
#endif // Q_WS_MAC
- }
switch (standardIcon) {
#ifndef QT_NO_IMAGEFORMAT_PNG
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index b87f3a87a1..350a8e6868 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -499,7 +499,7 @@ void QS60StylePrivate::setBackgroundTexture(QApplication *app) const
Q_UNUSED(app)
QPalette applicationPalette = QApplication::palette();
applicationPalette.setBrush(QPalette::Window, backgroundTexture());
- QApplication::setPalette(applicationPalette);
+ setThemePalette(app);
}
void QS60StylePrivate::deleteBackground()
@@ -743,7 +743,7 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
const QColor mainAreaTextColor =
s60Color(QS60StyleEnums::CL_QsnTextColors, 6, 0);
- widgetPalette.setColor(QPalette::All, QPalette::WindowText,
+ widgetPalette.setColor(QPalette::WindowText,
s60Color(QS60StyleEnums::CL_QsnLineColors, 8, 0));
QApplication::setPalette(widgetPalette, "QSlider");
// return to original palette after each widget
@@ -767,34 +767,34 @@ void QS60StylePrivate::setThemePaletteHash(QPalette *palette) const
QApplication::setPalette(widgetPalette, "QHeaderView");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::All, QPalette::ButtonText,
+ widgetPalette.setColor(QPalette::ButtonText,
s60Color(QS60StyleEnums::CL_QsnTextColors, 8, 0));
QApplication::setPalette(widgetPalette, "QMenuBar");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::Active, QPalette::WindowText,
+ widgetPalette.setColor(QPalette::WindowText,
s60Color(QS60StyleEnums::CL_QsnTextColors, 4, 0));
QApplication::setPalette(widgetPalette, "QTabBar");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::All, QPalette::Text,
+ widgetPalette.setColor(QPalette::Text,
s60Color(QS60StyleEnums::CL_QsnTextColors, 22, 0));
QApplication::setPalette(widgetPalette, "QTableView");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ widgetPalette.setColor(QPalette::HighlightedText,
s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
QApplication::setPalette(widgetPalette, "QLineEdit");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::All, QPalette::Text,
+ widgetPalette.setColor(QPalette::Text,
s60Color(QS60StyleEnums::CL_QsnTextColors, 34, 0));
- widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ widgetPalette.setColor(QPalette::HighlightedText,
s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
QApplication::setPalette(widgetPalette, "QTextEdit");
widgetPalette = *palette;
- widgetPalette.setColor(QPalette::All, QPalette::HighlightedText,
+ widgetPalette.setColor(QPalette::HighlightedText,
s60Color(QS60StyleEnums::CL_QsnTextColors, 24, 0));
QApplication::setPalette(widgetPalette, "QComboBox");
widgetPalette = *palette;
@@ -994,6 +994,10 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
if (const QStyleOptionToolButton *toolBtn = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
const State bflags = toolBtn->state;
const QRect button(subControlRect(control, toolBtn, SC_ToolButton, widget));
+ QRect menuRect = QRect();
+ if (toolBtn->subControls & SC_ToolButtonMenu)
+ menuRect = subControlRect(control, toolBtn, SC_ToolButtonMenu, widget);
+
QStyleOptionToolButton toolButton = *toolBtn;
if (sub&SC_ToolButton) {
@@ -1006,7 +1010,7 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
toolBar = qobject_cast<QToolBar *>(widget->parentWidget());
if (bflags & (State_Sunken | State_On | State_Raised)) {
- tool.rect = button;
+ tool.rect = button.unite(menuRect);
tool.state = bflags;
// todo: I'd like to move extension button next to where last button is
@@ -1061,6 +1065,12 @@ void QS60Style::drawComplexControl(ComplexControl control, const QStyleOptionCom
} else {
drawPrimitive(PE_PanelButtonTool, &tool, painter, widget);
}
+
+ if (toolButton.subControls & SC_ToolButtonMenu) {
+ tool.rect = menuRect;
+ tool.state = bflags;
+ drawPrimitive(PE_IndicatorArrowDown, &tool, painter, widget);
+ }
}
}
@@ -1752,7 +1762,7 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
#endif //QT_NO_MENUBAR
case CE_HeaderSection:
- if ( const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
+ if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
painter->save();
QPen linePen = QPen(QS60StylePrivate::s60Color(QS60StyleEnums::CL_QsnLineColors, 1, header));
const int penWidth = (header->orientation == Qt::Horizontal) ?
@@ -1770,6 +1780,25 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
}
}
painter->restore();
+
+ //Draw corner button as normal pushButton.
+ if (qobject_cast<const QAbstractButton *>(widget)) {
+ //Make cornerButton slightly smaller so that it is not on top of table border graphic.
+ QStyleOptionHeader subopt = *header;
+ const int borderTweak =
+ QS60StylePrivate::pixelMetric(PM_Custom_FrameCornerWidth)>>1;
+ if (subopt.direction == Qt::LeftToRight)
+ subopt.rect.adjust(borderTweak, borderTweak, 0, -borderTweak);
+ else
+ subopt.rect.adjust(0, borderTweak, -borderTweak, -borderTweak);
+ drawPrimitive(PE_PanelButtonBevel, &subopt, painter, widget);
+ } else if ((header->palette.brush(QPalette::Button) != Qt::transparent)) {
+ //Draw non-themed background. Background for theme is drawn in CE_ShapedFrame
+ //to get continuous theme graphic across all the header cells.
+ qDrawShadePanel(painter, header->rect, header->palette,
+ header->state & (State_Sunken | State_On), penWidth,
+ &header->palette.brush(QPalette::Button));
+ }
}
break;
case CE_HeaderEmptyArea: // no need to draw this
@@ -1840,15 +1869,24 @@ void QS60Style::drawControl(ControlElement element, const QStyleOption *option,
} else if (qobject_cast<const QTableView *>(widget)) {
QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableItem, painter, option->rect, flags);
} else if (const QHeaderView *header = qobject_cast<const QHeaderView *>(widget)) {
- if (header->orientation() == Qt::Horizontal) {
- QRect headerRect = option->rect;
- const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
- headerRect.adjust(0,frameWidth,-2*frameWidth,0);
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, headerRect, flags);
- } else {
+ //QS60style draws header background here instead of in each headersection, to get
+ //continuous graphic from section to section.
+ QS60StylePrivate::SkinElementFlags adjustableFlags = flags;
+ QRect headerRect = option->rect;
+ if (header->orientation() != Qt::Horizontal) {
//todo: update to horizontal table graphic
- QS60StylePrivate::drawSkinElement(QS60StylePrivate::SE_TableHeaderItem, painter, option->rect, flags | QS60StylePrivate::SF_PointWest);
+ adjustableFlags = (adjustableFlags | QS60StylePrivate::SF_PointWest);
+ } else {
+ const int frameWidth = QS60StylePrivate::pixelMetric(PM_DefaultFrameWidth);
+ if (option->direction == Qt::LeftToRight)
+ headerRect.adjust(-2*frameWidth, 0, 0, 0);
+ else
+ headerRect.adjust(0, 0, 2*frameWidth, 0);
}
+ if (option->palette.brush(QPalette::Button).color() == Qt::transparent)
+ QS60StylePrivate::drawSkinElement(
+ QS60StylePrivate::SE_TableHeaderItem, painter, headerRect, adjustableFlags);
+
} else if (qobject_cast<const QFrame *>(widget)) {
QCommonStyle::drawControl(element, option, painter, widget);
}
@@ -2204,7 +2242,6 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
// todo: items are below with #ifdefs "just in case". in final version, remove all non-required cases
case PE_FrameLineEdit:
- case PE_IndicatorButtonDropDown:
case PE_IndicatorDockWidgetResizeHandle:
case PE_PanelTipLabel:
case PE_PanelScrollAreaCorner:
@@ -2266,10 +2303,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz += QSize(2*f->lineWidth, 4*f->lineWidth);
break;
case CT_TabBarTab:
- QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
+ {
+ const QSize naviPaneSize = QS60StylePrivate::naviPaneSize();
+ sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget);
+ if (naviPaneSize.height() > sz.height())
+ sz.setHeight(naviPaneSize.height());
+ }
+ break;
+ case CT_ItemViewItem:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
- if (naviPaneSize.height() > sz.height())
- sz.setHeight(naviPaneSize.height());
+ if (QS60StylePrivate::isTouchSupported())
+ //Make itemview easier to use in touch devices
+ //QCommonStyle does not adjust height with horizontal margin, it only adjusts width
+ sz.setHeight(sz.height() + 2*pixelMetric(QStyle::PM_FocusFrameVMargin));
break;
default:
sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget);
@@ -2524,6 +2570,29 @@ QRect QS60Style::subControlRect(ComplexControl control, const QStyleOptionComple
}
}
break;
+ case CC_ToolButton:
+ if (const QStyleOptionToolButton *toolButton = qstyleoption_cast<const QStyleOptionToolButton *>(option)) {
+ const int indicatorRect = pixelMetric(PM_MenuButtonIndicator, toolButton, widget) +
+ 2*pixelMetric(PM_ButtonMargin, toolButton, widget);
+ ret = toolButton->rect;
+ const bool popup = (toolButton->features &
+ (QStyleOptionToolButton::MenuButtonPopup | QStyleOptionToolButton::PopupDelay))
+ == QStyleOptionToolButton::MenuButtonPopup;
+ switch (scontrol) {
+ case SC_ToolButton:
+ if (popup)
+ ret.adjust(0, 0, -indicatorRect, 0);
+ break;
+ case SC_ToolButtonMenu:
+ if (popup)
+ ret.adjust(ret.width() - indicatorRect, ret.height() - indicatorRect, 0, 0);
+ break;
+ default:
+ break;
+ }
+ ret = visualRect(toolButton->direction, toolButton->rect, ret);
+ }
+ break;
default:
ret = QCommonStyle::subControlRect(control, option, scontrol, widget);
}
diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp
index 678844cdd1..0cd87bdfa8 100644
--- a/src/gui/styles/qs60style_s60.cpp
+++ b/src/gui/styles/qs60style_s60.cpp
@@ -1382,13 +1382,13 @@ QSize QS60StylePrivate::naviPaneSize()
QSize QS60StyleModeSpecifics::naviPaneSize()
{
CAknNavigationControlContainer* naviContainer;
- if (S60->statusPane())
- naviContainer = static_cast<CAknNavigationControlContainer*>
- (S60->statusPane()->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
- if (naviContainer)
- return QSize(naviContainer->Size().iWidth, naviContainer->Size().iHeight);
- else
- return QSize(0,0);
+ if (S60->statusPane()) {
+ TRAPD(err, naviContainer = static_cast<CAknNavigationControlContainer*>
+ (S60->statusPane()->ControlL(TUid::Uid(EEikStatusPaneUidNavi))));
+ if (err==KErrNone)
+ return QSize(naviContainer->Size().iWidth, naviContainer->Size().iHeight);
+ }
+ return QSize(0,0);
}
#endif // Q_WS_S60
diff --git a/src/gui/styles/qs60style_simulated.cpp b/src/gui/styles/qs60style_simulated.cpp
index 14f04243e2..706b4e979f 100644
--- a/src/gui/styles/qs60style_simulated.cpp
+++ b/src/gui/styles/qs60style_simulated.cpp
@@ -322,7 +322,7 @@ QPixmap QS60StylePrivate::backgroundTexture()
{
if (!m_background) {
const QSize size = QApplication::desktop()->screen()->size();
- QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size);
+ QPixmap background = part(QS60StyleEnums::SP_QsnBgScreen, size, 0);
m_background = new QPixmap(background);
}
return *m_background;
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 3f6545cd92..9497b6fbc0 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1831,7 +1831,8 @@ void QTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
e->ignore();
return;
}
- bool isGettingInput = !e->commitString().isEmpty() || !e->preeditString().isEmpty()
+ bool isGettingInput = !e->commitString().isEmpty()
+ || e->preeditString() != cursor.block().layout()->preeditAreaText()
|| e->replacementLength() > 0;
if (isGettingInput) {
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 1690d87ed3..85b539f20d 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -294,15 +294,6 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
Rest of the standard locations point to folder on same drive with executable, except
that if executable is in ROM the folder from C drive is returned.
- \note On Mac OS X, DataLocation does not include QCoreApplication::organizationName.
- Use code like this to add it:
-
- \code
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
- #ifdef Q_WS_MAC
- location.insert(location.count() - QCoreApplication::applicationName().count(),
- QCoreApplication::organizationName() + "/");
- #endif
\endcode
*/
diff --git a/src/gui/util/qdesktopservices_mac.cpp b/src/gui/util/qdesktopservices_mac.cpp
index 0626e0a8b3..23f9e60d62 100644
--- a/src/gui/util/qdesktopservices_mac.cpp
+++ b/src/gui/util/qdesktopservices_mac.cpp
@@ -153,9 +153,12 @@ QString QDesktopServices::storageLocation(StandardLocation type)
QString path = getFullPath(ref);
- QString appName = QCoreApplication::applicationName();
- if (!appName.isEmpty() && (type == DataLocation || type == CacheLocation))
- path += QLatin1Char('/') + appName;
+ if (type == DataLocation || type == CacheLocation) {
+ if (QCoreApplication::organizationName().isEmpty() == false)
+ path += QLatin1Char('/') + QCoreApplication::organizationName();
+ if (QCoreApplication::applicationName().isEmpty() == false)
+ path += QLatin1Char('/') + QCoreApplication::applicationName();
+ }
return path;
}
diff --git a/src/gui/widgets/qabstractscrollarea.cpp b/src/gui/widgets/qabstractscrollarea.cpp
index 08962567d2..7d81d5a4e2 100644
--- a/src/gui/widgets/qabstractscrollarea.cpp
+++ b/src/gui/widgets/qabstractscrollarea.cpp
@@ -293,13 +293,16 @@ void QAbstractScrollAreaPrivate::init()
q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren();
+ viewport->grabGesture(Qt::PanGesture);
}
#ifdef Q_WS_WIN
void QAbstractScrollAreaPrivate::setSingleFingerPanEnabled(bool on)
{
singleFingerPanEnabled = on;
- winSetupGestures();
+ QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
+ if (dd)
+ dd->winSetupGestures();
}
#endif // Q_WS_WIN
@@ -539,6 +542,7 @@ void QAbstractScrollArea::setViewport(QWidget *widget)
d->viewport->setParent(this);
d->viewport->setFocusProxy(this);
d->viewport->installEventFilter(d->viewportFilter.data());
+ d->viewport->grabGesture(Qt::PanGesture);
d->layoutChildren();
if (isVisible())
d->viewport->show();
@@ -935,6 +939,26 @@ bool QAbstractScrollArea::event(QEvent *e)
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
return false;
+ case QEvent::Gesture:
+ {
+ QGestureEvent *ge = static_cast<QGestureEvent *>(e);
+ QPanGesture *g = static_cast<QPanGesture *>(ge->gesture(Qt::PanGesture));
+ if (g) {
+ QScrollBar *hBar = horizontalScrollBar();
+ QScrollBar *vBar = verticalScrollBar();
+ QPointF delta = g->lastOffset();
+ if (!delta.isNull()) {
+ if (QApplication::isRightToLeft())
+ delta.rx() *= -1;
+ int newX = hBar->value() - delta.x();
+ int newY = vBar->value() - delta.y();
+ hBar->setValue(newX);
+ vBar->setValue(newY);
+ }
+ return true;
+ }
+ return false;
+ }
case QEvent::StyleChange:
case QEvent::LayoutDirectionChange:
case QEvent::ApplicationLayoutDirectionChange:
@@ -990,6 +1014,8 @@ bool QAbstractScrollArea::viewportEvent(QEvent *e)
#endif
return QFrame::event(e);
case QEvent::LayoutRequest:
+ case QEvent::Gesture:
+ case QEvent::GestureOverride:
return event(e);
default:
break;
@@ -1266,11 +1292,13 @@ void QAbstractScrollAreaPrivate::_q_vslide(int y)
void QAbstractScrollAreaPrivate::_q_showOrHideScrollBars()
{
layoutChildren();
-#ifdef Q_OS_WIN
+#ifdef Q_WS_WIN
// Need to re-subscribe to gestures as the content changes to make sure we
// enable/disable panning when needed.
- winSetupGestures();
-#endif // Q_OS_WIN
+ QWidgetPrivate *dd = static_cast<QWidgetPrivate *>(QObjectPrivate::get(viewport));
+ if (dd)
+ dd->winSetupGestures();
+#endif // Q_WS_WIN
}
QPoint QAbstractScrollAreaPrivate::contentsOffset() const
@@ -1335,25 +1363,6 @@ void QAbstractScrollArea::setupViewport(QWidget *viewport)
Q_UNUSED(viewport);
}
-//void QAbstractScrollAreaPrivate::_q_gestureTriggered()
-//{
-// Q_Q(QAbstractScrollArea);
-// QPanGesture *g = qobject_cast<QPanGesture*>(q->sender());
-// if (!g)
-// return;
-// QScrollBar *hBar = q->horizontalScrollBar();
-// QScrollBar *vBar = q->verticalScrollBar();
-// QSizeF delta = g->lastOffset();
-// if (!delta.isNull()) {
-// if (QApplication::isRightToLeft())
-// delta.rwidth() *= -1;
-// int newX = hBar->value() - delta.width();
-// int newY = vBar->value() - delta.height();
-// hbar->setValue(newX);
-// vbar->setValue(newY);
-// }
-//}
-
QT_END_NAMESPACE
#include "moc_qabstractscrollarea.cpp"
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 8f17e981c8..0fc94c9d9d 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -401,7 +401,8 @@ void QLineControl::moveCursor(int pos, bool mark)
void QLineControl::processInputMethodEvent(QInputMethodEvent *event)
{
int priorState = 0;
- bool isGettingInput = !event->commitString().isEmpty() || !event->preeditString().isEmpty()
+ bool isGettingInput = !event->commitString().isEmpty()
+ || event->preeditString() != preeditAreaText()
|| event->replacementLength() > 0;
bool cursorPositionChanged = false;
diff --git a/src/gui/widgets/qplaintextedit.cpp b/src/gui/widgets/qplaintextedit.cpp
index bb93546a21..0de7421f16 100644
--- a/src/gui/widgets/qplaintextedit.cpp
+++ b/src/gui/widgets/qplaintextedit.cpp
@@ -730,9 +730,6 @@ QPlainTextEditPrivate::QPlainTextEditPrivate()
backgroundVisible = false;
centerOnScroll = false;
inDrag = false;
-#ifdef Q_WS_WIN
- singleFingerPanEnabled = true;
-#endif
}
@@ -789,6 +786,9 @@ void QPlainTextEditPrivate::init(const QString &txt)
viewport->setCursor(Qt::IBeamCursor);
#endif
originalOffsetY = 0;
+#ifdef Q_WS_WIN
+ setSingleFingerPanEnabled(true);
+#endif
}
void QPlainTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
@@ -1450,6 +1450,29 @@ bool QPlainTextEdit::event(QEvent *e)
d->sendControlEvent(e);
}
#endif
+ else if (e->type() == QEvent::Gesture) {
+ QGestureEvent *ge = static_cast<QGestureEvent *>(e);
+ QPanGesture *g = static_cast<QPanGesture *>(ge->gesture(Qt::PanGesture));
+ if (g) {
+ QScrollBar *hBar = horizontalScrollBar();
+ QScrollBar *vBar = verticalScrollBar();
+ if (g->state() == Qt::GestureStarted)
+ d->originalOffsetY = vBar->value();
+ QPointF offset = g->offset();
+ if (!offset.isNull()) {
+ if (QApplication::isRightToLeft())
+ offset.rx() *= -1;
+ // QPlainTextEdit scrolls by lines only in vertical direction
+ QFontMetrics fm(document()->defaultFont());
+ int lineHeight = fm.height();
+ int newX = hBar->value() - g->lastOffset().x();
+ int newY = d->originalOffsetY - offset.y()/lineHeight;
+ hBar->setValue(newX);
+ vBar->setValue(newY);
+ }
+ }
+ return true;
+ }
return QAbstractScrollArea::event(e);
}
@@ -2929,30 +2952,6 @@ QAbstractTextDocumentLayout::PaintContext QPlainTextEdit::getPaintContext() cons
(\a available is true) or unavailable (\a available is false).
*/
-//void QPlainTextEditPrivate::_q_gestureTriggered()
-//{
-// Q_Q(QPlainTextEdit);
-// QPanGesture *g = qobject_cast<QPanGesture*>(q->sender());
-// if (!g)
-// return;
-// QScrollBar *hBar = q->horizontalScrollBar();
-// QScrollBar *vBar = q->verticalScrollBar();
-// if (g->state() == Qt::GestureStarted)
-// originalOffsetY = vBar->value();
-// QSizeF totalOffset = g->totalOffset();
-// if (!totalOffset.isNull()) {
-// if (QApplication::isRightToLeft())
-// totalOffset.rwidth() *= -1;
-// // QPlainTextEdit scrolls by lines only in vertical direction
-// QFontMetrics fm(q->document()->defaultFont());
-// int lineHeight = fm.height();
-// int newX = hBar->value() - g->lastOffset().width();
-// int newY = originalOffsetY - totalOffset.height()/lineHeight;
-// hbar->setValue(newX);
-// vbar->setValue(newY);
-// }
-//}
-
QT_END_NAMESPACE
#include "moc_qplaintextedit.cpp"
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index d995e0f61e..88502e357f 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -116,9 +116,6 @@ QTextEditPrivate::QTextEditPrivate()
preferRichText = false;
showCursorOnInitialShow = true;
inDrag = false;
-#ifdef Q_WS_WIN
- setSingleFingerPanEnabled(true);
-#endif
}
void QTextEditPrivate::createAutoBulletList()
@@ -186,6 +183,9 @@ void QTextEditPrivate::init(const QString &html)
#ifndef QT_NO_CURSOR
viewport->setCursor(Qt::IBeamCursor);
#endif
+#ifdef Q_WS_WIN
+ setSingleFingerPanEnabled(true);
+#endif
}
void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index 7d6052b4d6..b2474ed136 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -15,14 +15,7 @@ contains(QT_CONFIG, opengl):CONFIG += opengl
contains(QT_CONFIG, opengles1):CONFIG += opengles1
contains(QT_CONFIG, opengles1cl):CONFIG += opengles1cl
contains(QT_CONFIG, opengles2):CONFIG += opengles2
-
-contains(QT_CONFIG, opengles.*) {
- for(p, QMAKE_LIBDIR_EGL) {
- exists($$p):LIBS_PRIVATE += -L$$p
- }
- !isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL
- !isEmpty(QMAKE_LIBS_EGL): LIBS_PRIVATE += $$QMAKE_LIBS_EGL
-}
+contains(QT_CONFIG, egl):CONFIG += egl
HEADERS += qgl.h \
qgl_p.h \
@@ -61,7 +54,7 @@ SOURCES += qgl.cpp \
gl2paintengineex/qpaintengineex_opengl2_p.h \
gl2paintengineex/qglengineshadersource_p.h \
gl2paintengineex/qglcustomshaderstage_p.h \
- gl2paintengineex/qtriangulatingstroker_p.h
+ gl2paintengineex/qtriangulatingstroker_p.h
SOURCES += qglshaderprogram.cpp \
qglpixmapfilter.cpp \
@@ -149,17 +142,3 @@ embedded {
}
INCLUDEPATH += ../3rdparty/harfbuzz/src
-
-contains(QT_CONFIG,opengles1) {
- LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1
- LIBS += $$QMAKE_LFLAGS_OPENGL_ES1
-} else:contains(QT_CONFIG,opengles1cl) {
- LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL
- LIBS += $$QMAKE_LFLAGS_OPENGL_ES1CL
-} else:contains(QT_CONFIG,opengles2) {
- LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES2
- LIBS += $$QMAKE_LFLAGS_OPENGL_ES2
-} else {
- LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL
- LIBS += $$QMAKE_LFLAGS_OPENGL
-}
diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp
index 8768fbc061..0eaab28b6d 100644
--- a/src/opengl/qglpixmapfilter.cpp
+++ b/src/opengl/qglpixmapfilter.cpp
@@ -518,7 +518,7 @@ bool QGLPixmapBlurFilter::processGL(QPainter *painter, const QPointF &pos, const
m_singlePass = false;
QGLFramebufferObjectFormat format;
- format.setInternalTextureFormat(GL_RGBA);
+ format.setInternalTextureFormat(GLenum(GL_RGBA));
QGLFramebufferObject *fbo = qgl_fbo_pool()->acquire(targetRect.size() / 2, format, true);
if (!fbo)
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 080c3b2105..e28c3821d6 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -2827,4 +2827,54 @@ void QGLShaderProgram::shaderDestroyed()
#endif
+#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
+/*! \internal */
+void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value)
+{
+ setUniformValue(location, GLint(value));
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValue(int location, QMacCompatGLuint value)
+{
+ setUniformValue(location, GLuint(value));
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValue(const char *name, QMacCompatGLint value)
+{
+ setUniformValue(name, GLint(value));
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValue(const char *name, QMacCompatGLuint value)
+{
+ setUniformValue(name, GLuint(value));
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValueArray(int location, const QMacCompatGLint *values, int count)
+{
+ setUniformValueArray(location, (const GLint *)values, count);
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValueArray(int location, const QMacCompatGLuint *values, int count)
+{
+ setUniformValueArray(location, (const GLuint *)values, count);
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGLint *values, int count)
+{
+ setUniformValueArray(name, (const GLint *)values, count);
+}
+
+/*! \internal */
+void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGLuint *values, int count)
+{
+ setUniformValueArray(name, (const GLuint *)values, count);
+}
+#endif
+
QT_END_NAMESPACE
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index b7bd2d751c..49c3364b67 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -181,6 +181,17 @@ public:
int uniformLocation(const QByteArray& name) const;
int uniformLocation(const QString& name) const;
+#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
+ void setUniformValue(int location, QMacCompatGLint value);
+ void setUniformValue(int location, QMacCompatGLuint value);
+ void setUniformValue(const char *name, QMacCompatGLint value);
+ void setUniformValue(const char *name, QMacCompatGLuint value);
+ void setUniformValueArray(int location, const QMacCompatGLint *values, int count);
+ void setUniformValueArray(int location, const QMacCompatGLuint *values, int count);
+ void setUniformValueArray(const char *name, const QMacCompatGLint *values, int count);
+ void setUniformValueArray(const char *name, const QMacCompatGLuint *values, int count);
+#endif
+
void setUniformValue(int location, GLfloat value);
void setUniformValue(int location, GLint value);
void setUniformValue(int location, GLuint value);
diff --git a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
index 473414486d..158633d5b7 100644
--- a/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
+++ b/src/plugins/sqldrivers/sqlite_symbian/sqlite_symbian.pro
@@ -1,5 +1,7 @@
# Use subdirs template to suppress generation of unnecessary files
TEMPLATE = subdirs
-# We just want to extract the zip file containing sqlite binaries for Symbian
-BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
+# We just want to export the sqlite3 binaries for Symbian for platforms that do not have them.
+!exists($${EPOCROOT}epoc32/release/armv5/lib/sqlite3.dso) {
+ BLD_INF_RULES.prj_exports += ":zip SQLite3_v9.2.zip"
+}
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 022a072c32..90c9f2719e 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -12,7 +12,7 @@ symbian: {
VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION}
qtresources.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/s60main.rsc
- qtresources.path = $$APP_RESOURCE_DIR
+ qtresources.path = c:$$APP_RESOURCE_DIR
qtlibraries.sources = \
QtCore.dll \
@@ -24,24 +24,24 @@ symbian: {
qts60plugindeployment = \
"IF package(0x1028315F)" \
- " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"!:\\sys\\bin\\qts60plugin_5_0.dll\"" \
+ " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \
"ELSEIF package(0x102752AE)" \
- " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"!:\\sys\\bin\\qts60plugin_3_2.dll\"" \
+ " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_2.dll\" - \"c:\\sys\\bin\\qts60plugin_3_2.dll\"" \
"ELSEIF package(0x102032BE)" \
- " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"!:\\sys\\bin\\qts60plugin_3_1.dll\"" \
+ " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_3_1.dll\" - \"c:\\sys\\bin\\qts60plugin_3_1.dll\"" \
"ELSE" \
- " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"!:\\sys\\bin\\qts60plugin_5_0.dll\"" \
+ " \"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/qts60plugin_5_0.dll\" - \"c:\\sys\\bin\\qts60plugin_5_0.dll\"" \
"ENDIF"
qtlibraries.pkg_postrules += qts60plugindeployment
sqlitedeployment = \
"; Deploy sqlite onto phone that does not have it (this should be replaced with embedded sis file when available)" \
"IF NOT package(0x2002533b) " \
- "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/sqlite3.dll\" - \"!:\\sys\\bin\\sqlite3.dll\"" \
+ "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/sqlite3.dll\" - \"c:\\sys\\bin\\sqlite3.dll\"" \
"ENDIF"
qtlibraries.pkg_postrules += sqlitedeployment
- qtlibraries.path = /sys/bin
+ qtlibraries.path = c:/sys/bin
vendorinfo = \
"; Localised Vendor name" \
@@ -67,15 +67,15 @@ symbian: {
!contains(QT_CONFIG, no-mng): imageformats_plugins.sources += qmng.dll
!contains(QT_CONFIG, no-tiff): imageformats_plugins.sources += qtiff.dll
!contains(QT_CONFIG, no-ico): imageformats_plugins.sources += qico.dll
- imageformats_plugins.path = $$QT_PLUGINS_BASE_DIR/imageformats
+ imageformats_plugins.path = c:$$QT_PLUGINS_BASE_DIR/imageformats
codecs_plugins.sources = qcncodecs.dll qjpcodecs.dll qtwcodecs.dll qkrcodecs.dll
- codecs_plugins.path = $$QT_PLUGINS_BASE_DIR/codecs
+ codecs_plugins.path = c:$$QT_PLUGINS_BASE_DIR/codecs
contains(QT_CONFIG, phonon-backend) {
phonon_backend_plugins.sources += phonon_mmf.dll
- phonon_backend_plugins.path = $$QT_PLUGINS_BASE_DIR/phonon_backend
+ phonon_backend_plugins.path = c:$$QT_PLUGINS_BASE_DIR/phonon_backend
DEPLOYMENT += phonon_backend_plugins
}
@@ -85,7 +85,7 @@ symbian: {
qtlibraries.sources += QtSvg.dll
imageformats_plugins.sources += qsvg.dll
iconengines_plugins.sources = qsvgicon.dll
- iconengines_plugins.path = $$QT_PLUGINS_BASE_DIR/iconengines
+ iconengines_plugins.path = c:$$QT_PLUGINS_BASE_DIR/iconengines
DEPLOYMENT += iconengines_plugins
}
@@ -105,9 +105,9 @@ symbian: {
qtlibraries.sources += QtWebKit.dll
}
- graphicssystems_plugins.path = $$QT_PLUGINS_BASE_DIR/graphicssystems
+ graphicssystems_plugins.path = c:$$QT_PLUGINS_BASE_DIR/graphicssystems
contains(QT_CONFIG, openvg) {
- qtlibraries.sources = QtOpenVG.dll
+ qtlibraries.sources += QtOpenVG.dll
graphicssystems_plugins.sources += qvggraphicssystem.dll
}
diff --git a/src/s60main/qts60main_mcrt0.cpp b/src/s60main/qts60main_mcrt0.cpp
index d30e07aa28..edc2fb88de 100644
--- a/src/s60main/qts60main_mcrt0.cpp
+++ b/src/s60main/qts60main_mcrt0.cpp
@@ -83,12 +83,10 @@ GLDEF_C TInt QtMainWrapper()
char **envp = 0;
// get args & environment
__crt0(argc, argv, envp);
- CleanupArrayDelete<char*>::PushL(argv);
- CleanupArrayDelete<char*>::PushL(envp);
//Call user(application)'s main
- int ret = 0;
- QT_TRYCATCH_LEAVING(ret = CALLMAIN(argc, argv, envp););
- CleanupStack::PopAndDestroy(2, argv);
+ TRAPD(ret, QT_TRYCATCH_LEAVING(ret = CALLMAIN(argc, argv, envp);));
+ delete[] argv;
+ delete[] envp;
return ret;
}
diff --git a/src/s60main/s60main.pro b/src/s60main/s60main.pro
index cc3c5475b5..47cf020f12 100644
--- a/src/s60main/s60main.pro
+++ b/src/s60main/s60main.pro
@@ -16,16 +16,6 @@ symbian {
SOURCES = qts60main.cpp \
qts60main_mcrt0.cpp
- # This block serves the minimalistic resource file for S60 3.1 platforms.
- # Note there is no way to ifdef S60 version in mmp file, that is why the resource
- # file is always compiled for WINSCW
- minimalAppResource31 = \
- "START RESOURCE s60main.rss" \
- "HEADER" \
- "TARGETPATH resource\apps" \
- "END"
- MMP_RULES += minimalAppResource31
-
# s60main needs to be built in ARM mode for GCCE to work.
MMP_RULES+="ALWAYS_BUILD_AS_ARM"
@@ -36,14 +26,4 @@ symbian {
error("$$_FILE_ is intended only for Symbian!")
}
-symbian-abld: {
- # abld build commands generated resources after the static library is built, and
- # we have dependency to resource from static lib -> resources need to be generated
- # explicitly before library
- rsgFix2.commands = "-$(DEL_FILE) $(EPOCROOT)Epoc32\Data\z\resource\apps\s60main.rsc >NUL 2>&1"
- rsgFix.commands = "-$(ABLD) resource $(PLATFORM) $(CFG) 2>NUL"
- QMAKE_EXTRA_TARGETS += rsgFix rsgFix2
- PRE_TARGETDEPS += rsgFix rsgFix2
-}
-
include(../qbase.pri)
diff --git a/src/xmlpatterns/acceltree/qacceltree_p.h b/src/xmlpatterns/acceltree/qacceltree_p.h
index 8da61c9b80..ee7d6f6805 100644
--- a/src/xmlpatterns/acceltree/qacceltree_p.h
+++ b/src/xmlpatterns/acceltree/qacceltree_p.h
@@ -89,7 +89,7 @@ namespace QPatternist
* @see <a href"http://www.inf.uni-konstanz.de/dbis/publications/download/accelerating-locsteps.pdf">Accelerating
* XPath Evaluation in Any RDBMS, Torsten Grust</a>
*/
- class AccelTree : public QAbstractXmlNodeModel
+ class Q_AUTOTEST_EXPORT AccelTree : public QAbstractXmlNodeModel
{
friend class AccelTreePrivate;
public:
diff --git a/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h b/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h
index bb547bd9ba..27e3c22fda 100644
--- a/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h
+++ b/src/xmlpatterns/acceltree/qcompressedwhitespace_p.h
@@ -84,7 +84,7 @@ namespace QPatternist
*
* @author Frans Englich <frans.englich@nokia.com>
*/
- class CompressedWhitespace
+ class Q_AUTOTEST_EXPORT CompressedWhitespace
{
public:
/**
diff --git a/tests/auto/checkxmlfiles/checkxmlfiles.pro b/tests/auto/checkxmlfiles/checkxmlfiles.pro
index c368c02114..d53c11cedc 100644
--- a/tests/auto/checkxmlfiles/checkxmlfiles.pro
+++ b/tests/auto/checkxmlfiles/checkxmlfiles.pro
@@ -12,7 +12,7 @@ addFiles.sources = \
$$QT_SOURCE_TREE/examples/sql/masterdetail/albumdetails.xml \
$$QT_SOURCE_TREE/examples/xmlpatterns/xquery/globalVariables/globals.gccxml \
$$QT_SOURCE_TREE/doc/src/diagrams/stylesheet/treeview.svg \
- $$QT_SOURCE_TREE/doc/src/diagrams/designer-mainwindow-actions.ui \
+ $$QT_SOURCE_TREE/doc/src/diagrams/designer-manual/designer-mainwindow-actions.ui \
$$QT_SOURCE_TREE/demos/undo/undo.qrc
addFiles.path = xmlfiles
DEPLOYMENT += addFiles
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp
index 02c823264f..20b53f2d34 100644
--- a/tests/auto/gestures/tst_gestures.cpp
+++ b/tests/auto/gestures/tst_gestures.cpp
@@ -111,12 +111,12 @@ public:
CustomEvent::EventType = QEvent::registerEventType();
}
- QGesture* createGesture(QObject *)
+ QGesture* create(QObject *)
{
return new CustomGesture;
}
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject*, QEvent *event)
+ QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event)
{
if (event->type() == CustomEvent::EventType) {
QGestureRecognizer::Result result = 0;
@@ -128,13 +128,13 @@ public:
if (e->hasHotSpot)
g->setHotSpot(e->hotSpot);
if (g->serial >= CustomGesture::SerialFinishedThreshold)
- result |= QGestureRecognizer::GestureFinished;
+ result |= QGestureRecognizer::FinishGesture;
else if (g->serial >= CustomGesture::SerialStartedThreshold)
- result |= QGestureRecognizer::GestureTriggered;
+ result |= QGestureRecognizer::TriggerGesture;
else if (g->serial >= CustomGesture::SerialMaybeThreshold)
- result |= QGestureRecognizer::MaybeGesture;
+ result |= QGestureRecognizer::MayBeGesture;
else
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
return result;
}
return QGestureRecognizer::Ignore;
@@ -142,7 +142,7 @@ public:
void reset(QGesture *state)
{
- CustomGesture *g = static_cast<CustomGesture*>(state);
+ CustomGesture *g = static_cast<CustomGesture *>(state);
g->serial = 0;
QGestureRecognizer::reset(state);
}
@@ -159,26 +159,26 @@ public:
CustomEvent::EventType = QEvent::registerEventType();
}
- QGesture* createGesture(QObject *)
+ QGesture* create(QObject *)
{
return new CustomGesture;
}
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject*, QEvent *event)
+ QGestureRecognizer::Result recognize(QGesture *state, QObject*, QEvent *event)
{
if (event->type() == CustomEvent::EventType) {
QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint;
- CustomGesture *g = static_cast<CustomGesture*>(state);
- CustomEvent *e = static_cast<CustomEvent*>(event);
+ CustomGesture *g = static_cast<CustomGesture *>(state);
+ CustomEvent *e = static_cast<CustomEvent *>(event);
g->serial = e->serial;
if (e->hasHotSpot)
g->setHotSpot(e->hotSpot);
if (g->serial >= CustomGesture::SerialFinishedThreshold)
- result |= QGestureRecognizer::GestureFinished;
+ result |= QGestureRecognizer::FinishGesture;
else if (g->serial >= CustomGesture::SerialMaybeThreshold)
- result |= QGestureRecognizer::GestureTriggered;
+ result |= QGestureRecognizer::TriggerGesture;
else
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
return result;
}
return QGestureRecognizer::Ignore;
@@ -186,7 +186,7 @@ public:
void reset(QGesture *state)
{
- CustomGesture *g = static_cast<CustomGesture*>(state);
+ CustomGesture *g = static_cast<CustomGesture *>(state);
g->serial = 0;
QGestureRecognizer::reset(state);
}
@@ -256,7 +256,7 @@ protected:
}
if (eventsPtr) {
QGestureEvent *e = static_cast<QGestureEvent*>(event);
- QList<QGesture*> gestures = e->allGestures();
+ QList<QGesture*> gestures = e->gestures();
foreach(QGesture *g, gestures) {
eventsPtr->all << g->gestureType();
switch(g->state()) {
@@ -332,6 +332,7 @@ private slots:
void consumeEventHint();
void unregisterRecognizer();
void autoCancelGestures();
+ void autoCancelGestures2();
};
tst_Gestures::tst_Gestures()
@@ -344,14 +345,14 @@ tst_Gestures::~tst_Gestures()
void tst_Gestures::initTestCase()
{
- CustomGesture::GestureType = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
+ CustomGesture::GestureType = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
QVERIFY(CustomGesture::GestureType != Qt::GestureType(0));
QVERIFY(CustomGesture::GestureType != Qt::CustomGesture);
}
void tst_Gestures::cleanupTestCase()
{
- QApplication::unregisterGestureRecognizer(CustomGesture::GestureType);
+ QGestureRecognizer::unregisterRecognizer(CustomGesture::GestureType);
}
void tst_Gestures::init()
@@ -365,7 +366,7 @@ void tst_Gestures::cleanup()
void tst_Gestures::customGesture()
{
GestureWidget widget;
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
CustomEvent event;
sendCustomGesture(&event, &widget);
@@ -386,7 +387,7 @@ void tst_Gestures::customGesture()
void tst_Gestures::consumeEventHint()
{
GestureWidget widget;
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
CustomGestureRecognizer::ConsumeEvents = true;
CustomEvent event;
@@ -399,7 +400,7 @@ void tst_Gestures::consumeEventHint()
void tst_Gestures::autoCancelingGestures()
{
GestureWidget widget;
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
// send partial gesture. The gesture will be in the "maybe" state, but will
// never get enough events to fire, so Qt will have to kill it.
CustomEvent ev;
@@ -423,7 +424,7 @@ void tst_Gestures::gestureOverChild()
GestureWidget *child = new GestureWidget("child");
l->addWidget(child);
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
CustomEvent event;
sendCustomGesture(&event, child);
@@ -439,7 +440,7 @@ void tst_Gestures::gestureOverChild()
QCOMPARE(widget.gestureOverrideEventsReceived, 0);
// enable gestures over the children
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetWithChildrenGesture);
+ widget.grabGesture(CustomGesture::GestureType);
widget.reset();
child->reset();
@@ -468,8 +469,8 @@ void tst_Gestures::multipleWidgetOnlyGestureInTree()
GestureWidget *child = new GestureWidget("child");
l->addWidget(child);
- parent.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
- child->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ parent.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ child->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
static const int TotalCustomEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialMaybeThreshold + 1;
@@ -506,8 +507,8 @@ void tst_Gestures::conflictingGestures()
GestureWidget *child = new GestureWidget("child");
l->addWidget(child);
- parent.grabGesture(CustomGesture::GestureType, Qt::WidgetWithChildrenGesture);
- child->grabGesture(CustomGesture::GestureType, Qt::WidgetWithChildrenGesture);
+ parent.grabGesture(CustomGesture::GestureType);
+ child->grabGesture(CustomGesture::GestureType);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -542,7 +543,9 @@ void tst_Gestures::conflictingGestures()
parent.reset();
child->reset();
- // nobody accepts the override, we will send normal events to the closest context (to the child)
+ // nobody accepts the override, we will send normal events to the closest
+ // context (i.e. to the child widget) and it will be propagated and
+ // accepted by the parent widget
parent.acceptGestureOverride = false;
child->acceptGestureOverride = false;
child->ignoredGestures << CustomGesture::GestureType;
@@ -551,6 +554,41 @@ void tst_Gestures::conflictingGestures()
sendCustomGesture(&event, child);
QCOMPARE(child->gestureOverrideEventsReceived, 1);
+ QCOMPARE(child->gestureEventsReceived, 1);
+ QCOMPARE(parent.gestureOverrideEventsReceived, 1);
+ QCOMPARE(parent.gestureEventsReceived, TotalGestureEventsCount);
+
+ parent.reset();
+ child->reset();
+
+ // nobody accepts the override, and nobody accepts the gesture event
+ parent.acceptGestureOverride = false;
+ child->acceptGestureOverride = false;
+ parent.ignoredGestures << CustomGesture::GestureType;
+ child->ignoredGestures << CustomGesture::GestureType;
+
+ // sending events to the child and making sure there is no conflict
+ sendCustomGesture(&event, child);
+
+ QCOMPARE(child->gestureOverrideEventsReceived, 1);
+ QCOMPARE(child->gestureEventsReceived, TotalGestureEventsCount);
+ QCOMPARE(parent.gestureOverrideEventsReceived, 1);
+ QCOMPARE(parent.gestureEventsReceived, 1);
+
+ parent.reset();
+ child->reset();
+
+ // we set an attribute to make sure all gesture events are propagated
+ parent.grabGesture(CustomGesture::GestureType, Qt::ReceivePartialGestures);
+ parent.acceptGestureOverride = false;
+ child->acceptGestureOverride = false;
+ parent.ignoredGestures << CustomGesture::GestureType;
+ child->ignoredGestures << CustomGesture::GestureType;
+
+ // sending events to the child and making sure there is no conflict
+ sendCustomGesture(&event, child);
+
+ QCOMPARE(child->gestureOverrideEventsReceived, 1);
QCOMPARE(child->gestureEventsReceived, TotalGestureEventsCount);
QCOMPARE(parent.gestureOverrideEventsReceived, 1);
QCOMPARE(parent.gestureEventsReceived, TotalGestureEventsCount);
@@ -558,7 +596,7 @@ void tst_Gestures::conflictingGestures()
parent.reset();
child->reset();
- Qt::GestureType ContinuousGesture = QApplication::registerGestureRecognizer(new CustomContinuousGestureRecognizer);
+ Qt::GestureType ContinuousGesture = QGestureRecognizer::registerRecognizer(new CustomContinuousGestureRecognizer);
static const int ContinuousGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialMaybeThreshold + 1;
child->grabGesture(ContinuousGesture);
// child accepts override. And it also receives another custom gesture.
@@ -572,13 +610,13 @@ void tst_Gestures::conflictingGestures()
QCOMPARE(parent.gestureOverrideEventsReceived, 0);
QCOMPARE(parent.gestureEventsReceived, 0);
- QApplication::unregisterGestureRecognizer(ContinuousGesture);
+ QGestureRecognizer::unregisterRecognizer(ContinuousGesture);
}
void tst_Gestures::finishedWithoutStarted()
{
GestureWidget widget;
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
// the gesture will claim it finished, but it was never started.
CustomEvent ev;
@@ -598,9 +636,9 @@ void tst_Gestures::finishedWithoutStarted()
void tst_Gestures::unknownGesture()
{
GestureWidget widget;
- widget.grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
- widget.grabGesture(Qt::CustomGesture, Qt::WidgetGesture);
- widget.grabGesture(Qt::GestureType(Qt::PanGesture+512), Qt::WidgetGesture);
+ widget.grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ widget.grabGesture(Qt::CustomGesture, Qt::DontStartGestureOnChildren);
+ widget.grabGesture(Qt::GestureType(Qt::PanGesture+512), Qt::DontStartGestureOnChildren);
CustomEvent event;
sendCustomGesture(&event, &widget);
@@ -702,7 +740,7 @@ protected:
}
if (eventsPtr) {
QGestureEvent *e = static_cast<QGestureEvent*>(event);
- QList<QGesture*> gestures = e->allGestures();
+ QList<QGesture*> gestures = e->gestures();
foreach(QGesture *g, gestures) {
eventsPtr->all << g->gestureType();
switch(g->state()) {
@@ -746,7 +784,7 @@ void tst_Gestures::graphicsItemGesture()
QTest::qWaitForWindowShown(&view);
view.ensureVisible(scene.sceneRect());
- view.viewport()->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
item->grabGesture(CustomGesture::GestureType);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -820,7 +858,7 @@ void tst_Gestures::graphicsItemTreeGesture()
QTest::qWaitForWindowShown(&view);
view.ensureVisible(scene.sceneRect());
- view.viewport()->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
item1->grabGesture(CustomGesture::GestureType);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -850,7 +888,7 @@ void tst_Gestures::graphicsItemTreeGesture()
QCOMPARE(item1_child2->gestureEventsReceived, 0);
QCOMPARE(item1_child2->gestureOverrideEventsReceived, 0);
QCOMPARE(item1->gestureOverrideEventsReceived, 1);
- QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount);
+ QCOMPARE(item1->gestureEventsReceived, 1);
}
void tst_Gestures::explicitGraphicsObjectTarget()
@@ -878,10 +916,10 @@ void tst_Gestures::explicitGraphicsObjectTarget()
QTest::qWaitForWindowShown(&view);
view.ensureVisible(scene.sceneRect());
- view.viewport()->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
- item1->grabGesture(CustomGesture::GestureType, Qt::ItemGesture);
- item2->grabGesture(CustomGesture::GestureType, Qt::ItemGesture);
- item2_child1->grabGesture(CustomGesture::GestureType, Qt::ItemGesture);
+ view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ item1->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ item2->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ item2_child1->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -938,7 +976,7 @@ void tst_Gestures::gestureOverChildGraphicsItem()
QTest::qWaitForWindowShown(&view);
view.ensureVisible(scene.sceneRect());
- view.viewport()->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
+ view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
item1->grabGesture(CustomGesture::GestureType);
static const int TotalGestureEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialStartedThreshold + 1;
@@ -965,7 +1003,39 @@ void tst_Gestures::gestureOverChildGraphicsItem()
event.hasHotSpot = true;
sendCustomGesture(&event, item0, &scene);
- QCOMPARE(item0->customEventsReceived, TotalCustomEventsCount);
+ QCOMPARE(item2_child1->gestureEventsReceived, 0);
+ QCOMPARE(item2_child1->gestureOverrideEventsReceived, 0);
+ QCOMPARE(item2->gestureEventsReceived, 1);
+ QCOMPARE(item2->gestureOverrideEventsReceived, 1);
+ QCOMPARE(item1->gestureEventsReceived, TotalGestureEventsCount);
+ QCOMPARE(item1->gestureOverrideEventsReceived, 1);
+
+ item0->reset(); item1->reset(); item2->reset(); item2_child1->reset();
+ item2->grabGesture(CustomGesture::GestureType);
+ item2->ignoredGestures << CustomGesture::GestureType;
+ item1->ignoredGestures << CustomGesture::GestureType;
+
+ event.hotSpot = mapToGlobal(QPointF(10, 10), item2_child1, &view);
+ event.hasHotSpot = true;
+ sendCustomGesture(&event, item0, &scene);
+
+ QCOMPARE(item2_child1->gestureEventsReceived, 0);
+ QCOMPARE(item2_child1->gestureOverrideEventsReceived, 0);
+ QCOMPARE(item2->gestureEventsReceived, TotalGestureEventsCount);
+ QCOMPARE(item2->gestureOverrideEventsReceived, 1);
+ QCOMPARE(item1->gestureEventsReceived, 1);
+ QCOMPARE(item1->gestureOverrideEventsReceived, 1);
+
+ item0->reset(); item1->reset(); item2->reset(); item2_child1->reset();
+ item2->grabGesture(CustomGesture::GestureType);
+ item2->ignoredGestures << CustomGesture::GestureType;
+ item1->ignoredGestures << CustomGesture::GestureType;
+ item1->grabGesture(CustomGesture::GestureType, Qt::ReceivePartialGestures);
+
+ event.hotSpot = mapToGlobal(QPointF(10, 10), item2_child1, &view);
+ event.hasHotSpot = true;
+ sendCustomGesture(&event, item0, &scene);
+
QCOMPARE(item2_child1->gestureEventsReceived, 0);
QCOMPARE(item2_child1->gestureOverrideEventsReceived, 0);
QCOMPARE(item2->gestureEventsReceived, TotalGestureEventsCount);
@@ -981,10 +1051,10 @@ void tst_Gestures::twoGesturesOnDifferentLevel()
GestureWidget *child = new GestureWidget("child");
l->addWidget(child);
- Qt::GestureType SecondGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType SecondGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
- parent.grabGesture(CustomGesture::GestureType, Qt::WidgetWithChildrenGesture);
- child->grabGesture(SecondGesture, Qt::WidgetWithChildrenGesture);
+ parent.grabGesture(CustomGesture::GestureType);
+ child->grabGesture(SecondGesture);
CustomEvent event;
// sending events that form a gesture to one widget, but they will be
@@ -1009,7 +1079,7 @@ void tst_Gestures::twoGesturesOnDifferentLevel()
for(int i = 0; i < child->events.all.size(); ++i)
QCOMPARE(parent.events.all.at(i), CustomGesture::GestureType);
- QApplication::unregisterGestureRecognizer(SecondGesture);
+ QGestureRecognizer::unregisterRecognizer(SecondGesture);
}
void tst_Gestures::multipleGesturesInTree()
@@ -1021,18 +1091,19 @@ void tst_Gestures::multipleGesturesInTree()
GestureWidget *D = new GestureWidget("D", C);
Qt::GestureType FirstGesture = CustomGesture::GestureType;
- Qt::GestureType SecondGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType ThirdGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
-
- A->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture); // A [1 3]
- A->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture); // |
- B->grabGesture(SecondGesture, Qt::WidgetWithChildrenGesture); // B [ 2 3]
- B->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture); // |
- C->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture); // C [1 2 3]
- C->grabGesture(SecondGesture, Qt::WidgetWithChildrenGesture); // |
- C->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture); // D [1 3]
- D->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture);
- D->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture);
+ Qt::GestureType SecondGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType ThirdGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+
+ Qt::GestureFlags flags = Qt::ReceivePartialGestures;
+ A->grabGesture(FirstGesture, flags); // A [1 3]
+ A->grabGesture(ThirdGesture, flags); // |
+ B->grabGesture(SecondGesture, flags); // B [ 2 3]
+ B->grabGesture(ThirdGesture, flags); // |
+ C->grabGesture(FirstGesture, flags); // C [1 2 3]
+ C->grabGesture(SecondGesture, flags); // |
+ C->grabGesture(ThirdGesture, flags); // D [1 3]
+ D->grabGesture(FirstGesture, flags);
+ D->grabGesture(ThirdGesture, flags);
// make sure all widgets ignore events, so they get propagated.
A->ignoredGestures << FirstGesture << ThirdGesture;
@@ -1079,8 +1150,8 @@ void tst_Gestures::multipleGesturesInTree()
QCOMPARE(A->events.all.count(SecondGesture), 0);
QCOMPARE(A->events.all.count(ThirdGesture), TotalGestureEventsCount);
- QApplication::unregisterGestureRecognizer(SecondGesture);
- QApplication::unregisterGestureRecognizer(ThirdGesture);
+ QGestureRecognizer::unregisterRecognizer(SecondGesture);
+ QGestureRecognizer::unregisterRecognizer(ThirdGesture);
}
void tst_Gestures::multipleGesturesInComplexTree()
@@ -1092,26 +1163,27 @@ void tst_Gestures::multipleGesturesInComplexTree()
GestureWidget *D = new GestureWidget("D", C);
Qt::GestureType FirstGesture = CustomGesture::GestureType;
- Qt::GestureType SecondGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType ThirdGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType FourthGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType FifthGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType SixthGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
- Qt::GestureType SeventhGesture = QApplication::registerGestureRecognizer(new CustomGestureRecognizer);
-
- A->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture); // A [1,3,4]
- A->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture); // |
- A->grabGesture(FourthGesture, Qt::WidgetWithChildrenGesture); // B [2,3,5]
- B->grabGesture(SecondGesture, Qt::WidgetWithChildrenGesture); // |
- B->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture); // C [1,2,3,6]
- B->grabGesture(FifthGesture, Qt::WidgetWithChildrenGesture); // |
- C->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture); // D [1,3,7]
- C->grabGesture(SecondGesture, Qt::WidgetWithChildrenGesture);
- C->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture);
- C->grabGesture(SixthGesture, Qt::WidgetWithChildrenGesture);
- D->grabGesture(FirstGesture, Qt::WidgetWithChildrenGesture);
- D->grabGesture(ThirdGesture, Qt::WidgetWithChildrenGesture);
- D->grabGesture(SeventhGesture, Qt::WidgetWithChildrenGesture);
+ Qt::GestureType SecondGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType ThirdGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType FourthGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType FifthGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType SixthGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+ Qt::GestureType SeventhGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+
+ Qt::GestureFlags flags = Qt::ReceivePartialGestures;
+ A->grabGesture(FirstGesture, flags); // A [1,3,4]
+ A->grabGesture(ThirdGesture, flags); // |
+ A->grabGesture(FourthGesture, flags); // B [2,3,5]
+ B->grabGesture(SecondGesture, flags); // |
+ B->grabGesture(ThirdGesture, flags); // C [1,2,3,6]
+ B->grabGesture(FifthGesture, flags); // |
+ C->grabGesture(FirstGesture, flags); // D [1,3,7]
+ C->grabGesture(SecondGesture, flags);
+ C->grabGesture(ThirdGesture, flags);
+ C->grabGesture(SixthGesture, flags);
+ D->grabGesture(FirstGesture, flags);
+ D->grabGesture(ThirdGesture, flags);
+ D->grabGesture(SeventhGesture, flags);
// make sure all widgets ignore events, so they get propagated.
QSet<Qt::GestureType> allGestureTypes;
@@ -1175,12 +1247,12 @@ void tst_Gestures::multipleGesturesInComplexTree()
QCOMPARE(A->events.all.count(SixthGesture), 0);
QCOMPARE(A->events.all.count(SeventhGesture), 0);
- QApplication::unregisterGestureRecognizer(SecondGesture);
- QApplication::unregisterGestureRecognizer(ThirdGesture);
- QApplication::unregisterGestureRecognizer(FourthGesture);
- QApplication::unregisterGestureRecognizer(FifthGesture);
- QApplication::unregisterGestureRecognizer(SixthGesture);
- QApplication::unregisterGestureRecognizer(SeventhGesture);
+ QGestureRecognizer::unregisterRecognizer(SecondGesture);
+ QGestureRecognizer::unregisterRecognizer(ThirdGesture);
+ QGestureRecognizer::unregisterRecognizer(FourthGesture);
+ QGestureRecognizer::unregisterRecognizer(FifthGesture);
+ QGestureRecognizer::unregisterRecognizer(SixthGesture);
+ QGestureRecognizer::unregisterRecognizer(SeventhGesture);
}
void tst_Gestures::testMapToScene()
@@ -1189,7 +1261,7 @@ void tst_Gestures::testMapToScene()
QList<QGesture*> list;
list << &gesture;
QGestureEvent event(list);
- QCOMPARE(event.mapToScene(gesture.hotSpot()), QPointF()); // not set, can't do much
+ QCOMPARE(event.mapToGraphicsScene(gesture.hotSpot()), QPointF()); // not set, can't do much
QGraphicsScene scene;
QGraphicsView view(&scene);
@@ -1206,7 +1278,7 @@ void tst_Gestures::testMapToScene()
QPoint origin = view.mapToGlobal(QPoint());
event.setWidget(view.viewport());
- QCOMPARE(event.mapToScene(origin + QPoint(100, 200)), view.mapToScene(QPoint(100, 200)));
+ QCOMPARE(event.mapToGraphicsScene(origin + QPoint(100, 200)), view.mapToScene(QPoint(100, 200)));
}
void tst_Gestures::ungrabGesture() // a method on QWidget
@@ -1224,7 +1296,7 @@ void tst_Gestures::ungrabGesture() // a method on QWidget
if (event->type() == QEvent::Gesture) {
QGestureEvent *gestureEvent = static_cast<QGestureEvent*>(event);
if (gestureEvent)
- foreach (QGesture *g, gestureEvent->allGestures())
+ foreach (QGesture *g, gestureEvent->gestures())
gestures.insert(g);
}
return GestureWidget::event(event);
@@ -1235,8 +1307,8 @@ void tst_Gestures::ungrabGesture() // a method on QWidget
MockGestureWidget *a = &parent;
MockGestureWidget *b = new MockGestureWidget("B", a);
- a->grabGesture(CustomGesture::GestureType, Qt::WidgetGesture);
- b->grabGesture(CustomGesture::GestureType, Qt::WidgetWithChildrenGesture);
+ a->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ b->grabGesture(CustomGesture::GestureType);
b->ignoredGestures << CustomGesture::GestureType;
CustomEvent event;
@@ -1295,20 +1367,6 @@ void tst_Gestures::unregisterRecognizer() // a method on QApplication
void tst_Gestures::autoCancelGestures()
{
- class MockRecognizer : public QGestureRecognizer {
- public:
- QGestureRecognizer::Result filterEvent(QGesture *gesture, QObject *watched, QEvent *event)
- {
- Q_UNUSED(gesture);
- Q_UNUSED(watched);
- if (event->type() == QEvent::MouseButtonPress)
- return QGestureRecognizer::GestureTriggered;
- if (event->type() == QEvent::MouseButtonRelease)
- return QGestureRecognizer::GestureFinished;
- return QGestureRecognizer::Ignore;
- }
- };
-
class MockWidget : public GestureWidget {
public:
MockWidget(const char *name) : GestureWidget(name) { }
@@ -1317,21 +1375,25 @@ void tst_Gestures::autoCancelGestures()
{
if (event->type() == QEvent::Gesture) {
QGestureEvent *ge = static_cast<QGestureEvent*>(event);
- Q_ASSERT(ge->allGestures().count() == 1); // can't use QCOMPARE here...
- ge->allGestures().first()->setGestureCancelPolicy(QGesture::CancelAllInContext);
+ Q_ASSERT(ge->gestures().count() == 1); // can't use QCOMPARE here...
+ ge->gestures().first()->setGestureCancelPolicy(QGesture::CancelAllInContext);
}
return GestureWidget::event(event);
}
};
+ const Qt::GestureType secondGesture = QGestureRecognizer::registerRecognizer(new CustomGestureRecognizer);
+
MockWidget parent("parent"); // this one sets the cancel policy to CancelAllInContext
parent.resize(300, 100);
+ parent.setWindowFlags(Qt::X11BypassWindowManagerHint);
GestureWidget *child = new GestureWidget("child", &parent);
child->setGeometry(10, 10, 100, 80);
- Qt::GestureType type = QApplication::registerGestureRecognizer(new MockRecognizer());
- parent.grabGesture(type, Qt::WidgetWithChildrenGesture);
- child->grabGesture(type, Qt::WidgetWithChildrenGesture);
+ parent.grabGesture(CustomGesture::GestureType);
+ child->grabGesture(secondGesture);
+ parent.show();
+ QTest::qWaitForWindowShown(&parent);
/*
An event is send to both the child and the parent, when the child gets it a gesture is triggered
@@ -1340,18 +1402,73 @@ void tst_Gestures::autoCancelGestures()
parent gets it he accepts it and that causes the cancel policy to activate.
The cause of that is the gesture for the child is cancelled and send to the child as such.
*/
- QMouseEvent event(QEvent::MouseButtonPress, QPoint(20,20), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ CustomEvent event;
+ event.serial = CustomGesture::SerialStartedThreshold;
QApplication::sendEvent(child, &event);
+ QCOMPARE(child->events.all.count(), 2);
QCOMPARE(child->events.started.count(), 1);
- QCOMPARE(child->events.all.count(), 1);
- QCOMPARE(parent.events.all.count(), 0);
- child->reset();
- QApplication::sendEvent(&parent, &event);
+ QCOMPARE(child->events.canceled.count(), 1);
QCOMPARE(parent.events.all.count(), 1);
- QCOMPARE(parent.events.started.count(), 1);
- QCOMPARE(child->events.started.count(), 0);
- QCOMPARE(child->events.all.count(), 1);
+
+ // clean up, make the parent gesture finish
+ event.serial = CustomGesture::SerialFinishedThreshold;
+ QApplication::sendEvent(child, &event);
+ QCOMPARE(parent.events.all.count(), 2);
+}
+
+void tst_Gestures::autoCancelGestures2()
+{
+ class MockItem : public GestureItem {
+ public:
+ MockItem(const char *name) : GestureItem(name) { }
+
+ bool event(QEvent *event) {
+ if (event->type() == QEvent::Gesture) {
+ QGestureEvent *ge = static_cast<QGestureEvent*>(event);
+ Q_ASSERT(ge->gestures().count() == 1); // can't use QCOMPARE here...
+ ge->gestures().first()->setGestureCancelPolicy(QGesture::CancelAllInContext);
+ }
+ return GestureItem::event(event);
+ }
+ };
+
+ const Qt::GestureType secondGesture = QGestureRecognizer ::registerRecognizer(new CustomGestureRecognizer);
+
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+
+ MockItem *parent = new MockItem("parent");
+ GestureItem *child = new GestureItem("child");
+ child->setParentItem(parent);
+ parent->setPos(0, 0);
+ child->setPos(10, 10);
+ scene.addItem(parent);
+ view.viewport()->grabGesture(CustomGesture::GestureType, Qt::DontStartGestureOnChildren);
+ view.viewport()->grabGesture(secondGesture, Qt::DontStartGestureOnChildren);
+ parent->grabGesture(CustomGesture::GestureType);
+ child->grabGesture(secondGesture);
+
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ view.ensureVisible(scene.sceneRect());
+
+ CustomEvent event;
+ event.serial = CustomGesture::SerialStartedThreshold;
+ event.hasHotSpot = true;
+ event.hotSpot = mapToGlobal(QPointF(5, 5), child, &view);
+ // qDebug() << event.hotSpot;
+ scene.sendEvent(child, &event);
+ //QEventLoop().exec();
+ QCOMPARE(parent->events.all.count(), 1);
+ QCOMPARE(child->events.started.count(), 1);
QCOMPARE(child->events.canceled.count(), 1);
+ QCOMPARE(child->events.all.count(), 2);
+
+ // clean up, make the parent gesture finish
+ event.serial = CustomGesture::SerialFinishedThreshold;
+ scene.sendEvent(child, &event);
+ QCOMPARE(parent->events.all.count(), 2);
}
QTEST_MAIN(tst_Gestures)
diff --git a/tests/auto/q3filedialog/tst_q3filedialog.cpp b/tests/auto/q3filedialog/tst_q3filedialog.cpp
index 2585f60b71..e2686eb97d 100644
--- a/tests/auto/q3filedialog/tst_q3filedialog.cpp
+++ b/tests/auto/q3filedialog/tst_q3filedialog.cpp
@@ -59,7 +59,9 @@ public:
virtual ~tst_Q3FileDialog();
private slots:
+#ifndef QT_MAC_USE_COCOA
void getSetCheck();
+#endif
};
tst_Q3FileDialog::tst_Q3FileDialog()
@@ -70,6 +72,7 @@ tst_Q3FileDialog::~tst_Q3FileDialog()
{
}
+#ifndef QT_MAC_USE_COCOA
class Preview : public QLabel, public Q3FilePreview
{
public:
@@ -125,6 +128,7 @@ void tst_Q3FileDialog::getSetCheck()
obj1.setPreviewMode(Q3FileDialog::PreviewMode(Q3FileDialog::Info));
QCOMPARE(obj1.previewMode(), Q3FileDialog::PreviewMode(Q3FileDialog::Info));
}
+#endif
QTEST_MAIN(tst_Q3FileDialog)
#include "tst_q3filedialog.moc"
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 508eba1d9e..62a38afa5d 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -13,7 +13,18 @@ win32 {
wince*|symbian*: {
copier.sources = ../copier/copier.exe
copier.path = copier
- paster.sources = ../paster/paster.exe
+ paster.sources = ../paster/paster.exe
paster.path = paster
- DEPLOYMENT = copier paster
+
+ symbian*: {
+ load(data_caging_paths)
+ rsc.sources = $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/copier.rsc
+ rsc.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/paster.rsc
+ rsc.path = $$APP_RESOURCE_DIR
+ reg_resource.sources = $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/copier_reg.rsc
+ reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc
+ reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
+ }
+
+ DEPLOYMENT = copier paster rsc reg_resource
} \ No newline at end of file
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp
index c53780e45e..11404022e6 100644
--- a/tests/auto/qdatetime/tst_qdatetime.cpp
+++ b/tests/auto/qdatetime/tst_qdatetime.cpp
@@ -450,11 +450,12 @@ void tst_QDateTime::toString_enumformat()
qDebug() << str3;
QVERIFY(!str3.isEmpty());
//check for date/time components in any order
- QVERIFY(str3.contains("1995"));
+ //year may be 2 or 4 digits
+ QVERIFY(str3.contains("95"));
//day and month may be in numeric or word form
QVERIFY(str3.contains("12"));
QVERIFY(str3.contains("34"));
- QVERIFY(str3.contains("56"));
+ //seconds may be absent
}
void tst_QDateTime::addDays()
diff --git a/tests/auto/qsound/tst_qsound.cpp b/tests/auto/qsound/tst_qsound.cpp
index 56a330b590..73eca983a1 100644
--- a/tests/auto/qsound/tst_qsound.cpp
+++ b/tests/auto/qsound/tst_qsound.cpp
@@ -55,20 +55,32 @@ public:
tst_QSound( QObject* parent=0) : QObject(parent) {}
private slots:
- void checkFinished();
+ void checkFinished();
+
+ // Manual tests
+ void staticPlay();
};
void tst_QSound::checkFinished()
{
- QSound sound(SRCDIR"4.wav");
- sound.setLoops(3);
- sound.play();
- QTest::qWait(5000);
+ QSound sound(SRCDIR"4.wav");
+ sound.setLoops(3);
+ sound.play();
+ QTest::qWait(5000);
#if defined(Q_WS_QWS)
- QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
+ QEXPECT_FAIL("", "QSound buggy on embedded (task QTBUG-157)", Abort);
#endif
- QVERIFY(sound.isFinished() );
+ QVERIFY(sound.isFinished() );
+}
+
+void tst_QSound::staticPlay()
+{
+ QSKIP("Test disabled -- only for manual purposes", SkipAll);
+
+ // Check that you hear sound with static play also.
+ QSound::play(SRCDIR"4.wav");
+ QTest::qWait(2000);
}
QTEST_MAIN(tst_QSound);
diff --git a/tests/auto/qtextscriptengine/generate/generate.pro b/tests/auto/qtextscriptengine/generate/generate.pro
index 355633d6f2..354e0e5cdf 100644
--- a/tests/auto/qtextscriptengine/generate/generate.pro
+++ b/tests/auto/qtextscriptengine/generate/generate.pro
@@ -5,6 +5,7 @@
TEMPLATE = app
CONFIG -= moc
INCLUDEPATH += . /usr/include/freetype2
+INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src
# Input
SOURCES += main.cpp
diff --git a/tests/auto/qtextscriptengine/generate/main.cpp b/tests/auto/qtextscriptengine/generate/main.cpp
index 853c72679d..15fbc47504 100644
--- a/tests/auto/qtextscriptengine/generate/main.cpp
+++ b/tests/auto/qtextscriptengine/generate/main.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
-#include <QtTest/QtTest>
+#include <QApplication>
#include <QTextEdit>
#include <QLineEdit>
#include <QVBoxLayout>
@@ -85,7 +85,7 @@ void MyEdit::setText(const QString &str)
result += "0x" + QString::number(str.at(i).unicode(), 16) + ", ";
result += "0x0 },\n { ";
for (int i = 0; i < e->layoutData->items[0].num_glyphs; ++i)
- result += "0x" + QString::number(e->layoutData->glyphPtr[i].glyph, 16) + ", ";
+ result += "0x" + QString::number(e->layoutData->glyphLayout.glyphs[i], 16) + ", ";
result += "0x0 } }";
setPlainText(result);
diff --git a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
index 226348a79d..78e0ce6a83 100644
--- a/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
+++ b/tests/auto/qtextscriptengine/tst_qtextscriptengine.cpp
@@ -98,7 +98,7 @@ private slots:
void telugu();
void kannada();
void malayalam();
- // sinhala missing
+ void sinhala();
void khmer();
void linearB();
@@ -379,7 +379,11 @@ void tst_QTextScriptEngine::bengali()
{ 0x151, 0x276, 0x172, 0x143, 0x0 } },
{ { 0x9b0, 0x9cd, 0x995, 0x9be, 0x983, 0x0 },
{ 0x151, 0x276, 0x172, 0x144, 0x0 } },
-
+ // test decomposed two parts matras
+ { { 0x995, 0x9c7, 0x9be, 0x0 },
+ { 0x179, 0x151, 0x172, 0x0 } },
+ { { 0x995, 0x9c7, 0x9d7, 0x0 },
+ { 0x179, 0x151, 0x17e, 0x0 } },
{ {0}, {0} }
};
@@ -502,16 +506,16 @@ void tst_QTextScriptEngine::bengali()
if (QFontDatabase().families(QFontDatabase::Bengali).contains("Likhan")) {
QFont f("Likhan");
const ShapeTable shape_table [] = {
- { { 0x09a8, 0x09cd, 0x09af, 0x0 },
- { 0x0192, 0x0 } },
+ { { 0x9a8, 0x9cd, 0x9af, 0x0 },
+ { 0x1ca, 0x0 } },
{ { 0x09b8, 0x09cd, 0x09af, 0x0 },
- { 0x01d6, 0x0 } },
+ { 0x020e, 0x0 } },
{ { 0x09b6, 0x09cd, 0x09af, 0x0 },
- { 0x01bc, 0x0 } },
+ { 0x01f4, 0x0 } },
{ { 0x09b7, 0x09cd, 0x09af, 0x0 },
- { 0x01c6, 0x0 } },
+ { 0x01fe, 0x0 } },
{ { 0x09b0, 0x09cd, 0x09a8, 0x09cd, 0x200d, 0x0 },
- { 0xd3, 0x12f, 0x0 } },
+ { 0x10b, 0x167, 0x0 } },
{ {0}, {0} }
};
@@ -647,6 +651,12 @@ void tst_QTextScriptEngine::tamil()
{ 0x0025, 0x0 } },
{ { 0x0b83, 0x0b95, 0x0 },
{ 0x0025, 0x0031, 0x0 } },
+ { { 0xb95, 0xbc6, 0xbbe, 0x0 },
+ { 0xa, 0x31, 0x7, 0x0 } },
+ { { 0xb95, 0xbc7, 0xbbe, 0x0 },
+ { 0xb, 0x31, 0x7, 0x0 } },
+ { { 0xb95, 0xbc6, 0xbd7, 0x0 },
+ { 0xa, 0x31, 0x40, 0x0 } },
{ {0}, {0} }
};
@@ -694,7 +704,9 @@ void tst_QTextScriptEngine::telugu()
{ 0xe6, 0xb3, 0x83, 0x0 } },
{ { 0xc15, 0xc4d, 0xc30, 0xc48, 0x0 },
{ 0xe6, 0xb3, 0x9f, 0x0 } },
- { {0}, {0} }
+ { { 0xc15, 0xc46, 0xc56, 0x0 },
+ { 0xe6, 0xb3, 0x0 } },
+ { {0}, {0} }
};
@@ -762,7 +774,16 @@ void tst_QTextScriptEngine::kannada()
{ 0x00b0, 0x006c, 0x0 } },
{ { 0x0cb7, 0x0ccd, 0x0 },
{ 0x0163, 0x0 } },
-
+ { { 0xc95, 0xcbf, 0xcd5, 0x0 },
+ { 0x114, 0x73, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcd5, 0x0 },
+ { 0x90, 0x6c, 0x73, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcd6, 0x0 },
+ { 0x90, 0x6c, 0x74, 0x0 } },
+ { { 0xc95, 0xcc6, 0xcc2, 0x0 },
+ { 0x90, 0x6c, 0x69, 0x0 } },
+ { { 0xc95, 0xcca, 0xcd5, 0x0 },
+ { 0x90, 0x6c, 0x69, 0x73, 0x0 } },
{ {0}, {0} }
};
@@ -816,8 +837,14 @@ void tst_QTextScriptEngine::malayalam()
{ 0x009e, 0x0 } },
{ { 0x0d30, 0x0d4d, 0x200d, 0x0 },
{ 0x009e, 0x0 } },
-
-
+ { { 0xd15, 0xd46, 0xd3e, 0x0 },
+ { 0x5e, 0x34, 0x58, 0x0 } },
+ { { 0xd15, 0xd47, 0xd3e, 0x0 },
+ { 0x5f, 0x34, 0x58, 0x0 } },
+ { { 0xd15, 0xd46, 0xd57, 0x0 },
+ { 0x5e, 0x34, 0x65, 0x0 } },
+ { { 0xd15, 0xd57, 0x0 },
+ { 0x34, 0x65, 0x0 } },
{ {0}, {0} }
};
@@ -836,6 +863,42 @@ void tst_QTextScriptEngine::malayalam()
#endif
}
+void tst_QTextScriptEngine::sinhala()
+{
+#if defined(Q_WS_X11)
+ {
+ if (QFontDatabase().families(QFontDatabase::Sinhala).contains("Malithi Web")) {
+ QFont f("Malithi Web");
+ const ShapeTable shape_table [] = {
+ { { 0xd9a, 0xdd9, 0xdcf, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x0 } },
+ { { 0xd9a, 0xdd9, 0xddf, 0x0 },
+ { 0x4a, 0x61, 0x50, 0x0 } },
+ { { 0xd9a, 0xdd9, 0xdca, 0x0 },
+ { 0x4a, 0x62, 0x0 } },
+ { { 0xd9a, 0xddc, 0xdca, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+ { { 0xd9a, 0xdda, 0x0 },
+ { 0x4a, 0x62, 0x0 } },
+ { { 0xd9a, 0xddd, 0x0 },
+ { 0x4a, 0x61, 0x42, 0x41, 0x0 } },
+ { {0}, {0} }
+ };
+
+
+ const ShapeTable *s = shape_table;
+ while (s->unicode[0]) {
+ QVERIFY( shaping(f, s) );
+ ++s;
+ }
+ } else {
+ QSKIP("couln't find Malithi Web", SkipAll);
+ }
+ }
+#else
+ QSKIP("X11 specific test", SkipAll);
+#endif
+}
void tst_QTextScriptEngine::khmer()
diff --git a/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp b/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp
index cb6bd4daa6..c19deb6249 100644
--- a/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp
+++ b/tests/auto/qxmlnodemodelindex/tst_qxmlnodemodelindex.cpp
@@ -178,7 +178,7 @@ void tst_QXmlNodeModelIndex::model() const
/* Check default value. */
{
const QXmlNodeModelIndex index;
- QCOMPARE(index.model(), static_cast<void *>(0));
+ QCOMPARE(index.model(), static_cast<const QAbstractXmlNodeModel *>(0));
}
}
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index 8a9d4ef142..49f2b08173 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -345,8 +345,8 @@ void tst_QXmlQuery::copyConstructor() const
query1.setInitialTemplateName(name);
const QXmlQuery query2(query1);
- QCOMPARE(query2.messageHandler(), &silencer);
- QCOMPARE(query2.uriResolver(), &resolver);
+ QCOMPARE(query2.messageHandler(), static_cast<QAbstractMessageHandler *>(&silencer));
+ QCOMPARE(query2.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
QCOMPARE(query2.queryLanguage(), QXmlQuery::XSLT20);
QCOMPARE(query2.initialTemplateName(), name);
QCOMPARE(query2.networkAccessManager(), &networkManager);
@@ -522,7 +522,7 @@ void tst_QXmlQuery::assignmentOperator() const
QVERIFY(copy.isValid());
QCOMPARE(copy.uriResolver(), static_cast<const QAbstractUriResolver *>(&returnURI));
- QCOMPARE(copy.messageHandler(), &silencer);
+ QCOMPARE(copy.messageHandler(), static_cast<QAbstractMessageHandler *>(&silencer));
QCOMPARE(testName.localName(copy.namePool()), QString::fromLatin1("somethingToCheck"));
QXmlResultItems result;
@@ -559,7 +559,7 @@ void tst_QXmlQuery::assignmentOperator() const
/* Check that the copy picked up the new things. */
QVERIFY(copy.isValid());
QCOMPARE(copy.uriResolver(), static_cast<const QAbstractUriResolver *>(&secondUriResolver));
- QCOMPARE(copy.messageHandler(), &secondSilencer);
+ QCOMPARE(copy.messageHandler(), static_cast<QAbstractMessageHandler *>(&secondSilencer));
QXmlResultItems resultCopy;
copy.evaluateTo(&resultCopy);
@@ -577,7 +577,7 @@ void tst_QXmlQuery::assignmentOperator() const
/* Check that the original is unchanged. */
QVERIFY(original.isValid());
QCOMPARE(original.uriResolver(), static_cast<const QAbstractUriResolver *>(&returnURI));
- QCOMPARE(original.messageHandler(), &silencer);
+ QCOMPARE(original.messageHandler(), static_cast<QAbstractMessageHandler *>(&silencer));
QXmlResultItems resultOriginal;
original.evaluateTo(&resultOriginal);
@@ -931,7 +931,7 @@ void tst_QXmlQuery::setMessageHandler() const
QXmlQuery query;
MessageSilencer silencer;
query.setMessageHandler(&silencer);
- QCOMPARE(&silencer, query.messageHandler());
+ QCOMPARE(static_cast<QAbstractMessageHandler *>(&silencer), query.messageHandler());
}
void tst_QXmlQuery::evaluateToReceiver()
@@ -1691,7 +1691,7 @@ void tst_QXmlQuery::setUriResolver() const
TestURIResolver resolver;
QXmlQuery query;
query.setUriResolver(&resolver);
- QCOMPARE(query.uriResolver(), &resolver);
+ QCOMPARE(query.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
}
}
diff --git a/tests/auto/qxmlschema/tst_qxmlschema.cpp b/tests/auto/qxmlschema/tst_qxmlschema.cpp
index 79f5587489..ec91f888a3 100644
--- a/tests/auto/qxmlschema/tst_qxmlschema.cpp
+++ b/tests/auto/qxmlschema/tst_qxmlschema.cpp
@@ -357,7 +357,7 @@ void tst_QXmlSchema::messageHandler() const
QXmlSchema schema;
schema.setMessageHandler(&handler);
- QCOMPARE(schema.messageHandler(), &handler);
+ QCOMPARE(schema.messageHandler(), static_cast<QAbstractMessageHandler *>(&handler));
}
}
@@ -394,7 +394,7 @@ void tst_QXmlSchema::uriResolver() const
QXmlSchema schema;
schema.setUriResolver(&resolver);
- QCOMPARE(schema.uriResolver(), &resolver);
+ QCOMPARE(schema.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
}
}
diff --git a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp
index 519f8643c9..9fc784b363 100644
--- a/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp
+++ b/tests/auto/qxmlschemavalidator/tst_qxmlschemavalidator.cpp
@@ -149,8 +149,8 @@ void tst_QXmlSchemaValidator::propertyInitialization() const
schema.setNetworkAccessManager(&manager);
QXmlSchemaValidator validator(schema);
- QCOMPARE(validator.messageHandler(), &handler);
- QCOMPARE(validator.uriResolver(), &resolver);
+ QCOMPARE(validator.messageHandler(), static_cast<QAbstractMessageHandler *>(&handler));
+ QCOMPARE(validator.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
QCOMPARE(validator.networkAccessManager(), &manager);
}
}
@@ -384,7 +384,7 @@ void tst_QXmlSchemaValidator::messageHandler() const
QXmlSchemaValidator validator(schema);
validator.setMessageHandler(&handler);
- QCOMPARE(validator.messageHandler(), &handler);
+ QCOMPARE(validator.messageHandler(), static_cast<QAbstractMessageHandler *>(&handler));
}
/* Test that we return the message handler that was set, even if the schema changed in between. */
@@ -399,7 +399,7 @@ void tst_QXmlSchemaValidator::messageHandler() const
const QXmlSchema schema2;
validator.setSchema(schema2);
- QCOMPARE(validator.messageHandler(), &handler);
+ QCOMPARE(validator.messageHandler(), static_cast<QAbstractMessageHandler *>(&handler));
}
}
@@ -452,7 +452,7 @@ void tst_QXmlSchemaValidator::uriResolver() const
QXmlSchemaValidator validator(schema);
validator.setUriResolver(&resolver);
- QCOMPARE(validator.uriResolver(), &resolver);
+ QCOMPARE(validator.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
}
/* Test that we return the uri resolver that was set, even if the schema changed in between. */
@@ -467,7 +467,7 @@ void tst_QXmlSchemaValidator::uriResolver() const
const QXmlSchema schema2;
validator.setSchema(schema2);
- QCOMPARE(validator.uriResolver(), &resolver);
+ QCOMPARE(validator.uriResolver(), static_cast<const QAbstractUriResolver *>(&resolver));
}
}
diff --git a/tests/auto/qxmlserializer/tst_qxmlserializer.cpp b/tests/auto/qxmlserializer/tst_qxmlserializer.cpp
index aeca140d0e..51044ff308 100644
--- a/tests/auto/qxmlserializer/tst_qxmlserializer.cpp
+++ b/tests/auto/qxmlserializer/tst_qxmlserializer.cpp
@@ -148,7 +148,7 @@ void tst_QXmlSerializer::outputDevice() const
{
const QXmlQuery query;
const QXmlSerializer serializer(query, &file);
- QCOMPARE(serializer.outputDevice(), &file);
+ QCOMPARE(serializer.outputDevice(), static_cast< QIODevice *>(&file));
}
}
@@ -158,7 +158,7 @@ void tst_QXmlSerializer::serializationError() const
QXmlQuery query;
MessageSilencer silencer;
query.setMessageHandler(&silencer);
-
+
query.setQuery(queryString);
QByteArray output;
diff --git a/tests/auto/xmlpatterns.pri b/tests/auto/xmlpatterns.pri
index 7cdd67fbe6..8c8ccadb20 100644
--- a/tests/auto/xmlpatterns.pri
+++ b/tests/auto/xmlpatterns.pri
@@ -15,8 +15,9 @@ QT -= gui
XMLPATTERNS_SDK = QtXmlPatternsSDK
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
- win32:XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}d
- else: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}_debug
+ symbian: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}
+ else:win32: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}d
+ else: XMLPATTERNS_SDK = $${XMLPATTERNS_SDK}_debug
}
INCLUDEPATH += \
diff --git a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
index 0dcb070468..22f66930ee 100644
--- a/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
+++ b/tests/auto/xmlpatterns/tst_xmlpatterns.cpp
@@ -48,6 +48,10 @@
#include "../qxmlquery/TestFundament.h"
#include "../network-settings.h"
+#if defined(Q_OS_SYMBIAN)
+#define SRCDIR ""
+#endif
+
/*!
\class tst_XmlPatterns
\internal
@@ -130,6 +134,8 @@ void tst_XmlPatterns::xquerySupport()
#ifdef Q_OS_WINCE
QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
+#elif defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll);
#endif
QFETCH(int, expectedExitCode);
@@ -218,7 +224,7 @@ void tst_XmlPatterns::xquerySupport()
void tst_XmlPatterns::xquerySupport_data() const
{
-#ifdef Q_OS_WINCE
+#if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN)
return;
#endif
@@ -849,6 +855,8 @@ void tst_XmlPatterns::xsltSupport_data() const
#ifdef Q_OS_WINCE
QSKIP("WinCE: This test uses unsupported WinCE functionality", SkipAll);
+#elif defined(Q_OS_SYMBIAN)
+ QSKIP("Symbian: This test uses unsupported Symbian functionality (QProcess with std streams)", SkipAll);
#endif
QTest::addColumn<int>("expectedExitCode");
diff --git a/tests/auto/xmlpatterns/xmlpatterns.pro b/tests/auto/xmlpatterns/xmlpatterns.pro
index 01e3b2bd18..54dd9aa61b 100644
--- a/tests/auto/xmlpatterns/xmlpatterns.pro
+++ b/tests/auto/xmlpatterns/xmlpatterns.pro
@@ -2,10 +2,10 @@ load(qttest_p4)
SOURCES += tst_xmlpatterns.cpp \
../qxmlquery/TestFundament.cpp
-!wince* {
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-} else {
+wince* {
DEFINES += SRCDIR=\\\"./\\\"
+} else:!symbian {
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
include (../xmlpatterns.pri)
diff --git a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro
index aeff89649a..acd71e4382 100644
--- a/tests/auto/xmlpatternsdiagnosticsts/test/test.pro
+++ b/tests/auto/xmlpatternsdiagnosticsts/test/test.pro
@@ -25,8 +25,8 @@ INCLUDEPATH += $$(QTSRCDIR)/tests/auto/xmlpatternsxqts/lib/ \
../../xmlpatternsxqts/test \
../../xmlpatternsxqts/lib
-wince*: {
- catalog.sources = TestSuite Baseline.xml
+wince*|symbian {
+ catalog.sources = ../TestSuite ../Baseline.xml
catalog.path = .
DEPLOYMENT += catalog
}
diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
index bcc988a3f1..0f55078f0a 100644
--- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
+++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
@@ -11,8 +11,9 @@ SOURCES += ../xmlpatternsxqts/test/tst_suitetest.cpp
PATTERNIST_SDK = QtXmlPatternsSDK
if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
- win32:PATTERNIST_SDK = $${PATTERNIST_SDK}d
- else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug
+ symbian: PATTERNIST_SDK = $${PATTERNIST_SDK}
+ else:win32: PATTERNIST_SDK = $${PATTERNIST_SDK}d
+ else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug
}
LIBS += -l$$PATTERNIST_SDK
diff --git a/tests/auto/xmlpatternsxqts/lib/Global.h b/tests/auto/xmlpatternsxqts/lib/Global.h
index eadb9405f8..a620417ec5 100644
--- a/tests/auto/xmlpatternsxqts/lib/Global.h
+++ b/tests/auto/xmlpatternsxqts/lib/Global.h
@@ -47,7 +47,7 @@
#include "private/qitem_p.h"
#include "private/qnamepool_p.h"
-#ifdef Q_WS_WIN
+#if defined(Q_WS_WIN) || defined(Q_OS_SYMBIAN)
# ifdef Q_PATTERNISTSDK_BUILDING
#define Q_PATTERNISTSDK_EXPORT __declspec(dllexport)
#else
diff --git a/tests/auto/xmlpatternsxqts/lib/lib.pro b/tests/auto/xmlpatternsxqts/lib/lib.pro
index cb9453a063..f5b0a06db4 100644
--- a/tests/auto/xmlpatternsxqts/lib/lib.pro
+++ b/tests/auto/xmlpatternsxqts/lib/lib.pro
@@ -13,6 +13,12 @@ mac {
INSTALLS += target
}
+symbian {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = All -Tcb
+ MMP_RULES += EXPORTUNFROZEN
+}
+
# We add gui, because xmlpatterns.pri pull it out.
QT += xmlpatterns xml network testlib gui
diff --git a/tests/manual/gestures/graphicsview/gestures.cpp b/tests/manual/gestures/graphicsview/gestures.cpp
index 5416457d19..4c21712a28 100644
--- a/tests/manual/gestures/graphicsview/gestures.cpp
+++ b/tests/manual/gestures/graphicsview/gestures.cpp
@@ -45,41 +45,41 @@
Qt::GestureType ThreeFingerSlideGesture::Type = Qt::CustomGesture;
-QGesture *ThreeFingerSlideGestureRecognizer::createGesture(QObject *)
+QGesture *ThreeFingerSlideGestureRecognizer::create(QObject *)
{
return new ThreeFingerSlideGesture;
}
-QGestureRecognizer::Result ThreeFingerSlideGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result ThreeFingerSlideGestureRecognizer::recognize(QGesture *state, QObject *, QEvent *event)
{
ThreeFingerSlideGesture *d = static_cast<ThreeFingerSlideGesture *>(state);
QGestureRecognizer::Result result;
switch (event->type()) {
case QEvent::TouchBegin:
- result = QGestureRecognizer::MaybeGesture;
+ result = QGestureRecognizer::MayBeGesture;
case QEvent::TouchEnd:
if (d->gestureFired)
- result = QGestureRecognizer::GestureFinished;
+ result = QGestureRecognizer::FinishGesture;
else
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
case QEvent::TouchUpdate:
if (d->state() != Qt::NoGesture) {
QTouchEvent *ev = static_cast<QTouchEvent*>(event);
if (ev->touchPoints().size() == 3) {
d->gestureFired = true;
- result = QGestureRecognizer::GestureTriggered;
+ result = QGestureRecognizer::TriggerGesture;
} else {
- result = QGestureRecognizer::MaybeGesture;
+ result = QGestureRecognizer::MayBeGesture;
for (int i = 0; i < ev->touchPoints().size(); ++i) {
const QTouchEvent::TouchPoint &pt = ev->touchPoints().at(i);
const int distance = (pt.pos().toPoint() - pt.startPos().toPoint()).manhattanLength();
if (distance > 20) {
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
}
}
}
} else {
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
}
break;
@@ -89,7 +89,7 @@ QGestureRecognizer::Result ThreeFingerSlideGestureRecognizer::filterEvent(QGestu
if (d->state() != Qt::NoGesture)
result = QGestureRecognizer::Ignore;
else
- result = QGestureRecognizer::NotGesture;
+ result = QGestureRecognizer::CancelGesture;
break;
default:
result = QGestureRecognizer::Ignore;
@@ -105,12 +105,12 @@ void ThreeFingerSlideGestureRecognizer::reset(QGesture *state)
}
-QGesture *RotateGestureRecognizer::createGesture(QObject *)
+QGesture *RotateGestureRecognizer::create(QObject *)
{
return new QGesture;
}
-QGestureRecognizer::Result RotateGestureRecognizer::filterEvent(QGesture *, QObject *, QEvent *event)
+QGestureRecognizer::Result RotateGestureRecognizer::recognize(QGesture *, QObject *, QEvent *event)
{
switch (event->type()) {
case QEvent::TouchBegin:
diff --git a/tests/manual/gestures/graphicsview/gestures.h b/tests/manual/gestures/graphicsview/gestures.h
index 6140b12d62..8a31b7117b 100644
--- a/tests/manual/gestures/graphicsview/gestures.h
+++ b/tests/manual/gestures/graphicsview/gestures.h
@@ -59,8 +59,8 @@ public:
class ThreeFingerSlideGestureRecognizer : public QGestureRecognizer
{
private:
- QGesture* createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
@@ -70,8 +70,8 @@ public:
RotateGestureRecognizer();
private:
- QGesture* createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGesture *create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp
index de92afe44e..f8433b59f3 100644
--- a/tests/manual/gestures/graphicsview/main.cpp
+++ b/tests/manual/gestures/graphicsview/main.cpp
@@ -66,11 +66,11 @@ protected:
default: qDebug("view: Pan: <unknown state>"); break;
}
- const QPointF offset = pan->offset();
+ const QPointF delta = pan->delta();
QScrollBar *vbar = verticalScrollBar();
QScrollBar *hbar = horizontalScrollBar();
- vbar->setValue(vbar->value() - offset.y());
- hbar->setValue(hbar->value() - offset.x());
+ vbar->setValue(vbar->value() - delta.y());
+ hbar->setValue(hbar->value() - delta.x());
ge->accept(pan);
return true;
}
@@ -152,8 +152,8 @@ private:
MainWindow::MainWindow()
{
- (void)QApplication::registerGestureRecognizer(new MousePanGestureRecognizer);
- ThreeFingerSlideGesture::Type = QApplication::registerGestureRecognizer(new ThreeFingerSlideGestureRecognizer);
+ (void)QGestureRecognizer::registerRecognizer(new MousePanGestureRecognizer);
+ ThreeFingerSlideGesture::Type = QGestureRecognizer::registerRecognizer(new ThreeFingerSlideGestureRecognizer);
tabWidget = new QTabWidget;
diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
index 6cdbe12847..82adfbd97f 100644
--- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
+++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.cpp
@@ -51,12 +51,12 @@ MousePanGestureRecognizer::MousePanGestureRecognizer()
{
}
-QGesture* MousePanGestureRecognizer::createGesture(QObject *)
+QGesture* MousePanGestureRecognizer::create(QObject *)
{
return new QPanGesture;
}
-QGestureRecognizer::Result MousePanGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result MousePanGestureRecognizer::recognize(QGesture *state, QObject *, QEvent *event)
{
QPanGesture *g = static_cast<QPanGesture *>(state);
QPoint globalPos;
@@ -78,23 +78,19 @@ QGestureRecognizer::Result MousePanGestureRecognizer::filterEvent(QGesture *stat
if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick
|| event->type() == QEvent::GraphicsSceneMousePress || event->type() == QEvent::GraphicsSceneMouseDoubleClick) {
g->setHotSpot(globalPos);
- g->setProperty("lastPos", globalPos);
+ g->setProperty("startPos", globalPos);
g->setProperty("pressed", QVariant::fromValue<bool>(true));
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
} else if (event->type() == QEvent::MouseMove || event->type() == QEvent::GraphicsSceneMouseMove) {
if (g->property("pressed").toBool()) {
- QPoint pos = globalPos;
- QPoint lastPos = g->property("lastPos").toPoint();
+ QPoint offset = globalPos - g->property("startPos").toPoint();
g->setLastOffset(g->offset());
- lastPos = pos - lastPos;
- g->setOffset(QPointF(lastPos.x(), lastPos.y()));
- g->setTotalOffset(g->totalOffset() + QPointF(lastPos.x(), lastPos.y()));
- g->setProperty("lastPos", pos);
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ g->setOffset(QPointF(offset.x(), offset.y()));
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
- return QGestureRecognizer::NotGesture;
+ return QGestureRecognizer::CancelGesture;
} else if (event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::GraphicsSceneMouseRelease) {
- return QGestureRecognizer::GestureFinished | QGestureRecognizer::ConsumeEventHint;
+ return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
}
return QGestureRecognizer::Ignore;
}
@@ -102,11 +98,10 @@ QGestureRecognizer::Result MousePanGestureRecognizer::filterEvent(QGesture *stat
void MousePanGestureRecognizer::reset(QGesture *state)
{
QPanGesture *g = static_cast<QPanGesture *>(state);
- g->setTotalOffset(QPointF());
g->setLastOffset(QPointF());
g->setOffset(QPointF());
g->setAcceleration(0);
- g->setProperty("lastPos", QVariant());
+ g->setProperty("startPos", QVariant());
g->setProperty("pressed", QVariant::fromValue<bool>(false));
QGestureRecognizer::reset(state);
}
diff --git a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
index b062fd0620..6e04621f29 100644
--- a/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
+++ b/tests/manual/gestures/graphicsview/mousepangesturerecognizer.h
@@ -49,8 +49,8 @@ class MousePanGestureRecognizer : public QGestureRecognizer
public:
MousePanGestureRecognizer();
- QGesture* createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGesture* create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp
index f90f6c66e4..4f33b289e2 100644
--- a/tests/manual/gestures/scrollarea/main.cpp
+++ b/tests/manual/gestures/scrollarea/main.cpp
@@ -50,7 +50,7 @@ public:
ScrollArea(QWidget *parent = 0)
: QScrollArea(parent), outside(false)
{
- viewport()->grabGesture(Qt::PanGesture);
+ viewport()->grabGesture(Qt::PanGesture, Qt::ReceivePartialGestures);
}
protected:
@@ -73,11 +73,11 @@ protected:
QPanGesture *pan = static_cast<QPanGesture *>(event->gesture(Qt::PanGesture));
if (pan) {
switch(pan->state()) {
- case Qt::GestureStarted: qDebug("area: Pan: started"); break;
- case Qt::GestureFinished: qDebug("area: Pan: finished"); break;
- case Qt::GestureCanceled: qDebug("area: Pan: canceled"); break;
+ case Qt::GestureStarted: qDebug() << this << "Pan: started"; break;
+ case Qt::GestureFinished: qDebug() << this << "Pan: finished"; break;
+ case Qt::GestureCanceled: qDebug() << this << "Pan: canceled"; break;
case Qt::GestureUpdated: break;
- default: qDebug("area: Pan: <unknown state>"); break;
+ default: qDebug() << this << "Pan: <unknown state>"; break;
}
if (pan->state() == Qt::GestureStarted)
@@ -87,8 +87,8 @@ protected:
if (outside)
return;
- const QPointF offset = pan->offset();
- const QPointF totalOffset = pan->totalOffset();
+ const QPointF delta = pan->delta();
+ const QPointF totalOffset = pan->offset();
QScrollBar *vbar = verticalScrollBar();
QScrollBar *hbar = horizontalScrollBar();
@@ -102,8 +102,8 @@ protected:
outside = true;
return;
}
- vbar->setValue(vbar->value() - offset.y());
- hbar->setValue(hbar->value() - offset.x());
+ vbar->setValue(vbar->value() - delta.y());
+ hbar->setValue(hbar->value() - delta.x());
event->accept(pan);
}
}
@@ -134,11 +134,11 @@ protected:
QPanGesture *pan = static_cast<QPanGesture *>(event->gesture(Qt::PanGesture));
if (pan) {
switch (pan->state()) {
- case Qt::GestureStarted: qDebug("slider: Pan: started"); break;
- case Qt::GestureFinished: qDebug("slider: Pan: finished"); break;
- case Qt::GestureCanceled: qDebug("slider: Pan: canceled"); break;
+ case Qt::GestureStarted: qDebug() << this << "Pan: started"; break;
+ case Qt::GestureFinished: qDebug() << this << "Pan: finished"; break;
+ case Qt::GestureCanceled: qDebug() << this << "Pan: canceled"; break;
case Qt::GestureUpdated: break;
- default: qDebug("slider: Pan: <unknown state>"); break;
+ default: qDebug() << this << "Pan: <unknown state>"; break;
}
if (pan->state() == Qt::GestureStarted)
@@ -147,8 +147,8 @@ protected:
event->ignore(pan);
if (outside)
return;
- const QPointF offset = pan->offset();
- const QPointF totalOffset = pan->totalOffset();
+ const QPointF delta = pan->delta();
+ const QPointF totalOffset = pan->offset();
if (orientation() == Qt::Horizontal) {
if ((value() == minimum() && totalOffset.x() < -10) ||
(value() == maximum() && totalOffset.x() > 10)) {
@@ -156,7 +156,7 @@ protected:
return;
}
if (totalOffset.y() < 40 && totalOffset.y() > -40) {
- setValue(value() + offset.x());
+ setValue(value() + delta.x());
event->accept(pan);
} else {
outside = true;
@@ -168,7 +168,7 @@ protected:
return;
}
if (totalOffset.x() < 40 && totalOffset.x() > -40) {
- setValue(value() - offset.y());
+ setValue(value() - delta.y());
event->accept(pan);
} else {
outside = true;
@@ -186,6 +186,7 @@ public:
MainWindow()
{
rootScrollArea = new ScrollArea;
+ rootScrollArea->setObjectName(QLatin1String("rootScrollArea"));
setCentralWidget(rootScrollArea);
QWidget *root = new QWidget;
@@ -193,14 +194,17 @@ public:
rootScrollArea->setWidget(root);
Slider *verticalSlider = new Slider(Qt::Vertical, root);
+ verticalSlider->setObjectName(QLatin1String("verticalSlider"));
verticalSlider ->move(650, 1100);
Slider *horizontalSlider = new Slider(Qt::Horizontal, root);
+ horizontalSlider->setObjectName(QLatin1String("horizontalSlider"));
horizontalSlider ->move(600, 1000);
childScrollArea = new ScrollArea(root);
+ childScrollArea->setObjectName(QLatin1String("childScrollArea"));
childScrollArea->move(500, 500);
QWidget *w = new QWidget;
- w->setMinimumWidth(400);
+ w->setMinimumWidth(700);
QVBoxLayout *l = new QVBoxLayout(w);
l->setMargin(20);
for (int i = 0; i < 100; ++i) {
@@ -211,6 +215,14 @@ public:
l->addWidget(w);
}
childScrollArea->setWidget(w);
+#if defined(Q_OS_WIN)
+ // Windows can force Qt to create a native window handle for an
+ // intermediate widget and that will block gesture to get touch events.
+ // So this hack to make sure gestures get all touch events they need.
+ foreach (QObject *w, children())
+ if (w->isWidgetType())
+ static_cast<QWidget *>(w)->setAttribute(Qt::WA_AcceptTouchEvents);
+#endif
}
private:
ScrollArea *rootScrollArea;
@@ -220,7 +232,7 @@ private:
int main(int argc, char **argv)
{
QApplication app(argc, argv);
- app.registerGestureRecognizer(new MousePanGestureRecognizer);
+ QGestureRecognizer::registerRecognizer(new MousePanGestureRecognizer);
MainWindow w;
w.show();
return app.exec();
diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
index 63d3e76bd6..66fcf18023 100644
--- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
+++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.cpp
@@ -49,34 +49,39 @@ MousePanGestureRecognizer::MousePanGestureRecognizer()
{
}
-QGesture* MousePanGestureRecognizer::createGesture(QObject *)
+QGesture *MousePanGestureRecognizer::create(QObject *)
{
return new QPanGesture;
}
-QGestureRecognizer::Result MousePanGestureRecognizer::filterEvent(QGesture *state, QObject *, QEvent *event)
+QGestureRecognizer::Result MousePanGestureRecognizer::recognize(QGesture *state, QObject *, QEvent *event)
{
QPanGesture *g = static_cast<QPanGesture *>(state);
+ if (event->type() == QEvent::TouchBegin) {
+ // ignore the following mousepress event
+ g->setProperty("ignoreMousePress", QVariant::fromValue<bool>(true));
+ } else if (event->type() == QEvent::TouchEnd) {
+ g->setProperty("ignoreMousePress", QVariant::fromValue<bool>(false));
+ }
QMouseEvent *me = static_cast<QMouseEvent *>(event);
- if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonDblClick) {
+ if (event->type() == QEvent::MouseButtonPress) {
+ if (g->property("ignoreMousePress").toBool())
+ return QGestureRecognizer::Ignore;
g->setHotSpot(me->globalPos());
- g->setProperty("lastPos", me->globalPos());
+ g->setProperty("startPos", me->globalPos());
g->setProperty("pressed", QVariant::fromValue<bool>(true));
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
} else if (event->type() == QEvent::MouseMove) {
if (g->property("pressed").toBool()) {
- QPoint pos = me->globalPos();
- QPoint lastPos = g->property("lastPos").toPoint();
+ QPoint offset = me->globalPos() - g->property("startPos").toPoint();
g->setLastOffset(g->offset());
- lastPos = pos - lastPos;
- g->setOffset(QPointF(lastPos.x(), lastPos.y()));
- g->setTotalOffset(g->totalOffset() + QPointF(lastPos.x(), lastPos.y()));
- g->setProperty("lastPos", pos);
- return QGestureRecognizer::GestureTriggered | QGestureRecognizer::ConsumeEventHint;
+ g->setOffset(QPointF(offset.x(), offset.y()));
+ return QGestureRecognizer::TriggerGesture | QGestureRecognizer::ConsumeEventHint;
}
- return QGestureRecognizer::NotGesture;
+ return QGestureRecognizer::CancelGesture;
} else if (event->type() == QEvent::MouseButtonRelease) {
- return QGestureRecognizer::GestureFinished | QGestureRecognizer::ConsumeEventHint;
+ if (g->property("pressed").toBool())
+ return QGestureRecognizer::FinishGesture | QGestureRecognizer::ConsumeEventHint;
}
return QGestureRecognizer::Ignore;
}
@@ -84,11 +89,11 @@ QGestureRecognizer::Result MousePanGestureRecognizer::filterEvent(QGesture *stat
void MousePanGestureRecognizer::reset(QGesture *state)
{
QPanGesture *g = static_cast<QPanGesture *>(state);
- g->setTotalOffset(QPointF());
g->setLastOffset(QPointF());
g->setOffset(QPointF());
g->setAcceleration(0);
- g->setProperty("lastPos", QVariant());
+ g->setProperty("startPos", QVariant());
g->setProperty("pressed", QVariant::fromValue<bool>(false));
+ g->setProperty("ignoreMousePress", QVariant::fromValue<bool>(false));
QGestureRecognizer::reset(state);
}
diff --git a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
index b062fd0620..6e04621f29 100644
--- a/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
+++ b/tests/manual/gestures/scrollarea/mousepangesturerecognizer.h
@@ -49,8 +49,8 @@ class MousePanGestureRecognizer : public QGestureRecognizer
public:
MousePanGestureRecognizer();
- QGesture* createGesture(QObject *target);
- QGestureRecognizer::Result filterEvent(QGesture *state, QObject *watched, QEvent *event);
+ QGesture* create(QObject *target);
+ QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
void reset(QGesture *state);
};
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index 2722b2f4f0..62b4736a08 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -222,8 +222,8 @@ CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent)
QVBoxLayout *vboxLayout = new QVBoxLayout(this);
QString resourcePath = QLatin1String(":/trolltech/assistant/images/");
-#ifndef Q_OS_MAC
vboxLayout->setMargin(0);
+#ifndef Q_OS_MAC
resourcePath.append(QLatin1String("win"));
#else
resourcePath.append(QLatin1String("mac"));
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index e2b7d58103..95f271defd 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -3103,7 +3103,7 @@ void Configure::generateConfigfiles()
if (tmpFile3.open()) {
tmpStream.setDevice(&tmpFile3);
tmpStream << "/* Evaluation license key */" << endl
- << "static const char qt_eval_key_data [512 + 12] = \"" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
+ << "static const char qt_eval_key_data [512 + 12] = \"qt_qevalkey=" << licenseInfo["LICENSEKEYEXT"] << "\";" << endl;
tmpStream.flush();
tmpFile3.flush();
diff --git a/tools/qdoc3/test/qt-html-templates.qdocconf b/tools/qdoc3/test/qt-html-templates.qdocconf
index 7ceacb2ab5..8c039eba50 100644
--- a/tools/qdoc3/test/qt-html-templates.qdocconf
+++ b/tools/qdoc3/test/qt-html-templates.qdocconf
@@ -35,7 +35,7 @@ HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
\
"<script type=\"text/javascript\" src=\"http://www.google.com/jsapi\"></script>" \
"<script type=\"text/javascript\">google.load(\"elements\", \"1\", {packages: \"transliteration\"});</script>" \
- "<script type=\"text/javascript\" src=\"http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en\"></script>" \
+ "<script type=\"text/javascript\" src=\"http://www.google.com/coop/cse/t13n?form=cse-search-box&amp;t13n_langs=en\"></script>" \
\
- "<script type=\"text/javascript\" src=\"http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en\"></script>"\
+ "<script type=\"text/javascript\" src=\"http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=en\"></script>"\
"</tr></table></div></address>"