| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- 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)
- }
- }
|