summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-11-02 00:00:11 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-11-02 00:00:11 (GMT)
commit8e9eb859d1876ca4133199a60b605bee6a43697c (patch)
tree2d4595064336de31daf0b3905bf49285fc76bb71
parentf4dc4e6370289b022e4b9d05b1afdac59e7813d1 (diff)
parent067e3fb0868814351829647358dea583d28d010e (diff)
downloadQt-8e9eb859d1876ca4133199a60b605bee6a43697c.zip
Qt-8e9eb859d1876ca4133199a60b605bee6a43697c.tar.gz
Qt-8e9eb859d1876ca4133199a60b605bee6a43697c.tar.bz2
Merge branch '4.8-upstream' into master-water
-rw-r--r--doc/src/qt-webpages.qdoc91
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp15
-rw-r--r--src/gui/kernel/qapplication_s60.cpp150
-rw-r--r--src/gui/kernel/qt_s60_p.h19
-rw-r--r--src/gui/kernel/qwidget_s60.cpp6
-rw-r--r--src/network/access/qnetworkdiskcache.cpp2
-rw-r--r--src/network/ssl/qssl.cpp2
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp4
9 files changed, 255 insertions, 44 deletions
diff --git a/doc/src/qt-webpages.qdoc b/doc/src/qt-webpages.qdoc
index c4d400d..394850f 100644
--- a/doc/src/qt-webpages.qdoc
+++ b/doc/src/qt-webpages.qdoc
@@ -531,6 +531,95 @@
*/
/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_2_hello_world_in_qtcre
+ \title Qt Essentials - Fundamentals of Qt part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_fundamentals_of_qt_part_1_your_first_qt_applic
+ \title Qt Essentials - Fundamentals of Qt part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/qt_essentials_widget_edition_application_creation_part_1_mainwindows
+ \title Qt Essentials - Application Creation part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_2_settings_resources_and_application_deployment
+ \title Qt Essentials - Application Creation part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/application_creation_part_3_translation_for_developers
+ \title Qt Essentials - Application Creation part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_1_common_widgets
+ \title Qt Essentials - Widgets part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_2_layout_management
+ \title Qt Essentials - Widgets part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/widgets_part_3_guidelines_for_custom_widgets
+ \title Qt Essentials - Widgets part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_1_using_graphicsview_classes
+ \title Qt Essentials - Graphics View part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_2_transformations_and_coordinate_systems
+ \title Qt Essentials - Graphics View part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/graphics_view_part_3_creating_custom_items
+ \title Qt Essentials - Graphics View part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_1_model_view_concept
+ \title Qt Essentials - Model/View I part 1
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_2_showing_simple_data
+ \title Qt Essentials - Model/View I part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_3_proxy_models
+ \title Qt Essentials - Model/View I part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_part_4_custom_models
+ \title Qt Essentials - Model/View I part 4
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_1_editing_item_data
+ \title Qt Essentials - Model/View II part 1
+*/
+/*!
+ \externalpage
+ \title Qt Essentials - Model/View II part 2
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_3_data_widget_mapper
+ \title Qt Essentials - Model/View II part 3
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_4_custom_tree_model
+ \title Qt Essentials - Model/View II part 4
+*/
+/*!
+ \externalpage http://developer.qt.nokia.com/elearning/watch/model_view_ii_part_5_drag_and_drop
+ \title Qt Essentials - Model/View II part 5
+*/
+/*!
+ \externalpage http://qt.nokia.com/certification
+ \title Qt Certification
+*/
+/*!
+ \externalpage http://qt.nokia.com/developer/learning/certification/exams/preparation-prerequisites
+ \title Qt Certification Exam Preparation and Prerequisites
+*/
+
+/*!
\externalpage http://qt.nokia.com/developer/learning/online/training/materials
\title Download Qt training materials
*/
@@ -558,4 +647,4 @@
/*!
\externalpage http://doc.qt.nokia.com/qtquick-components-symbian-1.1/index.html
\title Qt Quick Components for Symbian 1.1
-*/ \ No newline at end of file
+*/
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 0a74910..16518f4 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -2855,6 +2855,11 @@ void QDeclarativeGridView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxGridItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(colPos, rowPos);
added.append(item);
@@ -3045,6 +3050,11 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count)
FxGridItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
it = d->visibleItems.insert(it, movedItem);
if (it == d->visibleItems.begin() && firstItem)
movedItem->setPosition(firstItem->colPos(), firstItem->rowPos());
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 7638b2b..7b4dc5c 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -3285,6 +3285,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(insertionIdx, item);
pos -= item->size() + d->spacing;
item->setPosition(pos);
@@ -3315,6 +3320,11 @@ void QDeclarativeListView::itemsInserted(int modelIndex, int count)
addedVisible = true;
}
FxListItem *item = d->createItem(modelIndex + i);
+ if (!item) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
d->visibleItems.insert(index, item);
item->setPosition(pos);
added.append(item);
@@ -3518,6 +3528,11 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count)
FxListItem *movedItem = moved.take(item->index);
if (!movedItem)
movedItem = d->createItem(item->index);
+ if (!movedItem) {
+ // broken or no delegate
+ d->clear();
+ return;
+ }
if (item->index <= firstVisible->index)
moveBy -= movedItem->size();
it = d->visibleItems.insert(it, movedItem);
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index a9634d8..46b16cb 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -92,6 +92,10 @@
#include <graphics/wstfxconst.h>
#endif
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+#include <coeeventdata.h>
+#endif
+
QT_BEGIN_NAMESPACE
// Goom Events through Window Server
@@ -677,71 +681,121 @@ void QSymbianControl::HandleLongTapEventL( const TPoint& aPenEventLocation, cons
}
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+void QSymbianControl::translateMultiEventPointerEvent(const CCoeEventData &eventData )
+{
+ TUint count = eventData.Count();
+ QVector<TouchEventParams> touches;
+ touches.reserve(count);
+ for (int i = 0; i < count; i++) {
+ const TPointerEvent *pointerEvent = eventData.Pointer(i);
+ const TAdvancedPointerEvent *advEvent = pointerEvent->AdvancedPointerEvent();
+ if (advEvent)
+ touches.push_back(TouchEventFromAdvancedPointerEvent(advEvent));
+ }
+ if (touches.size())
+ processTouchEvents(touches);
+}
+#endif
+
void QSymbianControl::translateAdvancedPointerEvent(const TAdvancedPointerEvent *event)
{
+ processTouchEvents(QVector<TouchEventParams>(1, TouchEventFromAdvancedPointerEvent(event)));
+}
+
+QSymbianControl::TouchEventParams QSymbianControl::TouchEventFromAdvancedPointerEvent(const TAdvancedPointerEvent *event)
+{
QApplicationPrivate *d = QApplicationPrivate::instance();
QPointF screenPos = qwidget->mapToGlobal(translatePointForFixedNativeOrientation(event->iPosition));
qreal pressure;
- if(d->pressureSupported
+ if (d->pressureSupported
&& event->Pressure() > 0) //workaround for misconfigured HAL
pressure = event->Pressure() / qreal(d->maxTouchPressure);
else
pressure = qreal(1.0);
- processTouchEvent(event->PointerNumber(), event->iType, screenPos, pressure);
+ return TouchEventParams(event->PointerNumber(), event->iType, screenPos, pressure);
}
#endif
-void QSymbianControl::processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure)
+QSymbianControl::TouchEventParams::TouchEventParams()
+{}
+
+QSymbianControl::TouchEventParams::TouchEventParams(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure)
+ : pointerNumber(pointerNumber),
+ type(type),
+ screenPos(screenPos),
+ pressure(pressure)
+{}
+
+void QSymbianControl::processTouchEvents(const QVector<TouchEventParams> &touches)
{
QRect screenGeometry = qApp->desktop()->screenGeometry(qwidget);
QApplicationPrivate *d = QApplicationPrivate::instance();
+ // get the maximum pointer number
+ int numUpdates = touches.size();
+ int maxPointerNumber = 0;
+ for (int i = 0; i < numUpdates; ++i) {
+ const TouchEventParams &touch = touches[i];
+ maxPointerNumber = qMax(maxPointerNumber, touch.pointerNumber);
+ }
+
+ // ensure there are sufficient touch events in the list,
+ // touch events will be indexed by pointerNumber
QList<QTouchEvent::TouchPoint> points = d->appAllTouchPoints;
- while (points.count() <= pointerNumber)
+ while (points.count() <= maxPointerNumber)
points.append(QTouchEvent::TouchPoint(points.count()));
- Qt::TouchPointStates allStates = 0;
+ // first set all active touch points to stationary
for (int i = 0; i < points.count(); ++i) {
QTouchEvent::TouchPoint &touchPoint = points[i];
+ if (touchPoint.state() != Qt::TouchPointReleased) {
+ touchPoint.setState(Qt::TouchPointStationary);
+ }
+ }
- if (touchPoint.id() == pointerNumber) {
- Qt::TouchPointStates state;
- switch (type) {
- case TPointerEvent::EButton1Down:
+ // Add all info about moving or state changed touch points
+ for (int i = 0; i < numUpdates; ++i) {
+ const TouchEventParams &touch = touches[i];
+ QTouchEvent::TouchPoint &touchPoint = points[touch.pointerNumber];
+ Qt::TouchPointStates state;
+ switch (touch.type) {
+ case TPointerEvent::EButton1Down:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
- case TPointerEvent::EEnterHighPressure:
+ case TPointerEvent::EEnterHighPressure:
#endif
- state = Qt::TouchPointPressed;
- break;
- case TPointerEvent::EButton1Up:
+ state = Qt::TouchPointPressed;
+ break;
+ case TPointerEvent::EButton1Up:
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
- case TPointerEvent::EExitCloseProximity:
-#endif
- state = Qt::TouchPointReleased;
- break;
- case TPointerEvent::EDrag:
- state = Qt::TouchPointMoved;
- break;
- default:
- // how likely is this to happen?
- state = Qt::TouchPointStationary;
- break;
- }
- if (pointerNumber == 0)
- state |= Qt::TouchPointPrimary;
- touchPoint.setState(state);
+ case TPointerEvent::EExitCloseProximity:
+#endif
+ state = Qt::TouchPointReleased;
+ break;
+ case TPointerEvent::EDrag:
+ state = Qt::TouchPointMoved;
+ break;
+ default:
+ // how likely is this to happen?
+ state = Qt::TouchPointStationary;
+ break;
+ }
+ if (touch.pointerNumber == 0)
+ state |= Qt::TouchPointPrimary;
+ touchPoint.setState(state);
- touchPoint.setScreenPos(screenPos);
- touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(),
- screenPos.y() / screenGeometry.height()));
+ touchPoint.setScreenPos(touch.screenPos);
+ touchPoint.setNormalizedPos(QPointF(touch.screenPos.x() / screenGeometry.width(),
+ touch.screenPos.y() / screenGeometry.height()));
- touchPoint.setPressure(pressure);
- } else if (touchPoint.state() != Qt::TouchPointReleased) {
- // all other active touch points should be marked as stationary
- touchPoint.setState(Qt::TouchPointStationary);
- }
+ touchPoint.setPressure(touch.pressure);
+ }
+ // check the resulting state of all touch points
+ Qt::TouchPointStates allStates = 0;
+ for (int i = 0; i < points.count(); ++i) {
+ QTouchEvent::TouchPoint &touchPoint = points[i];
allStates |= touchPoint.state();
}
@@ -760,6 +814,28 @@ void QSymbianControl::processTouchEvent(int pointerNumber, TPointerEvent::TType
void QSymbianControl::HandlePointerEventL(const TPointerEvent& pEvent)
{
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ if (pEvent.iType == TPointerEvent::EDataCCoeEventData) {
+ // only advanced pointers can be data type pointer events
+ const TAdvancedPointerEvent *advEvent = pEvent.AdvancedPointerEvent();
+ if (!advEvent)
+ return;
+ const CCoeEventData& eventData = CCoeEventData::EventData(*advEvent);
+ if (eventData.Type() == CWsEventWithData::EPointerEvent) {
+ QT_TRYCATCH_LEAVING(translateMultiEventPointerEvent(eventData));
+ // pointer 0 events and unnumbered events should also be handled as mouse events
+ for (int i=0; i<eventData.Count(); i++) {
+ const TPointerEvent *pointerEvent = eventData.Pointer(i);
+ const TAdvancedPointerEvent *advEvent = pointerEvent->AdvancedPointerEvent();
+ if (!advEvent || advEvent->PointerNumber() == 0) {
+ m_longTapDetector->PointerEventL(*pointerEvent);
+ QT_TRYCATCH_LEAVING(HandlePointerEvent(*pointerEvent));
+ }
+ }
+ return;
+ }
+ }
+#endif
if (pEvent.IsAdvancedPointerEvent()) {
const TAdvancedPointerEvent *advancedPointerEvent = pEvent.AdvancedPointerEvent();
translateAdvancedPointerEvent(advancedPointerEvent);
@@ -833,7 +909,7 @@ void QSymbianControl::HandlePointerEvent(const TPointerEvent& pEvent)
//Generate single touch event for S60 5.0 (has touchscreen, does not have advanced pointers)
#ifndef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
if (S60->hasTouchscreen) {
- processTouchEvent(0, pEvent.iType, QPointF(globalPos), 1.0);
+ processTouchEvents(QVector<TouchEventParams>(1, TouchEventParams(0, pEvent.iType, QPointF(globalPos), 1.0)));
}
#endif
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 5ad5b00..5b5d5ce 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -102,6 +102,10 @@ class QSymbianTypeFaceExtras;
typedef QHash<QString, const QSymbianTypeFaceExtras *> QSymbianTypeFaceExtrasHash;
typedef void (*QThreadLocalReleaseFunc)();
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+class CCoeEventData;
+#endif
+
class Q_AUTOTEST_EXPORT QS60ThreadLocalData
{
public:
@@ -308,10 +312,23 @@ private:
const QPoint &globalPos,
Qt::MouseButton button,
Qt::KeyboardModifiers modifiers);
- void processTouchEvent(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
+ struct TouchEventParams
+ {
+ TouchEventParams();
+ TouchEventParams(int pointerNumber, TPointerEvent::TType type, QPointF screenPos, qreal pressure);
+ int pointerNumber;
+ TPointerEvent::TType type;
+ QPointF screenPos;
+ qreal pressure;
+ };
+ void processTouchEvents(const QVector<TouchEventParams> &touches);
void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation );
#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ void translateMultiEventPointerEvent(const CCoeEventData &eventData );
+#endif
void translateAdvancedPointerEvent(const TAdvancedPointerEvent *event);
+ TouchEventParams TouchEventFromAdvancedPointerEvent(const TAdvancedPointerEvent *event);
#endif
bool isSplitViewWidget(QWidget *widget);
bool hasFocusedAndVisibleChild(QWidget *parentWidget);
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 396c306..a37c265 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1040,8 +1040,12 @@ void QWidgetPrivate::registerTouchWindow()
RWindow *rwindow = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
QSymbianControl *window = static_cast<QSymbianControl *>(q->effectiveWinId());
//Enabling advanced pointer events for controls that already have active windows causes a panic.
- if (!window->isControlActive())
+ if (!window->isControlActive()) {
rwindow->EnableAdvancedPointers();
+#ifdef COE_GROUPED_POINTER_EVENT_VERSION
+ qt_symbian_throwIfError(window->ConfigureEventData(CCoeControl::EEventDataAllowGroupedPointerEvents));
+#endif
+ }
}
#endif
}
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index 1c515c2..af6ba1d 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -429,7 +429,7 @@ QIODevice *QNetworkDiskCache::data(const QUrl &url)
// ### verify that QFile uses the fd size and not the file name
qint64 size = file->size() - file->pos();
const uchar *p = 0;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_INTEGRITY)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_SYMBIAN)
p = file->map(file->pos(), size);
#endif
if (p) {
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index 08a05ff..b556328 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -131,7 +131,7 @@ QT_BEGIN_NAMESPACE
fragments into the data when using block ciphers. When enabled, this
prevents some attacks (such as the BEAST attack), however it is
incompatible with some servers.
- \value SslOptionDisableTickets Disables the SSL session ticket
+ \value SslOptionDisableSessionTickets Disables the SSL session ticket
extension. This can cause slower connection setup, however some servers
are not compatible with the extension.
\value SslOptionDisableCompression Disables the SSL compression
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index 5b5f0f7..daefe12 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -784,7 +784,7 @@ void tst_QString::equals2_data() const
static void __attribute__((noinline)) equals2_selftest()
{
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
const long pagesize = sysconf(_SC_PAGESIZE);
void *page1, *page3;
ushort *page2;
@@ -1341,7 +1341,7 @@ void tst_QString::ucstrncmp() const
};
static const int functionCount = sizeof func / sizeof func[0];
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
const long pagesize = sysconf(_SC_PAGESIZE);
void *page1, *page3;
ushort *page2;