diff --git a/README.md b/README.md index 205c555..1aaa7ae 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,26 @@ override USE_SYSTEM_LLVM=1 ``` ## Usage +### Running examples +To run the included examples, execute: +```julia +include(joinpath(Pkg.dir("QML"), "example", "runexamples.jl")) +``` +The examples require some additional packages to be installed: +```julia +Pkg.add("ModernGL") +Pkg.add("GLVisualize") +Pkg.add("GeometryTypes") +Pkg.add("GR") +Pkg.add("TestImages") +Pkg.add("Plots") +Pkg.add("PyPlot") +Pkg.clone("https://github.com/BenLauwens/StatefulFunctions.jl.git") +``` +And additionally, +* On Linux and Windows, `Pkg.add("ImageMagick")` +* On macOS, `Pkg.add("QuartzImageIO")` + ### Loading a QML file We support three methods of loading a QML file: `QQmlApplicationEngine`, `QQuickView` and `QQmlComponent`. These behave equivalently to the corresponding Qt classes. #### QQmlApplicationEngine diff --git a/example/progressbar_states.jl b/example/progressbar_states.jl index b3d2ea9..2ffe26d 100644 --- a/example/progressbar_states.jl +++ b/example/progressbar_states.jl @@ -2,7 +2,7 @@ using Base.Test using QML -using StateMachineIterator +using StatefulFunctions qmlfile = joinpath(dirname(Base.source_path()), "qml", "progressbar.qml") @@ -13,7 +13,7 @@ end const simulation_state = SimulationState(0.0) # Our simulation is just a busy wait, producing progress between 0.0 and 1.0 -@iterator function simulate() +@stateful function simulate() counter = 0.0 maxcount = 1000000000.0 while counter < maxcount