From 810ca0d9f587f967dfd2148a5cba2279e898f9d0 Mon Sep 17 00:00:00 2001 From: greek Date: Sat, 8 Jun 2024 17:35:27 +0100 Subject: [PATCH] Do no allow resizing of window. Some small documenting. Removed old street bets files. --- MainWindow.cpp | 2 +- PlayerAreaModel.cpp | 4 ++++ PlayerAreaModel.h | 1 + Root.qml | 6 ++++-- StreetBetsModel.cpp | 6 ------ StreetBetsModel.h | 14 -------------- 6 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 StreetBetsModel.cpp delete mode 100644 StreetBetsModel.h diff --git a/MainWindow.cpp b/MainWindow.cpp index b78ca81..f1c74aa 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -11,7 +11,7 @@ MainWindow::MainWindow(QWindow *parent) { /* * 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 */ load(QUrl("qrc:///Root.qml")); diff --git a/PlayerAreaModel.cpp b/PlayerAreaModel.cpp index bd96ae7..ca3d02d 100644 --- a/PlayerAreaModel.cpp +++ b/PlayerAreaModel.cpp @@ -45,6 +45,10 @@ void PlayerAreaModel::bet(BetType b, int n, int bet) player->bet1.betType = b; player->bet1.betValue = bet; player->bet1.betSpot = n; + /* + * 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 for convinience + */ if (b == SINGLE && n <= 35) { n = 35 - n; } diff --git a/PlayerAreaModel.h b/PlayerAreaModel.h index 2df3644..0a87aee 100644 --- a/PlayerAreaModel.h +++ b/PlayerAreaModel.h @@ -73,6 +73,7 @@ private: int focusedPlayer_; + /* bitmaps */ int64_t redNumbers = 45857548629; int64_t column3 = 9817068105; int64_t column2 = 19634136210; diff --git a/Root.qml b/Root.qml index 9302ee1..1fb17de 100644 --- a/Root.qml +++ b/Root.qml @@ -4,8 +4,10 @@ import QtQuick.Controls import roulette /* this is importing the target "roulette-payout" defined in CMakeLists.txt */ Window { - height: 500 - width: 1000 + maximumHeight: 500 + maximumWidth: 1000 + minimumHeight: 500 + minimumWidth: 1000 title: "Roulette Payout" visible: true diff --git a/StreetBetsModel.cpp b/StreetBetsModel.cpp deleted file mode 100644 index 18a60e6..0000000 --- a/StreetBetsModel.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StreetBetsModel.h" - -StreetBetsModel::StreetBetsModel(QObject *parent) -{ - -} diff --git a/StreetBetsModel.h b/StreetBetsModel.h deleted file mode 100644 index d1ba119..0000000 --- a/StreetBetsModel.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class StreetBetsModel : public QObject { - Q_OBJECT - QML_ELEMENT - - public: - explicit StreetBetsModel(QObject *parent = nullptr); -};