Compare commits
No commits in common. "b5db91addb35b26047e2c33ff040ed5812c951d1" and "91ea5543a2da6a1f05d4e45302daa52e7d1c85c4" have entirely different histories.
b5db91addb
...
91ea5543a2
12 changed files with 80 additions and 251 deletions
|
@ -20,15 +20,10 @@ Item {
|
||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
color: {
|
color: {
|
||||||
/*
|
if (PlayerAreaModel.focusedPlayer == 0 && rouletteTable.numberOfBets == 1 && border.width != 3) {
|
||||||
* A bit of a mess
|
"#00000000"
|
||||||
* The left side of the OR is checking if the player is croupier, and if it is, if it hasn't made a bet that has to be a number.
|
} else if (rouletteTable.numberOfBets < 2 || border.width == 3) {
|
||||||
* Even if the above isn't true, it still highlights if it's hovering a bet so that it can remove the bet.
|
if ((PlayerAreaModel.focusedPlayer == 0 && rouletteTable.numberOfBets < 1) || PlayerAreaModel.focusedPlayer != 0 || border.width == 3) {
|
||||||
*
|
|
||||||
* The right side of the OR is similar logic but for normal players that can make two bets on any square of the board
|
|
||||||
*/
|
|
||||||
if (((PlayerAreaModel.focusedPlayer == 0 && betType == 9) && (rouletteTable.numberOfBets < 1 || border.width == 3)) ||
|
|
||||||
(PlayerAreaModel.focusedPlayer != 0 && (rouletteTable.numberOfBets < 2 || border.width == 3))) {
|
|
||||||
if (tapHandler.pressed) {
|
if (tapHandler.pressed) {
|
||||||
"#88999999"
|
"#88999999"
|
||||||
} else if (hoverHandler.hovered) {
|
} else if (hoverHandler.hovered) {
|
||||||
|
@ -39,6 +34,9 @@ Item {
|
||||||
} else {
|
} else {
|
||||||
"#00000000"
|
"#00000000"
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
"#00000000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverHandler {
|
HoverHandler {
|
||||||
|
@ -48,12 +46,9 @@ Item {
|
||||||
id: tapHandler
|
id: tapHandler
|
||||||
|
|
||||||
onTapped: {
|
onTapped: {
|
||||||
/*
|
if (PlayerAreaModel.focusedPlayer == 0 && rouletteTable.numberOfBets == 1 && parent.border.width != 3) {
|
||||||
* Similar logic to what is used for setting the color attribute, but this time only go inside the "if" if a bet hasn't
|
|
||||||
* been made on the square that was clicked.
|
} else if (rouletteTable.numberOfBets < 2 && parent.border.width == 0) {
|
||||||
*/
|
|
||||||
if (((PlayerAreaModel.focusedPlayer == 0 && betType == 9) && (rouletteTable.numberOfBets < 1 && parent.border.width != 3)) ||
|
|
||||||
(PlayerAreaModel.focusedPlayer != 0 && (rouletteTable.numberOfBets < 2 && parent.border.width != 3))) {
|
|
||||||
parent.border.width = 3
|
parent.border.width = 3
|
||||||
|
|
||||||
/* Don't show this dialog for the croupier */
|
/* Don't show this dialog for the croupier */
|
||||||
|
|
|
@ -17,8 +17,6 @@ Dialog {
|
||||||
TextField {
|
TextField {
|
||||||
id: input
|
id: input
|
||||||
focus: true
|
focus: true
|
||||||
/* No negative numners or leading 0s, and cap at 99 million */
|
|
||||||
validator: RegularExpressionValidator { regularExpression: /[1-9][0-9]{0,7}/ }
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
|
|
@ -45,7 +45,7 @@ qt_add_qml_module(roulette-payout
|
||||||
RedBlack.qml
|
RedBlack.qml
|
||||||
EvenOdd.qml
|
EvenOdd.qml
|
||||||
LowHigh.qml
|
LowHigh.qml
|
||||||
Results.qml
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(roulette-payout PRIVATE
|
target_link_libraries(roulette-payout PRIVATE
|
||||||
|
|
|
@ -11,7 +11,7 @@ MainWindow::MainWindow(QWindow *parent)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* MainWindow is a QQmlApplicationEngine, so a .show() isn't needed
|
* MainWindow is a QQmlApplicationEngine, so a .show() isn't needed
|
||||||
* It will load a Window or ApplicationWindow that will set its own
|
* it will load a Window or ApplicationWindow that will set its own
|
||||||
* visibility status
|
* visibility status
|
||||||
*/
|
*/
|
||||||
load(QUrl("qrc:///Root.qml"));
|
load(QUrl("qrc:///Root.qml"));
|
||||||
|
|
|
@ -1,20 +1,13 @@
|
||||||
#include "PlayerAreaModel.h"
|
#include "PlayerAreaModel.h"
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
PlayerAreaModel::PlayerAreaModel(QObject *parent)
|
PlayerAreaModel::PlayerAreaModel(QObject *parent)
|
||||||
{
|
{
|
||||||
Player defaultValues;
|
Player defaultValues;
|
||||||
Bet defaultBets;
|
|
||||||
|
|
||||||
for(int i = 0; i < 8; i++){
|
for(int i = 0; i < 8; i++){
|
||||||
players.append(defaultValues);
|
players.append(defaultValues);
|
||||||
for (int ii = 0; ii < 2; ii++) {
|
|
||||||
players[i].bets.append(defaultBets);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* This is set to avoid segfaults if the starting value is out of bounds */
|
|
||||||
focusedPlayer_ = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint PlayerAreaModel::focusedPlayer()
|
uint PlayerAreaModel::focusedPlayer()
|
||||||
{
|
{
|
||||||
|
@ -25,10 +18,10 @@ void PlayerAreaModel::setFocusedPlayer(int n)
|
||||||
{
|
{
|
||||||
focusedPlayer_ = n;
|
focusedPlayer_ = n;
|
||||||
Player player = players.at(n);
|
Player player = players.at(n);
|
||||||
BetType b1 = player.bets[0].betType;
|
BetType b1 = player.bet1.betType;
|
||||||
BetType b2 = player.bets[1].betType;
|
BetType b2 = player.bet2.betType;
|
||||||
uint n1 = player.bets[0].betSpot;
|
uint n1 = player.bet1.betSpot;
|
||||||
uint n2 = player.bets[1].betSpot;
|
uint n2 = player.bet2.betSpot;
|
||||||
emit focusedPlayerChanged(b1, n1, b2, n2);
|
emit focusedPlayerChanged(b1, n1, b2, n2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,111 +32,51 @@ QString PlayerAreaModel::getPlayerName(int n)
|
||||||
|
|
||||||
void PlayerAreaModel::setPlayerName(QString s, int n)
|
void PlayerAreaModel::setPlayerName(QString s, int n)
|
||||||
{
|
{
|
||||||
players[n].playerName = s;
|
this->players[n].playerName = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerAreaModel::bet(BetType b, int n, int bet)
|
void PlayerAreaModel::bet(BetType b, int n, int bet)
|
||||||
{
|
{
|
||||||
Player *player = &players[focusedPlayer_];
|
Player *player = &players[focusedPlayer_];
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
if (player->bet1.betType == NONE) {
|
||||||
if (player->bets[i].betType == NONE) {
|
player->bet1.betType = b;
|
||||||
player->bets[i].betType = b;
|
player->bet1.betValue = bet;
|
||||||
player->bets[i].betValue = bet;
|
player->bet1.betSpot = n;
|
||||||
player->bets[i].betSpot = n;
|
if (b == 9 && n <= 35) {
|
||||||
/*
|
|
||||||
* This is needed because the visual roulette board is inverted from the
|
|
||||||
* actual QML grid we use to represent it.
|
|
||||||
* Here we use 35 because the grid is 0-indexed, but later we use 36 when it is 1-indexed.
|
|
||||||
*/
|
|
||||||
if (b == SINGLE && n <= 35) {
|
|
||||||
n = 35 - n;
|
n = 35 - n;
|
||||||
}
|
}
|
||||||
emit betChanged(b, n, bet);
|
emit betChanged(b, n, bet);
|
||||||
break;
|
} else if (player->bet2.betType == NONE) {
|
||||||
|
player->bet2.betType = b;
|
||||||
|
player->bet2.betValue = bet;
|
||||||
|
player->bet2.betSpot = n;
|
||||||
|
if (b == 9 && n <= 35) {
|
||||||
|
n = 35 - n;
|
||||||
}
|
}
|
||||||
|
emit betChanged(b, n, bet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerAreaModel::removeBet(BetType b, int n)
|
void PlayerAreaModel::removeBet(BetType b, int n)
|
||||||
{
|
{
|
||||||
Player *player = &players[focusedPlayer_];
|
Player *player = &players[focusedPlayer_];
|
||||||
|
if (player->bet1.betType != NONE) {
|
||||||
|
player->bet1.betType = NONE;
|
||||||
for (int i = 0; i < 2; i++) {
|
if (b == 9 && n <= 35) {
|
||||||
if (player->bets[i].betType == b && player->bets[i].betSpot == n) {
|
n = 35 - n;
|
||||||
player->bets[i].betType = NONE;
|
}
|
||||||
if (b == SINGLE && n <= 35) {
|
emit betRemoved(b, n);
|
||||||
|
} else {
|
||||||
|
player->bet2.betType = NONE;
|
||||||
|
if (b == 9 && n <= 35) {
|
||||||
n = 35 - n;
|
n = 35 - n;
|
||||||
}
|
}
|
||||||
emit betRemoved(b, n);
|
emit betRemoved(b, n);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void PlayerAreaModel::cancelBet(BetType b, int n)
|
void PlayerAreaModel::cancelBet(BetType b, int n) {
|
||||||
{
|
|
||||||
emit betCanceled(b, n);
|
emit betCanceled(b, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerAreaModel::payout()
|
|
||||||
{
|
|
||||||
if (players.at(0).bets[0].betType == NONE) {
|
|
||||||
fprintf(stderr, "Select where the ball landed\n");
|
|
||||||
} else {
|
|
||||||
int rollSpot = 36 - players.at(0).bets[0].betSpot;
|
|
||||||
|
|
||||||
for (int i = 1; i < 8; i++) {
|
|
||||||
players[i].payout = 0;
|
|
||||||
for (int ii = 0; ii < 2; ii++) {
|
|
||||||
int betType = players.at(i).bets[ii].betType;
|
|
||||||
int betSpot;
|
|
||||||
|
|
||||||
if (betType != NONE) {
|
|
||||||
betSpot = players.at(i).bets[ii].betSpot;
|
|
||||||
|
|
||||||
if (betType == SINGLE && betSpot <= 35) {
|
|
||||||
betSpot = 36 - betSpot;
|
|
||||||
} else {
|
|
||||||
betSpot += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (betType == SINGLE && betSpot == rollSpot) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 21;
|
|
||||||
} else if (betType == RED && (((int64_t)1 << (rollSpot - 1)) & redNumbers)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == BLACK && !(((int64_t)1 << (rollSpot - 1)) & redNumbers)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == ODD && (rollSpot % 2)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == EVEN && !(rollSpot % 2)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == LOW && rollSpot <= 18 ) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == HIGH && rollSpot >= 19 && rollSpot < 37) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 2;
|
|
||||||
} else if (betType == DOZEN) {
|
|
||||||
printf("CHECK %d %d\n", betSpot, rollSpot);
|
|
||||||
if (rollSpot <= 12 * betSpot && rollSpot >= (12 * (betSpot - 1)) + 1) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 3;
|
|
||||||
}
|
|
||||||
} else if (betType == STREET) {
|
|
||||||
if (rollSpot <= 3 * betSpot && rollSpot >= (3 * (betSpot - 1)) + 1) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 6;
|
|
||||||
}
|
|
||||||
} else if (betType == COLUMN) {
|
|
||||||
if (betSpot == 1 && (((int64_t)1 << (rollSpot - 1)) & column1)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 3;
|
|
||||||
} else if (betSpot == 2 && (((int64_t)1 << (rollSpot - 1)) & column2)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 3;
|
|
||||||
} else if (betSpot == 3 && (((int64_t)1 << (rollSpot - 1)) & column3)) {
|
|
||||||
players[i].payout += players.at(i).bets[ii].betValue * 3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
emit results(players.at(i).playerName, i, players.at(i).payout);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <QtGui/qwindow.h>
|
#include <QtGui/qwindow.h>
|
||||||
#include <cstdint>
|
|
||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
#include <qtmetamacros.h>
|
#include <qtmetamacros.h>
|
||||||
|
@ -11,7 +10,6 @@
|
||||||
class PlayerAreaModel : public QObject
|
class PlayerAreaModel : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
/* The name under which this "global variable" will be known in QML files */
|
|
||||||
QML_NAMED_ELEMENT(PlayerAreaModel)
|
QML_NAMED_ELEMENT(PlayerAreaModel)
|
||||||
QML_SINGLETON
|
QML_SINGLETON
|
||||||
|
|
||||||
|
@ -44,7 +42,6 @@ signals:
|
||||||
void betChanged(BetType b, int n, int bet);
|
void betChanged(BetType b, int n, int bet);
|
||||||
void betRemoved(BetType b, int n);
|
void betRemoved(BetType b, int n);
|
||||||
void betCanceled(BetType b, uint n);
|
void betCanceled(BetType b, uint n);
|
||||||
void results(QString name, int n, int payout);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPlayerName(QString s, int n);
|
void setPlayerName(QString s, int n);
|
||||||
|
@ -52,10 +49,10 @@ public slots:
|
||||||
void removeBet(BetType b, int n);
|
void removeBet(BetType b, int n);
|
||||||
QString getPlayerName(int n);
|
QString getPlayerName(int n);
|
||||||
void cancelBet(BetType b, int n);
|
void cancelBet(BetType b, int n);
|
||||||
void payout();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
struct Bet {
|
struct Bet {
|
||||||
uint betValue = 0;
|
uint betValue = 0;
|
||||||
BetType betType = NONE;
|
BetType betType = NONE;
|
||||||
|
@ -64,17 +61,11 @@ private:
|
||||||
|
|
||||||
struct Player {
|
struct Player {
|
||||||
QString playerName = "";
|
QString playerName = "";
|
||||||
QList<Bet> bets;
|
Bet bet1;
|
||||||
int payout;
|
Bet bet2;
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<Player> players;
|
QList<Player> players;
|
||||||
|
|
||||||
int focusedPlayer_;
|
int focusedPlayer_;
|
||||||
|
|
||||||
/* bitmaps */
|
|
||||||
int64_t redNumbers = 45857548629;
|
|
||||||
int64_t column3 = 9817068105;
|
|
||||||
int64_t column2 = 19634136210;
|
|
||||||
int64_t column1 = 39268272420;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -129,7 +129,7 @@ Item {
|
||||||
topMargin: 6
|
topMargin: 6
|
||||||
}
|
}
|
||||||
|
|
||||||
onTextEdited: PlayerAreaModel.setPlayerName(text, index + 1)
|
onTextEdited: PlayerAreaModel.setPlayerName(text, index)
|
||||||
onActiveFocusChanged: {
|
onActiveFocusChanged: {
|
||||||
/* focusReason 0, 1 and 2 are mouse, tab forward, and tab backward, respectively */
|
/* focusReason 0, 1 and 2 are mouse, tab forward, and tab backward, respectively */
|
||||||
if (activeFocus && (focusReason == 0 || focusReason == 1 || focusReason == 2)) {
|
if (activeFocus && (focusReason == 0 || focusReason == 1 || focusReason == 2)) {
|
||||||
|
@ -179,17 +179,17 @@ Item {
|
||||||
currentBet1.betType = b
|
currentBet1.betType = b
|
||||||
currentBet1.n = n
|
currentBet1.n = n
|
||||||
if (b < 7) {
|
if (b < 7) {
|
||||||
currentBet1.text = betTypes[b] + ": " + bet.toLocaleString(Qt.locale(), 'f', 0) + "g"
|
currentBet1.text = betTypes[b] + ": " + bet + "g"
|
||||||
} else {
|
} else {
|
||||||
currentBet1.text = betTypes[b] + " " + (n + 1) + ": " + bet.toLocaleString(Qt.locale(), 'f', 0) + "g"
|
currentBet1.text = betTypes[b] + " " + (n + 1) + ": " + bet + "g"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
currentBet2.betType = b
|
currentBet2.betType = b
|
||||||
currentBet2.n = n
|
currentBet2.n = n
|
||||||
if (b < 7) {
|
if (b < 7) {
|
||||||
currentBet2.text = betTypes[b] + ": " + bet.toLocaleString(Qt.locale(), 'f', 0) + "g"
|
currentBet2.text = betTypes[b] + ": " + bet + "g"
|
||||||
} else {
|
} else {
|
||||||
currentBet2.text = betTypes[b] + " " + (n + 1) + ": " + bet.toLocaleString(Qt.locale(), 'f', 0) + "g"
|
currentBet2.text = betTypes[b] + " " + (n + 1) + ": " + bet + "g"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
39
Results.qml
39
Results.qml
|
@ -1,39 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
|
|
||||||
import roulette
|
|
||||||
|
|
||||||
GridLayout {
|
|
||||||
rowSpacing: 20
|
|
||||||
columnSpacing: 50
|
|
||||||
flow: GridLayout.TopToBottom
|
|
||||||
rows: 3
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
/* These random IDs com from Results' parent*/
|
|
||||||
left: payoutButton.right
|
|
||||||
leftMargin: 30
|
|
||||||
top: roulette.bottom
|
|
||||||
topMargin: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: 7
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: ""
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: PlayerAreaModel
|
|
||||||
|
|
||||||
function onResults(name, n, payout) {
|
|
||||||
if (index + 1 == n && name != "") {
|
|
||||||
text = name + ": " + payout.toLocaleString(Qt.locale(), 'f', 0) + "g"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
76
Root.qml
76
Root.qml
|
@ -4,19 +4,17 @@ import QtQuick.Controls
|
||||||
import roulette /* this is importing the target "roulette-payout" defined in CMakeLists.txt */
|
import roulette /* this is importing the target "roulette-payout" defined in CMakeLists.txt */
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
maximumHeight: 500
|
height: 500
|
||||||
maximumWidth: 1000
|
width: 1000
|
||||||
minimumHeight: 500
|
|
||||||
minimumWidth: 1000
|
|
||||||
title: "Roulette Payout"
|
title: "Roulette Payout"
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
Pane {
|
Pane {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
/* Exists exclusively to remove focus from TextFields by clicking anywhere else on the screen */
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
onClicked: focus = true
|
onClicked: focus = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,73 +32,5 @@ Window {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
|
||||||
id: payoutButton
|
|
||||||
onClicked: PlayerAreaModel.payout()
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: roulette.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
bottomMargin: 20
|
|
||||||
}
|
|
||||||
|
|
||||||
contentItem: Text {
|
|
||||||
text: "Payout"
|
|
||||||
font.pointSize: 15
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
|
|
||||||
color: {
|
|
||||||
if (enabled == true) {
|
|
||||||
"#000000"
|
|
||||||
} else {
|
|
||||||
"#555555"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
implicitWidth: 150
|
|
||||||
implicitHeight: 60
|
|
||||||
opacity: {
|
|
||||||
if (enabled == true && parent.pressed) {
|
|
||||||
0.5
|
|
||||||
} else if (enabled == true && parent.hovered) {
|
|
||||||
0.2
|
|
||||||
} else {
|
|
||||||
0.3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
color: {
|
|
||||||
if (enabled == true) {
|
|
||||||
"#AAAAAA"
|
|
||||||
} else {
|
|
||||||
"#444444"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
border.width: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: PlayerAreaModel
|
|
||||||
|
|
||||||
function onBetChanged() {
|
|
||||||
if (PlayerAreaModel.focusedPlayer == 0) {
|
|
||||||
payoutButton.enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onBetRemoved() {
|
|
||||||
if (PlayerAreaModel.focusedPlayer == 0) {
|
|
||||||
payoutButton.enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Results {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ Item {
|
||||||
LayoutMirroring.enabled: true
|
LayoutMirroring.enabled: true
|
||||||
flow: GridLayout.TopToBottom
|
flow: GridLayout.TopToBottom
|
||||||
rows: 3
|
rows: 3
|
||||||
|
//rotation: 180
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
|
|
6
StreetBetsModel.cpp
Normal file
6
StreetBetsModel.cpp
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#include "StreetBetsModel.h"
|
||||||
|
|
||||||
|
StreetBetsModel::StreetBetsModel(QObject *parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
14
StreetBetsModel.h
Normal file
14
StreetBetsModel.h
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QQuickView>
|
||||||
|
#include <qqmlintegration.h>
|
||||||
|
#include <qtmetamacros.h>
|
||||||
|
#include <qobject.h>
|
||||||
|
|
||||||
|
class StreetBetsModel : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
QML_ELEMENT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit StreetBetsModel(QObject *parent = nullptr);
|
||||||
|
};
|
Loading…
Add table
Reference in a new issue