diff --git a/doric/doric.pro b/doric/doric.pro index 3f113457..a523991c 100644 --- a/doric/doric.pro +++ b/doric/doric.pro @@ -1,4 +1,6 @@ -QT += quick +QT += \ + quick \ + widgets CONFIG += c++11 @@ -53,6 +55,7 @@ HEADERS += \ native/native_timer.h \ plugin/shader_plugin.h \ registry.h \ + shader/layer.h \ shader/super_node.h \ shader/view_node.h \ template/singleton.h \ diff --git a/doric/main.cpp b/doric/main.cpp index fed8dade..929bf4bc 100644 --- a/doric/main.cpp +++ b/doric/main.cpp @@ -1,26 +1,19 @@ +#include +#include #include -#include -#include #include -#include #include "context_manager.h" int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - const QUrl url(QStringLiteral("qrc:/doric/main.qml")); - QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, - &app, [url](QObject *obj, const QUrl &objUrl) { - if (!obj && url == objUrl) - QCoreApplication::exit(-1); - }, Qt::QueuedConnection); - engine.load(url); - + QApplication app(argc, argv); + { + QWidget *widget = new QWidget(nullptr, Qt::WindowType::Window); + widget->setWindowTitle(QString("Hello Doric")); + widget->resize(360, 640); + widget->show(); + } { QResource resource(":/doric/Snake.js"); QFile *file = new QFile(resource.fileName()); diff --git a/doric/main.qml b/doric/main.qml deleted file mode 100644 index 0c5a78dc..00000000 --- a/doric/main.qml +++ /dev/null @@ -1,23 +0,0 @@ -import QtQuick 2.6 -import QtQuick.Controls 2.13 -import QtQuick.Window 2.2 - -Window { - visible: true - width: 360; - height: 640; - title: qsTr("Hello Doric"); - - StackView { - id: stack; - anchors.centerIn: parent; - initialItem: mainView; - width: 360; - height: 640; - } - - Rectangle { - id: mainView; - color: "lightgreen"; - } -} diff --git a/doric/qml.qrc b/doric/qml.qrc index f3f83d85..6d00a767 100644 --- a/doric/qml.qrc +++ b/doric/qml.qrc @@ -1,6 +1,5 @@ - main.qml ../../doric-js/bundle/doric-sandbox.js ../../doric-js/bundle/doric-lib.js ../../doric-demo/bundle/src/Snake.js diff --git a/doric/shader/layer.h b/doric/shader/layer.h new file mode 100644 index 00000000..ad132aff --- /dev/null +++ b/doric/shader/layer.h @@ -0,0 +1,10 @@ +#ifndef LAYER_H +#define LAYER_H + +#include "QWidget" + +class Layer : public QWidget { + +}; + +#endif // LAYER_H diff --git a/doric/shader/view_node.h b/doric/shader/view_node.h index 9e77b493..4441c1e3 100644 --- a/doric/shader/view_node.h +++ b/doric/shader/view_node.h @@ -1,11 +1,10 @@ #ifndef VIEW_NODE_H #define VIEW_NODE_H +#include + #include "context_holder.h" -using namespace std; - -template class SuperNode; template @@ -15,6 +14,7 @@ protected: T view; private: + SuperNode *superNode; QString *id; public: