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 | |
---|
28 | namespace 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(toolBox), "Video"); |
---|
44 | toolBox->addItem(new GuiAudio(toolBox), "Audio"); |
---|
45 | } |
---|
46 | mainLayout->addWidget(toolBox,1,1, 1, 3); |
---|
47 | |
---|
48 | |
---|
49 | QPushButton* quit = new QPushButton("quit"); |
---|
50 | connect(quit, SIGNAL(released()), this, SLOT(quit())); |
---|
51 | |
---|
52 | mainLayout->addWidget(quit, 2,3); |
---|
53 | } |
---|
54 | |
---|
55 | this->mainWindow->setCentralWidget(groupBox); |
---|
56 | this->mainWindow->show(); |
---|
57 | |
---|
58 | this->exec(); |
---|
59 | |
---|
60 | |
---|
61 | } |
---|
62 | |
---|
63 | QtGui::~QtGui() |
---|
64 | { |
---|
65 | delete this->mainWindow; |
---|
66 | } |
---|
67 | |
---|
68 | void QtGui::startGui() |
---|
69 | {} |
---|
70 | |
---|
71 | void QtGui::stopGui() |
---|
72 | {} |
---|
73 | |
---|
74 | void QtGui::suspend() |
---|
75 | {} |
---|
76 | |
---|
77 | //! Update the Gui. |
---|
78 | void QtGui::update() |
---|
79 | { |
---|
80 | this->processEvents(); |
---|
81 | } |
---|
82 | |
---|
83 | } |
---|