-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.qml
43 lines (42 loc) · 1.13 KB
/
main.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import QtQuick 2.3
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.0
import SyntaxHighlighter 1.0
ApplicationWindow {
id: windows
width: 640
height: 480
color: "#f1f1f1"
visible: true
function update() {
lines.text=processor.analyse(edit.text)
}
Component.onCompleted: {
windows.update()
}
Row{
width: parent.width
height: parent.height
anchors.fill: parent
SyntaxHighlighter{
id:processor
}
Text {
id: lines
width: parent.width / 2
height: parent.height
textFormat: Text.RichText
}
TextArea {
id: edit
width: parent.width / 2
height: parent.height
focus: true
text: "#Hello\n# Hi!\n\nHow are you?\n"
onLineCountChanged: windows.update()
onHeightChanged: windows.update()
onCursorPositionChanged: windows.update()
//onEditingFinished: update()
}
}
}