summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:42:48 +0300
committerJani Heikkinen <jani.heikkinen@digia.com>2014-04-23 12:42:48 +0300
commit54c1e5ed220570034a784bf4c616e177697e4d28 (patch)
tree2bac29aabf5380db0cb1f5176525417ac483fd81 /src/corelib
parent207598fd8e69be34e8ba2c9db7720cb6003ea114 (diff)
parentb0d996aed19570da73e9bdc166a38bbb14f4b859 (diff)
Merge remote-tracking branch 'origin/release' into stable
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/global/qcompilerdetection.h23
-rw-r--r--src/corelib/kernel/qobject.cpp13
-rw-r--r--src/corelib/kernel/qtranslator.cpp6
-rw-r--r--src/corelib/thread/qthread_win.cpp21
-rw-r--r--src/corelib/tools/qchar.h3
-rw-r--r--src/corelib/tools/qstring.h3
-rw-r--r--src/corelib/tools/qtimezone.cpp7
-rw-r--r--src/corelib/tools/qunicodetools.cpp38
9 files changed, 83 insertions, 33 deletions
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 18342d0138..c8eb15a7f7 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
+depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtqml qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
headerdirs += ..
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 950647004a..dd880d8ede 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -842,21 +842,28 @@
#endif /* Q_CC_MSVC */
#ifdef __cplusplus
+# include <utility>
# if defined(Q_OS_QNX)
-# include <utility>
# if defined(_YVALS) || defined(_LIBCPP_VER)
// QNX: libcpp (Dinkumware-based) doesn't have the <initializer_list>
// header, so the feature is useless, even if the compiler supports
// it. Disable.
-# ifdef Q_COMPILER_INITIALIZER_LISTS
-# undef Q_COMPILER_INITIALIZER_LISTS
-# endif
-# ifdef Q_COMPILER_RVALUE_REFS
-# undef Q_COMPILER_RVALUE_REFS
-# endif
+# undef Q_COMPILER_INITIALIZER_LISTS
+// That libcpp doesn't have std::move either, so disable everything
+// related to rvalue refs.
+# undef Q_COMPILER_RVALUE_REFS
+# undef Q_COMPILER_REF_QUALIFIERS
# endif
+# endif // Q_OS_QNX
+# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \
+ && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402)
+// Mac OS X: Apple has not updated libstdc++ since 2007, which means it does not have
+// <initializer_list> or std::move. Let's disable these features
+# undef Q_COMPILER_INITIALIZER_LISTS
+# undef Q_COMPILER_RVALUE_REFS
+# undef Q_COMPILER_REF_QUALIFIERS
# endif
-#endif // Q_OS_QNX
+#endif
/*
* C++11 keywords and expressions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 01bedb4a3a..0a504657a3 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -4063,18 +4063,21 @@ QDebug operator<<(QDebug dbg, const QObject *o) {
\macro Q_CLASSINFO(Name, Value)
\relates QObject
- This macro associates extra information to the class, which is
- available using QObject::metaObject(). Except for the ActiveQt
- extension, Qt doesn't use this information.
+ This macro associates extra information to the class, which is available
+ using QObject::metaObject(). Qt makes only limited use of this feature, in
+ the \l{Active Qt}, \l{Qt D-Bus} and \l{Qt QML} modules.
- The extra information takes the form of a \a Name string and a \a
- Value literal string.
+ The extra information takes the form of a \a Name string and a \a Value
+ literal string.
Example:
\snippet code/src_corelib_kernel_qobject.cpp 35
\sa QMetaObject::classInfo()
+ \sa QAxFactory
+ \sa {Using Qt D-Bus Adaptors}
+ \sa {Extending QML - Default Property Example}
*/
/*!
diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp
index 843a6edce1..94c77302dd 100644
--- a/src/corelib/kernel/qtranslator.cpp
+++ b/src/corelib/kernel/qtranslator.cpp
@@ -465,6 +465,12 @@ QTranslator::~QTranslator()
\li \c /opt/foolib/foo.qm
\li \c /opt/foolib/foo
\endlist
+
+ Usually, it is better to use the QTranslator::load(const QLocale &,
+ const QString &, const QString &, const QString &, const QString &)
+ function instead, because it uses \l{QLocale::uiLanguages()} and not simply
+ the locale name, which refers to the formatting of dates and numbers and not
+ necessarily the UI language.
*/
bool QTranslator::load(const QString & filename, const QString & directory,
diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp
index a12636778e..bdc3463b9f 100644
--- a/src/corelib/thread/qthread_win.cpp
+++ b/src/corelib/thread/qthread_win.cpp
@@ -63,6 +63,7 @@
#include <qt_windows.h>
#ifdef Q_OS_WINRT
+#include <qelapsedtimer.h>
#include <thread>
#endif
@@ -680,21 +681,11 @@ bool QThread::wait(unsigned long time)
break;
}
#else // !Q_OS_WINRT
- if (d->handle->joinable()) {
- HANDLE handle = d->handle->native_handle();
- switch (WaitForSingleObjectEx(handle, time, FALSE)) {
- case WAIT_OBJECT_0:
- ret = true;
- d->handle->join();
- break;
- case WAIT_FAILED:
- qErrnoWarning("QThread::wait: WaitForSingleObjectEx() failed");
- break;
- case WAIT_ABANDONED:
- case WAIT_TIMEOUT:
- default:
- break;
- }
+ if (!d->finished) {
+ QElapsedTimer timer;
+ timer.start();
+ while (timer.elapsed() < time && !d->finished)
+ yieldCurrentThread();
}
#endif // Q_OS_WINRT
diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h
index 266effb66a..1955758fca 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -358,6 +358,9 @@ public:
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
case QChar::Joining_Right: return QChar::Right;
+ case QChar::Joining_None:
+ case QChar::Joining_Left:
+ case QChar::Joining_Transparent:
default: return QChar::OtherJoining;
}
}
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 2d9a42957e..359d0c49e5 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -954,6 +954,9 @@ public:
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
case QChar::Joining_Right: return QChar::Right;
+ case QChar::Joining_None:
+ case QChar::Joining_Left:
+ case QChar::Joining_Transparent:
default: return QChar::OtherJoining;
}
}
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index b30caf4289..e17ff2b249 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -418,6 +418,13 @@ QTimeZone::~QTimeZone()
}
/*!
+ \fn QTimeZone::swap(QTimeZone &other)
+
+ Swaps this time zone instance with \a other. This function is very
+ fast and never fails.
+*/
+
+/*!
Assignment operator, assign \a other to this.
*/
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index fac795051a..fc36d07a4a 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -667,7 +667,7 @@ Q_CORE_EXPORT void initCharAttributes(const ushort *string, int length,
// ----------------------------------------------------------------------------
//
-// The Unicode script property. See http://www.unicode.org/reports/tr24/ (some very old version)
+// The Unicode script property. See http://www.unicode.org/reports/tr24/tr24-21.html
//
// ----------------------------------------------------------------------------
@@ -689,15 +689,36 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
- if (Q_LIKELY(prop->script == script || prop->script == QChar::Script_Inherited))
+ if (Q_LIKELY(prop->script == script || prop->script <= QChar::Script_Inherited))
continue;
// Never break between a combining mark (gc= Mc, Mn or Me) and its base character.
// Thus, a combining mark — whatever its script property value is — should inherit
// the script property value of its base character.
static const int test = (FLAG(QChar::Mark_NonSpacing) | FLAG(QChar::Mark_SpacingCombining) | FLAG(QChar::Mark_Enclosing));
- if (Q_UNLIKELY(FLAG(prop->category) & test))
- continue;
+ if (Q_UNLIKELY(FLAG(prop->category) & test)) {
+ // In cases where the base character itself has the Common script property value,
+ // and it is followed by one or more combining marks with a specific script property value,
+ // it may be even better for processing to let the base acquire the script property value
+ // from the first mark. This approach can be generalized by treating all the characters
+ // of a combining character sequence as having the script property value
+ // of the first non-Inherited, non-Common character in the sequence if there is one,
+ // and otherwise treating all the characters as having the Common script property value.
+ if (Q_LIKELY(script > QChar::Script_Common || prop->script <= QChar::Script_Common))
+ continue;
+
+ script = QChar::Script(prop->script);
+ }
+
+ if (Q_LIKELY(script != QChar::Script_Common)) {
+ // override preceding Common-s
+ while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
+ --sor;
+ } else {
+ // see if we are inheriting preceding run
+ if (sor > 0)
+ script = scripts[sor - 1];
+ }
while (sor < eor)
scripts[sor++] = script;
@@ -705,6 +726,15 @@ Q_CORE_EXPORT void initScripts(const ushort *string, int length, uchar *scripts)
script = prop->script;
}
eor = length;
+ if (Q_LIKELY(script != QChar::Script_Common)) {
+ // override preceding Common-s
+ while (sor > 0 && scripts[sor - 1] == QChar::Script_Common)
+ --sor;
+ } else {
+ // see if we are inheriting preceding run
+ if (sor > 0)
+ script = scripts[sor - 1];
+ }
while (sor < eor)
scripts[sor++] = script;
}