Skip to content

Commit a6e57ac

Browse files
committed
Updates for Qt 6.8
1 parent db93458 commit a6e57ac

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
project(JlQML)
2-
31
cmake_minimum_required(VERSION 3.16.0)
42

5-
set(JlQML_VERSION 0.6.1)
3+
project(JlQML)
4+
5+
set(JlQML_VERSION 0.7.0)
66
message(STATUS "Project version: v${JlQML_VERSION}")
77

88
set(CMAKE_MACOSX_RPATH 1)
@@ -25,6 +25,8 @@ endif()
2525
find_package(Qt6 COMPONENTS Core Gui OpenGL Qml Quick Svg REQUIRED)
2626
find_package(JlCxx)
2727

28+
qt_policy(SET QTP0001 NEW)
29+
2830
get_target_property(QtCore_location Qt6::Core LOCATION)
2931
get_filename_component(QtCore_location ${QtCore_location} DIRECTORY)
3032
get_target_property(JlCxx_location JlCxx::cxxwrap_julia LOCATION)
@@ -43,7 +45,7 @@ endif()
4345
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00)
4446

4547
qt6_add_qml_module(jlqml
46-
URI org.julialang
48+
URI jlqml
4749
VERSION 1.0
4850
NO_GENERATE_PLUGIN_SOURCE
4951
SOURCES

wrap_qml.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jl_datatype_t* julia_type_from_qt_id(int id)
8484
{
8585
if(qmlwrap::g_variant_type_map.count(id) == 0)
8686
{
87-
qWarning() << "invalid variant type " << QMetaType::typeName(id);
87+
qWarning() << "invalid variant type " << QMetaType(id).name();
8888
}
8989
assert(qmlwrap::g_variant_type_map.count(id) == 1);
9090
return qmlwrap::g_variant_type_map[id];
@@ -270,13 +270,13 @@ struct WrapQtAssociativeContainer
270270
wrapped.method("cppsetindex!", [] (WrappedT& hash, const ValueT& v, const KeyT& k) { hash[k] = v; });
271271
wrapped.method("insert", [] (WrappedT& hash, const KeyT& k, const ValueT& v) { hash.insert(k,v); });
272272
wrapped.method("clear", &WrappedT::clear);
273-
wrapped.method("remove", &WrappedT::remove);
273+
wrapped.method("remove", [] (WrappedT& hash, const KeyT& k) -> bool { return hash.remove(k); });
274274
wrapped.method("empty", &WrappedT::empty);
275275
wrapped.method("iteratorbegin", [] (WrappedT& hash) { return IteratorWrapperT<KeyT,ValueT>{hash.begin()}; });
276276
wrapped.method("iteratorend", [] (WrappedT& hash) { return IteratorWrapperT<KeyT,ValueT>{hash.end()}; });
277277
wrapped.method("keys", [] (const WrappedT& hash) { return hash.keys(); });
278278
wrapped.method("values", &WrappedT::values);
279-
wrapped.method("contains", &WrappedT::contains);
279+
wrapped.method("contains", [] (WrappedT& hash, const KeyT& k) -> bool { return hash.contains(k); });
280280
}
281281
};
282282

@@ -441,7 +441,6 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& qml_module)
441441

442442
jlcxx::for_each_parameter_type<qmlwrap::qvariant_types>(qmlwrap::WrapQVariant(qvar_type));
443443
qml_module.method("type", qmlwrap::julia_variant_type);
444-
jlcxx::stl::apply_stl<QVariant>(qml_module);
445444

446445
qml_module.method("make_qvariant_map", [] ()
447446
{
@@ -483,7 +482,7 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& qml_module)
483482
return success;
484483
});
485484

486-
qml_module.method("qt_prefix_path", []() { return QLibraryInfo::location(QLibraryInfo::PrefixPath); });
485+
qml_module.method("qt_prefix_path", []() { return QLibraryInfo::path(QLibraryInfo::PrefixPath); });
487486

488487
auto qquickitem_type = qml_module.add_type<QQuickItem>("QQuickItem", julia_base_type<QObject>());
489488

0 commit comments

Comments
 (0)