summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-01-06 07:33:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-08 23:54:56 +0100
commit7aeccb183a827e8504d7dd8614d1ca555caf61d9 (patch)
treef8b300daa82ffe59bb8007891be05c04ab625af4 /src
parent7e40ea4499ff9a6a96bf71019428dbb08876a2cd (diff)
Remove the Q_TYPENAME define.
It is mostly not used (most places in Qt use typename directly), so is already not very useful. For example typename is used in: QDataStream& operator<<(QDataStream& s, const QVector<T>& v) Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qglobal.h6
-rw-r--r--src/corelib/io/qdebug.h2
-rw-r--r--src/corelib/tools/qvector.h4
-rw-r--r--src/testlib/qbenchmark.cpp8
-rw-r--r--src/widgets/graphicsview/qgraph_p.h6
-rw-r--r--src/widgets/kernel/qformlayout.cpp2
6 files changed, 11 insertions, 17 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index f07a48eca4..b1bd425852 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -552,7 +552,6 @@ namespace QT_NAMESPACE {}
# define Q_NO_BOOL_TYPE
# define Q_NO_EXPLICIT_KEYWORD
# define Q_NO_USING_KEYWORD
-# define Q_TYPENAME
# define Q_OUTOFLINE_TEMPLATE inline
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
@@ -586,7 +585,6 @@ namespace QT_NAMESPACE {}
/* Apply to all versions prior to Compaq C++ V6.0-000 - observed on
DEC C++ V5.5-004. */
# if __DECCXX_VER < 60060000
-# define Q_TYPENAME
# define Q_BROKEN_TEMPLATE_SPECIALIZATION
# define Q_CANNOT_DELETE_CONSTANT
# endif
@@ -1619,10 +1617,6 @@ inline int qMacVersion() { return QSysInfo::MacintoshVersion; }
# define Q_INLINE_TEMPLATE inline
#endif
-#ifndef Q_TYPENAME
-# define Q_TYPENAME typename
-#endif
-
/*
Avoid "unused parameter" warnings
*/
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index ecef792e70..0654bf6f25 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -159,7 +159,7 @@ inline QDebug operator<<(QDebug debug, const QList<T> &list)
#endif
{
debug.nospace() << '(';
- for (Q_TYPENAME QList<T>::size_type i = 0; i < list.count(); ++i) {
+ for (typename QList<T>::size_type i = 0; i < list.count(); ++i) {
if (i)
debug << ", ";
debug << list.at(i);
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 17f51fb575..2e8abcad25 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -591,7 +591,7 @@ void QVector<T>::append(const T &t)
}
template <typename T>
-Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
+typename QVector<T>::iterator QVector<T>::insert(iterator before, size_type n, const T &t)
{
int offset = int(before - p->array);
if (n != 0) {
@@ -625,7 +625,7 @@ Q_TYPENAME QVector<T>::iterator QVector<T>::insert(iterator before, size_type n,
}
template <typename T>
-Q_TYPENAME QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
+typename QVector<T>::iterator QVector<T>::erase(iterator abegin, iterator aend)
{
int f = int(abegin - p->array);
int l = int(aend - p->array);
diff --git a/src/testlib/qbenchmark.cpp b/src/testlib/qbenchmark.cpp
index 02644f7dc3..b637a6e337 100644
--- a/src/testlib/qbenchmark.cpp
+++ b/src/testlib/qbenchmark.cpp
@@ -285,11 +285,11 @@ void QTest::setBenchmarkResult(qreal result, QTest::QBenchmarkMetric metric)
}
template <typename T>
-Q_TYPENAME T::value_type qAverage(const T &container)
+typename T::value_type qAverage(const T &container)
{
- Q_TYPENAME T::const_iterator it = container.constBegin();
- Q_TYPENAME T::const_iterator end = container.constEnd();
- Q_TYPENAME T::value_type acc = Q_TYPENAME T::value_type();
+ typename T::const_iterator it = container.constBegin();
+ typename T::const_iterator end = container.constEnd();
+ typename T::value_type acc = typename T::value_type();
int count = 0;
while (it != end) {
acc += *it;
diff --git a/src/widgets/graphicsview/qgraph_p.h b/src/widgets/graphicsview/qgraph_p.h
index 7c5b07f05d..676000ac3e 100644
--- a/src/widgets/graphicsview/qgraph_p.h
+++ b/src/widgets/graphicsview/qgraph_p.h
@@ -121,8 +121,8 @@ public:
private:
const Graph *g;
- Q_TYPENAME QHash<Vertex *, QHash<Vertex *, EdgeData *> * >::const_iterator row;
- Q_TYPENAME QHash<Vertex *, EdgeData *>::const_iterator column;
+ typename QHash<Vertex *, QHash<Vertex *, EdgeData *> * >::const_iterator row;
+ typename QHash<Vertex *, EdgeData *>::const_iterator column;
};
const_iterator constBegin() const {
@@ -228,7 +228,7 @@ public:
QString edges;
QSet<Vertex *> setOfVertices = vertices();
- for (Q_TYPENAME QSet<Vertex*>::const_iterator it = setOfVertices.begin(); it != setOfVertices.end(); ++it) {
+ for (typename QSet<Vertex*>::const_iterator it = setOfVertices.begin(); it != setOfVertices.end(); ++it) {
Vertex *v = *it;
QList<Vertex*> adjacents = adjacentVertices(v);
for (int i = 0; i < adjacents.count(); ++i) {
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index e902e4c9ac..955ef4e3c7 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -93,7 +93,7 @@ void FixedColumnMatrix<T, NumColumns>::addRow(const T &value)
template <class T, int NumColumns>
void FixedColumnMatrix<T, NumColumns>::insertRow(int r, const T &value)
{
- Q_TYPENAME Storage::iterator it = m_storage.begin();
+ typename Storage::iterator it = m_storage.begin();
it += r * NumColumns;
m_storage.insert(it, NumColumns, value);
}