summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/kernel/qmetaobject_p.h3
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobject_p.h b/src/corelib/kernel/qmetaobject_p.h
index 7afb70b..83ca9af 100644
--- a/src/corelib/kernel/qmetaobject_p.h
+++ b/src/corelib/kernel/qmetaobject_p.h
@@ -295,6 +295,9 @@ static QByteArray normalizeTypeInternal(const char *t, const char *e, bool fixSc
} else if (!star) {
// move const to the front (but not if const comes after a *)
result.prepend("const ");
+ } else {
+ // keep const after a *
+ result += "const";
}
}
}
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index 8331ca1..fb62312 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -664,7 +664,7 @@ void tst_QMetaObject::normalizedSignature_data()
QTest::newRow("const rettype") << "const QString *foo()" << "const QString*foo()";
QTest::newRow("const ref") << "const QString &foo()" << "const QString&foo()";
QTest::newRow("reference") << "QString &foo()" << "QString&foo()";
- QTest::newRow("const2") << "void foo(QString const *)" << "void foo(const QString*)";
+ QTest::newRow("const1") << "void foo(QString const *)" << "void foo(const QString*)";
QTest::newRow("const2") << "void foo(QString * const)" << "void foo(QString*const)";
QTest::newRow("const3") << "void foo(QString const &)" << "void foo(QString)";
QTest::newRow("const4") << "void foo(const int)" << "void foo(int)";
@@ -672,7 +672,7 @@ void tst_QMetaObject::normalizedSignature_data()
<< "void foo(int,int,int,int)";
QTest::newRow("const6") << "void foo(QList<const int>)" << "void foo(QList<const int>)";
QTest::newRow("const7") << "void foo(QList<const int*>)" << "void foo(QList<const int*>)";
- QTest::newRow("const7") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)";
+ QTest::newRow("const8") << "void foo(QList<int const*>)" << "void foo(QList<const int*>)";
}
void tst_QMetaObject::normalizedSignature()