-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathQueryInput.qml
42 lines (36 loc) · 854 Bytes
/
QueryInput.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
import QtQuick 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
Item {
id: root
property string queryString
signal refresh
implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
RowLayout {
anchors.fill: parent
id: layout
TextField {
id: ti
text: root.queryString
Layout.fillWidth: true
Keys.onReturnPressed: {
queryString = ti.text
refresh()
}
Keys.onEscapePressed: {
ti.text = queryString
ti.selectAll()
}
}
Button {
id: go
focus: false
text: "Go"
onClicked: {
queryString = ti.text
refresh()
}
}
}
}