Skip to content

Instantly share code, notes, and snippets.

@dtoebe
Created January 3, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtoebe/ba4e56a437b7c5de7aa6a5f97500594a to your computer and use it in GitHub Desktop.
Save dtoebe/ba4e56a437b7c5de7aa6a5f97500594a to your computer and use it in GitHub Desktop.
WRITE A SIMPLE MARKDOWN EDITOR WITH GO-QML - main.qml - 5
//assets/main.qml
...
ApplicationWindow {
...
toolBar: ToolBar { //Create a toolbar and set it as the ApplicationWindow's toolBar
//This will create the space and auto adjust the other children of ApplicationWindow down
RowLayout { //This formats the toolbar to move the buttons side by side
width: parent.width
height: prent.height
Button {
Layout.alignment: Qt.AlignRight //This tells QML that the button needs to be auto formatted to align right
text: "Copy To HTML"
onClicked: htmlText.copyToClip(mdarea.text) //We will create this method in the next part
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment