Created
January 3, 2017 11:52
-
-
Save dtoebe/07a68cb5a7a736f8922653779c942700 to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.go - 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//main.qml | |
... | |
import { | |
... | |
} | |
var ctx qml.Context //Global var to set the qml context | |
... | |
func run() error { | |
... | |
component, err := engine.LoadFile("assets/main.qml") | |
if err != nil { | |
return err | |
} | |
//Above code we have already written I just wanted to give you a point of reference | |
ctx = *engine.Context() //set the context with a pointer so the data stored stays persistent for the life of the variable. In this case the lifetime of the application | |
ctx.SetVar("mdtxt", "Markdown Editor") //Set the "mdtxt" property inside the QML file to the provided string | |
ctx.SetVar("rttxt", "Rich Text / HTML Editor") | |
... | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment