diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-05-21 15:24:19 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-22 09:21:28 +0200 |
commit | 4f485fab26b986a38b0caee7bbf4b16cd265f329 (patch) | |
tree | 48ff359227fa93b91a8a21bea583cdf616a4a851 /tools | |
parent | 1ab6740fd3d4d7dfcf9cd3b167fd34cc32532c8e (diff) | |
download | qtxmlpatterns-4f485fab26b986a38b0caee7bbf4b16cd265f329.tar.gz |
Simplify a type information access.
Change-Id: Ife446a14400f5fcb0704f9571015e26f2f6b101a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/xmlpatterns/qapplicationargumentparser.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/xmlpatterns/qapplicationargumentparser.cpp b/tools/xmlpatterns/qapplicationargumentparser.cpp index 62a15cc..c5dad71 100644 --- a/tools/xmlpatterns/qapplicationargumentparser.cpp +++ b/tools/xmlpatterns/qapplicationargumentparser.cpp @@ -845,7 +845,7 @@ QVariant QApplicationArgumentParser::convertToValue(const QApplicationArgument & QVariant result(input); if(QApplicationArgumentParserPrivate::isBuiltinVariant(type) && - result.convert(QVariant::Type(type))) + result.convert(type)) return result; else return QApplicationArgumentParserPrivate::conversionError(typeToName(argument), input); @@ -859,7 +859,7 @@ QVariant QApplicationArgumentParser::convertToValue(const QApplicationArgument & convertToValue() calls this function when requiring a string for referring to \a type, when generating user messages. - The implementation uses QVariant::typeToName() for most types, but special handles + The implementation uses QMetaType::typeName() for most types, but special handles some types, in order to let the message be better tailored for humans. \sa convertToValue() @@ -880,10 +880,7 @@ QString QApplicationArgumentParser::typeToName(const QApplicationArgument &argum return QLatin1String("string"); default: { - if(QApplicationArgumentParserPrivate::isBuiltinVariant(type)) - return QString::fromLatin1(QVariant::typeToName(QVariant::Type(type))); - else - return QLatin1String(QVariant(type, static_cast<void *>(0)).typeName()); + return QString::fromLatin1(QMetaType::typeName(type)); } } } |