diff --git a/.github/workflows/test-win-mac.yml b/.github/workflows/test-win-mac.yml index 381eb44..0d86548 100644 --- a/.github/workflows/test-win-mac.yml +++ b/.github/workflows/test-win-mac.yml @@ -39,8 +39,10 @@ jobs: ${{ runner.os }}-test-${{ env.cache-name }}- ${{ runner.os }}-test- ${{ runner.os }}- + - run: julia --color=yes --project -e 'using Pkg; pkg"add https://github.com/barche/Qt_jll.jl.git"' + - run: julia --color=yes --project -e 'using Pkg; pkg"add https://github.com/barche/jlqml_jll.jl.git"' + - run: julia --color=yes --project -e 'using Pkg; pkg"add https://github.com/barche/Mesa_jll.jl.git"' - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: - QT_QUICK_BACKEND: software - + QT_LOGGING_RULES: "*.debug=true;qt.qpa.input*.debug=false;qt.scenegraph.general=true;qt.qpa.gl=true" diff --git a/src/QML.jl b/src/QML.jl index 049bc11..a270580 100644 --- a/src/QML.jl +++ b/src/QML.jl @@ -8,6 +8,7 @@ export QPainter, device, width, height, logicalDpiX, logicalDpiY, QQuickWindow, export @emit, @qmlfunction, qmlfunction, load, QQmlPropertyMap export set_context_property export QUrlFromLocalFile +export qputenv, qgetenv, qunsetenv # TODO: Document: init_application, init_qmlapplicationengine # TODO: Document painter: device, effectiveDevicePixelRatio, height, JuliaCanvas, JuliaPaintedItem, logicalDpiX, logicalDpiY, width, window @@ -78,6 +79,10 @@ end end end +@static if Sys.iswindows() + using Mesa_jll +end + function __init__() @initcxx FileIO.add_format(format"QML", (), ".qml") @@ -87,6 +92,13 @@ function __init__() end @require Makie="ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" include(joinpath(@__DIR__, "makie_support.jl")) + + # Make sure Qt can find the Mesa dll if it doesn't find a compatible OpenGL implementation + @static if Sys.iswindows() + @show Mesa_jll.opengl32sw + @show isfile(Mesa_jll.opengl32sw) + qputenv("PATH", QByteArray(ENV["PATH"] * ";" * dirname(Mesa_jll.opengl32sw))) + end end # QString diff --git a/test/environmment.jl b/test/environmment.jl new file mode 100644 index 0000000..920e6ec --- /dev/null +++ b/test/environmment.jl @@ -0,0 +1,11 @@ +using CxxWrap +using QML +using Test + +let key = "__QML_TESTVAR", val = "TestStr" + qputenv(key, QByteArray(val)) + @test ENV[key] == val + @test QML.to_string(qgetenv(key)) == val + qunsetenv(key) + @test !haskey(ENV, key) +end diff --git a/test/runtests.jl b/test/runtests.jl index 34e033e..e24b278 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,8 +3,6 @@ using Test import QML using Documenter: doctest -doctest(QML, fix=true) - excluded = ["runtests.jl", "qml", "include"] testfiles = filter(fname -> fname ∉ excluded, readdir()) @@ -15,3 +13,5 @@ testfiles = filter(fname -> fname ∉ excluded, readdir()) include(f) end end + +# doctest(QML, fix=true)