diff --git a/src/declarative/CMakeLists.txt b/src/declarative/CMakeLists.txt --- a/src/declarative/CMakeLists.txt +++ b/src/declarative/CMakeLists.txt @@ -1,7 +1,8 @@ +qt5_wrap_cpp(kpeopledeclarative_SRCS ../widgets/actions.cpp) add_library(KF5PeopleDeclarative SHARED declarativepersondata.cpp personactionsmodel.cpp - peopleqmlplugin.cpp) + peopleqmlplugin.cpp ${kpeopledeclarative_SRCS}) target_link_libraries(KF5PeopleDeclarative Qt5::Qml diff --git a/src/declarative/peopleqmlplugin.cpp b/src/declarative/peopleqmlplugin.cpp --- a/src/declarative/peopleqmlplugin.cpp +++ b/src/declarative/peopleqmlplugin.cpp @@ -69,6 +69,8 @@ #endif qmlRegisterUncreatableType(uri, 1, 0, "ActionType", QStringLiteral("You cannot create ActionType")); qmlRegisterSingletonType(uri, 1, 0, "PersonPluginManager", [] (QQmlEngine*, QJSEngine*) -> QObject* { return new DeclarativePersonPluginManager; }); + + qmlRegisterUncreatableMetaObject(KPeople::staticMetaObject, uri, 1, 0, "KPeople", QStringLiteral("Access to enums & flags only")); } #include "peopleqmlplugin.moc" diff --git a/src/widgets/actions.h b/src/widgets/actions.h --- a/src/widgets/actions.h +++ b/src/widgets/actions.h @@ -20,13 +20,15 @@ #define KPEOPLEWIDGETS_ACTIONS_H #include +#include #include class QString; class QObject; class QAction; namespace KPeople { +Q_NAMESPACE class PersonData; /** @@ -43,6 +45,7 @@ SendFileAction, OtherAction = 100 }; +Q_ENUM_NS(ActionType) /** * Returns a list of actions relevant to the specified @p contactUri where