summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorminiak <milan.burda@gmail.com>2010-08-03 16:33:12 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-03 16:35:28 (GMT)
commit26f43dcc70a0bcc8aec96a0ca6f648c543b97b10 (patch)
treea387f04203570a75e347abd78cf765e9903c9e36
parent02e5a6c9abe9562ce2b2057c0b89f65d371c5b40 (diff)
downloadQt-26f43dcc70a0bcc8aec96a0ca6f648c543b97b10.zip
Qt-26f43dcc70a0bcc8aec96a0ca6f648c543b97b10.tar.gz
Qt-26f43dcc70a0bcc8aec96a0ca6f648c543b97b10.tar.bz2
It is no longer necessary to check for QT_NO_MEMBER_TEMPLATES
Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
-rw-r--r--src/corelib/concurrent/qfuture.h2
-rw-r--r--src/corelib/io/qdebug.h4
-rw-r--r--src/corelib/kernel/qobject.h6
-rw-r--r--src/corelib/kernel/qobjectdefs.h4
-rw-r--r--src/corelib/kernel/qvariant.h6
-rw-r--r--src/corelib/tools/qshareddata.h2
-rw-r--r--src/corelib/tools/qsharedpointer.cpp4
-rw-r--r--src/corelib/tools/qsharedpointer.h3
-rw-r--r--src/gui/math3d/qmatrix4x4.cpp4
-rw-r--r--src/gui/math3d/qmatrix4x4.h10
-rw-r--r--src/script/api/qscriptengine.h8
-rw-r--r--src/xmlpatterns/utils/qautoptr_p.h2
-rw-r--r--tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp6
-rw-r--r--tests/auto/qobject/tst_qobject.cpp2
-rw-r--r--tests/auto/qscriptengine/tst_qscriptengine.cpp2
15 files changed, 9 insertions, 56 deletions
diff --git a/src/corelib/concurrent/qfuture.h b/src/corelib/concurrent/qfuture.h
index 02ae40a..2856f5e 100644
--- a/src/corelib/concurrent/qfuture.h
+++ b/src/corelib/concurrent/qfuture.h
@@ -210,7 +210,7 @@ public:
bool operator==(const QFuture &other) const { return (d == other.d); }
bool operator!=(const QFuture &other) const { return (d != other.d); }
-#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(Q_CC_XLC)
+#if !defined(Q_CC_XLC)
template <typename T>
QFuture(const QFuture<T> &other)
: d(other.d)
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index 093312f..0591318 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -137,10 +137,8 @@ public:
inline QNoDebug &nospace() { return *this; }
inline QNoDebug &maybeSpace() { return *this; }
-#ifndef QT_NO_MEMBER_TEMPLATES
template<typename T>
inline QNoDebug &operator<<(const T &) { return *this; }
-#endif
};
Q_CORE_EXPORT_INLINE QDebug qCritical() { return QDebug(QtCriticalMsg); }
@@ -285,10 +283,8 @@ Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }
inline QNoDebug qDebug() { return QNoDebug(); }
#define qDebug QT_NO_QDEBUG_MACRO
-#ifdef QT_NO_MEMBER_TEMPLATES
template<typename T>
inline QNoDebug operator<<(QNoDebug debug, const T &) { return debug; }
-#endif
#endif
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 7f0084c..c8aa2b5 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -156,7 +156,6 @@ public:
int startTimer(int interval);
void killTimer(int id);
-#ifndef QT_NO_MEMBER_TEMPLATES
template<typename T>
inline T findChild(const QString &aName = QString()) const
{ return qFindChild<T>(this, aName); }
@@ -170,7 +169,6 @@ public:
inline QList<T> findChildren(const QRegExp &re) const
{ return qFindChildren<T>(this, re); }
#endif
-#endif
#ifdef QT3_SUPPORT
QT3_SUPPORT QObject *child(const char *objName, const char *inheritsClass = 0,
@@ -369,7 +367,7 @@ inline QList<T> qFindChildren(const QObject *o, const QRegExp &re)
template <class T>
inline T qobject_cast(QObject *object)
{
-#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(QT_NO_QOBJECT_CHECK)
+#if !defined(QT_NO_QOBJECT_CHECK)
reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(object));
#endif
return static_cast<T>(reinterpret_cast<T>(0)->staticMetaObject.cast(object));
@@ -382,7 +380,7 @@ inline T qobject_cast(const QObject *object)
register T ptr = static_cast<T>(object);
Q_UNUSED(ptr);
-#if !defined(QT_NO_MEMBER_TEMPLATES) && !defined(QT_NO_QOBJECT_CHECK)
+#if !defined(QT_NO_QOBJECT_CHECK)
reinterpret_cast<T>(0)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(object)));
#endif
return static_cast<T>(const_cast<QObject *>(reinterpret_cast<T>(0)->staticMetaObject.cast(const_cast<QObject *>(object))));
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
index 555a1f5..996fce2 100644
--- a/src/corelib/kernel/qobjectdefs.h
+++ b/src/corelib/kernel/qobjectdefs.h
@@ -117,7 +117,7 @@ class QString;
# define QT_TR_FUNCTIONS
#endif
-#if defined(QT_NO_MEMBER_TEMPLATES) || defined(QT_NO_QOBJECT_CHECK)
+#if defined(QT_NO_QOBJECT_CHECK)
/* tmake ignore Q_OBJECT */
#define Q_OBJECT_CHECK
#else
@@ -144,7 +144,7 @@ inline int qYouForgotTheQ_OBJECT_Macro(T, T) { return 0; }
template <typename T1, typename T2>
inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
-#endif // QT_NO_MEMBER_TEMPLATES
+#endif // QT_NO_QOBJECT_CHECK
#ifdef Q_NO_DATA_RELOCATION
#define Q_OBJECT_GETSTATICMETAOBJECT static const QMetaObject &getStaticMetaObject();
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index cb2825c..73b00e9 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -83,7 +83,6 @@ class QUrl;
class QVariant;
class QVariantComparisonHelper;
-#ifndef QT_NO_MEMBER_TEMPLATES
template <typename T>
inline QVariant qVariantFromValue(const T &);
@@ -95,7 +94,6 @@ inline T qVariantValue(const QVariant &);
template<typename T>
inline bool qVariantCanConvert(const QVariant &);
-#endif
class Q_CORE_EXPORT QVariant
{
@@ -327,7 +325,6 @@ class Q_CORE_EXPORT QVariant
const void *constData() const;
inline const void *data() const { return constData(); }
-#ifndef QT_NO_MEMBER_TEMPLATES
template<typename T>
inline void setValue(const T &value);
@@ -342,7 +339,6 @@ class Q_CORE_EXPORT QVariant
template<typename T>
bool canConvert() const
{ return qVariantCanConvert<T>(*this); }
-#endif
public:
#ifndef qdoc
@@ -527,11 +523,9 @@ inline QSize &QVariant::asSize()
{ return *reinterpret_cast<QSize *>(castOrDetach(Size)); }
#endif //QT3_SUPPORT
-#ifndef QT_NO_MEMBER_TEMPLATES
template<typename T>
inline void QVariant::setValue(const T &avalue)
{ qVariantSetValue(*this, avalue); }
-#endif
#ifndef QT_NO_DATASTREAM
Q_CORE_EXPORT QDataStream& operator>> (QDataStream& s, QVariant& p);
diff --git a/src/corelib/tools/qshareddata.h b/src/corelib/tools/qshareddata.h
index 7e9934d..80ba7b7 100644
--- a/src/corelib/tools/qshareddata.h
+++ b/src/corelib/tools/qshareddata.h
@@ -161,14 +161,12 @@ public:
explicit QExplicitlySharedDataPointer(T *data);
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<T> &o) : d(o.d) { if (d) d->ref.ref(); }
-#ifndef QT_NO_MEMBER_TEMPLATES
template<class X>
inline QExplicitlySharedDataPointer(const QExplicitlySharedDataPointer<X> &o) : d(static_cast<T *>(o.data()))
{
if(d)
d->ref.ref();
}
-#endif
inline QExplicitlySharedDataPointer<T> & operator=(const QExplicitlySharedDataPointer<T> &o) {
if (o.d != d) {
diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp
index 1b4b356..bad2897 100644
--- a/src/corelib/tools/qsharedpointer.cpp
+++ b/src/corelib/tools/qsharedpointer.cpp
@@ -1275,8 +1275,6 @@ QT_END_NAMESPACE
-#if !defined(QT_NO_MEMBER_TEMPLATES)
-
//# define QT_SHARED_POINTER_BACKTRACE_SUPPORT
# ifdef QT_SHARED_POINTER_BACKTRACE_SUPPORT
# if defined(__GLIBC__) && (__GLIBC__ >= 2) && !defined(__UCLIBC__) && !defined(QT_LINUXBASE)
@@ -1501,5 +1499,3 @@ void QtSharedPointer::internalSafetyCheckCleanCheck()
}
QT_END_NAMESPACE
-
-#endif
diff --git a/src/corelib/tools/qsharedpointer.h b/src/corelib/tools/qsharedpointer.h
index c51ade6..e0f4dca 100644
--- a/src/corelib/tools/qsharedpointer.h
+++ b/src/corelib/tools/qsharedpointer.h
@@ -47,10 +47,7 @@
#include <QtCore/qshareddata.h>
#ifndef Q_QDOC
-# if !defined(QT_NO_MEMBER_TEMPLATES)
-// QSharedPointer requires member template support
# include <QtCore/qsharedpointer_impl.h>
-# endif
#else
QT_BEGIN_HEADER
diff --git a/src/gui/math3d/qmatrix4x4.cpp b/src/gui/math3d/qmatrix4x4.cpp
index 16c7f97..04a9099 100644
--- a/src/gui/math3d/qmatrix4x4.cpp
+++ b/src/gui/math3d/qmatrix4x4.cpp
@@ -102,8 +102,6 @@ QMatrix4x4::QMatrix4x4(const qreal *values)
\sa optimize()
*/
-#if !defined(QT_NO_MEMBER_TEMPLATES) || defined(Q_QDOC)
-
/*!
\fn QMatrix4x4::QMatrix4x4(const QGenericMatrix<N, M, qreal>& matrix)
@@ -126,8 +124,6 @@ QMatrix4x4::QMatrix4x4(const qreal *values)
\sa qGenericMatrixFromMatrix4x4()
*/
-#endif
-
/*!
\fn QMatrix4x4 qGenericMatrixToMatrix4x4(const QGenericMatrix<N, M, qreal>& matrix)
\relates QMatrix4x4
diff --git a/src/gui/math3d/qmatrix4x4.h b/src/gui/math3d/qmatrix4x4.h
index 0671fa8..1f77d36 100644
--- a/src/gui/math3d/qmatrix4x4.h
+++ b/src/gui/math3d/qmatrix4x4.h
@@ -69,10 +69,10 @@ public:
qreal m21, qreal m22, qreal m23, qreal m24,
qreal m31, qreal m32, qreal m33, qreal m34,
qreal m41, qreal m42, qreal m43, qreal m44);
-#if !defined(QT_NO_MEMBER_TEMPLATES) || defined(Q_QDOC)
+
template <int N, int M>
explicit QMatrix4x4(const QGenericMatrix<N, M, qreal>& matrix);
-#endif
+
QMatrix4x4(const qreal *values, int cols, int rows);
QMatrix4x4(const QTransform& transform);
QMatrix4x4(const QMatrix& matrix);
@@ -169,10 +169,8 @@ public:
QRect mapRect(const QRect& rect) const;
QRectF mapRect(const QRectF& rect) const;
-#if !defined(QT_NO_MEMBER_TEMPLATES) || defined(Q_QDOC)
template <int N, int M>
QGenericMatrix<N, M, qreal> toGenericMatrix() const;
-#endif
inline qreal *data();
inline const qreal *data() const { return m[0]; }
@@ -223,8 +221,6 @@ inline QMatrix4x4::QMatrix4x4
flagBits = General;
}
-#if !defined(QT_NO_MEMBER_TEMPLATES)
-
template <int N, int M>
Q_INLINE_TEMPLATE QMatrix4x4::QMatrix4x4
(const QGenericMatrix<N, M, qreal>& matrix)
@@ -261,8 +257,6 @@ QGenericMatrix<N, M, qreal> QMatrix4x4::toGenericMatrix() const
return result;
}
-#endif
-
inline const qreal& QMatrix4x4::operator()(int aRow, int aColumn) const
{
Q_ASSERT(aRow >= 0 && aRow < 4 && aColumn >= 0 && aColumn < 4);
diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h
index 1fe65db..6add6ed 100644
--- a/src/script/api/qscriptengine.h
+++ b/src/script/api/qscriptengine.h
@@ -65,13 +65,11 @@ inline QScriptValue qscriptQMetaObjectConstructor(QScriptContext *, QScriptEngin
class QRegExp;
#endif
-#ifndef QT_NO_MEMBER_TEMPLATES
template <typename T>
inline QScriptValue qScriptValueFromValue(QScriptEngine *, const T &);
template <typename T>
inline T qScriptValueToValue(const QScriptValue &);
-#endif
class QScriptSyntaxCheckResultPrivate;
class Q_SCRIPT_EXPORT QScriptSyntaxCheckResult
@@ -196,9 +194,7 @@ public:
QScriptValue newQMetaObject(const QMetaObject *metaObject, const QScriptValue &ctor = QScriptValue());
-# ifndef QT_NO_MEMBER_TEMPLATES
template <class T> QScriptValue scriptValueFromQMetaObject();
-# endif // QT_NO_MEMBER_TEMPLATES
#endif // QT_NO_QOBJECT
@@ -213,7 +209,6 @@ public:
-#ifndef QT_NO_MEMBER_TEMPLATES
template <typename T>
inline QScriptValue toScriptValue(const T &value)
{
@@ -224,7 +219,6 @@ public:
{
return qScriptValueToValue<T>(value);
}
-#endif // QT_NO_MEMBER_TEMPLATES
void installTranslatorFunctions(const QScriptValue &object = QScriptValue());
@@ -311,12 +305,10 @@ template<> inline QScriptValue qscriptQMetaObjectConstructor<T>(QScriptContext *
return o; \
}
-# ifndef QT_NO_MEMBER_TEMPLATES
template <class T> QScriptValue QScriptEngine::scriptValueFromQMetaObject()
{
return qScriptValueFromQMetaObject<T>(this);
}
-# endif // QT_NO_MEMBER_TEMPLATES
#endif // QT_NO_QOBJECT
diff --git a/src/xmlpatterns/utils/qautoptr_p.h b/src/xmlpatterns/utils/qautoptr_p.h
index 060e7be..173999f 100644
--- a/src/xmlpatterns/utils/qautoptr_p.h
+++ b/src/xmlpatterns/utils/qautoptr_p.h
@@ -122,7 +122,6 @@ namespace QPatternist
return *this;
}
-#ifndef QT_NO_MEMBER_TEMPLATES
template<typename L>
operator AutoPtrRef<L>()
{
@@ -139,7 +138,6 @@ namespace QPatternist
inline AutoPtr(AutoPtr<L>& other) : m_ptr(other.release())
{
}
-#endif
inline T *release()
{
diff --git a/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
index 5709196..22c679a 100644
--- a/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -2822,10 +2822,9 @@ void tst_QMatrixNxN::convertGeneric()
9.0f, 10.0f, 11.0f, 12.0f,
0.0f, 0.0f, 0.0f, 1.0f
};
-#if !defined(QT_NO_MEMBER_TEMPLATES)
QMatrix4x4 m4(m1);
QVERIFY(isSame(m4, unique4x4));
-#endif
+
QMatrix4x4 m5 = qGenericMatrixToMatrix4x4(m1);
QVERIFY(isSame(m5, unique4x4));
@@ -2835,10 +2834,9 @@ void tst_QMatrixNxN::convertGeneric()
9.0f, 10.0f, 11.0f, 12.0f
};
QMatrix4x4 m9(uniqueValues4);
-#if !defined(QT_NO_MEMBER_TEMPLATES)
+
QMatrix4x3 m10 = m9.toGenericMatrix<4, 3>();
QVERIFY(isSame(m10, conv4x4));
-#endif
QMatrix4x3 m11 = qGenericMatrixFromMatrix4x4<4, 3>(m9);
QVERIFY(isSame(m11, conv4x4));
diff --git a/tests/auto/qobject/tst_qobject.cpp b/tests/auto/qobject/tst_qobject.cpp
index 5caac15..fc38a84 100644
--- a/tests/auto/qobject/tst_qobject.cpp
+++ b/tests/auto/qobject/tst_qobject.cpp
@@ -669,11 +669,9 @@ void tst_QObject::findChildren()
l = qFindChildren<QObject*>(&o, "unnamed");
QCOMPARE(l.size(), 0);
-#ifndef QT_NO_MEMBER_TEMPLATES
tl = o.findChildren<QTimer *>("t1");
QCOMPARE(tl.size(), 1);
QCOMPARE(tl.at(0), &t1);
-#endif
}
diff --git a/tests/auto/qscriptengine/tst_qscriptengine.cpp b/tests/auto/qscriptengine/tst_qscriptengine.cpp
index 81fb749..04b2627 100644
--- a/tests/auto/qscriptengine/tst_qscriptengine.cpp
+++ b/tests/auto/qscriptengine/tst_qscriptengine.cpp
@@ -1909,7 +1909,6 @@ void tst_QScriptEngine::valueConversion()
QString snum = qScriptValueToValue<QString>(num);
QCOMPARE(snum, QLatin1String("123"));
}
-#ifndef QT_NO_MEMBER_TEMPLATES
{
QScriptValue num = eng.toScriptValue(123);
QCOMPARE(num.isNumber(), true);
@@ -1921,7 +1920,6 @@ void tst_QScriptEngine::valueConversion()
QString snum = eng.fromScriptValue<QString>(num);
QCOMPARE(snum, QLatin1String("123"));
}
-#endif
{
QScriptValue num(&eng, 123);
QCOMPARE(qScriptValueToValue<char>(num), char(123));