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