}
/*!
- Returns a handle to the type called \a typeName, or QMetaType::UnknownType if there is
- no such type.
+ \internal
- \sa isRegistered(), typeName(), Type
+ Implementation of QMetaType::type().
*/
-int QMetaType::type(const char *typeName)
+template <int tryNormalizedType>
+static inline int qMetaTypeTypeImpl(const char *typeName)
{
int length = qstrlen(typeName);
if (!length)
- return UnknownType;
+ return QMetaType::UnknownType;
int type = qMetaTypeStaticType(typeName, length);
- if (type == UnknownType) {
+ if (type == QMetaType::UnknownType) {
QReadLocker locker(customTypesLock());
type = qMetaTypeCustomType_unlocked(typeName, length);
#ifndef QT_NO_QOBJECT
- if (type == UnknownType) {
+ if ((type == QMetaType::UnknownType) && tryNormalizedType) {
const NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName);
type = qMetaTypeStaticType(normalizedTypeName.constData(),
normalizedTypeName.size());
- if (type == UnknownType) {
+ if (type == QMetaType::UnknownType) {
type = qMetaTypeCustomType_unlocked(normalizedTypeName.constData(),
normalizedTypeName.size());
}
return type;
}
+/*!
+ Returns a handle to the type called \a typeName, or QMetaType::UnknownType if there is
+ no such type.
+
+ \sa isRegistered(), typeName(), Type
+*/
+int QMetaType::type(const char *typeName)
+{
+ return qMetaTypeTypeImpl</*tryNormalizedType=*/true>(typeName);
+}
+
+/*!
+ \a internal
+
+ Similar to QMetaType::type(); the only difference is that this function
+ doesn't attempt to normalize the type name (i.e., the lookup will fail
+ for type names in non-normalized form).
+*/
+int qMetaTypeTypeInternal(const char *typeName)
+{
+ return qMetaTypeTypeImpl</*tryNormalizedType=*/false>(typeName);
+}
+
#ifndef QT_NO_DATASTREAM
/*!
Writes the object pointed to by \a data with the ID \a type to
void signal4();
QT_MOC_COMPAT void signal5();
void signal6(void);
+ void signal7(int, const QString &);
public slots:
void aPublicSlot() { aPublicSlotCalled++; }
QTest::newRow("combo4") << SIGNAL( signal4( void ) )<< SLOT( slot4( void ) );
QTest::newRow("combo5") << SIGNAL( signal6( void ) ) << SLOT( slot4() );
QTest::newRow("combo6") << SIGNAL( signal6() ) << SLOT( slot4() );
+ QTest::newRow("combo7") << SIGNAL( signal7( int , const QString & ) ) << SLOT( slot4() );
}
void tst_QObject::connectDisconnectNotify()