-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathBlockchain.qml
More file actions
41 lines (35 loc) · 960 Bytes
/
Blockchain.qml
File metadata and controls
41 lines (35 loc) · 960 Bytes
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
import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Layouts 1.1
import QtGraphicalEffects 1.0
Rectangle {
id: blockchain
Layout.fillHeight: true
Layout.preferredWidth: mainLayout.width / 2
color: palette.blockchainColor
border.width: mm(.3)
border.color: palette.blockchainBorderColor
z: -1
function addBlock(block) {
blockchainModel.append({"content": block})
chainBlocks.goToEnd()
}
ListModel {
id: blockchainModel
}
ColumnLayout {
anchors.fill: parent
anchors.margins: mm(2)
Text {
text: "Blockchain"
}
AnimatedListView {
id: chainBlocks
Layout.fillHeight: true
Layout.fillWidth: true
interactive: miningTimer.running === false
verticalLayoutDirection: ListView.BottomToTop
model: blockchainModel
}
}
}