[SOLVED] Volume calculation from 3 spinBox values
Solved
QML and Qt Quick
-
@ACaldas Yes, this is a simple task in qml. This is a fast 5 min rapid prototype.
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.11 ApplicationWindow { width: 640 height: 480 visible: true title: qsTr("Volume Multiplication") RowLayout { id: rowLayout anchors.fill: parent Label{ Layout.fillWidth: true text: qsTr("Side A: ") } SpinBox { id: spinBoxSA onValueModified: result.text = calculateVolume(spinBoxSA.value, spinBoxSB.value, spinBoxH.value) } Label{ text: qsTr("Side B: ") Layout.fillWidth: true } SpinBox { id: spinBoxSB onValueModified: result.text = calculateVolume(spinBoxSA.value, spinBoxSB.value, spinBoxH.value) } Label{ text: qsTr("Height: ") Layout.fillWidth: true } SpinBox { id: spinBoxH onValueModified: result.text = calculateVolume(spinBoxSA.value, spinBoxSB.value, spinBoxH.value) } Label{ text: qsTr("Rsult: ") Layout.fillWidth: true } Label{ id: result Layout.fillWidth: true } } function calculateVolume(sideA, sideB, height) { return sideA*sideB*height; } }