roulette-payout/Roulette.qml
2024-06-06 08:17:49 +01:00

69 lines
1.4 KiB
QML

import QtQuick
import Qt5Compat.GraphicalEffects
import roulette
Item {
property int numberOfBets: 0
id: rouletteTable
Image {
source: "qrc:///roulette.png"
height: parent.height
width: parent.width
anchors {
top: parent.top
right: parent.right
}
StreetBetsView {
}
Columns {
}
Dozens {
}
Singles {
}
RedBlack {
}
EvenOdd {
}
LowHigh {
}
}
function destroyOnClose(obj) {
if (obj.closing != undefined)
obj.closing.connect(() => obj.destroy(1000));
else if (obj.aboutToHide != undefined)
obj.aboutToHide.connect(() => obj.destroy(1000));
}
/* Call this function to dynamically create a dialog box */
function showBetInputDialog(betType, n, squareX, squareY)
{
var component = Qt.createComponent("BetInputDialog.qml")
if (component.status == Component.Ready) {
var dialog = component.createObject(rouletteTable, {
"betType": betType,
"n": n,
"squareX": squareX,
"squareY": squareY
})
dialog.open()
destroyOnClose(dialog)
} else {
console.error("Something crapped out: " + component.errorString());
}
}
}