E:/dev/ssip2006/snake/MainProgram.cpp

Go to the documentation of this file.
00001 // Qt includes
00002 #include <Qt/qapplication.h>
00003 
00004 // local includes
00005 #include "MainProgram.h"
00006 #include "MainWindow.h"
00007 #include "QtCvWrapper.h"
00008 
00010 MainProgram::MainProgram(int argc, char* argv[])
00011 {
00012         // create a new instance of QApplication with params argc and argv
00013         QApplication app( argc, argv );
00014         // create a new instance of MainWindow with no parent widget
00015         m_mainWindow = new MainWindow(0, Qt::Window);
00016         // The main widget is like any other, in most respects except that if it is deleted,
00017         // the application exits.
00018         app.setActiveWindow(m_mainWindow);
00019         // resize window to 800x600 (including the 512x512 image space)
00020         m_mainWindow->resize(800,530);
00021         // Shows the widget and its child widgets.
00022         m_mainWindow->show();
00023 
00024         m_wrapper = new QtCvWrapper(this, m_mainWindow);
00025 
00026         // connections between gui and not-gui
00027         QObject::connect(m_mainWindow, SIGNAL(signalSnakeButtonPressed()), m_wrapper, SLOT(slotSnakeButtonPressed()));
00028         QObject::connect(m_mainWindow, SIGNAL(signalDemoButtonPressed()), m_wrapper, SLOT(slotTest()));
00029         QObject::connect(m_mainWindow, SIGNAL(signalImageOpened()), m_wrapper, SLOT(slotImageOpened()));
00030         QObject::connect(m_mainWindow, SIGNAL(signalInitCurve()), m_wrapper, SLOT(slotInitCurve()));
00031         // iteration on/off
00032         QObject::connect(m_mainWindow, SIGNAL(signalIterationOn()), m_wrapper, SLOT(slotIterationOn()));
00033         QObject::connect(m_mainWindow, SIGNAL(signalIterationOff()), m_wrapper, SLOT(slotIterationOff()));
00034         QObject::connect(m_mainWindow, SIGNAL(signalIterationStep()), m_wrapper, SLOT(slotIterationStep()));
00035 
00036 
00037 
00038         
00039 
00040         // Enters the main event loop and waits until exit() is called
00041         // or the main widget is destroyed, and returns the value that
00042         // was set via to exit() (which is 0 if exit() is called via quit()).
00043         app.exec();
00044 }
00045 
00047 MainProgram::~MainProgram(void)
00048 {
00049 }
00050 

Generated on Thu Jul 6 23:16:43 2006 for Snake Ballooning by  doxygen 1.4.7