Benchmark page was added

This commit is contained in:
2023-04-25 13:39:14 +02:00
parent f0af00b66a
commit f95c4e304d
7 changed files with 309 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import ru.ded.beerlog 1.0
Page {
title: qsTr("Benchmark")
Column {
anchors.fill: parent
anchors.margins: 10
ItemDelegate {
width: parent.width
text: qsTr("Items count")
TextField {
id: itemsCountField
anchors.right: parent.right
validator: IntValidator {
bottom: 0
top: 100000
}
height: parent.height
inputMethodHints: Qt.ImhPreferNumbers
}
}
ItemDelegate {
width: parent.width
text: qsTr("Submit time")
Label {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
text: benchmark.submitTime
}
}
ItemDelegate {
width: parent.width
text: qsTr("Receive time")
Label {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
text: benchmark.receiveTime
}
}
ItemDelegate {
width: parent.width
text: qsTr("Remove time")
Label {
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
text: benchmark.removeTime
}
}
ItemDelegate {
id: startButton
width: parent.width
text: qsTr("Start benchmark")
enabled: !benchmark.inProgress
onClicked: benchmark.startBenchmark()
states: State {
when: benchmark.inProgress
PropertyChanges {
target: startButton
text: qsTr("In progress")
}
}
}
}
BenchmarkViewModel {
id: benchmark
itemsCount: Number(itemsCountField.text)
}
}