Skip to content

Commit

Permalink
Added documentation on running examples
Browse files Browse the repository at this point in the history
Also, updated progressbar_states.jl: StateMachineIterator is now StatefulFunctions - and @iterator is now @stateful.
  • Loading branch information
stemann authored and barche committed Aug 3, 2017
1 parent 0c5be3b commit ec08b61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions example/progressbar_states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using Base.Test
using QML
using StateMachineIterator
using StatefulFunctions

qmlfile = joinpath(dirname(Base.source_path()), "qml", "progressbar.qml")

Expand All @@ -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
Expand Down

0 comments on commit ec08b61

Please sign in to comment.