[Orxonox-commit 2725] r7430 - sandbox_qt/src/orxonox

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Sep 12 18:52:54 CEST 2010


Author: rgrieder
Date: 2010-09-12 18:52:54 +0200 (Sun, 12 Sep 2010)
New Revision: 7430

Added:
   sandbox_qt/src/orxonox/MainWindow.cc
   sandbox_qt/src/orxonox/MainWindow.h
   sandbox_qt/src/orxonox/MainWindow.ui
Modified:
   sandbox_qt/src/orxonox/CMakeLists.txt
   sandbox_qt/src/orxonox/Main.cc
Log:
Added a main window to the Qt sandbox. That should be about it.

Modified: sandbox_qt/src/orxonox/CMakeLists.txt
===================================================================
--- sandbox_qt/src/orxonox/CMakeLists.txt	2010-09-12 14:27:55 UTC (rev 7429)
+++ sandbox_qt/src/orxonox/CMakeLists.txt	2010-09-12 16:52:54 UTC (rev 7430)
@@ -24,12 +24,17 @@
 
 SET_SOURCE_FILES(ORXONOX_SRC_FILES
   Main.cc
+  MainWindow.cc
 )
 
 #ADD_SUBDIRECTORY(subdir)
 
 ORXONOX_ADD_LIBRARY(orxonox
   FIND_HEADER_FILES
+  QT_MOC_FILES
+    MainWindow.h
+  QT_UIC_FILES
+    MainWindow.ui
   LINK_LIBRARIES
     ${QT_QTCORE_LIBRARY}
     ${QT_QTGUI_LIBRARY}

Modified: sandbox_qt/src/orxonox/Main.cc
===================================================================
--- sandbox_qt/src/orxonox/Main.cc	2010-09-12 14:27:55 UTC (rev 7429)
+++ sandbox_qt/src/orxonox/Main.cc	2010-09-12 16:52:54 UTC (rev 7430)
@@ -33,7 +33,7 @@
     The main function of Orxonox (but not the entry point of the program!)
 */
 
-#include "OrxonoxPrereqs.h"
+#include "Main.h"
 
 #include <QApplication>
 #include <QCoreApplication>
@@ -41,7 +41,7 @@
 #include "util/Debug.h"
 #include "core/CommandLineParser.h"
 #include "core/Core.h"
-#include "Main.h"
+#include "MainWindow.h"
 
 namespace orxonox
 {
@@ -61,12 +61,21 @@
             arguments.pop_front(); // Remove application path
         Core core(arguments.join(" ").toStdString());
 
-        QCoreApplication::setOrganizationName("");
-        QCoreApplication::setOrganizationDomain("");
-        QCoreApplication::setApplicationName("");
+        QCoreApplication::setOrganizationName("Orxonox");
+        QCoreApplication::setOrganizationDomain("www.orxonox.net");
+        QCoreApplication::setApplicationName("Orxonox Sandbox");
+        QString versionString;
+        versionString += QString::number(ORXONOX_VERSION_MAJOR);
+        versionString += QString::number(ORXONOX_VERSION_MINOR);
+        versionString += QString::number(ORXONOX_VERSION_PATCH);
+        QCoreApplication::setApplicationVersion(versionString);
 
         if (CommandLineParser::getValue("generateDoc").toString().isEmpty())
+        {
+            MainWindow window;
+            window.show();
             return app.exec();
+        }
         else
             return 0;
     }

Added: sandbox_qt/src/orxonox/MainWindow.cc
===================================================================
--- sandbox_qt/src/orxonox/MainWindow.cc	                        (rev 0)
+++ sandbox_qt/src/orxonox/MainWindow.cc	2010-09-12 16:52:54 UTC (rev 7430)
@@ -0,0 +1,37 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "MainWindow.h"
+
+namespace orxonox
+{
+    MainWindow::MainWindow()
+    {
+        setupUi(this);
+    }
+}

Added: sandbox_qt/src/orxonox/MainWindow.h
===================================================================
--- sandbox_qt/src/orxonox/MainWindow.h	                        (rev 0)
+++ sandbox_qt/src/orxonox/MainWindow.h	2010-09-12 16:52:54 UTC (rev 7430)
@@ -0,0 +1,48 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MainWindow_H__
+#define _MainWindow_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <QMainWindow>
+#include "orxonox/ui_MainWindow.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport MainWindow : public QMainWindow, private Ui::MainWindow
+    {
+        Q_OBJECT();
+
+    public:
+        MainWindow();
+    };
+}
+
+#endif /* _MainWindow_H__ */

Added: sandbox_qt/src/orxonox/MainWindow.ui
===================================================================
--- sandbox_qt/src/orxonox/MainWindow.ui	                        (rev 0)
+++ sandbox_qt/src/orxonox/MainWindow.ui	2010-09-12 16:52:54 UTC (rev 7430)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget"/>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>21</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>




More information about the Orxonox-commit mailing list