From 2e9f2133d64fa7dbeefe891bbf5b5351093708ba Mon Sep 17 00:00:00 2001 From: greek Date: Fri, 31 May 2024 13:56:24 +0100 Subject: [PATCH] Changed from QQuickView to QQmlApplication Engine. --- MainWindow.cpp | 7 ++----- MainWindow.h | 5 +++-- Root.qml | 15 +++++++++++---- main.cpp | 2 -- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index a083649..de149f7 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -1,7 +1,7 @@ #include #include -#include #include +#include #include #include @@ -9,8 +9,5 @@ MainWindow::MainWindow(QWindow *parent) { - QQuickView::setTitle("Roulette Payout"); - - setSource(QUrl("../Root.qml")); - + load(QUrl("../Root.qml")); } diff --git a/MainWindow.h b/MainWindow.h index 9a83c42..72ed251 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -1,9 +1,10 @@ #pragma once -#include +#include #include +#include -class MainWindow : public QQuickView +class MainWindow : public QQmlApplicationEngine { Q_OBJECT QML_ELEMENT diff --git a/Root.qml b/Root.qml index 5f2e34b..1866421 100644 --- a/Root.qml +++ b/Root.qml @@ -4,11 +4,18 @@ import QtQuick.Layouts import roulette -Pane { - id: rootWindow - +Window { height: 500 width: 1000 - PlayerAreaView { + title: "Roulette Payout" + visible: true + + Pane { + id: rootWindow + + anchors.fill: parent + PlayerAreaView { + id: playerAreaView + } } } diff --git a/main.cpp b/main.cpp index 3584545..512fad6 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,4 @@ #include -#include #include "MainWindow.h" @@ -8,7 +7,6 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); MainWindow view; - view.show(); return app.exec(); }