/*----------------------------------------------------------------------------*/
/* COPYRIGHT: TriTime (c) 2003/2005 / www.tritime.org                         */
/*----------------------------------------------------------------------------*/
/* PROJEKT  : TTCUT 2005                                                      */
/* FILE     : main.cpp                                                        */
/*----------------------------------------------------------------------------*/
/* AUTHOR  : b. altendorf (E-Mail: b.altendorf@tritime.de)   DATE: 02/01/2005 */
/* MODIFIED: b. altendorf                                    DATE: 02/23/2005 */
/* MODIFIED: b. altendorf                                    DATE: 05/25/2007 */
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.              */
/*----------------------------------------------------------------------------*/

// Qt headers
#include <QApplication>
#include <QMessageBox>
// #include <QSurfaceFormat>
#include <QStyleFactory>

// class declaration for the main window class
#include "ttcutmainwindow.h"

/* /////////////////////////////////////////////////////////////////////////////
 * TTCut main
 */
int main( int argc, char **argv )
{
  try
  {
    QT_REQUIRE_VERSION(argc, argv, "5.7.0");

    QApplication a( argc, argv );

    // Application main widget
    TTCutMainWindow* mainWnd = new TTCutMainWindow();

    a.setStyle(QStyleFactory::create("Fusion"));

    // Caption text in applications title bar
    mainWnd->setWindowTitle( TTCut::versionString );
    mainWnd->show();

    // set initial size of applications main window
    mainWnd->resize( 800, 600 );

    a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
    // Execute application and start event loop
    return a.exec();	   
  } 
  catch (...)
  {
    qWarning("Unhandled exception occurred!");
    qWarning("TTCut closed unexpectedly!");
  }
}
