From 1150c8693d240dca820c99698fe33a00417efe48 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 21 Nov 2022 17:31:56 +0100 Subject: [PATCH] uppercase gadget registrations when having enums only --- qmlexport/QskQml.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qmlexport/QskQml.cpp b/qmlexport/QskQml.cpp index 509d3a79..4b8bd6c8 100644 --- a/qmlexport/QskQml.cpp +++ b/qmlexport/QskQml.cpp @@ -125,11 +125,9 @@ namespace #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) registerUncreatableType< T >( className ); #else - // the class name without the "Qsk" prefix - /* 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 and creatable items usually start with a upper letter. This results in an odd naming scheme for the enums defined inside of gadgets. @@ -140,7 +138,11 @@ namespace enums are removed from the first and everything else than the enums from the second. TODO ... */ - registerUncreatableMetaObject( T::staticMetaObject, className ); + + if ( T::staticMetaObject.enumeratorCount() > 0 ) + { + registerUncreatableMetaObject( T::staticMetaObject, className ); + } QByteArray name = className; name.data()[0] = std::tolower( name.data()[0] );