diff --git a/Project.toml b/Project.toml index 47b697e..e3ea426 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "QML" uuid = "2db162a6-7e43-52c3-8d84-290c1c42d82a" -version = "0.13.0" +version = "0.13.1" authors = ["Bart Janssens "] [deps] @@ -30,7 +30,7 @@ MacroTools = "0.5" Observables = "0.5" Qt6Svg_jll = "6.10" Qt6Wayland_jll = "6.10" -jlqml_jll = "0.10.0" +jlqml_jll = "0.10.2" julia = "1.10" [extras] diff --git a/ext/Qt6Quick3DExt.jl b/ext/Qt6Quick3DExt.jl index 7f34c31..d9bc785 100644 --- a/ext/Qt6Quick3DExt.jl +++ b/ext/Qt6Quick3DExt.jl @@ -5,6 +5,7 @@ using Qt6Quick3D_jll function __init__() QML.loadqmljll(Qt6Quick3D_jll) + QML.add_plugin_path(Qt6Quick3D_jll) end end diff --git a/src/QML.jl b/src/QML.jl index f595832..5654ec6 100644 --- a/src/QML.jl +++ b/src/QML.jl @@ -148,13 +148,7 @@ end function add_plugin_path(m::Module) pluginpath = joinpath(m.artifact_dir, "plugins") - separator = Sys.iswindows() ? ';' : ':' - oldpath = get(ENV, "QT_PLUGIN_PATH", "") - newpath = isempty(oldpath) ? pluginpath : oldpath * separator * pluginpath - ENV["QT_PLUGIN_PATH"] = newpath - @static if Sys.iswindows() - qputenv("QT_PLUGIN_PATH", QByteArray(newpath)) - end + addLibraryPath(pluginpath) end # Persistent C++ - compatible storage of the command line arguments, passed to the QGuiApplication constructor diff --git a/test/labsplatform.jl b/test/labsplatform.jl new file mode 100644 index 0000000..b5adfa8 --- /dev/null +++ b/test/labsplatform.jl @@ -0,0 +1,6 @@ +using QML +using Test + +qmlfile = joinpath(dirname(@__FILE__), "qml", "labsplatform.qml") +loadqml(qmlfile) +exec() diff --git a/test/qml/labsplatform.qml b/test/qml/labsplatform.qml new file mode 100644 index 0000000..a74ba0c --- /dev/null +++ b/test/qml/labsplatform.qml @@ -0,0 +1,36 @@ +import QtQuick +import QtQuick.Controls +import Qt.labs.platform + +ApplicationWindow { + visible: true + width: 320 + height: 240 + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onClicked: zoomMenu.open() + } + + Menu { + id: zoomMenu + + MenuItem { + text: qsTr("Zoom In") + shortcut: StandardKey.ZoomIn + onTriggered: zoomIn() + } + + MenuItem { + text: qsTr("Zoom Out") + shortcut: StandardKey.ZoomOut + onTriggered: zoomOut() + } + } + + Timer { + interval: 1000; running: true; repeat: false + onTriggered: Qt.exit(0) + } +} \ No newline at end of file