summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-19 11:06:55 +0100
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-19 11:10:24 +0100
commit83525ca84ba7adadaeeb65ffa55a6d0f2630caaa (patch)
tree83a26fc42ba3811baf38776d266d4bf600684715 /src
parentb115770cc3bba68740a6848c7ccaed932399aca9 (diff)
parent4082e4711a1c54947429b15504caf778c6da22d0 (diff)
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp src/gui/kernel/qgesturemanager.cpp tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf Changes in qmake/generators/win32/msvc_objectmodel.cpp come from commit 4ba3dadcae97bfde6216c32cfa339f8f0e0253c7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-buffer.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h9
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gdef.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-global.h4
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-gsub.h9
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-open.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.h8
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-stream.h8
-rw-r--r--src/corelib/corelib.pro7
-rw-r--r--src/corelib/tools/qlocale.cpp6
-rw-r--r--src/corelib/tools/qsimd.cpp2
-rw-r--r--src/corelib/tools/qsimd_p.h3
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp60
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp41
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp48
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview_p_p.h4
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp4
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp2
-rw-r--r--src/gui/gui.pro3
-rw-r--r--src/gui/kernel/qgesturemanager.cpp10
-rw-r--r--src/gui/kernel/qgesturemanager_p.h1
-rw-r--r--src/gui/widgets/qtextedit.cpp2
-rw-r--r--src/network/access/qhttpnetworkheader.cpp12
-rw-r--r--src/network/access/qnetworkrequest.cpp10
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp44
-rw-r--r--src/network/ssl/qsslsocket_openssl_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h5
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/symbian/symbianengine.cpp41
-rw-r--r--src/plugins/bearer/symbian/symbianengine.h6
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp42
-rw-r--r--src/s60installs/bwins/QtCoreu.def4
-rw-r--r--src/s60installs/eabi/QtGuiu.def1
-rw-r--r--src/testlib/qtestcase.cpp3
-rwxr-xr-xsrc/xmlpatterns/parser/createTokenLookup.sh15
40 files changed, 249 insertions, 220 deletions
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h b/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
index 0d7c2c2c7c..0d631b20a6 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-buffer.h
@@ -32,10 +32,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
typedef struct HB_GlyphItemRec_ {
HB_UInt gindex;
HB_UInt properties;
@@ -93,10 +89,6 @@ hb_buffer_add_glyph( HB_Buffer buffer,
HB_UInt properties,
HB_UInt cluster );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_BUFFER_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
index 2a6d9581f9..94e9b43e61 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gdef-private.h
@@ -33,11 +33,6 @@
HB_BEGIN_HEADER
-
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/* Attachment related structures */
struct HB_AttachPoint_
@@ -126,10 +121,6 @@ _HB_GDEF_LoadMarkAttachClassDef_From_LookupFlags( HB_GDEFHeader* gdef,
HB_Lookup* lo,
HB_UShort num_lookups );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_GDEF_PRIVATE_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
index f9a03dde9d..ccb6bf9734 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gdef.h
@@ -31,10 +31,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/* GDEF glyph properties. Note that HB_GDEF_COMPONENT has no corresponding
* flag in the LookupFlag field. */
#define HB_GDEF_BASE_GLYPH 0x0002
@@ -131,10 +127,6 @@ HB_Error HB_GDEF_Build_ClassDefinition( HB_GDEFHeader* gdef,
HB_UShort* glyph_array,
HB_UShort* class_array );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_GDEF_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
index bccd6a265d..d4e6b466b6 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h
@@ -39,10 +39,6 @@
#define HB_END_HEADER /* nothing */
#endif
-#if defined(__GNUC__) || defined(_MSC_VER)
-#define HB_USE_PACKED_STRUCTS
-#endif
-
HB_BEGIN_HEADER
#ifndef FALSE
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
index 39f3159987..63ba90797d 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos-private.h
@@ -32,10 +32,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/* shared tables */
#define VR_X_PLACEMENT_DEVICE 0
@@ -720,10 +716,6 @@ HB_INTERNAL void
_HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
HB_UShort lookup_type );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_GPOS_PRIVATE_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
index 7eb329e20c..df0c3f639f 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gsub-private.h
@@ -32,10 +32,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
typedef union HB_GSUB_SubTable_ HB_GSUB_SubTable;
/* LookupType 1 */
@@ -474,10 +470,6 @@ HB_INTERNAL void
_HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
HB_UShort lookup_type );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_GSUB_PRIVATE_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
index b00df4401f..6e452bdb35 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.h
@@ -31,11 +31,6 @@
HB_BEGIN_HEADER
-
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/* Lookup types for glyph substitution */
#define HB_GSUB_LOOKUP_SINGLE 1
@@ -139,10 +134,6 @@ HB_Error HB_GSUB_Register_Alternate_Function( HB_GSUBHeader* gsub,
HB_Error HB_GSUB_Apply_String( HB_GSUBHeader* gsub,
HB_Buffer buffer );
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_GSUB_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.h b/src/3rdparty/harfbuzz/src/harfbuzz-open.h
index 4ba6cf5803..9ad7c98b2c 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-open.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.h
@@ -30,10 +30,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/* Use this if a feature applies to all glyphs */
#define HB_ALL_GLYPHS 0xFFFF
@@ -279,10 +275,6 @@ enum HB_Type_
typedef enum HB_Type_ HB_Type;
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif /* HARFBUZZ_OPEN_H */
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
index ab5c07a6c8..470e27b6f9 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.h
@@ -34,10 +34,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
/*
using anything else than signed or unsigned for bitfields in C is non standard,
but accepted by almost all compilers. And it gives a significant reduction in
@@ -258,10 +254,6 @@ typedef struct HB_Font_ {
void *userData;
} HB_FontRec;
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
typedef struct HB_ShaperItem_ HB_ShaperItem;
struct HB_ShaperItem_ {
diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
index a155cc277c..cfbfb1c4fe 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-stream.h
@@ -30,10 +30,6 @@
HB_BEGIN_HEADER
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(push, 1)
-#endif
-
typedef struct HB_StreamRec_
{
HB_Byte* base;
@@ -42,10 +38,6 @@ typedef struct HB_StreamRec_
HB_UInt pos;
} HB_StreamRec;
-#ifdef HB_USE_PACKED_STRUCTS
-#pragma pack(pop)
-#endif
-
HB_END_HEADER
#endif
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 349b3d462d..e946d5d1ae 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -44,10 +44,3 @@ symbian: {
MMP_RULES -= PAGED
MMP_RULES *= UNPAGED
}
-
-neon {
- DEFINES += QT_HAVE_NEON
- QMAKE_CXXFLAGS *= -mfpu=neon
-}
-
-
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 2fb3616223..83d6dcdf87 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -77,7 +77,7 @@ QT_END_NAMESPACE
#include <qdebug.h>
#include <time.h>
-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
# include <fenv.h>
#endif
@@ -6637,7 +6637,7 @@ Q_CORE_EXPORT char *qdtoa ( double d, int mode, int ndigits, int *decpt, int *si
_control87(MCW_EM, MCW_EM);
#endif
-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
fenv_t envp;
feholdexcept(&envp);
#endif
@@ -6653,7 +6653,7 @@ Q_CORE_EXPORT char *qdtoa ( double d, int mode, int ndigits, int *decpt, int *si
#endif //_M_X64
#endif //Q_OS_WIN
-#if defined(Q_OS_LINUX) && !defined(__UCLIBC__)
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
fesetenv(&envp);
#endif
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index ac8ccba957..d44a9d0c99 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -140,7 +140,7 @@ static inline uint detectProcessorFeatures()
#if defined(QT_HAVE_IWMMXT)
// runtime detection only available when running as a previlegied process
features = IWMMXT;
-#elif defined(QT_HAVE_NEON)
+#elif defined(QT_ALWAYS_HAVE_NEON)
features = NEON;
#endif
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index 664543b136..87fa7700eb 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -105,7 +105,8 @@ QT_BEGIN_HEADER
#endif // defined(QT_HAVE_SSE2) && (defined(__SSE2__) || defined(Q_CC_MSVC))
// NEON intrinsics
-#if defined(QT_HAVE_NEON)
+#if defined __ARM_NEON__
+#define QT_ALWAYS_HAVE_NEON
#include <arm_neon.h>
#endif
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index a3d89f226a..bb496c6b82 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -3606,7 +3606,7 @@ static QByteArray toLatin1_helper(const QChar *data, int length)
}
length = length % 16;
}
-#elif QT_HAVE_NEON
+#elif QT_ALWAYS_HAVE_NEON
// Refer to the documentation of the SSE2 implementation
// this use eactly the same method as for SSE except:
// 1) neon has unsigned comparison
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 94b1cb368c..6be49babe6 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -124,8 +124,8 @@ public:
}
qreal endPosition() const {
return (view->orientation() == QDeclarativeListView::Vertical
- ? item->y() + (item->height() > 0 ? item->height() : 1)
- : item->x() + (item->width() > 0 ? item->width() : 1)) - 1;
+ ? item->y() + (item->height() >= 1.0 ? item->height() : 1)
+ : item->x() + (item->width() >= 1.0 ? item->width() : 1)) - 1;
}
void setPosition(qreal pos) {
if (view->orientation() == QDeclarativeListView::Vertical) {
@@ -736,7 +736,7 @@ void QDeclarativeListViewPrivate::layout()
}
if (!visibleItems.isEmpty()) {
qreal oldEnd = visibleItems.last()->endPosition();
- qreal pos = visibleItems.first()->endPosition() + spacing + 1;
+ qreal pos = visibleItems.first()->position() + visibleItems.first()->size() + spacing;
for (int i=1; i < visibleItems.count(); ++i) {
FxListItem *item = visibleItems.at(i);
item->setPosition(pos);
@@ -1161,30 +1161,35 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
int oldDuration = fixupDuration;
fixupDuration = moveReason == Mouse ? fixupDuration : 0;
- if (snapMode != QDeclarativeListView::NoSnap) {
+ if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
+ updateHighlight();
+ qreal pos = currentItem->itemPosition();
+ qreal viewPos = position();
+ if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
+ viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
+ if (viewPos > pos - highlightRangeStart)
+ viewPos = pos - highlightRangeStart;
+
+ timeline.reset(data.move);
+ if (viewPos != position()) {
+ if (fixupDuration)
+ timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
+ else
+ timeline.set(data.move, -viewPos);
+ }
+ vTime = timeline.time();
+ } else if (snapMode != QDeclarativeListView::NoSnap) {
FxListItem *topItem = snapItemAt(position()+highlightRangeStart);
FxListItem *bottomItem = snapItemAt(position()+highlightRangeEnd);
qreal pos;
- if (topItem && bottomItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- qreal topPos = qMin(topItem->position() - highlightRangeStart, -maxExtent);
- qreal bottomPos = qMax(bottomItem->position() - highlightRangeEnd, -minExtent);
- pos = qAbs(data.move + topPos) < qAbs(data.move + bottomPos) ? topPos : bottomPos;
- } else if (topItem) {
+ if (topItem) {
pos = qMax(qMin(topItem->position() - highlightRangeStart, -maxExtent), -minExtent);
} else if (bottomItem) {
- pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
+ pos = qMax(qMin(bottomItem->position() - highlightRangeStart, -maxExtent), -minExtent);
} else {
fixupDuration = oldDuration;
return;
}
- if (currentItem && haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- updateHighlight();
- qreal currPos = currentItem->itemPosition();
- if (pos < currPos + currentItem->itemSize() - highlightRangeEnd)
- pos = currPos + currentItem->itemSize() - highlightRangeEnd;
- if (pos > currPos - highlightRangeStart)
- pos = currPos - highlightRangeStart;
- }
qreal dist = qAbs(data.move + pos);
if (dist > 0) {
@@ -1195,25 +1200,6 @@ void QDeclarativeListViewPrivate::fixup(AxisData &data, qreal minExtent, qreal m
timeline.set(data.move, -pos);
vTime = timeline.time();
}
- } else if (haveHighlightRange && highlightRange == QDeclarativeListView::StrictlyEnforceRange) {
- if (currentItem) {
- updateHighlight();
- qreal pos = currentItem->itemPosition();
- qreal viewPos = position();
- if (viewPos < pos + currentItem->itemSize() - highlightRangeEnd)
- viewPos = pos + currentItem->itemSize() - highlightRangeEnd;
- if (viewPos > pos - highlightRangeStart)
- viewPos = pos - highlightRangeStart;
-
- timeline.reset(data.move);
- if (viewPos != position()) {
- if (fixupDuration)
- timeline.move(data.move, -viewPos, QEasingCurve(QEasingCurve::InOutQuad), fixupDuration/2);
- else
- timeline.set(data.move, -viewPos);
- }
- vTime = timeline.time();
- }
} else {
QDeclarativeFlickablePrivate::fixup(data, minExtent, maxExtent);
}
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 109fbbbbd5..1119b92162 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -129,15 +129,41 @@ void QDeclarativeLoaderPrivate::initResize()
The loaded item can be accessed using the \l item property.
- Loader is like any other visual item and must be positioned and sized
- accordingly to become visible. Once the component is loaded, the Loader
- is automatically resized to the size of the component.
-
If the \l source or \l sourceComponent changes, any previously instantiated
items are destroyed. Setting \l source to an empty string or setting
\l sourceComponent to \c undefined destroys the currently loaded item,
freeing resources and leaving the Loader empty.
+ \section2 Loader sizing behavior
+
+ Loader is like any other visual item and must be positioned and sized
+ accordingly to become visible.
+
+ \list
+ \o If an explicit size is not specified for the Loader, the Loader
+ is automatically resized to the size of the loaded item once the
+ component is loaded.
+ \o If the size of the Loader is specified explicitly by setting
+ the width, height or by anchoring, the loaded item will be resized
+ to the size of the Loader.
+ \endlist
+
+ In both scenarios the size of the item and the Loader are identical.
+ This ensures that anchoring to the Loader is equivalent to anchoring
+ to the loaded item.
+
+ \table
+ \row
+ \o sizeloader.qml
+ \o sizeitem.qml
+ \row
+ \o \snippet doc/src/snippets/declarative/loader/sizeloader.qml 0
+ \o \snippet doc/src/snippets/declarative/loader/sizeitem.qml 0
+ \row
+ \o The red rectangle will be sized to the size of the root item.
+ \o The red rectangle will be 50x50, centered in the root item.
+ \endtable
+
\section2 Receiving signals from loaded items
@@ -343,12 +369,14 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
QDeclarativeContext *ctxt = new QDeclarativeContext(creationContext);
ctxt->setContextObject(q);
- QDeclarativeComponent *c = component;
- QObject *obj = component->create(ctxt);
+ QDeclarativeGuard<QDeclarativeComponent> c = component;
+ QObject *obj = component->beginCreate(ctxt);
if (component != c) {
// component->create could trigger a change in source that causes
// component to be set to something else. In that case we just
// need to cleanup.
+ if (c)
+ c->completeCreate();
delete obj;
delete ctxt;
return;
@@ -373,6 +401,7 @@ void QDeclarativeLoaderPrivate::_q_sourceLoaded()
delete ctxt;
source = QUrl();
}
+ component->completeCreate();
emit q->sourceChanged();
emit q->statusChanged();
emit q->progressChanged();
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index dc3d5ee0c6..7c79afe6bc 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -373,7 +373,21 @@ void QDeclarativePathViewPrivate::regenerate()
opacity of the items as they rotate. This additional code can be seen in the
PathAttribute documentation.)
- The \c focus can be set to \c true to enable keyboard navigation.
+ PathView does not automatically handle keyboard navigation. This is because
+ the keys to use for navigation will depend upon the shape of the path. Navigation
+ can be added quite simply by setting \c focus to \c true and calling
+ \l decrementCurrentIndex() or \l incrementCurrentIndex(), for example to navigate
+ using the left and right arrow keys:
+
+ \code
+ PathView {
+ ...
+ focus: true
+ Keys.onLeftPressed: decrementCurrentIndex()
+ Keys.onRightPressed: incrementCurrentIndex()
+ }
+ \endcode
+
The path view itself is a focus scope (see \l{qmlfocus#Acquiring Focus and Focus Scopes}{the focus documentation page} for more details).
Delegates are instantiated as needed and may be destroyed at any time.
@@ -523,7 +537,6 @@ int QDeclarativePathView::count() const
/*!
\qmlproperty Path PathView::path
- \default
This property holds the path used to lay out the items.
For more information see the \l Path documentation.
*/
@@ -607,6 +620,8 @@ void QDeclarativePathView::setCurrentIndex(int idx)
*/
void QDeclarativePathView::incrementCurrentIndex()
{
+ Q_D(QDeclarativePathView);
+ d->moveDirection = QDeclarativePathViewPrivate::Positive;
setCurrentIndex(currentIndex()+1);
}
@@ -625,6 +640,7 @@ void QDeclarativePathView::decrementCurrentIndex()
int idx = currentIndex()-1;
if (idx < 0)
idx = d->modelCount - 1;
+ d->moveDirection = QDeclarativePathViewPrivate::Negative;
setCurrentIndex(idx);
}
}
@@ -995,6 +1011,7 @@ void QDeclarativePathView::setDelegate(QDeclarativeComponent *delegate)
}
if (QDeclarativeVisualDataModel *dataModel = qobject_cast<QDeclarativeVisualDataModel*>(d->model)) {
dataModel->setDelegate(delegate);
+ d->modelCount = dataModel->count();
d->regenerate();
emit delegateChanged();
}
@@ -1636,7 +1653,7 @@ void QDeclarativePathViewPrivate::snapToCurrent()
if (!model || modelCount <= 0)
return;
- qreal targetOffset = modelCount - currentIndex;
+ qreal targetOffset = qmlMod(modelCount - currentIndex, modelCount);
moveReason = Other;
offsetAdj = 0.0;
@@ -1645,19 +1662,28 @@ void QDeclarativePathViewPrivate::snapToCurrent()
const int duration = highlightMoveDuration;
- if (targetOffset - offset > modelCount/2) {
+ if (moveDirection == Positive || (moveDirection == Shortest && targetOffset - offset > modelCount/2)) {
qreal distance = modelCount - targetOffset + offset;
- tl.move(moveOffset, 0.0, QEasingCurve(QEasingCurve::InQuad), int(duration * offset / distance));
- tl.set(moveOffset, modelCount);
- tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::OutQuad), int(duration * (modelCount-targetOffset) / distance));
- } else if (targetOffset - offset <= -modelCount/2) {
+ if (targetOffset > moveOffset) {
+ tl.move(moveOffset, 0.0, QEasingCurve(QEasingCurve::InQuad), int(duration * offset / distance));
+ tl.set(moveOffset, modelCount);
+ tl.move(moveOffset, targetOffset, QEasingCurve(offset == 0.0 ? QEasingCurve::InOutQuad : QEasingCurve::OutQuad), int(duration * (modelCount-targetOffset) / distance));
+ } else {
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
+ } else if (moveDirection == Negative || targetOffset - offset <= -modelCount/2) {
qreal distance = modelCount - offset + targetOffset;
- tl.move(moveOffset, modelCount, QEasingCurve(QEasingCurve::InQuad), int(duration * (modelCount-offset) / distance));
- tl.set(moveOffset, 0.0);
- tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::OutQuad), int(duration * targetOffset / distance));
+ if (targetOffset < moveOffset) {
+ tl.move(moveOffset, modelCount, QEasingCurve(targetOffset == 0 ? QEasingCurve::InOutQuad : QEasingCurve::InQuad), int(duration * (modelCount-offset) / distance));
+ tl.set(moveOffset, 0.0);
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::OutQuad), int(duration * targetOffset / distance));
+ } else {
+ tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
+ }
} else {
tl.move(moveOffset, targetOffset, QEasingCurve(QEasingCurve::InOutQuad), duration);
}
+ moveDirection = Shortest;
}
QDeclarativePathViewAttached *QDeclarativePathView::qmlAttachedProperties(QObject *obj)
diff --git a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
index b21721635b..6232b83cb1 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepathview_p_p.h
@@ -82,7 +82,7 @@ public:
, dragMargin(0), deceleration(100)
, moveOffset(this, &QDeclarativePathViewPrivate::setAdjustedOffset)
, firstIndex(-1), pathItems(-1), requestedIndex(-1)
- , moveReason(Other), attType(0), highlightComponent(0), highlightItem(0)
+ , moveReason(Other), moveDirection(Shortest), attType(0), highlightComponent(0), highlightItem(0)
, moveHighlight(this, &QDeclarativePathViewPrivate::setHighlightPosition)
, highlightPosition(0)
, highlightRangeStart(0), highlightRangeEnd(0)
@@ -173,6 +173,8 @@ public:
QVariant modelVariant;
enum MovementReason { Other, SetIndex, Mouse };
MovementReason moveReason;
+ enum MovementDirection { Shortest, Negative, Positive };
+ MovementDirection moveDirection;
QDeclarativeOpenMetaObjectType *attType;
QDeclarativeComponent *highlightComponent;
QDeclarativeItem *highlightItem;
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 1f01a45bf0..4fe6c4cac2 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -937,6 +937,10 @@ void QDeclarativeVisualDataModel::setPart(const QString &part)
int QDeclarativeVisualDataModel::count() const
{
Q_D(const QDeclarativeVisualDataModel);
+ if (d->m_visualItemModel)
+ return d->m_visualItemModel->count();
+ if (!d->m_delegate)
+ return 0;
return d->modelCount();
}
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 5f0fd560ab..fbe58297b3 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -601,7 +601,7 @@ struct QDeclarativeBindingCompilerPrivate
QDeclarativeImports imports;
QDeclarativeEnginePrivate *engine;
- QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((intptr_t)context, 16); }
+ QString contextName() const { return QLatin1String("$$$SCOPE_") + QString::number((quintptr)context, 16); }
bool compile(QDeclarativeJS::AST::Node *);
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 1e58a71d1e..3ee0e6f321 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -474,7 +474,7 @@ int QDeclarativeContextPrivate::context_count(QDeclarativeListProperty<QObject>
{
QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
- int contextProperty = (int)(intptr_t)prop->data;
+ int contextProperty = (int)(quintptr)prop->data;
if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
return 0;
@@ -487,7 +487,7 @@ QObject *QDeclarativeContextPrivate::context_at(QDeclarativeListProperty<QObject
{
QDeclarativeContext *context = static_cast<QDeclarativeContext*>(prop->object);
QDeclarativeContextPrivate *d = QDeclarativeContextPrivate::get(context);
- int contextProperty = (int)(intptr_t)prop->data;
+ int contextProperty = (int)(quintptr)prop->data;
if (d->propertyValues.at(contextProperty).userType() != qMetaTypeId<QList<QObject*> >()) {
return 0;
diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
index ea9211195b..eff59df2ef 100644
--- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
+++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp
@@ -421,7 +421,7 @@ QScriptValue QDeclarativeObjectScriptClass::tostring(QScriptContext *context, QS
ret += QString::fromUtf8(obj->metaObject()->className());
ret += QLatin1String("(0x");
- ret += QString::number((intptr_t)obj,16);
+ ret += QString::number((quintptr)obj,16);
if (!objectName.isEmpty()) {
ret += QLatin1String(", \"");
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index f7228dc7c8..11a25e2189 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -64,13 +64,12 @@ symbian {
neon:*-g++* {
DEFINES += QT_HAVE_NEON
- QMAKE_CXXFLAGS *= -mfpu=neon
HEADERS += $$NEON_HEADERS
SOURCES += $$NEON_SOURCES
DRAWHELPER_NEON_ASM_FILES = $$NEON_ASM
- neon_compiler.commands = $$QMAKE_CXX -c
+ neon_compiler.commands = $$QMAKE_CXX -c -mfpu=neon
neon_compiler.commands += $(CXXFLAGS) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
neon_compiler.dependency_type = TYPE_C
neon_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 5f1bb85805..930ca1081c 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -175,9 +175,9 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
m_activeGestures.remove(g);
m_gestureOwners.remove(g);
m_gestureTargets.remove(g);
+ m_gesturesToDelete.insert(g);
}
- qDeleteAll(gestures);
iter = m_objectGestures.erase(iter);
} else {
++iter;
@@ -386,6 +386,11 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
recycle(gesture);
m_gestureTargets.remove(gesture);
}
+
+ //Clean up the Gestures
+ qDeleteAll(m_gesturesToDelete);
+ m_gesturesToDelete.clear();
+
return consumeEventHint;
}
@@ -448,7 +453,8 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original)
void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
{
QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture);
- Q_ASSERT(recognizer);
+ if(!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed
+ return;
m_deletedRecognizers.remove(gesture);
if (m_deletedRecognizers.keys(recognizer).isEmpty()) {
// no more active gestures, cleanup!
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index 0d84b67434..a5a3482bb1 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -130,6 +130,7 @@ private:
QHash<QGestureRecognizer *, QSet<QGesture *> > m_obsoleteGestures;
QHash<QGesture *, QGestureRecognizer *> m_deletedRecognizers;
+ QSet<QGesture *> m_gesturesToDelete;
void cleanupGesturesForRemovedRecognizer(QGesture *gesture);
QGesture *getState(QObject *widget, QGestureRecognizer *recognizer,
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 45417307fc..6b3f4447e7 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -773,7 +773,7 @@ Qt::Alignment QTextEdit::alignment() const
is the document's parent object. The parent object of the provided document
remains the owner of the object.
- If the current document is a child of the text editor, then it is deleted.
+ The editor does not delete the current document, even if it is a child of the editor.
\sa document()
*/
diff --git a/src/network/access/qhttpnetworkheader.cpp b/src/network/access/qhttpnetworkheader.cpp
index 669f9cf340..3eb2f3bc7c 100644
--- a/src/network/access/qhttpnetworkheader.cpp
+++ b/src/network/access/qhttpnetworkheader.cpp
@@ -60,7 +60,17 @@ QHttpNetworkHeaderPrivate::QHttpNetworkHeaderPrivate(const QHttpNetworkHeaderPri
qint64 QHttpNetworkHeaderPrivate::contentLength() const
{
bool ok = false;
- QByteArray value = headerField("content-length");
+ // We are not using the headerField() method here because servers might send us multiple content-length
+ // headers which is crap (see QTBUG-15311). Therefore just take the first content-length header field.
+ QByteArray value;
+ QList<QPair<QByteArray, QByteArray> >::ConstIterator it = fields.constBegin(),
+ end = fields.constEnd();
+ for ( ; it != end; ++it)
+ if (qstricmp("content-length", it->first) == 0) {
+ value = it->second;
+ break;
+ }
+
qint64 length = value.toULongLong(&ok);
if (ok)
return length;
diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp
index deb678a5de..647eecb38e 100644
--- a/src/network/access/qnetworkrequest.cpp
+++ b/src/network/access/qnetworkrequest.cpp
@@ -899,10 +899,16 @@ void QNetworkHeadersPrivate::parseAndSetHeader(const QByteArray &key, const QByt
// is it a known header?
QNetworkRequest::KnownHeaders parsedKey = parseHeaderName(key);
if (parsedKey != QNetworkRequest::KnownHeaders(-1)) {
- if (value.isNull())
+ if (value.isNull()) {
cookedHeaders.remove(parsedKey);
- else
+ } else if (parsedKey == QNetworkRequest::ContentLengthHeader
+ && cookedHeaders.contains(QNetworkRequest::ContentLengthHeader)) {
+ // Only set the cooked header "Content-Length" once.
+ // See bug QTBUG-15311
+ } else {
cookedHeaders.insert(parsedKey, parseHeaderValue(parsedKey, value));
+ }
+
}
}
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 426b07ae21..70ef7ba84b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -81,9 +81,6 @@ QT_BEGIN_NAMESPACE
bool QSslSocketPrivate::s_libraryLoaded = false;
bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
-// Useful defines
-#define SSL_ERRORSTR() QString::fromLocal8Bit(q_ERR_error_string(q_ERR_get_error(), NULL))
-
/* \internal
From OpenSSL's thread(3) manual page:
@@ -273,7 +270,7 @@ init_context:
}
// ### Bad error code
- q->setErrorString(QSslSocket::tr("Error creating SSL context (%1)").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error creating SSL context (%1)").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
@@ -298,7 +295,7 @@ init_context:
if (!q_SSL_CTX_set_cipher_list(ctx, cipherString.data())) {
// ### Bad error code
- q->setErrorString(QSslSocket::tr("Invalid or empty cipher list (%1)").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Invalid or empty cipher list (%1)").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
@@ -326,14 +323,14 @@ init_context:
if (!configuration.localCertificate.isNull()) {
// Require a private key as well.
if (configuration.privateKey.isNull()) {
- q->setErrorString(QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Cannot provide a certificate with no key, %1").arg(getErrorsFromOpenSsl()));
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
}
// Load certificate
if (!q_SSL_CTX_use_certificate(ctx, (X509 *)configuration.localCertificate.handle())) {
- q->setErrorString(QSslSocket::tr("Error loading local certificate, %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error loading local certificate, %1").arg(getErrorsFromOpenSsl()));
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
}
@@ -348,14 +345,14 @@ init_context:
else
q_EVP_PKEY_set1_DSA(pkey, (DSA *)configuration.privateKey.handle());
if (!q_SSL_CTX_use_PrivateKey(ctx, pkey)) {
- q->setErrorString(QSslSocket::tr("Error loading private key, %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error loading private key, %1").arg(getErrorsFromOpenSsl()));
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
}
// Check if the certificate matches the private key.
if (!q_SSL_CTX_check_private_key(ctx)) {
- q->setErrorString(QSslSocket::tr("Private key does not certify public key, %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Private key does not certify public key, %1").arg(getErrorsFromOpenSsl()));
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
}
@@ -375,7 +372,7 @@ init_context:
// Create and initialize SSL session
if (!(ssl = q_SSL_new(ctx))) {
// ### Bad error code
- q->setErrorString(QSslSocket::tr("Error creating SSL session, %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error creating SSL session, %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
@@ -390,7 +387,7 @@ init_context:
writeBio = q_BIO_new(q_BIO_s_mem());
if (!readBio || !writeBio) {
// ### Bad error code
- q->setErrorString(QSslSocket::tr("Error creating SSL session: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error creating SSL session: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return false;
@@ -835,6 +832,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
systemCerts.append(QSslCertificate::fromPath(it.next()));
}
systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora, Mandriva
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/share/certs/ca-root-nss.crt"), QSsl::Pem)); // FreeBSD's ca_root_nss
#elif defined(Q_OS_SYMBIAN)
QList<QByteArray> certs;
@@ -911,7 +909,7 @@ void QSslSocketBackendPrivate::transmit()
int writtenBytes = q_SSL_write(ssl, writeBuffer.readPointer(), nextDataBlockSize);
if (writtenBytes <= 0) {
// ### Better error handling.
- q->setErrorString(QSslSocket::tr("Unable to write data: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Unable to write data: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return;
@@ -974,7 +972,7 @@ void QSslSocketBackendPrivate::transmit()
plainSocket->read(data.data(), writtenToBio);
} else {
// ### Better error handling.
- q->setErrorString(QSslSocket::tr("Unable to decrypt data: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Unable to decrypt data: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return;
@@ -1052,7 +1050,7 @@ void QSslSocketBackendPrivate::transmit()
case SSL_ERROR_SSL: // error in the SSL library
// we do not know exactly what the error is, nor whether we can recover from it,
// so just return to prevent an endless loop in the outer "while" statement
- q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
return;
@@ -1062,7 +1060,7 @@ void QSslSocketBackendPrivate::transmit()
// SSL_ERROR_WANT_X509_LOOKUP: can only happen with a
// SSL_CTX_set_client_cert_cb(), which we do not call.
// So this default case should never be triggered.
- q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error while reading: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::UnknownSocketError);
emit q->error(QAbstractSocket::UnknownSocketError);
break;
@@ -1157,8 +1155,7 @@ bool QSslSocketBackendPrivate::startHandshake()
// The handshake is not yet complete.
break;
default:
- // ### Handle errors better
- q->setErrorString(QSslSocket::tr("Error during SSL handshake: %1").arg(SSL_ERRORSTR()));
+ q->setErrorString(QSslSocket::tr("Error during SSL handshake: %1").arg(getErrorsFromOpenSsl()));
q->setSocketError(QAbstractSocket::SslHandshakeFailedError);
#ifdef QSSLSOCKET_DEBUG
qDebug() << "QSslSocketBackendPrivate::startHandshake: error!" << q->errorString();
@@ -1334,6 +1331,19 @@ QList<QSslCertificate> QSslSocketBackendPrivate::STACKOFX509_to_QSslCertificates
return certificates;
}
+QString QSslSocketBackendPrivate::getErrorsFromOpenSsl()
+{
+ QString errorString;
+ unsigned long errNum;
+ while((errNum = q_ERR_get_error())) {
+ if (! errorString.isEmpty())
+ errorString.append(QLatin1String(", "));
+ const char *error = q_ERR_error_string(errNum, NULL);
+ errorString.append(QString::fromAscii(error)); // error is ascii according to man ERR_error_string
+ }
+ return errorString;
+}
+
bool QSslSocketBackendPrivate::isMatchingHostname(const QString &cn, const QString &hostname)
{
int wildcard = cn.indexOf(QLatin1Char('*'));
diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h
index b59a6c9999..878c654a24 100644
--- a/src/network/ssl/qsslsocket_openssl_p.h
+++ b/src/network/ssl/qsslsocket_openssl_p.h
@@ -117,6 +117,7 @@ public:
static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher);
static QList<QSslCertificate> STACKOFX509_to_QSslCertificates(STACK_OF(X509) *x509);
Q_AUTOTEST_EXPORT static bool isMatchingHostname(const QString &cn, const QString &hostname);
+ static QString getErrorsFromOpenSsl();
};
#if defined(Q_OS_SYMBIAN)
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index a7ece0f162..0d30f9a844 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -340,12 +340,7 @@ static const char* const qglslImageSrcFragmentShader = "\n\
uniform lowp sampler2D imageTexture; \n\
lowp vec4 srcPixel() \n\
{ \n"
-#ifdef QT_OPENGL_ES_2
- // work-around for driver bug
- "return 1.0 * texture2D(imageTexture, textureCoords); \n"
-#else
"return texture2D(imageTexture, textureCoords); \n"
-#endif
"}\n";
static const char* const qglslCustomSrcFragmentShader = "\n\
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index c5a39e1f6d..53a5b4d0d6 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -1151,10 +1151,10 @@ void QNetworkSessionPrivateImpl::RunL()
serviceConfig = QNetworkConfiguration();
iError = QNetworkSession::InvalidConfigurationError;
QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
- Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
+ Cancel();
QT_TRYCATCH_LEAVING(syncStateWithInterface());
break;
case KErrCancel: // Connection attempt cancelled
@@ -1173,10 +1173,10 @@ void QNetworkSessionPrivateImpl::RunL()
iError = QNetworkSession::UnknownSessionError;
}
QT_TRYCATCH_LEAVING(emit QNetworkSessionPrivate::error(iError));
- Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
+ Cancel();
QT_TRYCATCH_LEAVING(syncStateWithInterface());
break;
}
@@ -1268,10 +1268,10 @@ bool QNetworkSessionPrivateImpl::newState(QNetworkSession::State newState, TUint
serviceConfig = QNetworkConfiguration();
iError = QNetworkSession::SessionAbortedError;
emit QNetworkSessionPrivate::error(iError);
- Cancel();
if (ipConnectionNotifier) {
ipConnectionNotifier->StopNotifications();
}
+ Cancel();
// Start handling IAP state change signals from QNetworkConfigurationManagerPrivate
iHandleStateNotificationsFromManager = true;
emitSessionClosed = true; // Emit SessionClosed after state change has been reported
diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp
index b4dfc4d223..33fa50852b 100644
--- a/src/plugins/bearer/symbian/symbianengine.cpp
+++ b/src/plugins/bearer/symbian/symbianengine.cpp
@@ -135,10 +135,9 @@ void SymbianEngine::initialize()
updateConfigurations();
updateStatesToSnaps();
- updateAvailableAccessPoints(); // On first time updates synchronously (without WLAN scans)
+ updateAvailableAccessPoints(); // On first time updates (without WLAN scans)
// Start monitoring IAP and/or SNAP changes in Symbian CommsDB
startCommsDatabaseNotifications();
- iFirstUpdate = false;
}
SymbianEngine::~SymbianEngine()
@@ -790,6 +789,12 @@ void SymbianEngine::accessPointScanningReady(TBool scanSuccessful, TConnMonIapIn
mutex.unlock();
emit updateCompleted();
mutex.lock();
+ } else {
+ iFirstUpdate = false;
+ if (iScanInQueue) {
+ iScanInQueue = EFalse;
+ updateAvailableAccessPoints();
+ }
}
}
@@ -976,7 +981,7 @@ void SymbianEngine::RunL()
QMutexLocker locker(&mutex);
if (iStatus != KErrCancel) {
- // By default, start relistening notifications. Stop only if interesting event occurred.
+ // By default, start relistening notifications. Stop only if interesting event occured.
iWaitingCommsDatabaseNotifications = true;
RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int());
switch (event) {
@@ -1356,27 +1361,39 @@ AccessPointsAvailabilityScanner::~AccessPointsAvailabilityScanner()
void AccessPointsAvailabilityScanner::DoCancel()
{
iConnectionMonitor.CancelAsyncRequest(EConnMonGetPckgAttribute);
+ iScanActive = EFalse;
+ iOwner.iScanInQueue = EFalse;
}
void AccessPointsAvailabilityScanner::StartScanning()
{
- if (iOwner.iFirstUpdate) {
- // On first update (the mgr is being instantiated) update only those bearers who
- // don't need time-consuming scans (WLAN).
- // Note: EBearerIdWCDMA covers also GPRS bearer
- iConnectionMonitor.GetPckgAttribute(EBearerIdWCDMA, 0, KIapAvailability, iIapBuf, iStatus);
+ if (!iScanActive) {
+ iScanActive = ETrue;
+ if (iOwner.iFirstUpdate) {
+ // On first update (the mgr is being instantiated) update only those bearers who
+ // don't need time-consuming scans (WLAN).
+ // Note: EBearerIdWCDMA covers also GPRS bearer
+ iConnectionMonitor.GetPckgAttribute(EBearerIdWCDMA, 0, KIapAvailability, iIapBuf, iStatus);
+ } else {
+ iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus);
+ }
+
+ if (!IsActive()) {
+ SetActive();
+ }
} else {
- iConnectionMonitor.GetPckgAttribute(EBearerIdAll, 0, KIapAvailability, iIapBuf, iStatus);
+ // Queue scan for getting WLAN info after first request returns
+ if (iOwner.iFirstUpdate) {
+ iOwner.iScanInQueue = ETrue;
+ }
}
-
- if (!IsActive())
- SetActive();
}
void AccessPointsAvailabilityScanner::RunL()
{
QMutexLocker locker(&iOwner.mutex);
+ iScanActive = EFalse;
if (iStatus.Int() != KErrNone) {
iIapBuf().iCount = 0;
QT_TRYCATCH_LEAVING(iOwner.accessPointScanningReady(false,iIapBuf()));
diff --git a/src/plugins/bearer/symbian/symbianengine.h b/src/plugins/bearer/symbian/symbianengine.h
index 7c1076ed2b..337d4d11e6 100644
--- a/src/plugins/bearer/symbian/symbianengine.h
+++ b/src/plugins/bearer/symbian/symbianengine.h
@@ -207,6 +207,7 @@ private: // Data
TBool iInitOk;
TBool iUpdateGoingOn;
TBool iUpdatePending;
+ TBool iScanInQueue;
AccessPointsAvailabilityScanner* ipAccessPointsAvailabilityScanner;
@@ -234,9 +235,10 @@ protected: // From CActive
void DoCancel();
private: // Data
- SymbianEngine& iOwner;
+ SymbianEngine& iOwner;
RConnectionMonitor& iConnectionMonitor;
- TConnMonIapInfoBuf iIapBuf;
+ TConnMonIapInfoBuf iIapBuf;
+ TBool iScanActive;
};
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
index c16a242b96..ceed7aeb59 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintengine.cpp
@@ -68,6 +68,15 @@ public:
Matrix_BlitsUnsupported = (Matrix_NegativeScale|Matrix_RectsUnsupported)
};
+ inline static uint getTransformationType(const QTransform &transform)
+ {
+ int ret = transform.type();
+ if (qMin(transform.m11(), transform.m22()) < 0) {
+ ret |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
+ }
+ return ret;
+ }
+
enum CompositionModeStatus {
PorterDuff_None = 0x0,
PorterDuff_Supported = 0x1,
@@ -99,7 +108,7 @@ public:
inline bool isSimpleBrush(const QBrush &brush) const;
- void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos);
+ void drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &pos, const QTransform &pixmapTransform);
void blit(const QRectF &dest, IDirectFBSurface *surface, const QRectF &src);
inline bool supportsStretchBlit() const;
@@ -707,7 +716,8 @@ void QDirectFBPaintEngine::drawTiledPixmap(const QRectF &r,
const QPixmap pix(data);
QRasterPaintEngine::drawTiledPixmap(r, pix, offset);
} else {
- CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset));
+ QTransform transform(state()->matrix);
+ CLIPPED_PAINT(d->drawTiledPixmap(r, pixmap, offset, transform));
}
}
@@ -827,9 +837,14 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
return; }
case Qt::TexturePattern: {
+ const QPointF &brushOrigin = state()->brushOrigin;
+ const QTransform stateTransform = state()->matrix;
+ QTransform transform(stateTransform);
+ transform.translate(brushOrigin.x(), brushOrigin.y());
+ transform = brush.transform() * transform;
if (!(d->compositionModeStatus & QDirectFBPaintEnginePrivate::PorterDuff_Supported)
- || (d->transformationType & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
- || (!d->supportsStretchBlit() && state()->matrix.isScaling())) {
+ || (QDirectFBPaintEnginePrivate::getTransformationType(transform) & QDirectFBPaintEnginePrivate::Matrix_BlitsUnsupported)
+ || (!d->supportsStretchBlit() && transform.isScaling())) {
break;
}
@@ -837,7 +852,7 @@ void QDirectFBPaintEngine::fillRect(const QRectF &rect, const QBrush &brush)
if (texture.pixmapData()->classId() != QPixmapData::DirectFBClass)
break;
- CLIPPED_PAINT(d->drawTiledPixmap(rect, texture, rect.topLeft() - state()->brushOrigin));
+ CLIPPED_PAINT(d->drawTiledPixmap(stateTransform.mapRect(rect), texture, rect.topLeft() - brushOrigin, transform));
return; }
default:
break;
@@ -948,10 +963,7 @@ void QDirectFBPaintEnginePrivate::unlock(QDirectFBPaintDevice *device)
void QDirectFBPaintEnginePrivate::setTransform(const QTransform &transform)
{
- transformationType = transform.type();
- if (qMin(transform.m11(), transform.m22()) < 0) {
- transformationType |= QDirectFBPaintEnginePrivate::Matrix_NegativeScale;
- }
+ transformationType = getTransformationType(transform);
setPen(q->state()->pen);
}
@@ -1153,10 +1165,12 @@ static inline qreal fixCoord(qreal rect_pos, qreal pixmapSize, qreal offset)
return pos;
}
-void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap, const QPointF &off)
+void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPixmap &pixmap,
+ const QPointF &off, const QTransform &pixmapTransform)
{
- Q_ASSERT(!(transformationType & Matrix_BlitsUnsupported));
const QTransform &transform = q->state()->matrix;
+ Q_ASSERT(!(getTransformationType(transform) & Matrix_BlitsUnsupported) &&
+ !(getTransformationType(pixmapTransform) & Matrix_BlitsUnsupported));
const QRect destinationRect = transform.mapRect(dest).toRect().normalized();
QRect newClip = destinationRect;
if (!currentClip.isEmpty())
@@ -1173,7 +1187,7 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
};
surface->SetClip(surface, &clip);
- QPointF offset = off;
+ QPointF offset = pixmapTransform.inverted().map(off);
Q_ASSERT(transform.type() <= QTransform::TxScale);
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->classId() == QPixmapData::DirectFBClass);
@@ -1187,13 +1201,13 @@ void QDirectFBPaintEnginePrivate::drawTiledPixmap(const QRectF &dest, const QPix
prepareForBlit(blitFlags);
QDirectFBPaintEnginePrivate::unlock(dfbData);
const QSize pixmapSize = dfbData->size();
- if (transform.isScaling()) {
+ if (transform.isScaling() || pixmapTransform.isScaling()) {
Q_ASSERT(supportsStretchBlit());
Q_ASSERT(qMin(transform.m11(), transform.m22()) >= 0);
offset.rx() *= transform.m11();
offset.ry() *= transform.m22();
- const QSizeF mappedSize(pixmapSize.width() * transform.m11(), pixmapSize.height() * transform.m22());
+ const QSizeF mappedSize(pixmapSize.width() * pixmapTransform.m11(), pixmapSize.height() * pixmapTransform.m22());
qreal y = fixCoord(destinationRect.y(), mappedSize.height(), offset.y());
const qreal startX = fixCoord(destinationRect.x(), mappedSize.width(), offset.x());
while (y <= destinationRect.bottom()) {
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index f4e3a28275..6ecb403e2a 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -2960,7 +2960,7 @@ EXPORTS
?qvsnprintf@@YAHPADIPBD0@Z @ 2959 NONAME ; int qvsnprintf(char *, unsigned int, char const *, char *)
?raiseError@QXmlStreamReader@@QAEXABVQString@@@Z @ 2960 NONAME ; void QXmlStreamReader::raiseError(class QString const &)
?rangeContains@QXmlUtils@@CA_NPBVQXmlCharRange@@0VQChar@@@Z @ 2961 NONAME ; bool QXmlUtils::rangeContains(class QXmlCharRange const *, class QXmlCharRange const *, class QChar)
- ?reactivateDeferredActiveObjects@QEventDispatcherSymbian@@QAEXXZ @ 2962 NONAME ; void QEventDispatcherSymbian::reactivateDeferredActiveObjects(void)
+ ?reactivateDeferredActiveObjects@QEventDispatcherSymbian@@QAEXXZ @ 2962 NONAME ABSENT ; void QEventDispatcherSymbian::reactivateDeferredActiveObjects(void)
?reactivateSocketNotifier@QEventDispatcherSymbian@@QAEXPAVQSocketNotifier@@@Z @ 2963 NONAME ; void QEventDispatcherSymbian::reactivateSocketNotifier(class QSocketNotifier *)
?read@QAbstractFileEngine@@UAE_JPAD_J@Z @ 2964 NONAME ; long long QAbstractFileEngine::read(char *, long long)
?read@QFSFileEngine@@UAE_JPAD_J@Z @ 2965 NONAME ; long long QFSFileEngine::read(char *, long long)
@@ -4484,4 +4484,6 @@ EXPORTS
?selectThread@QEventDispatcherSymbian@@AAEAAVQSelectThread@@XZ @ 4483 NONAME ; class QSelectThread & QEventDispatcherSymbian::selectThread(void)
?qt_symbian_SetupThreadHeap@@YAHHAAUSStdEpocThreadCreateInfo@@@Z @ 4484 NONAME ; int qt_symbian_SetupThreadHeap(int, struct SStdEpocThreadCreateInfo &)
?objectNameChanged@QAbstractDeclarativeData@@2P6AXPAV1@PAVQObject@@@ZA @ 4485 NONAME ; void (*QAbstractDeclarativeData::objectNameChanged)(class QAbstractDeclarativeData *, class QObject *)
+ ?queueDeferredActiveObjectsCompletion@QEventDispatcherSymbian@@QAEXXZ @ 4486 NONAME ; void QEventDispatcherSymbian::queueDeferredActiveObjectsCompletion(void)
+ ?reactivateDeferredActiveObjects@QEventDispatcherSymbian@@UAEXXZ @ 4487 NONAME ; void QEventDispatcherSymbian::reactivateDeferredActiveObjects(void)
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 75bb026245..54768a10ea 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12104,4 +12104,5 @@ EXPORTS
_ZN15QStaticTextItem13setFontEngineEP11QFontEngine @ 12103 NONAME
_ZN15QStaticTextItemD1Ev @ 12104 NONAME
_ZN15QStaticTextItemD2Ev @ 12105 NONAME
+ _ZN19QEventDispatcherS6031reactivateDeferredActiveObjectsEv @ 12106 NONAME
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index aae2786770..126c6c16f1 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -755,6 +755,9 @@ QT_BEGIN_NAMESPACE
QTest::touchEvent to create a QTouchEventSequence instance. Add touch events to
the sequence by calling press(), move(), release() and stationary(), and let the
instance run out of scope to commit the sequence to the event system.
+
+ Example:
+ \snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 25
*/
/*!
diff --git a/src/xmlpatterns/parser/createTokenLookup.sh b/src/xmlpatterns/parser/createTokenLookup.sh
index e11a3ba3e4..933956869d 100755
--- a/src/xmlpatterns/parser/createTokenLookup.sh
+++ b/src/xmlpatterns/parser/createTokenLookup.sh
@@ -55,8 +55,8 @@ license=`cat <<EOF
** 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 either Technology Preview License Agreement or the
-** Beta Release License Agreement.
+** 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
@@ -66,13 +66,12 @@ license=`cat <<EOF
** 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.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
+** 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 are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
**
**
**