summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-07-13 15:56:21 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-07-13 15:56:21 (GMT)
commit41370bc3d87afbb5485d1246dc4bcd8ab6498aa8 (patch)
tree75f87410e58fcaca1f2d239ddc21609bfc1c5211 /src/corelib
parenteef8caf294b45c8748cc7c74ddda82bec2869ecf (diff)
parentc3b6b687e340d4d0c65789c3ac80dbaf2eb513b5 (diff)
downloadQt-41370bc3d87afbb5485d1246dc4bcd8ab6498aa8.zip
Qt-41370bc3d87afbb5485d1246dc4bcd8ab6498aa8.tar.gz
Qt-41370bc3d87afbb5485d1246dc4bcd8ab6498aa8.tar.bz2
Merge remote-tracking branch 'mainline/4.8'
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qtextcodec_symbian.cpp4
-rw-r--r--src/corelib/global/qglobal.h63
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc25
-rw-r--r--src/corelib/io/qfile.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp11
-rw-r--r--src/corelib/tools/qline.cpp5
-rw-r--r--src/corelib/tools/qlist.cpp2
-rw-r--r--src/corelib/tools/qlocale.qdoc1
-rw-r--r--src/corelib/tools/qpoint.cpp9
-rw-r--r--src/corelib/tools/qscopedpointer.h4
-rw-r--r--src/corelib/tools/qset.qdoc1
-rw-r--r--src/corelib/tools/qstring.cpp3
-rw-r--r--src/corelib/tools/qstringlist.h2
-rw-r--r--src/corelib/xml/qxmlstream.cpp5
15 files changed, 92 insertions, 46 deletions
diff --git a/src/corelib/codecs/qtextcodec_symbian.cpp b/src/corelib/codecs/qtextcodec_symbian.cpp
index c8a7357..504a7c8 100644
--- a/src/corelib/codecs/qtextcodec_symbian.cpp
+++ b/src/corelib/codecs/qtextcodec_symbian.cpp
@@ -119,11 +119,13 @@ static const QSymbianCodecInitData codecsData[] = {
{ /*271082504*/ 271082504, 0, "portuguese_locking_gsm7ext\0" },
{ /*271082505*/ 271082505, 0, "portuguese_locking_single\0" },
{ /*271082506*/ 271082506, 0, "spanish_gsm7_single\0" },
+ { /*271082762*/ 271082762, 0, "hkscs_2004\0" },
{ /*271085624*/ 271085624, 114, "GB18030\0" },
{ /*536929574*/ 536929574, 38, "EUC-KR\0" },
{ /*536936703*/ 536936703, 0, "CP949\0" },
{ /*536936705*/ 536936705, 37, "ISO-2022-KR\0csISO2022KR\0" },
- { /*536941517*/ 536941517, 36, "KS_C_5601-1987\0iso-ir-149\0KS_C_5601-1989\0KSC_5601\0Korean\0csKSC56011987\0" }
+ { /*536941517*/ 536941517, 36, "KS_C_5601-1987\0iso-ir-149\0KS_C_5601-1989\0KSC_5601\0Korean\0csKSC56011987\0" },
+ { /*537124345*/ 537124345, 119, "KZ-1048\0" }
};
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1f5f537..9c7f1c6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -536,6 +536,11 @@ namespace QT_NAMESPACE {}
# define Q_COMPILER_LAMBDA
# define Q_COMPILER_UNICODE_STRINGS
# endif
+# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
+ /* C++0x features supported in GCC 4.6: */
+# define Q_COMPILER_CONSTEXPR
+# endif
+
# endif
/* IBM compiler versions are a bit messy. There are actually two products:
@@ -1135,6 +1140,12 @@ redefine to built-in booleans to make autotests work properly */
# define QT_FASTCALL
#endif
+#ifdef Q_COMPILER_CONSTEXPR
+# define Q_DECL_CONSTEXPR constexpr
+#else
+# define Q_DECL_CONSTEXPR
+#endif
+
//defines the type for the WNDPROC on windows
//the alignment needs to be forced for sse2 to not crash with mingw
#if defined(Q_WS_WIN)
@@ -1166,25 +1177,25 @@ typedef double qreal;
*/
template <typename T>
-inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
+Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
-inline int qRound(qreal d)
+Q_DECL_CONSTEXPR inline int qRound(qreal d)
{ return d >= qreal(0.0) ? int(d + qreal(0.5)) : int(d - int(d-1) + qreal(0.5)) + int(d-1); }
#if defined(QT_NO_FPU) || defined(QT_ARCH_ARM) || defined(QT_ARCH_WINDOWSCE) || defined(QT_ARCH_SYMBIAN)
-inline qint64 qRound64(double d)
+Q_DECL_CONSTEXPR inline qint64 qRound64(double d)
{ return d >= 0.0 ? qint64(d + 0.5) : qint64(d - qreal(qint64(d-1)) + 0.5) + qint64(d-1); }
#else
-inline qint64 qRound64(qreal d)
+Q_DECL_CONSTEXPR inline qint64 qRound64(qreal d)
{ return d >= qreal(0.0) ? qint64(d + qreal(0.5)) : qint64(d - qreal(qint64(d-1)) + qreal(0.5)) + qint64(d-1); }
#endif
template <typename T>
-inline const T &qMin(const T &a, const T &b) { if (a < b) return a; return b; }
+Q_DECL_CONSTEXPR inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; }
template <typename T>
-inline const T &qMax(const T &a, const T &b) { if (a < b) return b; return a; }
+Q_DECL_CONSTEXPR inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; }
template <typename T>
-inline const T &qBound(const T &min, const T &val, const T &max)
+Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max)
{ return qMax(min, qMin(max, val)); }
#ifdef QT3_SUPPORT
@@ -1978,12 +1989,12 @@ inline bool operator!=(QBool b1, bool b2) { return !b1 != !b2; }
inline bool operator!=(bool b1, QBool b2) { return !b1 != !b2; }
inline bool operator!=(QBool b1, QBool b2) { return !b1 != !b2; }
-static inline bool qFuzzyCompare(double p1, double p2)
+Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2)
{
return (qAbs(p1 - p2) <= 0.000000000001 * qMin(qAbs(p1), qAbs(p2)));
}
-static inline bool qFuzzyCompare(float p1, float p2)
+Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2)
{
return (qAbs(p1 - p2) <= 0.00001f * qMin(qAbs(p1), qAbs(p2)));
}
@@ -1991,7 +2002,7 @@ static inline bool qFuzzyCompare(float p1, float p2)
/*!
\internal
*/
-static inline bool qFuzzyIsNull(double d)
+Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(double d)
{
return qAbs(d) <= 0.000000000001;
}
@@ -1999,7 +2010,7 @@ static inline bool qFuzzyIsNull(double d)
/*!
\internal
*/
-static inline bool qFuzzyIsNull(float f)
+Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f)
{
return qAbs(f) <= 0.00001f;
}
@@ -2267,9 +2278,9 @@ class QFlags
int i;
public:
typedef Enum enum_type;
- inline QFlags(const QFlags &f) : i(f.i) {}
- inline QFlags(Enum f) : i(f) {}
- inline QFlags(Zero = 0) : i(0) {}
+ Q_DECL_CONSTEXPR inline QFlags(const QFlags &f) : i(f.i) {}
+ Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {}
+ Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {}
inline QFlags(QFlag f) : i(f) {}
inline QFlags &operator=(const QFlags &f) { i = f.i; return *this; }
@@ -2280,18 +2291,18 @@ public:
inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; }
inline QFlags &operator^=(Enum f) { i ^= f; return *this; }
- inline operator int() const { return i; }
+ Q_DECL_CONSTEXPR inline operator int() const { return i; }
- inline QFlags operator|(QFlags f) const { QFlags g; g.i = i | f.i; return g; }
- inline QFlags operator|(Enum f) const { QFlags g; g.i = i | f; return g; }
- inline QFlags operator^(QFlags f) const { QFlags g; g.i = i ^ f.i; return g; }
- inline QFlags operator^(Enum f) const { QFlags g; g.i = i ^ f; return g; }
- inline QFlags operator&(int mask) const { QFlags g; g.i = i & mask; return g; }
- inline QFlags operator&(uint mask) const { QFlags g; g.i = i & mask; return g; }
- inline QFlags operator&(Enum f) const { QFlags g; g.i = i & f; return g; }
- inline QFlags operator~() const { QFlags g; g.i = ~i; return g; }
+ Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); }
+ Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); }
+ Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); }
+ Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); }
- inline bool operator!() const { return !i; }
+ Q_DECL_CONSTEXPR inline bool operator!() const { return !i; }
inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); }
};
@@ -2304,9 +2315,9 @@ inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \
{ return QIncompatibleFlag(int(f1) | f2); }
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \
-inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) \
{ return QFlags<Flags::enum_type>(f1) | f2; } \
-inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
+Q_DECL_CONSTEXPR inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) \
{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags)
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 99479d0..e247533 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -546,6 +546,7 @@ public:
AA_S60DontConstructApplicationPanes = 8,
AA_S60DisablePartialScreenInputMode = 9,
AA_X11InitThreads = 10,
+ AA_CaptureMultimediaKeys = 11,
// Add new attributes before this line
AA_AttributeCount
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9f59c6e..dc92866 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -156,17 +156,30 @@
whole lifetime. This attribute must be set before QApplication is
constructed.
- \omitvalue AA_S60DisablePartialScreenInputMode By default in Symbian^3,
- a separate editing window is opened on top of an application. This is exactly
- like editing on previous versions of Symbian behave. When this attribute
- is true, a virtual keyboard window is shown on top of application and it
- is ensured that the focused text widget is visible. This is only supported in
- Symbian^3. (internal)
+ \value AA_S60DisablePartialScreenInputMode By default in Symbian^3, a separate
+ editing window is opened on top of an application. This is exactly like
+ editing on previous versions of Symbian behave. When this attribute is false,
+ a non-fullscreen virtual keyboard window is shown on top of application and
+ it is ensured that the focused text input widget is visible.
+ The auto-translation of input widget is only supported for applications
+ based on QGraphicsView, but the non-fullscreen virtual keyboard will
+ work for any kind of application (i.e. QWidgets-based). By default this
+ attribute is true. This attribute must be set after QApplication is
+ constructed. This is only supported in Symbian^3 and later Symbian releases.
\value AA_X11InitThreads Calls XInitThreads() as part of the QApplication
construction in order to make Xlib calls thread-safe. This
attribute must be set before QApplication is constructed.
+ \value AA_CaptureMultimediaKeys Enables application to receive multimedia key events
+ (play, next, previous etc). This includes also external sources such as headsets.
+ Application can not use Remote Control framework on Symbian if this attribute is
+ set. On Symbian, multimedia key event routing may vary between different devices.
+ For example, application on background may receive multimedia key events only if
+ it has active audio stream i.e. it is playing music or video. This attribute must
+ be set before QApplication is constructed. This attribute is only supported in Symbian
+ platform.
+
\omitvalue AA_AttributeCount
*/
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 66edf58..929b2f9 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -358,6 +358,7 @@ QFilePrivate::setError(QFile::FileError err, int errNum)
/*!
\enum QFile::FileHandleFlag
+ \since 4.8
This enum is used when opening a file to specify additional
options which only apply to files and not to a generic
@@ -1657,6 +1658,7 @@ bool QFile::atEnd() const
/*!
\fn bool QFile::seek(qint64 pos)
+ \since 4.8
For random-access devices, this function sets the current position
to \a pos, returning true on success, or false if an error occurred.
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 4b689c5..e900663 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1683,13 +1683,10 @@ QProcessEnvironment QProcess::processEnvironment() const
bool QProcess::waitForStarted(int msecs)
{
Q_D(QProcess);
- if (d->processState == QProcess::Starting) {
- if (!d->waitForStarted(msecs))
- return false;
- setProcessState(QProcess::Running);
- emit started();
- }
- return d->processState == QProcess::Running;
+ if (d->processState == QProcess::Running)
+ return true;
+
+ return d->waitForStarted(msecs);
}
/*! \reimp
diff --git a/src/corelib/tools/qline.cpp b/src/corelib/tools/qline.cpp
index af3b7d5..0f67652 100644
--- a/src/corelib/tools/qline.cpp
+++ b/src/corelib/tools/qline.cpp
@@ -564,8 +564,9 @@ qreal QLineF::length() const
Returns the angle of the line in degrees.
- Positive values for the angles mean counter-clockwise while negative values
- mean the clockwise direction. Zero degrees is at the 3 o'clock position.
+ The return value will be in the range of values from 0.0 up to but not
+ including 360.0. The angles are measured counter-clockwise from a point
+ on the x-axis to the right of the origin (x > 0).
\sa setAngle()
*/
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 36a9c60..e68ddd5 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -237,7 +237,7 @@ void **QListData::append(int n)
if (b - n >= 2 * d->alloc / 3) {
// we have enough space. Just not at the end -> move it.
e -= b;
- ::memcpy(d->array, d->array + b, e * sizeof(void *));
+ ::memmove(d->array, d->array + b, e * sizeof(void *));
d->begin = 0;
} else {
realloc(grow(d->alloc + n));
diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc
index fd139c3..5d4f305 100644
--- a/src/corelib/tools/qlocale.qdoc
+++ b/src/corelib/tools/qlocale.qdoc
@@ -608,6 +608,7 @@
/*!
\enum QLocale::Script
+ \since 4.8
This enumerated type is used to specify a script.
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index bd32fe7..ae6ed71 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -188,6 +188,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(float factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point.
@@ -200,6 +201,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(double factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point. For example:
@@ -214,6 +216,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QPoint &QPoint::operator*=(int factor)
+ \since 4.8
Multiplies this point's coordinates by the given \a factor, and
returns a reference to this point.
@@ -259,6 +262,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, float factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -271,6 +275,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, double factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -283,6 +288,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn const QPoint operator*(const QPoint &point, int factor)
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
@@ -293,6 +299,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(float factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
@@ -301,6 +308,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(double factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
@@ -309,6 +317,7 @@ QT_BEGIN_NAMESPACE
\fn const QPoint operator*(int factor, const QPoint &point)
\overload
\relates QPoint
+ \since 4.8
Returns a copy of the given \a point multiplied by the given \a factor.
*/
diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h
index b15bcac..a24f62e 100644
--- a/src/corelib/tools/qscopedpointer.h
+++ b/src/corelib/tools/qscopedpointer.h
@@ -208,8 +208,10 @@ template <typename T, typename Cleanup = QScopedPointerArrayDeleter<T> >
class QScopedArrayPointer : public QScopedPointer<T, Cleanup>
{
public:
+ inline QScopedArrayPointer() : QScopedPointer<T, Cleanup>(0) {}
+
template <typename D>
- explicit inline QScopedArrayPointer(D *p = 0, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
+ explicit inline QScopedArrayPointer(D *p, typename QtPrivate::QScopedArrayEnsureSameType<T,D>::Type = 0)
: QScopedPointer<T, Cleanup>(p)
{
}
diff --git a/src/corelib/tools/qset.qdoc b/src/corelib/tools/qset.qdoc
index f562c68..31129e0 100644
--- a/src/corelib/tools/qset.qdoc
+++ b/src/corelib/tools/qset.qdoc
@@ -124,6 +124,7 @@
/*!
\fn void QSet::swap(QSet<T> &other)
+ \since 4.8
Swaps set \a other with this set. This operation is very fast and
never fails.
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index ee45cfd..791bfff 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -839,18 +839,21 @@ int QString::grow(int size)
/*!
\typedef QString::const_reference
+ \since 4.8
The QString::const_reference typedef provides an STL-style
const reference for QString.
*/
/*!
\typedef QString::reference
+ \since 4.8
The QString::const_reference typedef provides an STL-style
reference for QString.
*/
/*!
\typedef QString::value_type
+ \since 4.8
The QString::const_reference typedef provides an STL-style
value type for QString.
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index 2159512..f4689b4 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -71,7 +71,7 @@ public:
inline QStringList(const QStringList &l) : QList<QString>(l) { }
inline QStringList(const QList<QString> &l) : QList<QString>(l) { }
#ifdef Q_COMPILER_INITIALIZER_LISTS
- inline QStringList(std::initializer_list<QString> args) : QList(args) { }
+ inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
#endif
inline void sort();
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index caaffd3..9682688 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3381,7 +3381,10 @@ int QXmlStreamWriter::autoFormattingIndent() const
}
/*!
- Returns \c true if the stream failed to write to the underlying device.
+ \since 4.8
+
+ Returns true if the stream failed to write to the underlying device;
+ otherwise returns false.
The error status is never reset. Writes happening after the error
occurred are ignored, even if the error condition is cleared.