Changed from QQuickView to QQmlApplication Engine.
This commit is contained in:
parent
8bb03932d2
commit
2e9f2133d6
4 changed files with 16 additions and 13 deletions
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
11
Root.qml
11
Root.qml
|
@ -4,11 +4,18 @@ import QtQuick.Layouts
|
|||
|
||||
import roulette
|
||||
|
||||
Window {
|
||||
height: 500
|
||||
width: 1000
|
||||
title: "Roulette Payout"
|
||||
visible: true
|
||||
|
||||
Pane {
|
||||
id: rootWindow
|
||||
|
||||
height: 500
|
||||
width: 1000
|
||||
anchors.fill: parent
|
||||
PlayerAreaView {
|
||||
id: playerAreaView
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue