moc: Fix Generator::registerableMetaType

when the type is a pointer to a registerable 1 argument template type.

Task-number: QTBUG-31002
Change-Id: Iac0d6b71b2b805a1876110a0781d02188083c4e5
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Olivier Goffart 2013-05-18 16:26:16 +02:00 committed by The Qt Project
parent 403c46b9b7
commit e63b831bbd
2 changed files with 4 additions and 2 deletions

View File

@ -172,12 +172,12 @@ bool Generator::registerableMetaType(const QByteArray &propertyType)
#undef STREAM_1ARG_TEMPLATE
;
foreach (const QByteArray &oneArgTemplateType, oneArgTemplates)
if (propertyType.startsWith(oneArgTemplateType + "<") && !propertyType.endsWith("&")) {
if (propertyType.startsWith(oneArgTemplateType + "<") && propertyType.endsWith(">")) {
const int argumentSize = propertyType.size() - oneArgTemplateType.size() - 1
// The closing '>'
- 1
// templates inside templates have an extra whitespace char to strip.
- (propertyType.at(propertyType.size() - 2) == '>' ? 1 : 0 );
- (propertyType.at(propertyType.size() - 2) == ' ' ? 1 : 0 );
const QByteArray templateArg = propertyType.mid(oneArgTemplateType.size() + 1, argumentSize);
return isBuiltinType(templateArg) || registerableMetaType(templateArg);
}

View File

@ -325,6 +325,8 @@ public slots:
signals:
void signalWithArray(const double[3]);
void signalWithNamedArray(const double namedArray[3]);
void signalWithIterator(QList<QUrl>::iterator);
void signalWithListPointer(QList<QUrl>*); //QTBUG-31002
private slots:
// for tst_Moc::preprocessorConditionals