Skip to content

Commit a4e81e6

Browse files
committed
Add SVG imageformat plugin to the path
1 parent cff66cb commit a4e81e6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "QML"
22
uuid = "2db162a6-7e43-52c3-8d84-290c1c42d82a"
3-
version = "0.12.0"
3+
version = "0.12.1"
44
authors = ["Bart Janssens <bart@bartjanssens.org>"]
55

66
[deps]
@@ -9,6 +9,7 @@ CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
99
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1010
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1111
Observables = "510215fc-4207-5dde-b226-833fc4488ee2"
12+
Qt6Svg_jll = "6de9746b-f93d-5813-b365-ba18ad4a9cf3"
1213
Qt6Wayland_jll = "e99dba38-086e-5de3-a5b1-6e4c66e897c3"
1314
jlqml_jll = "6b5019fb-a83d-5b4e-a9f7-678a36c28df7"
1415

@@ -27,6 +28,7 @@ ColorTypes = "0.11, 0.12"
2728
CxxWrap = "0.17.5"
2829
MacroTools = "0.5"
2930
Observables = "0.5"
31+
Qt6Svg_jll = "6.8"
3032
Qt6Wayland_jll = "6.8"
3133
jlqml_jll = "0.9.0"
3234
julia = "1.10"

src/QML.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ using Observables
2626
import Libdl
2727
using ColorTypes
2828
using MacroTools: @capture
29+
import Qt6Svg_jll # Not using extensions for this one since it is an indirect dependency anyway
2930

3031
const envfile = joinpath(dirname(dirname(@__FILE__)), "deps", "env.jl")
3132
if isfile(envfile)
@@ -142,6 +143,17 @@ function loadqmljll(m::Module)
142143
end
143144
end
144145

146+
function add_plugin_path(m::Module)
147+
pluginpath = joinpath(m.artifact_dir, "plugins")
148+
separator = Sys.iswindows() ? ';' : ':'
149+
oldpath = get(ENV, "QT_PLUGIN_PATH", "")
150+
newpath = isempty(oldpath) ? pluginpath : oldpath * separator * pluginpath
151+
ENV["QT_PLUGIN_PATH"] = newpath
152+
@static if Sys.iswindows()
153+
qputenv("QT_PLUGIN_PATH", QByteArray(newpath))
154+
end
155+
end
156+
145157
# Persistent C++ - compatible storage of the command line arguments, passed to the QGuiApplication constructor
146158
mutable struct ArgcArgv
147159
argv
@@ -172,6 +184,7 @@ function __init__()
172184
@initcxx
173185

174186
loadqmljll(jlqml_jll.Qt6Declarative_jll)
187+
add_plugin_path(Qt6Svg_jll)
175188

176189
global ARGV = ArgcArgv([Base.julia_cmd()[1], ARGS...])
177190
global APPLICATION = QGuiApplication(ARGV.argc, getargv(ARGV))

0 commit comments

Comments
 (0)