Changed from QQuickView to QQmlApplication Engine.

This commit is contained in:
greek 2024-05-31 13:56:24 +01:00
parent 8bb03932d2
commit 2e9f2133d6
4 changed files with 16 additions and 13 deletions

View file

@ -1,7 +1,7 @@
#include <QQmlContext>
#include <QtGui/qwindow.h>
#include <cstddef>
#include <qqml.h>
#include <qqmlapplicationengine.h>
#include <qquickview.h>
#include <qurl.h>
@ -9,8 +9,5 @@
MainWindow::MainWindow(QWindow *parent)
{
QQuickView::setTitle("Roulette Payout");
setSource(QUrl("../Root.qml"));
load(QUrl("../Root.qml"));
}

View file

@ -1,9 +1,10 @@
#pragma once
#include <QQuickView>
#include <QQmlApplicationEngine>
#include <QtGui/qwindow.h>
#include <qqmlapplicationengine.h>
class MainWindow : public QQuickView
class MainWindow : public QQmlApplicationEngine
{
Q_OBJECT
QML_ELEMENT

View file

@ -4,11 +4,18 @@ import QtQuick.Layouts
import roulette
Pane {
id: rootWindow
Window {
height: 500
width: 1000
title: "Roulette Payout"
visible: true
Pane {
id: rootWindow
anchors.fill: parent
PlayerAreaView {
id: playerAreaView
}
}
}

View file

@ -1,5 +1,4 @@
#include <QGuiApplication>
#include <QQuickView>
#include "MainWindow.h"
@ -8,7 +7,6 @@ int main(int argc, char *argv[])
QGuiApplication app(argc, argv);
MainWindow view;
view.show();
return app.exec();
}