Commit 916523b7 authored by wiebel's avatar wiebel
Browse files

hopefully made already existing code comply with CodingStandard

parent 13e454df
......@@ -13,6 +13,7 @@ PRESS 'c' again for further configuration
PRESS 'g' to generate the build system including the Makefiles.
> make
Now the "build" directory should contain an executable named bCognize. The program can be started with the following command:
Now the subdirectory "bin" of the "build" directory should contain an executable named bCognize.
Inside "build" the program can be started with the following command:
> ./bCognize
\ No newline at end of file
> bin/bCognize
\ No newline at end of file
cmake_minimum_required(VERSION 2.4)
cmake_minimum_required(VERSION 2.6)
PROJECT( BrainCognize )
find_package( Qt4 REQUIRED )
......@@ -9,13 +9,21 @@ include_directories( ${QT_INCLUDE_DIR} )
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTOPENGL_LIBRARY}
${QT_QT3SUPPORT_LIBRARY}
)
add_subdirectory( gui )
set( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib )
mark_as_advanced( LIBRARY_OUTPUT_PATH )
set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
mark_as_advanced( EXECUTABLE_OUTPUT_PATH )
add_executable( bCognize bCognize.cpp )
target_link_libraries(
bCognize
guiqt4
${QT_LINK_LIBRARIES}
)
\ No newline at end of file
/*
* bCognize.cpp
*
* Created on: Mar 25, 2009
* Author: wiebel
*/
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#include <iostream>
#include <QtGui/QApplication>
#include "gui/qt4/BCMainWindow.h"
#include "gui/qt4/BMainWindow.h"
using namespace std;
int main( int argc, char* argv[] )
{
QApplication appl( argc, argv );
QMainWindow *widget = new QMainWindow;
BCMainWindow gui;
gui.setupGUI(widget);
BMainWindow gui;
gui.setupGUI( widget );
widget->show();
int qtExecResult;
qtExecResult = appl.exec ();
return qtExecResult;
int qtExecResult;
qtExecResult = appl.exec();
return qtExecResult;
}
add_subdirectory( qt4 )
\ No newline at end of file
#ifndef BCMAINWINDOW_H
#define BCMAINWINDOW_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#include "../icons/icons.h"
class BCMainWindow
{
public:
QAction *actionLoad;
QAction *actionSave;
QAction *actionPreferences;
QAction *actionExit;
QAction *actionAbout_BrainCognize;
QWidget *centralwidget;
QMenuBar *menubar;
QMenu *menuFile;
QMenu *menuHelp;
// QStatusBar *statusBar;
QToolBar *toolBar;
void setupGUI(QMainWindow *MainWindow)
{
QIcon mainWindowIcon;
QIcon quitIcon;
QIcon saveIcon;
QIcon loadIcon;
QIcon aboutIcon;
mainWindowIcon.addPixmap( QPixmap( logoIcon_xpm ) );
quitIcon.addPixmap( QPixmap( quit_xpm ) );
saveIcon.addPixmap( QPixmap( disc_xpm ) );
loadIcon.addPixmap( QPixmap( fileopen_xpm ) );
aboutIcon.addPixmap( QPixmap( logoIcon_xpm ) );
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(946, 632);
MainWindow->setWindowIcon(mainWindowIcon);
actionLoad = new QAction(MainWindow);
actionLoad->setObjectName(QString::fromUtf8("actionLoad"));
actionLoad->setIcon(loadIcon);
actionLoad->setText(QApplication::translate("MainWindow", "Load", 0, QApplication::UnicodeUTF8));
actionLoad->setShortcut(QApplication::translate("MainWindow", "Ctrl+L", 0, QApplication::UnicodeUTF8));
actionSave = new QAction(MainWindow);
actionSave->setObjectName(QString::fromUtf8("actionSave"));
actionSave->setIcon(saveIcon);
actionSave->setText(QApplication::translate("MainWindow", "Save", 0, QApplication::UnicodeUTF8));
actionPreferences = new QAction(MainWindow);
actionPreferences->setObjectName(QString::fromUtf8("actionPreferences"));
actionPreferences->setText(QApplication::translate("MainWindow", "Preferences", 0, QApplication::UnicodeUTF8));
actionExit = new QAction(MainWindow);
actionExit->setObjectName(QString::fromUtf8("actionExit"));
actionExit->setIcon(quitIcon);
actionExit->setText(QApplication::translate("MainWindow", "E&xit", 0, QApplication::UnicodeUTF8));
actionExit->setShortcut(QApplication::translate("MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8));
actionAbout_BrainCognize = new QAction(MainWindow);
actionAbout_BrainCognize->setObjectName(QString::fromUtf8("actionAbout_BrainCognize"));
actionAbout_BrainCognize->setIcon(aboutIcon);
actionAbout_BrainCognize->setText(QApplication::translate("MainWindow", "About BrainCognize", 0, QApplication::UnicodeUTF8));
centralwidget = new QWidget(MainWindow);
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
menubar->setObjectName(QString::fromUtf8("menubar"));
menubar->setGeometry(QRect(0, 0, 946, 24));
menuFile = new QMenu(menubar);
menuFile->setObjectName(QString::fromUtf8("menuFile"));
menuHelp = new QMenu(menubar);
menuHelp->setObjectName(QString::fromUtf8("menuHelp"));
MainWindow->setMenuBar(menubar);
toolBar = new QToolBar(MainWindow);
toolBar->setObjectName(QString::fromUtf8("toolBar"));
MainWindow->addToolBar(Qt::TopToolBarArea, toolBar);
menubar->addAction(menuFile->menuAction());
menubar->addAction(menuHelp->menuAction());
menuFile->addAction(actionLoad);
menuFile->addAction(actionSave);
menuFile->addSeparator();
menuFile->addAction(actionPreferences);
menuFile->addSeparator();
menuFile->addAction(actionExit);
menuFile->setTitle(QApplication::translate("MainWindow", "&File", 0, QApplication::UnicodeUTF8));
menuHelp->addAction(actionAbout_BrainCognize);
menuHelp->setTitle(QApplication::translate("MainWindow", "&Help", 0, QApplication::UnicodeUTF8));
toolBar->addSeparator();
MainWindow->setWindowTitle( QApplication::translate("MainWindow", "BrainCognize", 0, QApplication::UnicodeUTF8) );
toolBar->setWindowTitle(QApplication::translate("MainWindow", "toolBar", 0, QApplication::UnicodeUTF8));
QObject::connect(actionExit, SIGNAL(activated()), MainWindow, SLOT(close()));
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
};
#endif // BCMAINWINDOW_H
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#include "BMainWindow.h"
void BMainWindow::setupGUI( QMainWindow *MainWindow )
{
QIcon mainWindowIcon;
QIcon quitIcon;
QIcon saveIcon;
QIcon loadIcon;
QIcon aboutIcon;
mainWindowIcon.addPixmap( QPixmap( logoIcon_xpm ) );
quitIcon.addPixmap( QPixmap( quit_xpm ) );
saveIcon.addPixmap( QPixmap( disc_xpm ) );
loadIcon.addPixmap( QPixmap( fileopen_xpm ) );
aboutIcon.addPixmap( QPixmap( logoIcon_xpm ) );
if( MainWindow->objectName().isEmpty() )
MainWindow->setObjectName( QString::fromUtf8( "MainWindow" ) );
MainWindow->resize( 946, 632 );
MainWindow->setWindowIcon( mainWindowIcon );
m_actionLoad = new QAction( MainWindow );
m_actionLoad->setObjectName( QString::fromUtf8( "actionLoad" ) );
m_actionLoad->setIcon( loadIcon );
m_actionLoad->setText( QApplication::translate( "MainWindow", "Load", 0, QApplication::UnicodeUTF8 ) );
m_actionLoad->setShortcut( QApplication::translate( "MainWindow", "Ctrl+L", 0, QApplication::UnicodeUTF8 ) );
m_actionSave = new QAction( MainWindow );
m_actionSave->setObjectName( QString::fromUtf8( "actionSave" ) );
m_actionSave->setIcon( saveIcon );
m_actionSave->setText( QApplication::translate( "MainWindow", "Save", 0, QApplication::UnicodeUTF8 ) );
m_actionPreferences = new QAction( MainWindow );
m_actionPreferences->setObjectName( QString::fromUtf8( "actionPreferences" ) );
m_actionPreferences->setText( QApplication::translate( "MainWindow", "Preferences", 0, QApplication::UnicodeUTF8 ) );
m_actionExit = new QAction( MainWindow );
m_actionExit->setObjectName( QString::fromUtf8( "actionExit" ) );
m_actionExit->setIcon( quitIcon );
m_actionExit->setText( QApplication::translate( "MainWindow", "E&xit", 0, QApplication::UnicodeUTF8 ) );
m_actionExit->setShortcut( QApplication::translate( "MainWindow", "Ctrl+Q", 0, QApplication::UnicodeUTF8 ) );
m_actionAbout_BrainCognize = new QAction( MainWindow );
m_actionAbout_BrainCognize->setObjectName( QString::fromUtf8( "actionAbout_BrainCognize" ) );
m_actionAbout_BrainCognize->setIcon( aboutIcon );
m_actionAbout_BrainCognize->setText( QApplication::translate( "MainWindow", "About BrainCognize", 0, QApplication::UnicodeUTF8 ) );
m_centralwidget = new QWidget( MainWindow );
m_centralwidget->setObjectName( QString::fromUtf8( "centralwidget" ) );
MainWindow->setCentralWidget( m_centralwidget );
m_menubar = new QMenuBar( MainWindow );
m_menubar->setObjectName( QString::fromUtf8( "menubar" ) );
m_menubar->setGeometry( QRect( 0, 0, 946, 24 ) );
m_menuFile = new QMenu( m_menubar );
m_menuFile->setObjectName( QString::fromUtf8( "menuFile" ) );
m_menuHelp = new QMenu( m_menubar );
m_menuHelp->setObjectName( QString::fromUtf8( "menuHelp" ) );
MainWindow->setMenuBar( m_menubar );
m_toolBar = new QToolBar( MainWindow );
m_toolBar->setObjectName( QString::fromUtf8( "toolBar" ) );
MainWindow->addToolBar( Qt::TopToolBarArea, m_toolBar );
m_menubar->addAction( m_menuFile->menuAction() );
m_menubar->addAction( m_menuHelp->menuAction() );
m_menuFile->addAction( m_actionLoad );
m_menuFile->addAction( m_actionSave );
m_menuFile->addSeparator();
m_menuFile->addAction( m_actionPreferences );
m_menuFile->addSeparator();
m_menuFile->addAction( m_actionExit );
m_menuFile->setTitle( QApplication::translate( "MainWindow", "&File", 0, QApplication::UnicodeUTF8 ) );
m_menuHelp->addAction( m_actionAbout_BrainCognize );
m_menuHelp->setTitle( QApplication::translate( "MainWindow", "&Help", 0, QApplication::UnicodeUTF8 ) );
m_toolBar->addSeparator();
MainWindow->setWindowTitle( QApplication::translate( "MainWindow", "BrainCognize", 0, QApplication::UnicodeUTF8 ) );
m_toolBar->setWindowTitle( QApplication::translate( "MainWindow", "toolBar", 0, QApplication::UnicodeUTF8 ) );
QObject::connect( m_actionExit, SIGNAL(activated()), MainWindow, SLOT(close()) );
QMetaObject::connectSlotsByName( MainWindow );
} // setupUi
//---------------------------------------------------------------------------
//
// Project: BrainCognize
//
//---------------------------------------------------------------------------
#ifndef BMAINWINDOW_H
#define BMAINWINDOW_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QMainWindow>
#include <QtGui/QMenu>
#include <QtGui/QMenuBar>
#include <QtGui/QStatusBar>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#include "../icons/icons.h"
class BMainWindow
{
public:
void setupGUI( QMainWindow *MainWindow );
private:
QAction* m_actionLoad;
QAction* m_actionSave;
QAction* m_actionPreferences;
QAction* m_actionExit;
QAction* m_actionAbout_BrainCognize;
QWidget* m_centralwidget;
QMenuBar* m_menubar;
QMenu* m_menuFile;
QMenu* m_menuHelp;
// QStatusBar* m_statusBar;
QToolBar* m_toolBar;
};
#endif // BMAINWINDOW_H
list( APPEND GUI_QT4_SRC
BMainWindow.cpp
)
add_library( guiqt4 SHARED ${GUI_QT4_SRC} )
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment