From 3397dd57a30f7868c887b01c47a56bb6fa651eb6 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 10 Sep 2017 13:00:35 +0100 Subject: Adding qt editor --- editor/editor.pro | 34 +++++ editor/editor.pro.user | 336 ++++++++++++++++++++++++++++++++++++++++++++++++ editor/editorwindow.cpp | 18 +++ editor/editorwindow.h | 25 ++++ editor/editorwindow.ui | 69 ++++++++++ editor/main.cpp | 11 ++ editor/tooltip.py | 28 ---- 7 files changed, 493 insertions(+), 28 deletions(-) create mode 100644 editor/editor.pro create mode 100644 editor/editor.pro.user create mode 100644 editor/editorwindow.cpp create mode 100644 editor/editorwindow.h create mode 100644 editor/editorwindow.ui create mode 100644 editor/main.cpp delete mode 100644 editor/tooltip.py (limited to 'editor') diff --git a/editor/editor.pro b/editor/editor.pro new file mode 100644 index 00000000..1cec2824 --- /dev/null +++ b/editor/editor.pro @@ -0,0 +1,34 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2017-09-10T12:11:18 +# +#------------------------------------------------- + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = editor +TEMPLATE = app + +# The following define makes your compiler emit warnings if you use +# any feature of Qt which as been marked as deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if you use deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + +SOURCES += \ + main.cpp \ + editorwindow.cpp + +HEADERS += \ + editorwindow.h + +FORMS += \ + editorwindow.ui diff --git a/editor/editor.pro.user b/editor/editor.pro.user new file mode 100644 index 00000000..9432df0a --- /dev/null +++ b/editor/editor.pro.user @@ -0,0 +1,336 @@ + + + + + + EnvironmentId + {9dce752e-6199-4873-be9d-96711f00400a} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {f5cdc152-9721-42b1-adce-0f96841fccff} + 0 + 0 + 0 + + /home/yannherklotz/Github/YAGE/build-editor-Desktop-Debug + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + + Qt4ProjectManager.Qt4BuildConfiguration + 2 + true + + + /home/yannherklotz/Github/YAGE/build-editor-Desktop-Release + + + true + qmake + + QtProjectManager.QMakeBuildStep + false + + false + false + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + + /home/yannherklotz/Github/YAGE/build-editor-Desktop-Profile + + + true + qmake + + QtProjectManager.QMakeBuildStep + true + + false + true + false + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + false + + + + 2 + Build + + ProjectExplorer.BuildSteps.Build + + + + true + Make + + Qt4ProjectManager.MakeStep + + -w + -r + + true + clean + + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + true + + 3 + + + 0 + Deploy + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy locally + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + editor + + Qt4ProjectManager.Qt4RunConfiguration:/home/yannherklotz/Github/YAGE/editor/editor.pro + true + + editor.pro + false + + /home/yannherklotz/Github/YAGE/build-editor-Desktop-Debug + 3768 + false + true + false + false + true + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 18 + + + Version + 18 + + diff --git a/editor/editorwindow.cpp b/editor/editorwindow.cpp new file mode 100644 index 00000000..35eeeb31 --- /dev/null +++ b/editor/editorwindow.cpp @@ -0,0 +1,18 @@ +#include "editorwindow.h" +#include "ui_editorwindow.h" + +EditorWindow::EditorWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::EditorWindow) +{ + ui->setupUi(this); +} + +EditorWindow::~EditorWindow() +{ + delete ui; +} + +void EditorWindow::on_openGLWidget_destroyed() +{ +} diff --git a/editor/editorwindow.h b/editor/editorwindow.h new file mode 100644 index 00000000..1e3e8045 --- /dev/null +++ b/editor/editorwindow.h @@ -0,0 +1,25 @@ +#ifndef EDITORWINDOW_H +#define EDITORWINDOW_H + +#include + +namespace Ui { +class EditorWindow; +} + +class EditorWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit EditorWindow(QWidget *parent = 0); + ~EditorWindow(); + +private slots: + void on_openGLWidget_destroyed(); + +private: + Ui::EditorWindow *ui; +}; + +#endif // EDITORWINDOW_H diff --git a/editor/editorwindow.ui b/editor/editorwindow.ui new file mode 100644 index 00000000..63fd4940 --- /dev/null +++ b/editor/editorwindow.ui @@ -0,0 +1,69 @@ + + + EditorWindow + + + + 0 + 0 + 1920 + 1080 + + + + EditorWindow + + + + + + 110 + 80 + 1071 + 431 + + + + + + + + 0 + 0 + 1920 + 22 + + + + + File + + + + + + Edit + + + + + + + + TopToolBarArea + + + false + + + + + + New Game + + + + + + + diff --git a/editor/main.cpp b/editor/main.cpp new file mode 100644 index 00000000..a3aa7cbc --- /dev/null +++ b/editor/main.cpp @@ -0,0 +1,11 @@ +#include "editorwindow.h" +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + EditorWindow w; + w.show(); + + return a.exec(); +} diff --git a/editor/tooltip.py b/editor/tooltip.py deleted file mode 100644 index 57ed7a86..00000000 --- a/editor/tooltip.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python3 - -import sys -from PyQt5.QtWidgets import QWidget, QPushButton, QApplication -from PyQt5.QtCore import QCoreApplication - - -class Example(QWidget): - - def __init__(self): - super().__init__() - self.initUI() - - def initUI(self): - qbtn = QPushButton("Quit", self) - qbtn.clicked.connect(QCoreApplication.instance().quit) - qbtn.resize(qbtn.sizeHint()) - qbtn.move(50, 50) - - self.setGeometry(300, 300, 250, 150) - self.setWindowTitle("Quit Button") - self.show() - - -if __name__ == "__main__": - app = QApplication(sys.argv) - ex = Example() - sys.exit(app.exec_()) -- cgit