summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-08-27 11:15:05 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-08-27 11:15:05 (GMT)
commit287001fcd6d854b58bd61412e8b2c5bbdcb67b05 (patch)
treed78b4f109c9cce328dc5627de334f96b79331046 /src
parent9ef61d3d1e53d32dc2568cbfb9f8ff5b19cb4ffc (diff)
parent8cb399e2c2ba47cdf3b27c7c5cb4d8d35702a068 (diff)
downloadQt-287001fcd6d854b58bd61412e8b2c5bbdcb67b05.zip
Qt-287001fcd6d854b58bd61412e8b2c5bbdcb67b05.tar.gz
Qt-287001fcd6d854b58bd61412e8b2c5bbdcb67b05.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri2
-rw-r--r--src/corelib/global/global.pri2
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qlibraryinfo.cpp11
-rw-r--r--src/corelib/plugin/qlibrary.cpp5
-rw-r--r--src/corelib/tools/qsimd.cpp191
-rw-r--r--src/corelib/tools/qsimd_p.h1
-rw-r--r--src/corelib/tools/qstring.cpp63
-rw-r--r--src/corelib/tools/qstring.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanchors.cpp9
-rw-r--r--src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeborderimage.cpp6
-rw-r--r--src/declarative/graphicsitems/qdeclarativeevents.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflipable.cpp9
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocuspanel.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativefocusscope.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp19
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp14
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h12
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp13
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimagebase.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativelayoutitem.cpp7
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp16
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h12
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativemousearea.cpp11
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath.cpp58
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp18
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativerepeater.cpp21
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp26
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp17
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetranslate.cpp3
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp8
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h1
-rw-r--r--src/declarative/qml/qdeclarativecompiledbindings.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp27
-rw-r--r--src/declarative/qml/qdeclarativecompositetypemanager.cpp18
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp8
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp157
-rw-r--r--src/declarative/qml/qdeclarativeimport_p.h37
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h7
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp54
-rw-r--r--src/declarative/util/qdeclarativebind.cpp15
-rw-r--r--src/declarative/util/qdeclarativeconnections.cpp7
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp3
-rw-r--r--src/declarative/util/qdeclarativepropertychanges.cpp6
-rw-r--r--src/declarative/util/qdeclarativestate.cpp17
-rw-r--r--src/declarative/util/qdeclarativetransition.cpp6
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp9
-rw-r--r--src/gui/gui.pro2
-rw-r--r--src/gui/kernel/qeventdispatcher_mac.mm6
-rw-r--r--src/gui/kernel/qgesturemanager.cpp5
-rw-r--r--src/gui/styles/qgtkstyle.cpp5
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp33
-rw-r--r--src/network/bearer/qnetworkconfigmanager.cpp12
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp10
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp5
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp9
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp1
-rw-r--r--src/opengl/qgl.cpp3
-rw-r--r--src/opengl/qgl_p.h3
-rw-r--r--src/opengl/qgl_win.cpp2
-rw-r--r--src/opengl/qglshaderprogram.cpp10
-rw-r--r--src/plugins/bearer/icd/qnetworksession_impl.cpp6
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.cpp47
-rw-r--r--src/plugins/bearer/symbian/qnetworksession_impl.h1
-rw-r--r--src/script/api/qscriptengine.cpp28
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp2
-rw-r--r--src/sql/drivers/psql/qsql_psql.pri7
-rw-r--r--src/sql/drivers/tds/qsql_tds.pri4
-rw-r--r--src/testlib/qbenchmarkmeasurement_p.h4
78 files changed, 540 insertions, 673 deletions
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 2047143..ac0c47c 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -82,7 +82,7 @@ CONFIG(QTDIR_build) {
symbian: TARGET =$$TARGET$${QT_LIBINFIX}
}
moduleFile=$$PWD/../WebKit/qt/qt_webkit_version.pri
-include($$moduleFile)
+isEmpty(QT_BUILD_TREE):include($$moduleFile)
VERSION = $${QT_WEBKIT_MAJOR_VERSION}.$${QT_WEBKIT_MINOR_VERSION}.$${QT_WEBKIT_PATCH_VERSION}
unix {
diff --git a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
index d8cf06c..4594d1e 100644
--- a/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
+++ b/src/3rdparty/webkit/WebKit/qt/qt_webkit_version.pri
@@ -2,4 +2,4 @@ QT_WEBKIT_VERSION = 4.7.0
QT_WEBKIT_MAJOR_VERSION = 4
QT_WEBKIT_MINOR_VERSION = 7
QT_WEBKIT_PATCH_VERSION = 0
-QT_CONFIG *= webkit
+QT_CONFIG += webkit
diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri
index b916b4d..2505e72 100644
--- a/src/corelib/global/global.pri
+++ b/src/corelib/global/global.pri
@@ -19,7 +19,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = global/qt_pch.h
-linux*-g++*:!static {
+linux*:!static {
QMAKE_LFLAGS += -Wl,-e,qt_core_boilerplate
prog=$$quote(if (/program interpreter: (.*)]/) { print $1; })
DEFINES += ELF_INTERPRETER=\\\"$$system(readelf -l /bin/ls | perl -n -e \'$$prog\')\\\"
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index af35316..401af85 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1828,6 +1828,7 @@ QSysInfo::S60Version QSysInfo::s60Version()
CDir* contents;
TInt err = fileFinder.FindWildByDir(qt_S60Filter, qt_S60SystemInstallDir, contents);
if (err == KErrNone) {
+ QScopedPointer<CDir> contentsDeleter(contents);
err = contents->Sort(EDescending|ESortByName);
if (err == KErrNone && contents->Count() > 0 && (*contents)[0].iName.Length() >= 12) {
TInt major = (*contents)[0].iName[9] - '0';
@@ -1850,7 +1851,6 @@ QSysInfo::S60Version QSysInfo::s60Version()
}
}
}
- delete contents;
}
# ifdef Q_CC_NOKIAX86
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index ea7e2e4..a0779c9 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -500,6 +500,7 @@ QT_END_NAMESPACE
extern const char qt_core_interpreter[] __attribute__((section(".interp")))
= ELF_INTERPRETER;
+extern void qDumpCPUFeatures(); // in qsimd.cpp
extern "C" void qt_core_boilerplate();
void qt_core_boilerplate()
{
@@ -508,6 +509,14 @@ void qt_core_boilerplate()
"Contact: Nokia Corporation (qt-info@nokia.com)\n"
"\n"
"Build key: " QT_BUILD_KEY "\n"
+ "Compat build key: "
+#ifdef QT_BUILD_KEY_COMPAT
+ "| " QT_BUILD_KEY_COMPAT " "
+#endif
+#ifdef QT_BUILD_KEY_COMPAT2
+ "| " QT_BUILD_KEY_COMPAT2 " "
+#endif
+ "|\n"
"Build date: %s\n"
"Installation prefix: %s\n"
"Library path: %s\n"
@@ -517,6 +526,8 @@ void qt_core_boilerplate()
qt_configure_libraries_path_str + 12,
qt_configure_headers_path_str + 12);
+// qDumpCPUFeatures();
+
#ifdef QT_EVAL
extern void qt_core_eval_init(uint);
qt_core_eval_init(1);
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 0f99948..a9ae2ab 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -790,10 +790,13 @@ bool QLibraryPrivate::isPlugin(QSettings *settings)
.arg(qt_version&0xff)
.arg(debug ? QLatin1String("debug") : QLatin1String("release"));
} else if (key != QT_BUILD_KEY
+ // we may have some compatibility keys, try them too:
#ifdef QT_BUILD_KEY_COMPAT
- // be sure to load plugins using an older but compatible build key
&& key != QT_BUILD_KEY_COMPAT
#endif
+#ifdef QT_BUILD_KEY_COMPAT2
+ && key != QT_BUILD_KEY_COMPAT2
+#endif
) {
if (qt_debug_component()) {
qWarning("In %s:\n"
diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
index 8005d7d..68ab033 100644
--- a/src/corelib/tools/qsimd.cpp
+++ b/src/corelib/tools/qsimd.cpp
@@ -41,6 +41,7 @@
#include "qsimd_p.h"
#include <QByteArray>
+#include <stdio.h>
#if defined(Q_OS_WINCE)
#include <windows.h>
@@ -50,15 +51,20 @@
#include <intrin.h>
#endif
+#if defined(Q_OS_LINUX) && defined(__arm__)
+#include "private/qcore_unix_p.h"
+
+#include <asm/hwcap.h>
+#include <linux/auxvec.h>
+#endif
+
QT_BEGIN_NAMESPACE
-uint qDetectCPUFeatures()
+#if defined (Q_OS_WINCE)
+static inline uint detectProcessorFeatures()
{
- static uint features = 0xffffffff;
- if (features != 0xffffffff)
- return features;
+ uint features = 0;
-#if defined (Q_OS_WINCE)
#if defined (ARM)
if (IsProcessorFeaturePresent(PF_ARM_INTEL_WMMX)) {
features = IWMMXT;
@@ -78,22 +84,57 @@ uint qDetectCPUFeatures()
#endif
features = 0;
return features;
-#elif defined(QT_HAVE_IWMMXT)
+}
+
+#elif defined(__arm__) || defined(__arm) || defined(QT_HAVE_IWMMXT) || defined(QT_HAVE_NEON)
+static inline uint detectProcessorFeatures()
+{
+ uint features = 0;
+
+#if defined(Q_OS_LINUX)
+ int auxv = ::qt_safe_open("/proc/self/auxv", O_RDONLY);
+ if (auxv != -1) {
+ unsigned long vector[64];
+ int nread;
+ while (features == 0) {
+ nread = ::qt_safe_read(auxv, (char *)vector, sizeof vector);
+ if (nread <= 0) {
+ // EOF or error
+ break;
+ }
+
+ int max = nread / (sizeof vector[0]);
+ for (int i = 0; i < max; i += 2)
+ if (vector[i] == AT_HWCAP) {
+ if (vector[i+1] & HWCAP_IWMMXT)
+ features |= IWMMXT;
+ if (vector[i+1] & HWCAP_NEON)
+ features |= NEON;
+ break;
+ }
+ }
+
+ ::qt_safe_close(auxv);
+ return features;
+ }
+ // fall back if /proc/self/auxv wasn't found
+#endif
+
+#if defined(QT_HAVE_IWMMXT)
// runtime detection only available when running as a previlegied process
- static const bool doIWMMXT = !qgetenv("QT_NO_IWMMXT").toInt();
- features = doIWMMXT ? IWMMXT : 0;
- return features;
+ features = IWMMXT;
#elif defined(QT_HAVE_NEON)
- static const bool doNEON = !qgetenv("QT_NO_NEON").toInt();
- features = doNEON ? NEON : 0;
+ features = NEON;
+#endif
+
return features;
-#else
- features = 0;
-#if defined(__x86_64__) || defined(Q_OS_WIN64)
- features = MMX|SSE|SSE2|CMOV;
-#elif defined(__ia64__)
- features = MMX|SSE|SSE2;
+}
+
#elif defined(__i386__) || defined(_M_IX86)
+static inline uint detectProcessorFeatures()
+{
+ uint features = 0;
+
unsigned int extended_result = 0;
unsigned int feature_result = 0;
uint result = 0;
@@ -149,6 +190,7 @@ uint qDetectCPUFeatures()
:
: "%eax", "%ecx", "%edx"
);
+
#elif defined (Q_OS_WIN)
_asm {
push eax
@@ -210,6 +252,7 @@ uint qDetectCPUFeatures()
}
#endif
+
// result now contains the standard feature bits
if (result & (1u << 15))
features |= CMOV;
@@ -236,9 +279,13 @@ uint qDetectCPUFeatures()
if (feature_result & (1u << 28))
features |= AVX;
-#endif // i386
+ return features;
+}
-#if defined(__x86_64__) || defined(Q_OS_WIN64)
+#elif defined(__x86_64) || defined(Q_OS_WIN64)
+static inline uint detectProcessorFeatures()
+{
+ uint features = MMX|SSE|SSE2|CMOV;
uint feature_result = 0;
#if defined(Q_CC_GNU)
@@ -282,33 +329,97 @@ uint qDetectCPUFeatures()
features |= SSE4_2;
if (feature_result & (1u << 28))
features |= AVX;
-#endif // x86_64
-#if defined(QT_HAVE_MMX)
- if (qgetenv("QT_NO_MMX").toInt())
- features ^= MMX;
-#endif
- if (qgetenv("QT_NO_MMXEXT").toInt())
- features ^= MMXEXT;
+ return features;
+}
-#if defined(QT_HAVE_3DNOW)
- if (qgetenv("QT_NO_3DNOW").toInt())
- features ^= MMX3DNOW;
-#endif
- if (qgetenv("QT_NO_3DNOWEXT").toInt())
- features ^= MMX3DNOWEXT;
+#elif defined(__ia64__)
+static inline uint detectProcessorFeatures()
+{
+ return MMX|SSE|SSE2;
+}
-#if defined(QT_HAVE_SSE)
- if (qgetenv("QT_NO_SSE").toInt())
- features ^= SSE;
-#endif
-#if defined(QT_HAVE_SSE2)
- if (qgetenv("QT_NO_SSE2").toInt())
- features ^= SSE2;
+#else
+static inline uint detectProcessorFeatures()
+{
+ return 0;
+}
#endif
+/*
+ * Use kdesdk/scripts/generate_string_table.pl to update the table below.
+ * Here's the data (don't forget the ONE leading space):
+ mmx
+ mmxext
+ mmx3dnow
+ mmx3dnowext
+ sse
+ sse2
+ cmov
+ iwmmxt
+ neon
+ sse3
+ ssse3
+ sse4.1
+ sse4.2
+ avx
+ */
+
+// begin generated
+static const char features_string[] =
+ " mmx\0"
+ " mmxext\0"
+ " mmx3dnow\0"
+ " mmx3dnowext\0"
+ " sse\0"
+ " sse2\0"
+ " cmov\0"
+ " iwmmxt\0"
+ " neon\0"
+ " sse3\0"
+ " ssse3\0"
+ " sse4.1\0"
+ " sse4.2\0"
+ " avx\0"
+ "\0";
+
+static const int features_indices[] = {
+ 0, 5, 13, 23, 36, 41, 47, 53,
+ 61, 67, 73, 80, 88, 96, -1
+};
+// end generated
+
+const int features_count = (sizeof features_indices - 1) / (sizeof features_indices[0]);
+
+uint qDetectCPUFeatures()
+{
+ static QBasicAtomicInt features = Q_BASIC_ATOMIC_INITIALIZER(-1);
+ if (features != -1)
+ return features;
+
+ uint f = detectProcessorFeatures();
+ QByteArray disable = qgetenv("QT_NO_CPU_FEATURE");
+ if (!disable.isEmpty()) {
+ disable.prepend(' ');
+ for (int i = 0; i < features_count; ++i) {
+ if (disable.contains(features_string + features_indices[i]))
+ f &= ~(1 << i);
+ }
+ }
+
+ features = f;
return features;
-#endif
+}
+
+void qDumpCPUFeatures()
+{
+ uint features = qDetectCPUFeatures();
+ printf("Processor features: ");
+ for (int i = 0; i < features_count; ++i) {
+ if (features & (1 << i))
+ printf("%s", features_string + features_indices[i]);
+ }
+ puts("");
}
QT_END_NAMESPACE
diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
index a3148fb..2626657 100644
--- a/src/corelib/tools/qsimd_p.h
+++ b/src/corelib/tools/qsimd_p.h
@@ -85,6 +85,7 @@ QT_BEGIN_HEADER
// SSE4.1 and SSE4.2 intrinsics
#if (defined(QT_HAVE_SSE4_1) || defined(QT_HAVE_SSE4_2)) && (defined(__SSE4_1__) || defined(Q_CC_MSVC))
#include <smmintrin.h>
+#include <nmmintrin.h>
#endif
// AVX intrinsics
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 2fd9a0b..d940bf8 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -173,7 +173,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b)
return 1;
}
-// Unicode case-insensitive comparison
+// Unicode case-sensitive comparison
static int ucstrcmp(const QChar *a, int alen, const QChar *b, int blen)
{
if (a == b && alen == blen)
@@ -202,22 +202,55 @@ static int ucstrnicmp(const ushort *a, const ushort *b, int l)
return ucstricmp(a, a + l, b, b + l);
}
+// Benchmarking indicates that doing memcmp is much slower than
+// executing the comparison ourselves.
+//
+// The profiling was done on a population of calls to qMemEquals, generated
+// during a run of the demo browser. The profile of the data (32-bit x86
+// Linux) was:
+//
+// total number of comparisons: 21353
+// longest string compared: 95
+// average comparison length: 14.8786
+// cache-line crosses: 5661 (13.3%)
+// alignment histogram:
+// 0xXXX0 = 512 (1.2%) strings, 0 (0.0%) of which same-aligned
+// 0xXXX2 = 15087 (35.3%) strings, 5145 (34.1%) of which same-aligned
+// 0xXXX4 = 525 (1.2%) strings, 0 (0.0%) of which same-aligned
+// 0xXXX6 = 557 (1.3%) strings, 6 (1.1%) of which same-aligned
+// 0xXXX8 = 509 (1.2%) strings, 0 (0.0%) of which same-aligned
+// 0xXXXa = 24358 (57.0%) strings, 9901 (40.6%) of which same-aligned
+// 0xXXXc = 557 (1.3%) strings, 0 (0.0%) of which same-aligned
+// 0xXXXe = 601 (1.4%) strings, 15 (2.5%) of which same-aligned
+// total = 42706 (100%) strings, 15067 (35.3%) of which same-aligned
+//
+// 92% of the strings have alignment of 2 or 10, which is due to malloc on
+// 32-bit Linux returning values aligned to 8 bytes, and offsetof(array, QString::Data) == 18.
+//
+// The profile on 64-bit will be different since offsetof(array, QString::Data) == 26.
+//
+// The benchmark results were, for a Core-i7 @ 2.67 GHz 32-bit, compiled with -O3 -funroll-loops:
+// 16-bit loads only: 872,301 CPU ticks [Qt 4.5 / memcmp]
+// 32- and 16-bit loads: 773,362 CPU ticks [Qt 4.6]
+// SSE2 "movdqu" 128-bit loads: 618,736 CPU ticks
+// SSE3 "lddqu" 128-bit loads: 619,954 CPU ticks
+// SSSE3 "palignr" corrections: 852,147 CPU ticks
+// SSE4.2 "pcmpestrm": 738,702 CPU ticks
+//
+// The same benchmark on an Atom N450 @ 1.66 GHz, is:
+// 16-bit loads only: 2,185,882 CPU ticks
+// 32- and 16-bit loads: 1,805,060 CPU ticks
+// SSE2 "movdqu" 128-bit loads: 2,529,843 CPU ticks
+// SSE3 "lddqu" 128-bit loads: 2,514,858 CPU ticks
+// SSSE3 "palignr" corrections: 2,160,325 CPU ticks
+// SSE4.2 not available
+//
+// The conclusion we reach is that alignment the SSE2 unaligned code can gain
+// 20% improvement in performance in some systems, but suffers a penalty due
+// to the unaligned loads on others.
+
static bool qMemEquals(const quint16 *a, const quint16 *b, int length)
{
- // Benchmarking indicates that doing memcmp is much slower than
- // executing the comparison ourselves.
- // To make it even faster, we do a 32-bit comparison, comparing
- // twice the amount of data as a normal word-by-word comparison.
- //
- // Benchmarking results on a 2.33 GHz Core2 Duo, with a 64-QChar
- // block of data, with 4194304 iterations (per iteration):
- // operation usec cpu ticks
- // memcmp 330 710
- // 16-bit 79 167-171
- // 32-bit aligned 49 105-109
- //
- // Testing also indicates that unaligned 32-bit loads are as
- // performant as 32-bit aligned.
if (a == b || !length)
return true;
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index e52f59f..06e4d47 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -614,6 +614,7 @@ private:
ushort asciiCache : 1;
ushort capacity : 1;
ushort reserved : 11;
+ // ### Qt5: try to ensure that "array" is aligned to 16 bytes on both 32- and 64-bit
ushort array[1];
};
static Data shared_null;
diff --git a/src/declarative/graphicsitems/qdeclarativeanchors.cpp b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
index 7ac2b17..26fb97f 100644
--- a/src/declarative/graphicsitems/qdeclarativeanchors.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanchors.cpp
@@ -148,15 +148,6 @@ static qreal adjustedPosition(QGraphicsObject *item, QDeclarativeAnchorLine::Anc
return ret;
}
-/*!
- \internal
- \class QDeclarativeAnchors
- \since 4.7
- \brief The QDeclarativeAnchors class provides a way to lay out items relative to other items.
-
- \warning Currently, only anchoring to siblings or parent is supported.
-*/
-
QDeclarativeAnchors::QDeclarativeAnchors(QObject *parent)
: QObject(*new QDeclarativeAnchorsPrivate(0), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
index e0a2149..a95e944 100644
--- a/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeanimatedimage.cpp
@@ -54,11 +54,6 @@
QT_BEGIN_NAMESPACE
/*!
- \class QDeclarativeAnimatedImage
- \internal
-*/
-
-/*!
\qmlclass AnimatedImage QDeclarativeAnimatedImage
\inherits Image
\since 4.7
diff --git a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
index e0c7fc2..f16770b 100644
--- a/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeborderimage.cpp
@@ -79,12 +79,6 @@ QT_BEGIN_NAMESPACE
rectangular item.
*/
-/*!
- \class QDeclarativeBorderImage BorderImage
- \internal
- \brief The QDeclarativeBorderImage class provides an image item that you can add to a QDeclarativeView.
-*/
-
QDeclarativeBorderImage::QDeclarativeBorderImage(QDeclarativeItem *parent)
: QDeclarativeImageBase(*(new QDeclarativeBorderImagePrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeevents.cpp b/src/declarative/graphicsitems/qdeclarativeevents.cpp
index 0a35a3f..dbfb3fb 100644
--- a/src/declarative/graphicsitems/qdeclarativeevents.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeevents.cpp
@@ -60,11 +60,6 @@ Item {
*/
/*!
- \internal
- \class QDeclarativeKeyEvent
-*/
-
-/*!
\qmlproperty int KeyEvent::key
This property holds the code of the key that was pressed or released.
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index a6e8c85..a710190 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -653,6 +653,8 @@ void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEven
timeline.clear();
hData.velocity = 0;
vData.velocity = 0;
+ hData.dragStartOffset = 0;
+ vData.dragStartOffset = 0;
lastPos = QPoint();
QDeclarativeItemPrivate::start(lastPosTime);
pressPos = event->pos();
@@ -675,7 +677,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (q->yflick()) {
int dy = int(event->pos().y() - pressPos.y());
if (qAbs(dy) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
- qreal newY = dy + vData.pressPos;
+ if (!vMoved)
+ vData.dragStartOffset = dy;
+ qreal newY = dy + vData.pressPos - vData.dragStartOffset;
const qreal minY = q->minYExtent();
const qreal maxY = q->maxYExtent();
if (newY > minY)
@@ -705,7 +709,9 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (q->xflick()) {
int dx = int(event->pos().x() - pressPos.x());
if (qAbs(dx) > QApplication::startDragDistance() || QDeclarativeItemPrivate::elapsed(pressTime) > 200) {
- qreal newX = dx + hData.pressPos;
+ if (!hMoved)
+ hData.dragStartOffset = dx;
+ qreal newX = dx + hData.pressPos - hData.dragStartOffset;
const qreal minX = q->minXExtent();
const qreal maxX = q->maxXExtent();
if (newX > minX)
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index b919e1b..c398faa 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -96,6 +96,7 @@ public:
QDeclarativeTimeLineValueProxy<QDeclarativeFlickablePrivate> move;
qreal viewSize;
qreal pressPos;
+ qreal dragStartOffset;
qreal velocity;
qreal flickTarget;
QDeclarativeFlickablePrivate::Velocity smoothVelocity;
diff --git a/src/declarative/graphicsitems/qdeclarativeflipable.cpp b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
index 6ce0fa6..69dd66a 100644
--- a/src/declarative/graphicsitems/qdeclarativeflipable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflipable.cpp
@@ -99,15 +99,6 @@ public:
\sa {declarative/ui-components/flipable}{Flipable example}
*/
-/*!
- \internal
- \class QDeclarativeFlipable
- \brief The Flipable item provides a surface that can be flipped.
-
- Flipable is an item that can be visibly "flipped" between its front and
- back sides.
-*/
-
QDeclarativeFlipable::QDeclarativeFlipable(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeFlipablePrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
index 5c7959a..f345a14 100644
--- a/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocuspanel.cpp
@@ -61,11 +61,6 @@ QT_BEGIN_NAMESPACE
\l {qmlfocus}{keyboard focus documentation}.
*/
-/*!
- \internal
- \class QDeclarativeFocusPanel
-*/
-
QDeclarativeFocusPanel::QDeclarativeFocusPanel(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
index 4498275..da97a46 100644
--- a/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
+++ b/src/declarative/graphicsitems/qdeclarativefocusscope.cpp
@@ -60,11 +60,6 @@ QT_BEGIN_NAMESPACE
\sa {declarative/keyinteraction/focus}{Keyboard focus example}
*/
-/*!
- \internal
- \class QDeclarativeFocusScope
-*/
-
QDeclarativeFocusScope::QDeclarativeFocusScope(QDeclarativeItem *parent) :
QDeclarativeItem(parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp
index ee45406..d45fe83 100644
--- a/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegraphicswidget.cpp
@@ -68,7 +68,6 @@ QDeclarativeGraphicsWidget::~QDeclarativeGraphicsWidget()
delete d->_anchors; d->_anchors = 0;
}
-/*! \internal */
QDeclarativeAnchors *QDeclarativeGraphicsWidget::anchors()
{
Q_D(QDeclarativeGraphicsWidget);
@@ -85,54 +84,36 @@ QDeclarativeItemPrivate::AnchorLines *QDeclarativeGraphicsWidgetPrivate::anchorL
return _anchorLines;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::left() const
{
Q_D(const QDeclarativeGraphicsWidget);
return d->anchorLines()->left;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::right() const
{
Q_D(const QDeclarativeGraphicsWidget);
return d->anchorLines()->right;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::horizontalCenter() const
{
Q_D(const QDeclarativeGraphicsWidget);
return d->anchorLines()->hCenter;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::top() const
{
Q_D(const QDeclarativeGraphicsWidget);
return d->anchorLines()->top;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::bottom() const
{
Q_D(const QDeclarativeGraphicsWidget);
return d->anchorLines()->bottom;
}
-/*!
- \internal
-*/
QDeclarativeAnchorLine QDeclarativeGraphicsWidget::verticalCenter() const
{
Q_D(const QDeclarativeGraphicsWidget);
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index d67e69a..a0faf14 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -64,7 +64,7 @@ public:
FxGridItem(QDeclarativeItem *i, QDeclarativeGridView *v) : item(i), view(v) {
attached = static_cast<QDeclarativeGridViewAttached*>(qmlAttachedPropertiesObject<QDeclarativeGridView>(item));
if (attached)
- attached->m_view = view;
+ attached->setView(view);
}
~FxGridItem() {}
@@ -2212,7 +2212,7 @@ void QDeclarativeGridView::trackedPositionChanged()
if (trackedPos < d->startPosition() + d->highlightRangeStart) {
pos = d->startPosition();
} else if (d->trackedItem->endRowPos() > d->endPosition() - d->size() + d->highlightRangeEnd) {
- pos = d->endPosition() - d->size();
+ pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
@@ -2226,14 +2226,14 @@ void QDeclarativeGridView::trackedPositionChanged()
} else {
if (trackedPos < viewPos && d->currentItem->rowPos() < viewPos) {
pos = d->currentItem->rowPos() < trackedPos ? trackedPos : d->currentItem->rowPos();
- } else if (d->trackedItem->endRowPos() > viewPos + d->size()
- && d->currentItem->endRowPos() > viewPos + d->size()) {
- if (d->trackedItem->endRowPos() < d->currentItem->endRowPos()) {
- pos = d->trackedItem->endRowPos() - d->size();
+ } else if (d->trackedItem->endRowPos() >= viewPos + d->size()
+ && d->currentItem->endRowPos() >= viewPos + d->size()) {
+ if (d->trackedItem->endRowPos() <= d->currentItem->endRowPos()) {
+ pos = d->trackedItem->endRowPos() - d->size() + 1;
if (d->rowSize() > d->size())
pos = trackedPos;
} else {
- pos = d->currentItem->endRowPos() - d->size();
+ pos = d->currentItem->endRowPos() - d->size() + 1;
if (d->rowSize() > d->size())
pos = d->currentItem->rowPos();
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h
index d6bbaf3..ee632b1 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativegridview_p.h
@@ -43,6 +43,7 @@
#define QDECLARATIVEGRIDVIEW_H
#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeguard_p.h"
QT_BEGIN_HEADER
@@ -220,8 +221,14 @@ public:
: QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
~QDeclarativeGridViewAttached() {}
- Q_PROPERTY(QDeclarativeGridView *view READ view CONSTANT)
+ Q_PROPERTY(QDeclarativeGridView *view READ view NOTIFY viewChanged)
QDeclarativeGridView *view() { return m_view; }
+ void setView(QDeclarativeGridView *view) {
+ if (view != m_view) {
+ m_view = view;
+ emit viewChanged();
+ }
+ }
Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
bool isCurrentItem() const { return m_isCurrent; }
@@ -249,9 +256,10 @@ Q_SIGNALS:
void delayRemoveChanged();
void add();
void remove();
+ void viewChanged();
public:
- QDeclarativeGridView *m_view;
+ QDeclarativeGuard<QDeclarativeGridView> m_view;
bool m_isCurrent : 1;
bool m_delayRemove : 1;
};
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp
index 1cc5f81..7a88e78 100644
--- a/src/declarative/graphicsitems/qdeclarativeimage.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp
@@ -91,19 +91,6 @@ QT_BEGIN_NAMESPACE
\sa {declarative/imageelements/image}{Image example}, QDeclarativeImageProvider
*/
-/*!
- \internal
- \class QDeclarativeImage Image
- \brief The QDeclarativeImage class provides an image item that you can add to a QDeclarativeView.
-
- Example:
- \qml
- Image { source: "pics/star.png" }
- \endqml
-
- A QDeclarativeImage object can be instantiated in QML using the tag \l Image.
-*/
-
QDeclarativeImage::QDeclarativeImage(QDeclarativeItem *parent)
: QDeclarativeImageBase(*(new QDeclarativeImagePrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
index d6b935b..416604b 100644
--- a/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeimagebase.cpp
@@ -50,13 +50,6 @@
QT_BEGIN_NAMESPACE
-
-/*!
- \class QDeclarativeImageBase
- \internal
- \brief The base class for declarative images.
- */
-
QDeclarativeImageBase::QDeclarativeImageBase(QDeclarativeImageBasePrivate &dd, QDeclarativeItem *parent)
: QDeclarativeItem(dd, parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index 0f16a79..1054898 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -229,12 +229,6 @@ QT_BEGIN_NAMESPACE
The angle to rotate, in degrees clockwise.
*/
-/*!
- \internal
- \class QDeclarativeContents
- \brief The QDeclarativeContents class gives access to the height and width of an item's contents.
-
-*/
QDeclarativeContents::QDeclarativeContents(QDeclarativeItem *item) : m_item(item), m_x(0), m_y(0), m_width(0), m_height(0)
{
//### optimize
@@ -1728,7 +1722,6 @@ void QDeclarativeItemPrivate::parentProperty(QObject *o, void *rv, QDeclarativeN
specify it.
*/
-/*! \internal */
QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::data()
{
return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::data_append);
@@ -2416,7 +2409,6 @@ void QDeclarativeItemPrivate::focusChanged(bool flag)
emit q->focusChanged(flag);
}
-/*! \internal */
QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::resources()
{
return QDeclarativeListProperty<QObject>(q_func(), 0, QDeclarativeItemPrivate::resources_append,
@@ -2441,7 +2433,6 @@ QDeclarativeListProperty<QObject> QDeclarativeItemPrivate::resources()
\sa {qmlstate}{States}
*/
-/*! \internal */
QDeclarativeListProperty<QDeclarativeState> QDeclarativeItemPrivate::states()
{
return _states()->statesProperty();
@@ -2465,7 +2456,6 @@ QDeclarativeListProperty<QDeclarativeState> QDeclarativeItemPrivate::states()
*/
-/*! \internal */
QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transitions()
{
return _states()->transitionsProperty();
@@ -2538,7 +2528,6 @@ QDeclarativeListProperty<QDeclarativeTransition> QDeclarativeItemPrivate::transi
\sa {qmlstates}{States}
*/
-/*! \internal */
QString QDeclarativeItemPrivate::state() const
{
if (!_stateGroup)
@@ -2547,7 +2536,6 @@ QString QDeclarativeItemPrivate::state() const
return _stateGroup->state();
}
-/*! \internal */
void QDeclarativeItemPrivate::setState(const QString &state)
{
_states()->setState(state);
diff --git a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
index 8509473..d71b2c5 100644
--- a/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelayoutitem.cpp
@@ -66,13 +66,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \internal
- \class QDeclarativeLayoutItem
- \brief The QDeclarativeLayoutItem class allows you to place your QML UI elements inside Qt's Graphics View layouts.
-*/
-
-
-/*!
\qmlproperty QSizeF LayoutItem::maximumSize
The maximumSize property can be set to specify the maximum desired size of this LayoutItem
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp
index 2e2e08c..d3d46f7 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp
@@ -96,7 +96,7 @@ public:
FxListItem(QDeclarativeItem *i, QDeclarativeListView *v) : item(i), section(0), view(v) {
attached = static_cast<QDeclarativeListViewAttached*>(qmlAttachedPropertiesObject<QDeclarativeListView>(item));
if (attached)
- attached->m_view = view;
+ attached->setView(view);
}
~FxListItem() {}
qreal position() const {
@@ -2652,7 +2652,7 @@ void QDeclarativeListView::trackedPositionChanged()
if (trackedPos < d->startPosition() + d->highlightRangeStart) {
pos = d->startPosition();
} else if (d->trackedItem->endPosition() > d->endPosition() - d->size() + d->highlightRangeEnd) {
- pos = d->endPosition() - d->size();
+ pos = d->endPosition() - d->size() + 1;
if (pos < d->startPosition())
pos = d->startPosition();
} else {
@@ -2666,14 +2666,14 @@ void QDeclarativeListView::trackedPositionChanged()
} else {
if (trackedPos < viewPos && d->currentItem->position() < viewPos) {
pos = d->currentItem->position() < trackedPos ? trackedPos : d->currentItem->position();
- } else if (d->trackedItem->endPosition() > viewPos + d->size()
- && d->currentItem->endPosition() > viewPos + d->size()) {
- if (d->trackedItem->endPosition() < d->currentItem->endPosition()) {
- pos = d->trackedItem->endPosition() - d->size();
- if (d->trackedItem->size() > d->size())
+ } else if (d->trackedItem->endPosition() >= viewPos + d->size()
+ && d->currentItem->endPosition() >= viewPos + d->size()) {
+ if (d->trackedItem->endPosition() <= d->currentItem->endPosition()) {
+ pos = d->trackedItem->endPosition() - d->size() + 1;
+ if (d->trackedItem->size() > d->size())
pos = trackedPos;
} else {
- pos = d->currentItem->endPosition() - d->size();
+ pos = d->currentItem->endPosition() - d->size() + 1;
if (d->currentItem->size() > d->size())
pos = d->currentItem->position();
}
diff --git a/src/declarative/graphicsitems/qdeclarativelistview_p.h b/src/declarative/graphicsitems/qdeclarativelistview_p.h
index b264861..8fbff49 100644
--- a/src/declarative/graphicsitems/qdeclarativelistview_p.h
+++ b/src/declarative/graphicsitems/qdeclarativelistview_p.h
@@ -43,6 +43,7 @@
#define QDECLARATIVELISTVIEW_H
#include "private/qdeclarativeflickable_p.h"
+#include "private/qdeclarativeguard_p.h"
QT_BEGIN_HEADER
@@ -268,8 +269,14 @@ public:
: QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
~QDeclarativeListViewAttached() {}
- Q_PROPERTY(QDeclarativeListView *view READ view CONSTANT)
+ Q_PROPERTY(QDeclarativeListView *view READ view NOTIFY viewChanged)
QDeclarativeListView *view() { return m_view; }
+ void setView(QDeclarativeListView *view) {
+ if (view != m_view) {
+ m_view = view;
+ emit viewChanged();
+ }
+ }
Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
bool isCurrentItem() const { return m_isCurrent; }
@@ -327,9 +334,10 @@ Q_SIGNALS:
void delayRemoveChanged();
void add();
void remove();
+ void viewChanged();
public:
- QDeclarativeListView *m_view;
+ QDeclarativeGuard<QDeclarativeListView> m_view;
mutable QString m_section;
QString m_prevSection;
QString m_nextSection;
diff --git a/src/declarative/graphicsitems/qdeclarativeloader.cpp b/src/declarative/graphicsitems/qdeclarativeloader.cpp
index 2fde4c8..5d71625 100644
--- a/src/declarative/graphicsitems/qdeclarativeloader.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeloader.cpp
@@ -189,14 +189,6 @@ void QDeclarativeLoaderPrivate::initResize()
\sa {dynamic-object-creation}{Dynamic Object Creation}
*/
-/*!
- \internal
- \class QDeclarativeLoader
- */
-
-/*!
- Create a new QDeclarativeLoader instance.
- */
QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeLoaderPrivate), parent)
{
@@ -204,9 +196,6 @@ QDeclarativeLoader::QDeclarativeLoader(QDeclarativeItem *parent)
d->flags |= QGraphicsItem::ItemIsFocusScope;
}
-/*!
- Destroy the loader instance.
- */
QDeclarativeLoader::~QDeclarativeLoader()
{
Q_D(QDeclarativeLoader);
diff --git a/src/declarative/graphicsitems/qdeclarativemousearea.cpp b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
index 2823888..ec01549 100644
--- a/src/declarative/graphicsitems/qdeclarativemousearea.cpp
+++ b/src/declarative/graphicsitems/qdeclarativemousearea.cpp
@@ -317,16 +317,6 @@ QDeclarativeMouseAreaPrivate::~QDeclarativeMouseAreaPrivate()
\l Flickable, \c onCanceled should be used in addition to onReleased.
*/
-/*!
- \internal
- \class QDeclarativeMouseArea
- \brief The QDeclarativeMouseArea class provides a simple mouse handling abstraction for use within QML.
-
- All QDeclarativeItem derived classes can do mouse handling but the QDeclarativeMouseArea class exposes mouse
- handling data as properties and tracks flicking and dragging of the mouse.
-
- A QDeclarativeMouseArea object can be instantiated in QML using the tag \l MouseArea.
- */
QDeclarativeMouseArea::QDeclarativeMouseArea(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeMouseAreaPrivate), parent)
{
@@ -690,7 +680,6 @@ void QDeclarativeMouseArea::geometryChanged(const QRectF &newGeometry,
d->lastPos = mapFromScene(d->lastScenePos);
}
-/*! \internal */
QVariant QDeclarativeMouseArea::itemChange(GraphicsItemChange change,
const QVariant &value)
{
diff --git a/src/declarative/graphicsitems/qdeclarativepath.cpp b/src/declarative/graphicsitems/qdeclarativepath.cpp
index 0c069ce..f93357d 100644
--- a/src/declarative/graphicsitems/qdeclarativepath.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepath.cpp
@@ -62,11 +62,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \internal
- \class QDeclarativePathElement
-*/
-
-/*!
\qmlclass Path QDeclarativePath
\ingroup qml-view-elements
\since 4.7
@@ -83,13 +78,6 @@ QT_BEGIN_NAMESPACE
\sa PathView, PathAttribute, PathPercent, PathLine, PathQuad, PathCubic
*/
-
-/*!
- \internal
- \class QDeclarativePath
- \brief The QDeclarativePath class defines a path.
- \sa QDeclarativePathView
-*/
QDeclarativePath::QDeclarativePath(QObject *parent)
: QObject(*(new QDeclarativePathPrivate), parent)
{
@@ -527,15 +515,6 @@ void QDeclarativeCurve::setY(qreal y)
*/
/*!
- \internal
- \class QDeclarativePathAttribute
- \brief The QDeclarativePathAttribute class allows to set the value of an attribute at a given position in the path.
-
- \sa QDeclarativePath
-*/
-
-
-/*!
\qmlproperty string PathAttribute::name
the name of the attribute to change.
@@ -608,14 +587,6 @@ void QDeclarativePathAttribute::setValue(qreal value)
*/
/*!
- \internal
- \class QDeclarativePathLine
- \brief The QDeclarativePathLine class defines a straight line.
-
- \sa QDeclarativePath
-*/
-
-/*!
\qmlproperty real PathLine::x
\qmlproperty real PathLine::y
@@ -652,15 +623,6 @@ void QDeclarativePathLine::addToPath(QPainterPath &path)
*/
/*!
- \internal
- \class QDeclarativePathQuad
- \brief The QDeclarativePathQuad class defines a quadratic Bezier curve with a control point.
-
- \sa QDeclarativePath
-*/
-
-
-/*!
\qmlproperty real PathQuad::x
\qmlproperty real PathQuad::y
@@ -743,14 +705,6 @@ void QDeclarativePathQuad::addToPath(QPainterPath &path)
*/
/*!
- \internal
- \class QDeclarativePathCubic
- \brief The QDeclarativePathCubic class defines a cubic Bezier curve with two control points.
-
- \sa QDeclarativePath
-*/
-
-/*!
\qmlproperty real PathCubic::x
\qmlproperty real PathCubic::y
@@ -872,18 +826,6 @@ void QDeclarativePathCubic::addToPath(QPainterPath &path)
\sa Path
*/
-/*!
- \internal
- \class QDeclarativePathPercent
- \brief The QDeclarativePathPercent class manipulates the way a path is interpreted.
-
- QDeclarativePathPercent allows you to bunch up items (or spread out items) along various
- segments of a QDeclarativePathView's path.
-
- \sa QDeclarativePath
-
-*/
-
qreal QDeclarativePathPercent::value() const
{
return _value;
diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
index 4ceb5d9..b776b8e 100644
--- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp
@@ -108,8 +108,7 @@ void QDeclarativeBasePositioner::graphicsWidgetGeometryChanged()
You also need to set a PositionerType, to declare whether you are positioning the x, y or both
for the child items. Depending on the chosen type, only x or y changes will be applied.
- Note that the subclass is responsible for adding the
- spacing in between items.
+ Note that the subclass is responsible for adding the spacing in between items.
*/
QDeclarativeBasePositioner::QDeclarativeBasePositioner(PositionerType at, QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeBasePositionerPrivate), parent)
@@ -439,11 +438,6 @@ Column {
\image spacing_b.png
*/
-/*!
- \internal
- \class QDeclarativeColumn
- \brief The QDeclarativeColumn class lines up items vertically.
-*/
QDeclarativeColumn::QDeclarativeColumn(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Vertical, parent)
{
@@ -579,11 +573,6 @@ Row {
\image spacing_b.png
*/
-/*!
- \internal
- \class QDeclarativeRow
- \brief The QDeclarativeRow class lines up items horizontally.
-*/
QDeclarativeRow::QDeclarativeRow(QDeclarativeItem *parent)
: QDeclarativeBasePositioner(Horizontal, parent)
{
@@ -736,11 +725,6 @@ Grid {
\image spacing_b.png
*/
-/*!
- \internal
- \class QDeclarativeGrid
- \brief The QDeclarativeGrid class lays out items in a grid.
-*/
QDeclarativeGrid::QDeclarativeGrid(QDeclarativeItem *parent) :
QDeclarativeBasePositioner(Both, parent), m_rows(-1), m_columns(-1), m_flow(LeftToRight)
{
diff --git a/src/declarative/graphicsitems/qdeclarativerectangle.cpp b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
index 5990c2d..d027924 100644
--- a/src/declarative/graphicsitems/qdeclarativerectangle.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerectangle.cpp
@@ -180,11 +180,6 @@ void QDeclarativeGradient::doUpdate()
int QDeclarativeRectanglePrivate::doUpdateSlotIdx = -1;
-/*!
- \internal
- \class QDeclarativeRectangle
- \brief The QDeclarativeRectangle class provides a rectangle item that you can add to a QDeclarativeView.
-*/
QDeclarativeRectangle::QDeclarativeRectangle(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeRectanglePrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativerepeater.cpp b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
index 4a951a2..97cf05c 100644
--- a/src/declarative/graphicsitems/qdeclarativerepeater.cpp
+++ b/src/declarative/graphicsitems/qdeclarativerepeater.cpp
@@ -146,23 +146,11 @@ QDeclarativeRepeaterPrivate::~QDeclarativeRepeaterPrivate()
\endcode
*/
-/*!
- \internal
- \class QDeclarativeRepeater
- */
-
-/*!
- Create a new QDeclarativeRepeater instance.
- */
QDeclarativeRepeater::QDeclarativeRepeater(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeRepeaterPrivate), parent)
{
}
-/*!
- Destroy the repeater instance. All items it instantiated are also
- destroyed.
- */
QDeclarativeRepeater::~QDeclarativeRepeater()
{
}
@@ -301,18 +289,12 @@ int QDeclarativeRepeater::count() const
}
-/*!
- \internal
- */
void QDeclarativeRepeater::componentComplete()
{
QDeclarativeItem::componentComplete();
regenerate();
}
-/*!
- \internal
- */
QVariant QDeclarativeRepeater::itemChange(GraphicsItemChange change,
const QVariant &value)
{
@@ -335,9 +317,6 @@ void QDeclarativeRepeater::clear()
d->deletables.clear();
}
-/*!
- \internal
- */
void QDeclarativeRepeater::regenerate()
{
Q_D(QDeclarativeRepeater);
diff --git a/src/declarative/graphicsitems/qdeclarativetext.cpp b/src/declarative/graphicsitems/qdeclarativetext.cpp
index e5ad743..f16af88 100644
--- a/src/declarative/graphicsitems/qdeclarativetext.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetext.cpp
@@ -190,32 +190,6 @@ QSet<QUrl> QTextDocumentWithImageResources::errors;
\sa {declarative/text/fonts}{Fonts example}
*/
-
-/*!
- \internal
- \class QDeclarativeText
- \qmlclass Text
-
- \brief The QDeclarativeText class provides a formatted text item that you can add to a QDeclarativeView.
-
- Text was designed for read-only text; it does not allow for any text editing.
- It can display both plain and rich text. For example:
-
- \qml
- Text { text: "Hello World!"; font.family: "Helvetica"; font.pointSize: 24; color: "red" }
- Text { text: "<b>Hello</b> <i>World!</i>" }
- \endqml
-
- \image text.png
-
- If height and width are not explicitly set, Text will attempt to determine how
- much room is needed and set it accordingly. Unless \c wrapMode is set, it will always
- prefer width to height (all text will be placed on a single line).
-
- The \c elide property can alternatively be used to fit a line of plain text to a set width.
-
- A QDeclarativeText object can be instantiated in QML using the tag \c Text.
-*/
QDeclarativeText::QDeclarativeText(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeTextPrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativetextedit.cpp b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
index b8e8726..b1c0fcd 100644
--- a/src/declarative/graphicsitems/qdeclarativetextedit.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextedit.cpp
@@ -103,23 +103,6 @@ TextEdit {
\sa Text, TextInput, {declarative/text/textselection}{Text Selection example}
*/
-/*!
- \internal
- \class QDeclarativeTextEdit
- \qmlclass TextEdit
-
- \brief The QDeclarativeTextEdit class provides an editable formatted text item that you can add to a QDeclarativeView.
-
- It can display both plain and rich text.
-
- \image declarative-textedit.png
-
- A QDeclarativeTextEdit object can be instantiated in QML using the tag \c &lt;TextEdit&gt;.
-*/
-
-/*!
- Constructs a new QDeclarativeTextEdit.
-*/
QDeclarativeTextEdit::QDeclarativeTextEdit(QDeclarativeItem *parent)
: QDeclarativePaintedItem(*(new QDeclarativeTextEditPrivate), parent)
{
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index b4f36f4..5604b82 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -437,8 +437,6 @@ void QDeclarativeTextInput::setCursorPosition(int cp)
}
/*!
- \internal
-
Returns a Rect which encompasses the cursor, but which may be larger than is
required. Ignores custom cursor delegates.
*/
diff --git a/src/declarative/graphicsitems/qdeclarativetranslate.cpp b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
index 0bae0cd..2e0af2a 100644
--- a/src/declarative/graphicsitems/qdeclarativetranslate.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetranslate.cpp
@@ -116,9 +116,6 @@ void QDeclarativeTranslate::setY(qreal y)
emit yChanged();
}
-/*!
- \internal
-*/
void QDeclarativeTranslate::applyTo(QMatrix4x4 *matrix) const
{
Q_D(const QDeclarativeTranslate);
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 65b14cf..b4e8bda 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -714,6 +714,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)),
this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)));
QObject::disconnect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
+ QObject::disconnect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));
d->m_abstractItemModel = 0;
} else if (d->m_visualItemModel) {
QObject::disconnect(d->m_visualItemModel, SIGNAL(itemsInserted(int,int)),
@@ -761,6 +762,7 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
QObject::connect(d->m_abstractItemModel, SIGNAL(rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)),
this, SLOT(_q_rowsMoved(const QModelIndex&,int,int,const QModelIndex&,int)));
QObject::connect(d->m_abstractItemModel, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
+ QObject::connect(d->m_abstractItemModel, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));
d->m_metaDataCacheable = true;
return;
}
@@ -1332,6 +1334,12 @@ void QDeclarativeVisualDataModel::_q_dataChanged(const QModelIndex &begin, const
_q_itemsChanged(begin.row(), end.row() - begin.row() + 1, d->m_roles);
}
+void QDeclarativeVisualDataModel::_q_layoutChanged()
+{
+ Q_D(QDeclarativeVisualDataModel);
+ _q_itemsChanged(0, count(), d->m_roles);
+}
+
void QDeclarativeVisualDataModel::_q_modelReset()
{
emit modelReset();
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
index 50d2c53..e159786 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel_p.h
@@ -194,6 +194,7 @@ private Q_SLOTS:
void _q_rowsRemoved(const QModelIndex &,int,int);
void _q_rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int);
void _q_dataChanged(const QModelIndex&,const QModelIndex&);
+ void _q_layoutChanged();
void _q_modelReset();
void _q_createdPackage(int index, QDeclarativePackage *package);
void _q_destroyingPackage(QDeclarativePackage *package);
diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp
index 723da94..9402596 100644
--- a/src/declarative/qml/qdeclarativecompiledbindings.cpp
+++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp
@@ -1874,7 +1874,7 @@ bool QDeclarativeBindingCompilerPrivate::parseName(AST::Node *node, Result &type
return false;
QDeclarativeImportedNamespace *ns = 0;
- if (!engine->importDatabase.resolveType(imports, name.toUtf8(), &attachType, 0, 0, 0, &ns))
+ if (!imports.resolveType(name.toUtf8(), &attachType, 0, 0, 0, &ns))
return false;
if (ns || !attachType || !attachType->attachedPropertiesType())
return false;
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 2b4a4a5..f044e1a 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -668,13 +668,14 @@ void QDeclarativeCompiler::compileTree(Object *tree)
QString scriptCode = QString::fromUtf8(unit->scripts.at(ii).resource->data);
Object::ScriptBlock::Pragmas pragmas = QDeclarativeScriptParser::extractPragmas(scriptCode);
+ Q_ASSERT(!importedScripts.contains(unit->scripts.at(ii).qualifier));
+
if (!scriptCode.isEmpty()) {
Object::ScriptBlock &scriptBlock = importedScripts[unit->scripts.at(ii).qualifier];
- scriptBlock.codes.append(scriptCode);
- scriptBlock.lineNumbers.append(1);
- scriptBlock.files.append(unit->scripts.at(ii).resource->url);
- scriptBlock.pragmas.append(pragmas);
+ scriptBlock.code = scriptCode;
+ scriptBlock.file = unit->scripts.at(ii).resource->url;
+ scriptBlock.pragmas = pragmas;
}
}
@@ -703,7 +704,7 @@ void QDeclarativeCompiler::compileTree(Object *tree)
for (int ii = 0; ii < importedScriptIndexes.count(); ++ii)
output->importCache->add(importedScriptIndexes.at(ii), ii);
- unit->imports.cache(output->importCache, engine);
+ unit->imports.populateCache(output->importCache, engine);
Q_ASSERT(tree->metatype);
@@ -1403,8 +1404,7 @@ bool QDeclarativeCompiler::buildProperty(QDeclarativeParser::Property *prop,
QDeclarativeType *type = 0;
QDeclarativeImportedNamespace *typeNamespace = 0;
- enginePrivate->importDatabase.resolveType(unit->imports, prop->name,
- &type, 0, 0, 0, &typeNamespace);
+ unit->imports.resolveType(prop->name, &type, 0, 0, 0, &typeNamespace);
if (typeNamespace) {
// ### We might need to indicate that this property is a namespace
@@ -1512,7 +1512,7 @@ bool QDeclarativeCompiler::buildPropertyInNamespace(QDeclarativeImportedNamespac
// Setup attached property data
QDeclarativeType *type = 0;
- enginePrivate->importDatabase.resolveTypeInNamespace(ns, prop->name, &type, 0, 0, 0);
+ unit->imports.resolveType(ns, prop->name, &type, 0, 0, 0);
if (!type || !type->attachedPropertiesType())
COMPILE_EXCEPTION(prop, tr("Non-existent attached object"));
@@ -2139,8 +2139,7 @@ bool QDeclarativeCompiler::testQualifiedEnumAssignment(const QMetaProperty &prop
QString typeName = parts.at(0);
QDeclarativeType *type = 0;
- enginePrivate->importDatabase.resolveType(unit->imports, typeName.toUtf8(),
- &type, 0, 0, 0, 0);
+ unit->imports.resolveType(typeName.toUtf8(), &type, 0, 0, 0, 0);
if (!type || obj->typeName != type->qmlTypeName())
return true;
@@ -2167,7 +2166,7 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const
int dot = script.indexOf('.');
if (dot > 0) {
QDeclarativeType *type = 0;
- enginePrivate->importDatabase.resolveType(unit->imports, script.left(dot), &type, 0, 0, 0, 0);
+ unit->imports.resolveType(script.left(dot), &type, 0, 0, 0, 0);
if (!type)
return -1;
const QMetaObject *mo = type->metaObject();
@@ -2185,8 +2184,7 @@ int QDeclarativeCompiler::evaluateEnum(const QByteArray& script) const
const QMetaObject *QDeclarativeCompiler::resolveType(const QByteArray& name) const
{
QDeclarativeType *qmltype = 0;
- if (!enginePrivate->importDatabase.resolveType(unit->imports, name, &qmltype,
- 0, 0, 0, 0))
+ if (!unit->imports.resolveType(name, &qmltype, 0, 0, 0, 0))
return 0;
if (!qmltype)
return 0;
@@ -2344,8 +2342,7 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeParser::Object *obj, Dyn
QByteArray customTypeName;
QDeclarativeType *qmltype = 0;
QUrl url;
- if (!enginePrivate->importDatabase.resolveType(unit->imports, p.customType, &qmltype,
- &url, 0, 0, 0))
+ if (!unit->imports.resolveType(p.customType, &qmltype, &url, 0, 0, 0))
COMPILE_EXCEPTION(&p, tr("Invalid property type"));
if (!qmltype) {
diff --git a/src/declarative/qml/qdeclarativecompositetypemanager.cpp b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
index 2e77534..cc8f887 100644
--- a/src/declarative/qml/qdeclarativecompositetypemanager.cpp
+++ b/src/declarative/qml/qdeclarativecompositetypemanager.cpp
@@ -523,7 +523,7 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
int waiting = 0;
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(engine);
- QDeclarativeImportDatabase &importDatabase = ep->importDatabase;
+ QDeclarativeImportDatabase *importDatabase = &ep->importDatabase;
// For local urls, add an implicit import "." as first (most overridden) lookup.
// This will also trigger the loading of the qmldir and the import of any native
@@ -538,9 +538,10 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
qmldircomponentsnetwork = parser.components();
}
- importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, QLatin1String("."),
- QString(), -1, -1, QDeclarativeScriptParser::Import::File,
- 0); // error ignored (just means no fallback)
+ unit->imports.addImport(importDatabase,
+ QLatin1String("."), QString(), -1, -1, QDeclarativeScriptParser::Import::File,
+ qmldircomponentsnetwork,
+ 0); // error ignored (just means no fallback)
}
@@ -577,8 +578,9 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
}
QString errorString;
- if (!importDatabase.addToImport(&unit->imports, qmldircomponentsnetwork, imp.uri, imp.qualifier,
- vmaj, vmin, imp.type, &errorString)) {
+ if (!unit->imports.addImport(importDatabase,
+ imp.uri, imp.qualifier, vmaj, vmin, imp.type,
+ qmldircomponentsnetwork, &errorString)) {
QDeclarativeError error;
error.setUrl(unit->imports.baseUrl());
error.setDescription(errorString);
@@ -606,8 +608,8 @@ int QDeclarativeCompositeTypeManager::resolveTypes(QDeclarativeCompositeTypeData
int minorVersion;
QDeclarativeImportedNamespace *typeNamespace = 0;
QString errorString;
- if (!importDatabase.resolveType(unit->imports, typeName, &ref.type, &url, &majorVersion, &minorVersion,
- &typeNamespace, &errorString) || typeNamespace) {
+ if (!unit->imports.resolveType(typeName, &ref.type, &url, &majorVersion, &minorVersion,
+ &typeNamespace, &errorString) || typeNamespace) {
// Known to not be a type:
// - known to be a namespace (Namespace {})
// - type with unknown namespace (UnknownNamespace.SomeType {})
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index a3b16d9..de45a95 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -660,14 +660,12 @@ void QDeclarativeContextData::addImportedScript(const QDeclarativeParser::Object
if (!engine)
return;
- Q_ASSERT(script.codes.count() == 1);
-
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
QScriptEngine *scriptEngine = QDeclarativeEnginePrivate::getScriptEngine(engine);
- const QString &code = script.codes.at(0);
- const QString &url = script.files.at(0);
- const QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = script.pragmas.at(0);
+ const QString &code = script.code;
+ const QString &url = script.file;
+ const QDeclarativeParser::Object::ScriptBlock::Pragmas &pragmas = script.pragmas;
Q_ASSERT(!url.isEmpty());
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 5c21ebc..8f95e26 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -109,6 +109,11 @@ public:
QHash<QString,QDeclarativeImportedNamespace* > set;
};
+/*!
+\class QDeclarativeImports
+\brief The QDeclarativeImports class encapsulates one QML document's import statements.
+\internal
+*/
QDeclarativeImports::QDeclarativeImports(const QDeclarativeImports &copy)
: d(copy.d)
{
@@ -181,7 +186,7 @@ cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeImportedNamespac
return cache;
}
-void QDeclarativeImports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const
+void QDeclarativeImports::populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *engine) const
{
const QDeclarativeImportedNamespace &set = d->unqualifiedset;
@@ -201,6 +206,67 @@ void QDeclarativeImports::cache(QDeclarativeTypeNameCache *cache, QDeclarativeEn
cacheForNamespace(engine, set, cache);
}
+
+/*!
+ \internal
+
+ The given (namespace qualified) \a type is resolved to either
+ \list
+ \o a QDeclarativeImportedNamespace stored at \a ns_return,
+ \o a QDeclarativeType stored at \a type_return, or
+ \o a component located at \a url_return.
+ \endlist
+
+ If any return pointer is 0, the corresponding search is not done.
+
+ \sa addImport()
+*/
+bool QDeclarativeImports::resolveType(const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin,
+ QDeclarativeImportedNamespace** ns_return, QString *errorString) const
+{
+ QDeclarativeImportedNamespace* ns = d->findNamespace(QString::fromUtf8(type));
+ if (ns) {
+ if (ns_return)
+ *ns_return = ns;
+ return true;
+ }
+ if (type_return || url_return) {
+ if (d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
+ if (qmlImportTrace()) {
+ if (type_return && *type_return && url_return && !url_return->isEmpty())
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << (*type_return)->typeName() << " " << *url_return;
+ if (type_return && *type_return)
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << (*type_return)->typeName();
+ if (url_return && !url_return->isEmpty())
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::resolveType: "
+ << type << " => " << *url_return;
+ }
+ return true;
+ }
+ }
+ return false;
+}
+
+/*!
+ \internal
+
+ Searching \e only in the namespace \a ns (previously returned in a call to
+ resolveType(), \a type is found and returned to either
+ a QDeclarativeType stored at \a type_return, or
+ a component located at \a url_return.
+
+ If either return pointer is 0, the corresponding search is not done.
+*/
+bool QDeclarativeImports::resolveType(QDeclarativeImportedNamespace* ns, const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *vmaj, int *vmin) const
+{
+ return ns->find(type,vmaj,vmin,type_return,url_return);
+}
+
bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, int *vmajor, int *vminor,
QDeclarativeType** type_return, QUrl* url_return,
QUrl *base, bool *typeRecursionDetected)
@@ -280,15 +346,16 @@ QDeclarativeImportsPrivate::~QDeclarativeImportsPrivate()
}
bool QDeclarativeImportsPrivate::importExtension(const QString &absoluteFilePath, const QString &uri,
- QDeclarativeImportDatabase *database,
- QDeclarativeDirComponents* components, QString *errorString)
+ QDeclarativeImportDatabase *database,
+ QDeclarativeDirComponents* components, QString *errorString)
{
QFile file(absoluteFilePath);
QString filecontent;
if (file.open(QFile::ReadOnly)) {
filecontent = QString::fromUtf8(file.readAll());
if (qmlImportTrace())
- qDebug() << "QDeclarativeImportDatabase::add: loaded" << absoluteFilePath;
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(base.toString()) << "::importExtension: "
+ << "loaded " << absoluteFilePath;
} else {
if (errorString)
*errorString = QDeclarativeImportDatabase::tr("module \"%1\" definition \"%2\" not readable").arg(uri).arg(absoluteFilePath);
@@ -576,6 +643,10 @@ bool QDeclarativeImportedNamespace::find(const QByteArray& type, int *vmajor, in
return false;
}
+/*!
+\class QDeclarativeImportDatabase
+\brief The QDeclarativeImportDatabase class manages the QML imports for a QDeclarativeEngine.
+*/
QDeclarativeImportDatabase::QDeclarativeImportDatabase(QDeclarativeEngine *e)
: engine(e)
{
@@ -619,75 +690,19 @@ QDeclarativeImportDatabase::~QDeclarativeImportDatabase()
The base URL must already have been set with Import::setBaseUrl().
*/
-bool QDeclarativeImportDatabase::addToImport(QDeclarativeImports* imports,
- const QDeclarativeDirComponents &qmldircomponentsnetwork,
- const QString& uri, const QString& prefix, int vmaj, int vmin,
- QDeclarativeScriptParser::Import::Type importType,
- QString *errorString)
+bool QDeclarativeImports::addImport(QDeclarativeImportDatabase *importDb,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ QString *errorString)
{
if (qmlImportTrace())
- qDebug().nospace() << "QDeclarativeImportDatabase::addToImport " << imports << " " << uri << " "
- << vmaj << '.' << vmin << " "
+ qDebug().nospace() << "QDeclarativeImports(" << qPrintable(baseUrl().toString()) << ")" << "::addImport: "
+ << uri << " " << vmaj << '.' << vmin << " "
<< (importType==QDeclarativeScriptParser::Import::Library? "Library" : "File")
<< " as " << prefix;
- bool ok = imports->d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, this, errorString);
- return ok;
-}
-
-/*!
- \internal
-
- Using the given \a imports, the given (namespace qualified) \a type is resolved to either
- a QDeclarativeImportedNamespace stored at \a ns_return,
- a QDeclarativeType stored at \a type_return, or
- a component located at \a url_return.
-
- If any return pointer is 0, the corresponding search is not done.
-
- \sa addToImport()
-*/
-bool QDeclarativeImportDatabase::resolveType(const QDeclarativeImports& imports, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return, int *vmaj, int *vmin,
- QDeclarativeImportedNamespace** ns_return, QString *errorString) const
-{
- QDeclarativeImportedNamespace* ns = imports.d->findNamespace(QString::fromUtf8(type));
- if (ns) {
- if (ns_return)
- *ns_return = ns;
- return true;
- }
- if (type_return || url_return) {
- if (imports.d->find(type,vmaj,vmin,type_return,url_return, errorString)) {
- if (qmlImportTrace()) {
- if (type_return && *type_return && url_return && !url_return->isEmpty())
- qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName() << *url_return;
- if (type_return && *type_return)
- qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << (*type_return)->typeName();
- if (url_return && !url_return->isEmpty())
- qDebug() << "QDeclarativeImportDatabase::resolveType" << type << '=' << *url_return;
- }
- return true;
- }
- }
- return false;
-}
-
-/*!
- \internal
-
- Searching \e only in the namespace \a ns (previously returned in a call to
- resolveType(), \a type is found and returned to either
- a QDeclarativeType stored at \a type_return, or
- a component located at \a url_return.
-
- If either return pointer is 0, the corresponding search is not done.
-*/
-bool QDeclarativeImportDatabase::resolveTypeInNamespace(QDeclarativeImportedNamespace* ns, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return,
- int *vmaj, int *vmin) const
-{
- return ns->find(type,vmaj,vmin,type_return,url_return);
+ return d->add(qmldircomponentsnetwork, uri, prefix, vmaj, vmin, importType, importDb, errorString);
}
/*!
@@ -834,7 +849,7 @@ void QDeclarativeImportDatabase::setPluginPathList(const QStringList &paths)
void QDeclarativeImportDatabase::addPluginPath(const QString& path)
{
if (qmlImportTrace())
- qDebug() << "QDeclarativeImportDatabase::addPluginPath" << path;
+ qDebug().nospace() << "QDeclarativeImportDatabase::addPluginPath: " << path;
QUrl url = QUrl(path);
if (url.isRelative() || url.scheme() == QLatin1String("file")) {
@@ -848,7 +863,7 @@ void QDeclarativeImportDatabase::addPluginPath(const QString& path)
void QDeclarativeImportDatabase::addImportPath(const QString& path)
{
if (qmlImportTrace())
- qDebug() << "QDeclarativeImportDatabase::addImportPath" << path;
+ qDebug().nospace() << "QDeclarativeImportDatabase::addImportPath: " << path;
if (path.isEmpty())
return;
@@ -882,7 +897,7 @@ void QDeclarativeImportDatabase::setImportPathList(const QStringList &paths)
bool QDeclarativeImportDatabase::importPlugin(const QString &filePath, const QString &uri, QString *errorString)
{
if (qmlImportTrace())
- qDebug() << "QDeclarativeImportDatabase::importPlugin" << uri << "from" << filePath;
+ qDebug().nospace() << "QDeclarativeImportDatabase::importPlugin: " << uri << " from " << filePath;
QFileInfo fileInfo(filePath);
const QString absoluteFilePath = fileInfo.absoluteFilePath();
diff --git a/src/declarative/qml/qdeclarativeimport_p.h b/src/declarative/qml/qdeclarativeimport_p.h
index 88246d4..84802de 100644
--- a/src/declarative/qml/qdeclarativeimport_p.h
+++ b/src/declarative/qml/qdeclarativeimport_p.h
@@ -65,9 +65,10 @@ QT_BEGIN_NAMESPACE
class QDeclarativeTypeNameCache;
class QDeclarativeEngine;
class QDir;
-
class QDeclarativeImportedNamespace;
class QDeclarativeImportsPrivate;
+class QDeclarativeImportDatabase;
+
class QDeclarativeImports
{
public:
@@ -79,7 +80,24 @@ public:
void setBaseUrl(const QUrl &url);
QUrl baseUrl() const;
- void cache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const;
+ bool resolveType(const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor,
+ QDeclarativeImportedNamespace** ns_return,
+ QString *errorString = 0) const;
+ bool resolveType(QDeclarativeImportedNamespace*,
+ const QByteArray& type,
+ QDeclarativeType** type_return, QUrl* url_return,
+ int *version_major, int *version_minor) const;
+
+ bool addImport(QDeclarativeImportDatabase *,
+ const QString& uri, const QString& prefix, int vmaj, int vmin,
+ QDeclarativeScriptParser::Import::Type importType,
+ const QDeclarativeDirComponents &qmldircomponentsnetwork,
+ QString *errorString);
+
+ void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const;
+
private:
friend class QDeclarativeImportDatabase;
QDeclarativeImportsPrivate *d;
@@ -102,21 +120,6 @@ public:
void setPluginPathList(const QStringList &paths);
void addPluginPath(const QString& path);
-
- bool addToImport(QDeclarativeImports*, const QDeclarativeDirComponents &qmldircomponentsnetwork,
- const QString& uri, const QString& prefix, int vmaj, int vmin,
- QDeclarativeScriptParser::Import::Type importType,
- QString *errorString);
- bool resolveType(const QDeclarativeImports&, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return,
- int *version_major, int *version_minor,
- QDeclarativeImportedNamespace** ns_return,
- QString *errorString = 0) const;
- bool resolveTypeInNamespace(QDeclarativeImportedNamespace*, const QByteArray& type,
- QDeclarativeType** type_return, QUrl* url_return,
- int *version_major, int *version_minor ) const;
-
-
private:
friend class QDeclarativeImportsPrivate;
QString resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
index d192f3a..c58aebc 100644
--- a/src/declarative/qml/qdeclarativeparser_p.h
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -183,10 +183,9 @@ namespace QDeclarativeParser
};
Q_DECLARE_FLAGS(Pragmas, Pragma)
- QStringList codes;
- QStringList files;
- QList<int> lineNumbers;
- QList<Pragmas> pragmas;
+ QString code;
+ QString file;
+ Pragmas pragmas;
};
// The bytes to cast instances by to get to the QDeclarativeParserStatus
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 4e9e8d5..267642d 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -84,11 +84,6 @@ QT_BEGIN_NAMESPACE
element directly will result in an error.
*/
-/*!
- \class QDeclarativeAbstractAnimation
- \internal
-*/
-
QDeclarativeAbstractAnimation::QDeclarativeAbstractAnimation(QObject *parent)
: QObject(*(new QDeclarativeAbstractAnimationPrivate), parent)
{
@@ -574,12 +569,6 @@ void QDeclarativeAbstractAnimation::timelineComplete()
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-/*!
- \internal
- \class QDeclarativePauseAnimation
-*/
-
-
QDeclarativePauseAnimation::QDeclarativePauseAnimation(QObject *parent)
: QDeclarativeAbstractAnimation(*(new QDeclarativePauseAnimationPrivate), parent)
{
@@ -659,11 +648,6 @@ QAbstractAnimation *QDeclarativePauseAnimation::qtAnimation()
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-/*!
- \internal
- \class QDeclarativeColorAnimation
-*/
-
QDeclarativeColorAnimation::QDeclarativeColorAnimation(QObject *parent)
: QDeclarativePropertyAnimation(parent)
{
@@ -776,10 +760,6 @@ void QDeclarativeColorAnimation::setTo(const QColor &t)
\sa StateChangeScript
*/
-/*!
- \internal
- \class QDeclarativeScriptAction
-*/
QDeclarativeScriptAction::QDeclarativeScriptAction(QObject *parent)
:QDeclarativeAbstractAnimation(*(new QDeclarativeScriptActionPrivate), parent)
{
@@ -933,10 +913,6 @@ QAbstractAnimation *QDeclarativeScriptAction::qtAnimation()
\sa {QML Animation}, QtDeclarative
*/
-/*!
- \internal
- \class QDeclarativePropertyAction
-*/
QDeclarativePropertyAction::QDeclarativePropertyAction(QObject *parent)
: QDeclarativeAbstractAnimation(*(new QDeclarativePropertyActionPrivate), parent)
{
@@ -1185,12 +1161,6 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions,
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-
-/*!
- \internal
- \class QDeclarativeNumberAnimation
-*/
-
QDeclarativeNumberAnimation::QDeclarativeNumberAnimation(QObject *parent)
: QDeclarativePropertyAnimation(parent)
{
@@ -1276,7 +1246,7 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
/*!
\qmlclass Vector3dAnimation QDeclarativeVector3dAnimation
- \ingroup qml-animation-transition
+ \ingroup qml-animation-transition
\since 4.7
\inherits PropertyAnimation
\brief The Vector3dAnimation element animates changes in QVector3d values.
@@ -1291,12 +1261,6 @@ void QDeclarativeNumberAnimation::setTo(qreal t)
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-
-/*!
- \internal
- \class QDeclarativeVector3dAnimation
-*/
-
QDeclarativeVector3dAnimation::QDeclarativeVector3dAnimation(QObject *parent)
: QDeclarativePropertyAnimation(parent)
{
@@ -1396,12 +1360,6 @@ void QDeclarativeVector3dAnimation::setTo(QVector3D t)
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-
-/*!
- \internal
- \class QDeclarativeRotationAnimation
-*/
-
QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress)
{
qreal newt = t;
@@ -1702,11 +1660,6 @@ void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actio
\sa SequentialAnimation, {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-/*!
- \internal
- \class QDeclarativeParallelAnimation
-*/
-
QDeclarativeParallelAnimation::QDeclarativeParallelAnimation(QObject *parent) :
QDeclarativeAnimationGroup(parent)
{
@@ -2512,11 +2465,6 @@ void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions
\sa {QML Animation}, {declarative/animation/basics}{Animation basics example}
*/
-
-/*!
- \internal
- \class QDeclarativeParentAnimation
-*/
QDeclarativeParentAnimation::QDeclarativeParentAnimation(QObject *parent)
: QDeclarativeAnimationGroup(*(new QDeclarativeParentAnimationPrivate), parent)
{
diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp
index 86d08f5..88b45ae 100644
--- a/src/declarative/util/qdeclarativebind.cpp
+++ b/src/declarative/util/qdeclarativebind.cpp
@@ -72,7 +72,7 @@ public:
/*!
\qmlclass Binding QDeclarativeBind
- \ingroup qml-working-with-data
+ \ingroup qml-working-with-data
\since 4.7
\brief The Binding element allows arbitrary property bindings to be created.
@@ -95,18 +95,7 @@ public:
immediately pushed onto the new target.
\sa QtDeclarative
- */
-/*!
- \internal
- \class QDeclarativeBind
- \brief The QDeclarativeBind class allows arbitrary property bindings to be created.
-
- Simple bindings are usually earier to do in-place rather than creating a
- QDeclarativeBind item. For that reason, QDeclarativeBind is usually used to transfer property information
- from Qml to C++.
-
- \sa cppqml
- */
+*/
QDeclarativeBind::QDeclarativeBind(QObject *parent)
: QObject(*(new QDeclarativeBindPrivate), parent)
{
diff --git a/src/declarative/util/qdeclarativeconnections.cpp b/src/declarative/util/qdeclarativeconnections.cpp
index 293928e..15e5ac5 100644
--- a/src/declarative/util/qdeclarativeconnections.cpp
+++ b/src/declarative/util/qdeclarativeconnections.cpp
@@ -124,13 +124,6 @@ public:
\sa QtDeclarative
*/
-
-/*!
- \internal
- \class QDeclarativeConnections
- \brief The QDeclarativeConnections class describes generalized connections to signals.
-
-*/
QDeclarativeConnections::QDeclarativeConnections(QObject *parent) :
QObject(*(new QDeclarativeConnectionsPrivate), parent)
{
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index 0162beb..7504c23 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -58,9 +58,6 @@ Q_DECLARE_METATYPE(QListModelInterface *)
QT_BEGIN_NAMESPACE
-#define DATA_ROLE_ID 1
-#define DATA_ROLE_NAME "data"
-
QDeclarativeListModelParser::ListInstruction *QDeclarativeListModelParser::ListModelData::instructions() const
{
return (QDeclarativeListModelParser::ListInstruction *)((char *)this + sizeof(ListModelData));
diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp
index c28ada3..e897458 100644
--- a/src/declarative/util/qdeclarativepropertychanges.cpp
+++ b/src/declarative/util/qdeclarativepropertychanges.cpp
@@ -127,12 +127,6 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \internal
- \class QDeclarativePropertyChanges
- \brief The QDeclarativePropertyChanges class describes new property values for a state.
-*/
-
-/*!
\qmlproperty Object PropertyChanges::target
This property holds the object which contains the properties to be changed.
*/
diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp
index 6e17cf2..1ed7923 100644
--- a/src/declarative/util/qdeclarativestate.cpp
+++ b/src/declarative/util/qdeclarativestate.cpp
@@ -123,9 +123,6 @@ bool QDeclarativeActionEvent::override(QDeclarativeActionEvent *other)
return false;
}
-/*!
- \internal
-*/
QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObject *parent)
: QObject(dd, parent)
{
@@ -164,20 +161,6 @@ QDeclarativeStateOperation::QDeclarativeStateOperation(QObjectPrivate &dd, QObje
\sa {declarative/animation/states}{states example}, {qmlstates}{States},
{qdeclarativeanimation.html#transitions}{QML Transitions}, QtDeclarative
*/
-
-/*!
- \internal
- \class QDeclarativeState
- \brief The QDeclarativeState class allows you to define configurations of objects and properties.
-
-
- QDeclarativeState allows you to specify a state as a set of batched changes from the default
- configuration.
-
- \sa {states-transitions}{States and Transitions}
-*/
-
-
QDeclarativeState::QDeclarativeState(QObject *parent)
: QObject(*(new QDeclarativeStatePrivate), parent)
{
diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp
index 21d7ded..478c7f4 100644
--- a/src/declarative/util/qdeclarativetransition.cpp
+++ b/src/declarative/util/qdeclarativetransition.cpp
@@ -99,12 +99,6 @@ QT_BEGIN_NAMESPACE
\sa {QML Animation}, {declarative/animation/states}{states example}, {qmlstates}{States}, {QtDeclarative}
*/
-/*!
- \internal
- \class QDeclarativeTransition
- \brief The QDeclarativeTransition class allows you to define animated transitions that occur on state changes.
-*/
-
//ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting
//and disconnecting signals and slots frequently
class ParallelAnimationWrapper : public QParallelAnimationGroup
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 7b3d4a8..47b502d 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -466,8 +466,6 @@ public:
QList<QDeclarativeXmlListModelRole *> roleObjects;
static void append_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, QDeclarativeXmlListModelRole *role);
static void clear_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list);
- static void removeAt_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, int i);
- static void insert_role(QDeclarativeListProperty<QDeclarativeXmlListModelRole> *list, int i, QDeclarativeXmlListModelRole *role);
QList<QList<QVariant> > data;
int redirectCount;
};
@@ -500,11 +498,6 @@ void QDeclarativeXmlListModelPrivate::clear_role(QDeclarativeListProperty<QDecla
}
/*!
- \class QDeclarativeXmlListModel
- \internal
-*/
-
-/*!
\qmlclass XmlListModel QDeclarativeXmlListModel
\ingroup qml-working-with-data
\since 4.7
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 3c23884..4c03d33 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5742,16 +5742,11 @@ void QGraphicsScenePrivate::touchEventHandler(QTouchEvent *sceneTouchEvent)
}
if (sceneTouchEvent->deviceType() == QTouchEvent::TouchScreen) {
- // on touch-screens, combine this touch point with the closest one we find if it
- // is a a direct descendent or ancestor (
+ // on touch-screens, combine this touch point with the closest one we find
int closestTouchPointId = findClosestTouchPointId(touchPoint.scenePos());
QGraphicsItem *closestItem = itemForTouchPointId.value(closestTouchPointId);
- if (!item
- || (closestItem
- && (item->isAncestorOf(closestItem)
- || closestItem->isAncestorOf(item)))) {
+ if (!item || (closestItem && cachedItemsUnderMouse.contains(closestItem)))
item = closestItem;
- }
}
if (!item)
continue;
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 3943e26..13d2c77 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -99,7 +99,7 @@ neon:*-g++* {
contains(QMAKE_MAC_XARCH, no) {
DEFINES += QT_NO_MAC_XARCH
} else {
- win32-g++*|!win32:!*-icc* {
+ win32-g++*|!win32:!win32-icc*:!macx-icc* {
mmx {
mmx_compiler.commands = $$QMAKE_CXX -c -Winline
diff --git a/src/gui/kernel/qeventdispatcher_mac.mm b/src/gui/kernel/qeventdispatcher_mac.mm
index 89f01d8..515c6d3 100644
--- a/src/gui/kernel/qeventdispatcher_mac.mm
+++ b/src/gui/kernel/qeventdispatcher_mac.mm
@@ -830,6 +830,7 @@ NSModalSession QEventDispatcherMacPrivate::currentModalSession()
[window setLevel:levelBeforeEnterModal];
}
currentModalSessionCached = info.session;
+ cleanupModalSessionsNeeded = false;
}
return currentModalSessionCached;
}
@@ -881,6 +882,10 @@ void QEventDispatcherMacPrivate::cleanupModalSessions()
for (int i=stackSize-1; i>=0; --i) {
QCocoaModalSessionInfo &info = cocoaModalSessionStack[i];
if (info.widget) {
+ // This session has a widget, and is therefore not marked
+ // as stopped. So just make it current. There might still be other
+ // stopped sessions on the stack, but those will be stopped on
+ // a later "cleanup" call.
currentModalSessionCached = info.session;
break;
}
@@ -926,6 +931,7 @@ void QEventDispatcherMacPrivate::endModalSession(QWidget *widget)
if (i == stackSize-1) {
// The top sessions ended. Interrupt the event dispatcher
// to start spinning the correct session immidiatly:
+ currentModalSessionCached = 0;
cleanupModalSessionsNeeded = true;
QEventDispatcherMac::instance()->interrupt();
}
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index e768a21..cb4061e 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -595,8 +595,9 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures,
if (gesture->hasHotSpot()) {
// guess the target widget using the hotspot of the gesture
QPoint pt = gesture->hotSpot().toPoint();
- if (QWidget *w = qApp->topLevelAt(pt)) {
- target = w->childAt(w->mapFromGlobal(pt));
+ if (QWidget *topLevel = qApp->topLevelAt(pt)) {
+ QWidget *child = topLevel->childAt(topLevel->mapFromGlobal(pt));
+ target = child ? child : topLevel;
}
} else {
// or use the context of the gesture
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index c989bd3..c5429dd 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -836,7 +836,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
case PE_PanelItemViewItem:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
- if (vopt->backgroundBrush.style() != Qt::NoBrush) {
+ uint resolve_mask = vopt->palette.resolve();
+ if (vopt->backgroundBrush.style() != Qt::NoBrush
+ || (resolve_mask & (1 << QPalette::Base)))
+ {
QPointF oldBO = painter->brushOrigin();
painter->setBrushOrigin(vopt->rect.topLeft());
painter->fillRect(vopt->rect, vopt->backgroundBrush);
diff --git a/src/imports/particles/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index 5cd9c0c..edb69bc 100644
--- a/src/imports/particles/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -165,14 +165,6 @@ void QDeclarativeParticleMotion::destroy(QDeclarativeParticle &particle)
It has no further properties.
*/
-
-/*!
- \internal
- \class QDeclarativeParticleMotionLinear
- \ingroup group_effects
- \brief The QDeclarativeParticleMotionLinear class moves the particles linearly.
-*/
-
void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int interval)
{
p.x += interval * p.x_velocity;
@@ -196,14 +188,6 @@ void QDeclarativeParticleMotionLinear::advance(QDeclarativeParticle &p, int inte
*/
/*!
- \internal
- \class QDeclarativeParticleMotionGravity
- \ingroup group_effects
- \brief The QDeclarativeParticleMotionGravity class moves the particles towards a point.
-
-*/
-
-/*!
\qmlproperty real ParticleMotionGravity::xattractor
\qmlproperty real ParticleMotionGravity::yattractor
These properties hold the x and y coordinates of the point attracting the particles.
@@ -311,16 +295,6 @@ Rectangle {
*/
/*!
- \internal
- \class QDeclarativeParticleMotionWander
- \ingroup group_effects
- \brief The QDeclarativeParticleMotionWander class moves particles in a somewhat random fashion.
-
- The particles will continue roughly in the original direction, however will randomly
- drift to each side.
-*/
-
-/*!
\qmlproperty real ParticleMotionWander::xvariance
\qmlproperty real ParticleMotionWander::yvariance
@@ -709,13 +683,6 @@ Rectangle {
\image particles.gif
*/
-/*!
- \internal
- \class QDeclarativeParticles
- \ingroup group_effects
- \brief The QDeclarativeParticles class generates and moves particles.
-*/
-
QDeclarativeParticles::QDeclarativeParticles(QDeclarativeItem *parent)
: QDeclarativeItem(*(new QDeclarativeParticlesPrivate), parent)
{
diff --git a/src/network/bearer/qnetworkconfigmanager.cpp b/src/network/bearer/qnetworkconfigmanager.cpp
index 102b347..65014a6 100644
--- a/src/network/bearer/qnetworkconfigmanager.cpp
+++ b/src/network/bearer/qnetworkconfigmanager.cpp
@@ -54,7 +54,15 @@ Q_GLOBAL_STATIC(QNetworkConfigurationManagerPrivate, connManager);
QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
{
- return connManager();
+ static bool initialized = false;
+
+ QNetworkConfigurationManagerPrivate *m = connManager();
+ if (!initialized) {
+ initialized = true;
+ m->updateConfigurations();
+ }
+
+ return m;
}
/*!
@@ -178,7 +186,7 @@ QNetworkConfigurationManagerPrivate *qNetworkConfigurationManagerPrivate()
QNetworkConfigurationManager::QNetworkConfigurationManager( QObject* parent )
: QObject(parent)
{
- QNetworkConfigurationManagerPrivate *priv = connManager();
+ QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
connect(priv, SIGNAL(configurationAdded(QNetworkConfiguration)),
this, SIGNAL(configurationAdded(QNetworkConfiguration)));
diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp
index dd174bf..d388920 100644
--- a/src/network/bearer/qnetworkconfigmanager_p.cpp
+++ b/src/network/bearer/qnetworkconfigmanager_p.cpp
@@ -64,9 +64,6 @@ QNetworkConfigurationManagerPrivate::QNetworkConfigurationManagerPrivate()
{
qRegisterMetaType<QNetworkConfiguration>("QNetworkConfiguration");
qRegisterMetaType<QNetworkConfigurationPrivatePointer>("QNetworkConfigurationPrivatePointer");
-
- moveToThread(QCoreApplicationPrivate::mainThread());
- updateConfigurations();
}
QNetworkConfigurationManagerPrivate::~QNetworkConfigurationManagerPrivate()
@@ -359,6 +356,13 @@ void QNetworkConfigurationManagerPrivate::updateConfigurations()
if (sender())
return;
+ if (thread() != QCoreApplicationPrivate::mainThread()) {
+ if (thread() != QThread::currentThread())
+ return;
+
+ moveToThread(QCoreApplicationPrivate::mainThread());
+ }
+
updating = false;
#ifndef QT_NO_LIBRARY
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 3112dd6..9e3da61 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -247,7 +247,10 @@ QHostInfo QHostInfoAgent::fromName(const QString &hostName)
#ifndef QT_NO_IPV6
else if (node->ai_family == AF_INET6) {
QHostAddress addr;
- addr.setAddress(((sockaddr_in6 *) node->ai_addr)->sin6_addr.s6_addr);
+ sockaddr_in6 *sa6 = (sockaddr_in6 *) node->ai_addr;
+ addr.setAddress(sa6->sin6_addr.s6_addr);
+ if (sa6->sin6_scope_id)
+ addr.setScopeId(QString::number(sa6->sin6_scope_id));
if (!addresses.contains(addr))
addresses.append(addr);
}
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index fe28863..f6bfbac 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -352,10 +352,13 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &addr, quint16
memset(&sockAddrIPv6, 0, sizeof(sockAddrIPv6));
sockAddrIPv6.sin6_family = AF_INET6;
sockAddrIPv6.sin6_port = htons(port);
+
+ QString scopeid = addr.scopeId();
+ bool ok;
+ sockAddrIPv6.sin6_scope_id = scopeid.toInt(&ok);
#ifndef QT_NO_IPV6IFNAME
- sockAddrIPv6.sin6_scope_id = ::if_nametoindex(addr.scopeId().toLatin1().data());
-#else
- sockAddrIPv6.sin6_scope_id = addr.scopeId().toInt();
+ if (!ok)
+ sockAddrIPv6.sin6_scope_id = ::if_nametoindex(scopeid.toLatin1());
#endif
Q_IPV6ADDR ip6 = addr.toIPv6Address();
memcpy(&sockAddrIPv6.sin6_addr.s6_addr, &ip6, sizeof(ip6));
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 8177b4f..477ef45 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -207,6 +207,7 @@ static inline void qt_socket_setPortAndAddress(SOCKET socketDescriptor, sockaddr
if (address.protocol() == QAbstractSocket::IPv6Protocol) {
memset(sockAddrIPv6, 0, sizeof(qt_sockaddr_in6));
sockAddrIPv6->sin6_family = AF_INET6;
+ sockAddrIPv6->sin6_scope_id = address.scopeId().toInt();
WSAHtons(socketDescriptor, port, &(sockAddrIPv6->sin6_port));
Q_IPV6ADDR tmp = address.toIPv6Address();
memcpy(&(sockAddrIPv6->sin6_addr.qt_s6_addr), &tmp, sizeof(tmp));
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 9e69816..943a195 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -5262,6 +5262,8 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= FragmentProgram;
if (extensions.match("GL_ARB_fragment_shader"))
glExtensions |= FragmentShader;
+ if (extensions.match("GL_ARB_ES2_compatibility"))
+ glExtensions |= ES2Compatibility;
if (extensions.match("GL_ARB_texture_mirrored_repeat"))
glExtensions |= MirroredRepeat;
if (extensions.match("GL_EXT_framebuffer_object"))
@@ -5282,6 +5284,7 @@ QGLExtensions::Extensions QGLExtensions::currentContextExtensions()
glExtensions |= FramebufferObject;
glExtensions |= GenerateMipmap;
glExtensions |= FragmentShader;
+ glExtensions |= ES2Compatibility;
#endif
#if defined(QT_OPENGL_ES_1)
if (extensions.match("GL_OES_framebuffer_object"))
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 387c8f7..623eeaf 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -284,7 +284,8 @@ public:
DDSTextureCompression = 0x00008000,
ETC1TextureCompression = 0x00010000,
PVRTCTextureCompression = 0x00020000,
- FragmentShader = 0x00040000
+ FragmentShader = 0x00040000,
+ ES2Compatibility = 0x00080000
};
Q_DECLARE_FLAGS(Extensions, Extension)
diff --git a/src/opengl/qgl_win.cpp b/src/opengl/qgl_win.cpp
index 5ab944a..8eb6177 100644
--- a/src/opengl/qgl_win.cpp
+++ b/src/opengl/qgl_win.cpp
@@ -1042,7 +1042,7 @@ int QGLContext::choosePixelFormat(void* dummyPfd, HDC pdc)
iAttributes[i++] = WGL_DRAW_TO_WINDOW_ARB;
iAttributes[i++] = TRUE;
iAttributes[i++] = WGL_COLOR_BITS_ARB;
- iAttributes[i++] = 32;
+ iAttributes[i++] = 24;
iAttributes[i++] = WGL_DOUBLE_BUFFER_ARB;
iAttributes[i++] = d->glFormat.doubleBuffer();
if (d->glFormat.stereo()) {
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index 74382b0..bc1c009 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -97,6 +97,10 @@ QT_BEGIN_NAMESPACE
to just features that are present in GLSL/ES, and avoid
standard variable names that only work on the desktop.
+ If the \c{GL_ARB_ES2_compatibility} extension is present,
+ then the above prefix is not added because the desktop OpenGL
+ implementation supports precision qualifiers.
+
\section1 Simple shader example
\snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 1
@@ -394,8 +398,10 @@ bool QGLShader::compileSourceCode(const char *source)
srclen.append(GLint(headerLen));
}
#ifdef QGL_DEFINE_QUALIFIERS
- src.append(qualifierDefines);
- srclen.append(GLint(sizeof(qualifierDefines) - 1));
+ if (!(QGLExtensions::glExtensions() & QGLExtensions::ES2Compatibility)) {
+ src.append(qualifierDefines);
+ srclen.append(GLint(sizeof(qualifierDefines) - 1));
+ }
#endif
#ifdef QGL_REDEFINE_HIGHP
if (d->shaderType == Fragment) {
diff --git a/src/plugins/bearer/icd/qnetworksession_impl.cpp b/src/plugins/bearer/icd/qnetworksession_impl.cpp
index 3170bf6..8013d30 100644
--- a/src/plugins/bearer/icd/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/icd/qnetworksession_impl.cpp
@@ -888,12 +888,12 @@ void QNetworkSessionPrivateImpl::close()
state = QNetworkSession::Closing;
emit stateChanged(state);
+ // we fake a disconnection, session error is sent
+ updateState(QNetworkSession::Disconnected);
+
opened = false;
isOpen = false;
- // we fake a disconnection, session error is not sent
- updateState(QNetworkSession::Disconnected);
-
icd.disconnect(ICD_CONNECTION_FLAG_APPLICATION_EVENT);
startTime = QDateTime();
} else {
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.cpp b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
index 1de4c0f..32eb61a 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.cpp
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.cpp
@@ -102,15 +102,14 @@ QNetworkSessionPrivateImpl::~QNetworkSessionPrivateImpl()
// Cancel possible RConnection::Start()
Cancel();
iSocketServ.Close();
-
- // Close global 'Open C' RConnection
- // Clears also possible unsetdefaultif() flags.
- setdefaultif(0);
-
+
+ // Restore default interface to system default
+ restoreDefaultIf();
+
iConnectionMonitor.Close();
iOpenCLibrary.Close();
#ifdef QT_BEARERMGMT_SYMBIAN_DEBUG
- qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and setdefaultif(0))";
+ qDebug() << "QNS this : " << QString::number((uint)this) << " - destroyed (and restoreDefaultIf())";
#endif
}
@@ -523,16 +522,9 @@ void QNetworkSessionPrivateImpl::close(bool allowSignals)
Cancel(); // closes iConnection
iSocketServ.Close();
-
- // Close global 'Open C' RConnection. If OpenC supports,
- // close the defaultif for good to avoid difficult timing
- // and bouncing issues of network going immediately back up
- // because of e.g. select() thread etc.
- if (iDynamicUnSetdefaultif) {
- iDynamicUnSetdefaultif();
- } else {
- setdefaultif(0);
- }
+
+ // Restore default interface to system default
+ restoreDefaultIf();
// If UserChoice, go down immediately. If some other configuration,
// go down immediately if there is no reports expected from the platform;
@@ -1457,6 +1449,29 @@ void QNetworkSessionPrivateImpl::handleSymbianConnectionStatusChange(TInt aConne
}
}
+void QNetworkSessionPrivateImpl::restoreDefaultIf()
+{
+ QNetworkConfigurationPrivatePointer config = engine->defaultConfiguration();
+
+ QMutexLocker locker(&config->mutex);
+
+ ifreq ifr;
+ memset(&ifr, 0, sizeof(ifreq));
+
+ switch (config->type) {
+ case QNetworkConfiguration::InternetAccessPoint:
+ strcpy(ifr.ifr_name, config->name.toUtf8().constData());
+ break;
+ case QNetworkConfiguration::ServiceNetwork:
+ ifr.ifr_ifru.snap_id = toSymbianConfig(config)->numericId;
+ break;
+ default:
+ ;
+ };
+
+ setdefaultif(&ifr);
+}
+
ConnectionProgressNotifier::ConnectionProgressNotifier(QNetworkSessionPrivateImpl& owner, RConnection& connection)
: CActive(CActive::EPriorityUserInput), iOwner(owner), iConnection(connection)
{
diff --git a/src/plugins/bearer/symbian/qnetworksession_impl.h b/src/plugins/bearer/symbian/qnetworksession_impl.h
index aac9321..1b0e968 100644
--- a/src/plugins/bearer/symbian/qnetworksession_impl.h
+++ b/src/plugins/bearer/symbian/qnetworksession_impl.h
@@ -143,6 +143,7 @@ private:
void handleSymbianConnectionStatusChange(TInt aConnectionStatus, TInt aError, TUint accessPointId = 0);
QNetworkConfiguration bestConfigFromSNAP(const QNetworkConfiguration& snapConfig) const;
QNetworkConfiguration activeConfiguration(TUint32 iapId = 0) const;
+ void restoreDefaultIf();
#ifndef QT_NO_NETWORKINTERFACE
QNetworkInterface interface(TUint iapId) const;
#endif
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 8560214..8347626 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -782,6 +782,8 @@ static JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState*, JSC::JSOb
static JSC::JSValue JSC_HOST_CALL functionQsTranslateNoOp(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
static JSC::JSValue JSC_HOST_CALL functionQsTr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
static JSC::JSValue JSC_HOST_CALL functionQsTrNoOp(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
+static JSC::JSValue JSC_HOST_CALL functionQsTrId(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
+static JSC::JSValue JSC_HOST_CALL functionQsTrIdNoOp(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
JSC::JSValue JSC_HOST_CALL functionQsTranslate(JSC::ExecState *exec, JSC::JSObject*, JSC::JSValue, const JSC::ArgList &args)
{
@@ -892,6 +894,28 @@ JSC::JSValue JSC_HOST_CALL functionQsTrNoOp(JSC::ExecState *, JSC::JSObject*, JS
return args.at(0);
}
+JSC::JSValue JSC_HOST_CALL functionQsTrId(JSC::ExecState *exec, JSC::JSObject*, JSC::JSValue, const JSC::ArgList &args)
+{
+ if (args.size() < 1)
+ return JSC::throwError(exec, JSC::GeneralError, "qsTrId() requires at least one argument");
+ if (!args.at(0).isString())
+ return JSC::throwError(exec, JSC::TypeError, "qsTrId(): first argument (id) must be a string");
+ if ((args.size() > 1) && !args.at(1).isNumber())
+ return JSC::throwError(exec, JSC::TypeError, "qsTrId(): second argument (n) must be a number");
+ JSC::UString id = args.at(0).toString(exec);
+ int n = -1;
+ if (args.size() > 1)
+ n = args.at(1).toInt32(exec);
+ return JSC::jsString(exec, qtTrId(QScript::convertToLatin1(id).constData(), n));
+}
+
+JSC::JSValue JSC_HOST_CALL functionQsTrIdNoOp(JSC::ExecState *, JSC::JSObject*, JSC::JSValue, const JSC::ArgList &args)
+{
+ if (args.size() < 1)
+ return JSC::jsUndefined();
+ return args.at(0);
+}
+
static JSC::JSValue JSC_HOST_CALL stringProtoFuncArg(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
JSC::JSValue JSC_HOST_CALL stringProtoFuncArg(JSC::ExecState *exec, JSC::JSObject*, JSC::JSValue thisObject, const JSC::ArgList &args)
@@ -3435,6 +3459,8 @@ void QScriptEngine::registerCustomType(int type, MarshalFunction mf,
\row \o QT_TR_NOOP() \o QT_TR_NOOP()
\row \o qsTranslate() \o QCoreApplication::translate()
\row \o QT_TRANSLATE_NOOP() \o QT_TRANSLATE_NOOP()
+ \row \o qsTrId() (since 4.7) \o qtTrId()
+ \row \o QT_TRID_NOOP() (since 4.7) \o QT_TRID_NOOP()
\endtable
\sa {Internationalization with Qt}
@@ -3453,6 +3479,8 @@ void QScriptEngine::installTranslatorFunctions(const QScriptValue &object)
JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp));
JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 3, JSC::Identifier(exec, "qsTr"), QScript::functionQsTr));
JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TR_NOOP"), QScript::functionQsTrNoOp));
+ JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "qsTrId"), QScript::functionQsTrId));
+ JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "QT_TRID_NOOP"), QScript::functionQsTrIdNoOp));
glob->stringPrototype()->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 1, JSC::Identifier(exec, "arg"), QScript::stringProtoFuncArg));
}
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 9a35ac5..66dabfa 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -2106,7 +2106,7 @@ void QODBCDriverPrivate::checkSqlServer()
serverType = QString::fromUtf8((const char *)serverString.constData(), t);
#endif
isFreeTDSDriver = serverType.contains(QLatin1String("tdsodbc"), Qt::CaseInsensitive);
- unicode = isFreeTDSDriver == false;
+ unicode = unicode && !isFreeTDSDriver;
}
}
diff --git a/src/sql/drivers/psql/qsql_psql.pri b/src/sql/drivers/psql/qsql_psql.pri
index 97db4be..6da3540 100644
--- a/src/sql/drivers/psql/qsql_psql.pri
+++ b/src/sql/drivers/psql/qsql_psql.pri
@@ -2,12 +2,9 @@ HEADERS += $$PWD/qsql_psql.h
SOURCES += $$PWD/qsql_psql.cpp
unix|win32-g++* {
- !static:!isEmpty(QT_LFLAGS_PSQL) {
- !contains(QT_CONFIG, system-zlib): QT_LFLAGS_PSQL -= -lz
- LIBS *= $$QT_LFLAGS_PSQL
- QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
- }
+ LIBS *= $$QT_LFLAGS_PSQL
!contains(LIBS, .*pq.*):LIBS += -lpq
+ QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
} else {
!contains(LIBS, .*pq.*):LIBS += -llibpq -lws2_32 -ladvapi32
}
diff --git a/src/sql/drivers/tds/qsql_tds.pri b/src/sql/drivers/tds/qsql_tds.pri
index 037f793..521c06b 100644
--- a/src/sql/drivers/tds/qsql_tds.pri
+++ b/src/sql/drivers/tds/qsql_tds.pri
@@ -1,8 +1,8 @@
HEADERS += $$PWD/qsql_tds.h
SOURCES += $$PWD/qsql_tds.cpp
-unix|win32-g++: {
- !isEmpty(QT_LFLAGS_TDS):!static:LIBS *= $$QT_LFLAGS_TDS
+unix|win32-g++*: {
+ LIBS *= $$QT_LFLAGS_TDS
!contains(LIBS, .*sybdb.*):LIBS += -lsybdb
QMAKE_CXXFLAGS *= $$QT_CFLAGS_TDS
} else:win32-borland {
diff --git a/src/testlib/qbenchmarkmeasurement_p.h b/src/testlib/qbenchmarkmeasurement_p.h
index 932852c..20a3bc1 100644
--- a/src/testlib/qbenchmarkmeasurement_p.h
+++ b/src/testlib/qbenchmarkmeasurement_p.h
@@ -53,7 +53,7 @@
// We mean it.
//
-#include <QtCore/qdatetime.h>
+#include <QtCore/qelapsedtimer.h>
#include "3rdparty/cycle_p.h"
#include "qbenchmark.h"
@@ -87,7 +87,7 @@ public:
bool needsWarmupIteration();
QTest::QBenchmarkMetric metricType();
private:
- QTime time;
+ QElapsedTimer time;
};
#ifdef HAVE_TICK_COUNTER // defined in 3rdparty/cycle_p.h