From 1e1093868d14dcf0374f5c621f68a82587950f2d Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 29 Oct 2020 07:49:53 +0100 Subject: [PATCH] Qt6 incompatibilities fixed --- qmlexport/QskQml.cpp | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/qmlexport/QskQml.cpp b/qmlexport/QskQml.cpp index 9c72509d..ccc66b2f 100644 --- a/qmlexport/QskQml.cpp +++ b/qmlexport/QskQml.cpp @@ -72,24 +72,6 @@ QSK_QT_PRIVATE_END qmlRegisterSingletonType< className >( QSK_MODULE_NAME, 1, 0, typeName, \ [] ( QQmlEngine*, QJSEngine* ) { return dynamic_cast< QObject* >( singleton ); } ) -#if 0 -// Utility for exposing a namespaced enum to QML, copied from qmlRegisterUncreatableType -#define QSK_REGISTER_NS_ENUM( namespaceName, enumName, typeName ) \ -{ \ - namespace T = namespaceName; \ - QML_GETTYPENAMES \ - QQmlPrivate::RegisterType type = \ - { \ - 1, qRegisterNormalizedMetaType< T::enumName* >( pointerName.constData() ), \ - qRegisterNormalizedMetaType< QQmlListProperty< T::enumName > >( listName.constData() ), \ - 0, nullptr, QString(), QSK_MODULE_NAME, 1, 0, typeName, &T::staticMetaObject, \ - nullptr, nullptr, -1, -1, -1, nullptr, nullptr, nullptr, 0 \ - }; \ - (void) QQmlPrivate::qmlregister(QQmlPrivate::TypeRegistration, &type); \ - (void) qRegisterMetaType< namespaceName::enumName >(); \ -} -#endif - // Expose values in QskRgbValue to QML struct QskRgbValue_Gadget { @@ -163,22 +145,22 @@ class QskMain : public QObject this, nullptr, []( QQmlListProperty< QObject >* property, QObject* value ) { - QskMain* main = static_cast< QskMain* >( property->object ); + auto main = static_cast< QskMain* >( property->object ); main->m_data.append( value ); }, []( QQmlListProperty< QObject >* property ) { - const QskMain* main = static_cast< const QskMain* >( property->object ); - return main->m_data.count(); + auto main = static_cast< const QskMain* >( property->object ); + return static_cast< int >( main->m_data.count() ); }, []( QQmlListProperty< QObject >* property, int index ) { - const QskMain* main = static_cast< const QskMain* >( property->object ); + auto main = static_cast< const QskMain* >( property->object ); return main->m_data.at( index ); }, []( QQmlListProperty< QObject >* property ) { - QskMain* main = static_cast< QskMain* >( property->object ); + auto main = static_cast< QskMain* >( property->object ); main->m_data.clear(); } );