#include <QtGui/QApplication>
#include <QThread>
#include <QMetaType>
#include <QHostAddress>

#include <stdio.h>
#include <stdlib.h>

#include "clientglobals.h"
#include "mainwindow.h"
 void myMessageOutput(QtMsgType type, const char *msg)
 {
     switch (type) {
     case QtDebugMsg:
         fprintf(stderr, "Debug: %x %s\n", (uint)QThread::currentThread(), msg);
         break;
     case QtWarningMsg:
         fprintf(stderr, "Warning: %x %s\n", (uint)QThread::currentThread(), msg);
         break;
     case QtCriticalMsg:
         fprintf(stderr, "Critical: %x %s\n", (uint)QThread::currentThread(), msg);
         break;
     case QtFatalMsg:
         fprintf(stderr, "Fatal: %x %s\n", (uint)QThread::currentThread(), msg);
         abort();
     }
 }


int main(int argc, char *argv[])
{
    qInstallMsgHandler(myMessageOutput);
    QApplication a(argc, argv);
    qRegisterMetaType<QHostAddress>("QHostAddress");
    qRegisterMetaType<KeyEvent>("KeyEvent");
    qRegisterMetaType<MouseEvent>("MouseEvent");

    a.setApplicationName("QEMU Client");
    a.setAttribute( Qt::AA_NativeWindows, true );

    MainWindow w;
    w.show();
    return a.exec();
}

