From 8bc67f25071622e4e88f36d546d5ec8202459d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sun, 25 Dec 2011 21:19:32 +0000 Subject: [PATCH] paysages: Started Qt GUI git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@202 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- Makefile | 8 + gui_qt/formwater.cpp | 14 ++ gui_qt/formwater.h | 22 +++ gui_qt/formwater.ui | 338 ++++++++++++++++++++++++++++++++ gui_qt/main.cc | 16 ++ gui_qt/mainwindow.cpp | 20 ++ gui_qt/mainwindow.h | 22 +++ gui_qt/mainwindow.ui | 105 ++++++++++ gui_qt/paysages-qt.pro | 21 ++ gui_qt/paysages-qt.pro.user | 159 +++++++++++++++ lib_paysages/shared/functions.h | 6 +- 11 files changed, 728 insertions(+), 3 deletions(-) create mode 100644 gui_qt/formwater.cpp create mode 100644 gui_qt/formwater.h create mode 100644 gui_qt/formwater.ui create mode 100644 gui_qt/main.cc create mode 100644 gui_qt/mainwindow.cpp create mode 100644 gui_qt/mainwindow.h create mode 100644 gui_qt/mainwindow.ui create mode 100644 gui_qt/paysages-qt.pro create mode 100644 gui_qt/paysages-qt.pro.user diff --git a/Makefile b/Makefile index b500b2c..698f4f4 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,17 @@ all: cd lib_paysages && make cd gui_gtk && make + cd gui_qt && qmake && make clean: cd lib_paysages && make clean cd gui_gtk && make clean + cd gui_qt && make clean && rm -f Makefile paysages-qt + +run_gtk: + LD_LIBRARY_PATH=lib_paysages ./gui_gtk/paysages-gtk + +run_qt: + LD_LIBRARY_PATH=lib_paysages ./gui_qt/paysages-qt .PHONY:all clean diff --git a/gui_qt/formwater.cpp b/gui_qt/formwater.cpp new file mode 100644 index 0000000..c931272 --- /dev/null +++ b/gui_qt/formwater.cpp @@ -0,0 +1,14 @@ +#include "formwater.h" +#include "ui_formwater.h" + +FormWater::FormWater(QWidget *parent) : + QWidget(parent), + ui(new Ui::FormWater) +{ + ui->setupUi(this); +} + +FormWater::~FormWater() +{ + delete ui; +} diff --git a/gui_qt/formwater.h b/gui_qt/formwater.h new file mode 100644 index 0000000..ef499c6 --- /dev/null +++ b/gui_qt/formwater.h @@ -0,0 +1,22 @@ +#ifndef FORMWATER_H +#define FORMWATER_H + +#include + +namespace Ui { + class FormWater; +} + +class FormWater : public QWidget +{ + Q_OBJECT + +public: + explicit FormWater(QWidget *parent = 0); + ~FormWater(); + +private: + Ui::FormWater *ui; +}; + +#endif // FORMWATER_H diff --git a/gui_qt/formwater.ui b/gui_qt/formwater.ui new file mode 100644 index 0000000..d3ade26 --- /dev/null +++ b/gui_qt/formwater.ui @@ -0,0 +1,338 @@ + + + FormWater + + + + 0 + 0 + 739 + 591 + + + + Form + + + + + 279 + 550 + 451 + 31 + + + + + + + Apply + + + + + + + Revert + + + + + + + + + 10 + 10 + 258 + 566 + + + + + + + + 0 + 0 + + + + Coverage preview + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 256 + 256 + + + + + 256 + 256 + + + + + 256 + 256 + + + + + + + + + 0 + 0 + + + + Color preview + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 256 + 256 + + + + + 256 + 256 + + + + + 256 + 256 + + + + + + + + + + 280 + 10 + 451 + 531 + + + + 2 + + + + + 0 + 0 + 98 + 28 + + + + Coverage + + + + + 0 + 0 + 451 + 431 + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Height + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + 98 + 28 + + + + Waves + + + + + + 0 + 0 + 451 + 438 + + + + Colors + + + + + 0 + 0 + 451 + 431 + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + Transparency + + + + + + + 1000 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 100 + + + + + + + Reflection + + + + + + + 1000 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 100 + + + + + + + Surface color + + + + + + + PushButton + + + + + + + Depth color + + + + + + + Depth limit + + + + + + + PushButton + + + + + + + 50 + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1 + + + + + + + + + + + diff --git a/gui_qt/main.cc b/gui_qt/main.cc new file mode 100644 index 0000000..9c15be8 --- /dev/null +++ b/gui_qt/main.cc @@ -0,0 +1,16 @@ +#include +#include "mainwindow.h" + +#include "../lib_paysages/shared/functions.h" + +int main(int argc, char** argv) +{ + QApplication app(argc, argv); + MainWindow window; + + paysagesInit(); + + window.show(); + + return app.exec(); +} diff --git a/gui_qt/mainwindow.cpp b/gui_qt/mainwindow.cpp new file mode 100644 index 0000000..aff3226 --- /dev/null +++ b/gui_qt/mainwindow.cpp @@ -0,0 +1,20 @@ +#include "mainwindow.h" +#include "formwater.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) +{ + QTabWidget* tabs; + + ui->setupUi(this); + + tabs = this->findChild("tabWidget"); + tabs->addTab(new FormWater(tabs), "Water"); +} + +MainWindow::~MainWindow() +{ + delete ui; +} diff --git a/gui_qt/mainwindow.h b/gui_qt/mainwindow.h new file mode 100644 index 0000000..c9fd6a9 --- /dev/null +++ b/gui_qt/mainwindow.h @@ -0,0 +1,22 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { + class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/gui_qt/mainwindow.ui b/gui_qt/mainwindow.ui new file mode 100644 index 0000000..71ff3f9 --- /dev/null +++ b/gui_qt/mainwindow.ui @@ -0,0 +1,105 @@ + + + MainWindow + + + + 0 + 0 + 744 + 673 + + + + + 0 + 0 + + + + + 744 + 673 + + + + + 744 + 673 + + + + + 744 + 673 + + + + Paysages + + + + + + 0 + 0 + 741 + 621 + + + + -1 + + + + + + + 0 + 0 + 744 + 25 + + + + + File + + + + + + + + + About... + + + + + + + + + New + + + + + Save + + + + + Load + + + + + Quit + + + + + + diff --git a/gui_qt/paysages-qt.pro b/gui_qt/paysages-qt.pro new file mode 100644 index 0000000..e05d753 --- /dev/null +++ b/gui_qt/paysages-qt.pro @@ -0,0 +1,21 @@ +###################################################################### +# Automatically generated by qmake (2.01a) dim. dc. 25 21:03:17 2011 +###################################################################### + +TEMPLATE = app +TARGET = +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += debug + +LIBS += -L../lib_paysages/ -lpaysages + +# Input +HEADERS += ../lib_paysages/shared/functions.h ../lib_paysages/shared/types.h \ + mainwindow.h \ + formwater.h +FORMS += mainwindow.ui \ + formwater.ui +SOURCES += main.cc \ + mainwindow.cpp \ + formwater.cpp diff --git a/gui_qt/paysages-qt.pro.user b/gui_qt/paysages-qt.pro.user new file mode 100644 index 0000000..8348f08 --- /dev/null +++ b/gui_qt/paysages-qt.pro.user @@ -0,0 +1,159 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + System + false + false + 4 + true + 1 + true + false + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + 0 + + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit. + + + qmake + + QtProjectManager.QMakeBuildStep + false + + false + + + Make + + Qt4ProjectManager.MakeStep + false + + + + 2 + Compiler + + ProjectExplorer.BuildSteps.Build + + + + Make + + Qt4ProjectManager.MakeStep + true + clean + + + 1 + Nettoyer + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + 4.7.4 Release + + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/michael/coding/paysages/gui_qt + 3 + ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit. + false + + 1 + + + 0 + Déploiement + + ProjectExplorer.BuildSteps.Deploy + + 1 + Pas de déploiement + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + true + 25 + + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + paysages-qt + + Qt4ProjectManager.Qt4RunConfiguration + 2 + + paysages-qt.pro + false + false + + LD_LIBRARY_PATH=../lib_paysages + + + 3768 + true + false + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.EnvironmentId + {8abe6662-5ded-4243-9d4d-dbf8a3c19b83} + + + ProjectExplorer.Project.Updater.FileVersion + 9 + + diff --git a/lib_paysages/shared/functions.h b/lib_paysages/shared/functions.h index fca8ad6..5d8cd2a 100644 --- a/lib_paysages/shared/functions.h +++ b/lib_paysages/shared/functions.h @@ -1,13 +1,13 @@ #ifndef _PAYSAGES_FUNCTIONS_H_ #define _PAYSAGES_FUNCTIONS_H_ -#include "types.h" -#include - #ifdef __cplusplus extern "C" { #endif +#include "types.h" +#include + void paysagesInit(); /* array.c */