Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16.0)

project(JlQML)

set(JlQML_VERSION 0.10.2)
set(JlQML_VERSION 0.10.3)
message(STATUS "Project version: v${JlQML_VERSION}")

set(CMAKE_MACOSX_RPATH 1)
Expand Down
3 changes: 2 additions & 1 deletion wrap_qml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ template<> struct SuperType<QCoreApplication> { using type = QObject; };
template<> struct SuperType<QGuiApplication> { using type = QCoreApplication; };
template<> struct SuperType<QQmlComponent> { using type = QObject; };
template<> struct SuperType<QQmlContext> { using type = QObject; };
template<> struct SuperType<QQmlEngine> { using type = QObject; };
template<> struct SuperType<QJSEngine> { using type = QObject; };
template<> struct SuperType<QQmlEngine> { using type = QJSEngine; };
template<> struct SuperType<QQmlPropertyMap> { using type = QObject; };
template<> struct SuperType<qmlwrap::JuliaPropertyMap> { using type = QQmlPropertyMap; };
template<> struct SuperType<QQuickView> { using type = QQuickWindow; };
Expand Down
1 change: 1 addition & 0 deletions wrap_qml_part_a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ void wrap_part_a(jlcxx::Module& qml_module)
using namespace jlcxx;

qml_module.add_type<QObject>("QObject")
.method("parent", &QObject::parent)
.method("deleteLater", &QObject::deleteLater);
qml_module.method("connect_destroyed_signal", [] (QObject& obj, jl_value_t* jl_f)
{
Expand Down
15 changes: 14 additions & 1 deletion wrap_qml_part_b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,20 @@ void wrap_part_b(jlcxx::Module& qml_module)

qml_module.add_type<QQmlImageProviderBase>("QQmlImageProviderBase", julia_base_type<QObject>());

qml_module.add_type<QQmlEngine>("QQmlEngine", julia_base_type<QObject>())
qml_module.add_enum<QJSEngine::ObjectOwnership>("ObjectOwnership",
std::vector<const char*>({
"CppOwnership",
"JavaScriptOwnership"
}),
std::vector<int>({
QJSEngine::CppOwnership,
QJSEngine::JavaScriptOwnership
})
);

qml_module.add_type<QJSEngine>("QJSEngine", julia_base_type<QObject>());
qml_module.method("setObjectOwnership", QJSEngine::setObjectOwnership);
qml_module.add_type<QQmlEngine>("QQmlEngine", julia_base_type<QJSEngine>())
.method("addImageProvider", &QQmlEngine::addImageProvider)
.method("clearComponentCache", &QQmlEngine::clearComponentCache)
.method("clearSingletons", &QQmlEngine::clearSingletons)
Expand Down
Loading