uppercase gadget registrations when having enums only

This commit is contained in:
Uwe Rathmann 2022-11-21 17:31:56 +01:00
parent ea8f426d67
commit 1150c8693d
1 changed files with 6 additions and 4 deletions

View File

@ -125,8 +125,6 @@ namespace
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
registerUncreatableType< T >( className ); registerUncreatableType< T >( className );
#else #else
// the class name without the "Qsk" prefix
/* /*
According to the QML naming rules uncreatables have to According to the QML naming rules uncreatables have to
start with a lowercase letter ( since Qt6 ), while namespaces start with a lowercase letter ( since Qt6 ), while namespaces
@ -140,7 +138,11 @@ namespace
enums are removed from the first and everything else than the enums from enums are removed from the first and everything else than the enums from
the second. TODO ... the second. TODO ...
*/ */
if ( T::staticMetaObject.enumeratorCount() > 0 )
{
registerUncreatableMetaObject( T::staticMetaObject, className ); registerUncreatableMetaObject( T::staticMetaObject, className );
}
QByteArray name = className; QByteArray name = className;
name.data()[0] = std::tolower( name.data()[0] ); name.data()[0] = std::tolower( name.data()[0] );