Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc @ 7555

Last change on this file since 7555 was 7555, checked in by bensch, 18 years ago

orxonox/qt_gui: more elaborate Saveables

File size: 2.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
17
18#include "qt_gui.h"
19
20#include <QtGui/QApplication>
21#include <QtGui/QToolBox>
22#include <QtGui/QGridLayout>
23
24#include "qt_gui_elements.h"
25#include "gui_video.h"
26#include "gui_audio.h"
27
28namespace OrxGui
29{
30  QtGui::QtGui(int argc, char** argv)
31  : QApplication(argc, argv)
32  {
33
34    this->mainWindow = new QMainWindow();
35
36
37    QGroupBox* groupBox = new QGroupBox(this->mainWindow);
38    QGridLayout* mainLayout = new QGridLayout(groupBox);
39    {
40      QToolBox* toolBox = new QToolBox(groupBox);
41      {
42
43        toolBox->addItem(new GuiVideo(this), "Video");
44        toolBox->addItem(new GuiAudio(this), "Audio");
45      }
46      mainLayout->addWidget(toolBox,1,1, 1, 3);
47
48
49      QPushButton* start = new QPushButton("start");
50      connect(start, SIGNAL(released()), this, SLOT(startApp()));
51      mainLayout->addWidget(start, 2,2);
52
53      QPushButton* quit = new QPushButton("quit");
54      connect(quit, SIGNAL(released()), this, SLOT(quitApp()));
55      mainLayout->addWidget(quit, 2,3);
56
57    }
58
59    connect(this->mainWindow, SIGNAL(destroyed()), this, SLOT(quitApp()));
60    this->mainWindow->setCentralWidget(groupBox);
61    this->mainWindow->show();
62
63    this->exec();
64  }
65
66  QtGui::~QtGui()
67  {
68    delete this->mainWindow;
69  }
70
71  void QtGui::startGui()
72  {}
73
74  void QtGui::stopGui()
75  {}
76
77  void QtGui::suspend()
78  {}
79
80    //! Update the Gui.
81  void QtGui::update()
82  {
83    this->processEvents();
84  }
85
86
87  void QtGui::quitApp()
88  {
89    Gui::quitEvent();
90    this->quit();
91  }
92
93  void QtGui::startApp()
94  {
95    Gui::startEvent();
96    this->quit();
97  }
98
99}
Note: See TracBrowser for help on using the repository browser.