@@ -26,6 +26,7 @@ using Observables
2626import Libdl
2727using ColorTypes
2828using MacroTools: @capture
29+ import Qt6Svg_jll # Not using extensions for this one since it is an indirect dependency anyway
2930
3031const envfile = joinpath (dirname (dirname (@__FILE__ )), " deps" , " env.jl" )
3132if isfile (envfile)
@@ -142,6 +143,17 @@ function loadqmljll(m::Module)
142143 end
143144end
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
146158mutable 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