diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fccff9..9cd0025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,4 +4,4 @@ set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_TYPE_NAMES ${REACT_NATIVE_DESKTOP_EXTE \"RNRandomBytes\" PARENT_SCOPE) set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_SRC ${REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_SRC} - ${CMAKE_CURRENT_SOURCE_DIR}/rnrandombytesdesktop.cpp PARENT__SCOPE) + ${CMAKE_CURRENT_SOURCE_DIR}/rnrandombytesdesktop.cpp PARENT_SCOPE) diff --git a/rnrandombytesdesktop.cpp b/rnrandombytesdesktop.cpp index 7d56ddd..1227d59 100644 --- a/rnrandombytesdesktop.cpp +++ b/rnrandombytesdesktop.cpp @@ -13,7 +13,7 @@ #include #include "bridge.h" -#include "rnrandombytes.h" +#include "rnrandombytesdesktop.h" #include #include #include @@ -22,6 +22,15 @@ #include #include + +namespace { +struct RegisterQMLMetaType { + RegisterQMLMetaType() { + qRegisterMetaType(); + } +} registerMetaType; +} // namespace + class RNRandomBytesPrivate { public: diff --git a/rnrandombytesdesktop.h b/rnrandombytesdesktop.h index c891871..f86fc5c 100644 --- a/rnrandombytesdesktop.h +++ b/rnrandombytesdesktop.h @@ -31,7 +31,7 @@ public: typedef std::function LoadEventCallback; - RNRandomBytes(QObject* parent = 0); + Q_INVOKABLE RNRandomBytes(QObject* parent = 0); ~RNRandomBytes(); QString moduleName() override;