// HQtMain.cpp
// 
// HOOPS/MVO and HOOPS/QT global variables are declared and initialized
// One Qt QApplication object is instanced and configured
// One initial HQApplication object is instanced
// The Qt event processing loop is launched

// Qt Headers
#include <qapplication.h>
#include <qobject.h>

// HOOPS/MVO Headers
#include "HDB.h"

// HOOPS/Qt Headers
#include "HQApplication.h"
#include "HQDeleter.h"

// HOOPS Headers
#include "hc.h"

// Create Global pointer to HOOPS/MVO class HDB
HDB * m_pHDB=0;

// Create a global pointer to HOOPS/Qt class HQDeleter
HQDeleter * deleter=0;
 

int main( int argc, char **argv )

// Initialize the global HOOPS Database Object
m_pHDB = new HDB();
m_pHDB->Init();
// Create an HQDeleter object and initialize the global pointer
deleter = new HQDeleter();
// Configure Qt's color allocation approach and GUI Sytle
QApplication::setColorSpec( QApplication::ManyColor );
QApplication::setStyle(WindowsStyle);

// Create the one QApplication object
QApplication * a = new QApplication(argc,argv); 

// Form a Signal/Slot connection so the applicaiton will exit
// when the last top level widget closes
a->connect(a, SIGNAL(lastWindowClosed ()) , a, SLOT(quit()));

// Create an HQApplication object
HQApplication * ha = new HQApplication(a);

// Launch the Qt event processing loop
return a->exec();

// Clean up
delete m_pHDB;

}