--- infoscreen/main.cpp 2009/12/11 08:17:45 501 +++ infoscreen/main.cpp 2010/07/16 07:41:48 996 @@ -1,28 +1,39 @@ #include -#include +#include "mainview.h" +#include -class MyWebView : public QWebView + +//TODO: write messages to log file +void myMessageOutput(QtMsgType type, const char *msg) { -public: - MyWebView(QWidget* parent) : QWebView(parent) { - this->setWindowState( Qt::WindowFullScreen ); - } - -}; + switch (type) { + case QtDebugMsg: + fprintf(stderr, "Debug: %s\n", msg); + break; + case QtWarningMsg: + fprintf(stderr, "Warning: %s\n", msg); + break; + case QtCriticalMsg: + fprintf(stderr, "Critical: %s\n", msg); + break; + case QtFatalMsg: + fprintf(stderr, "Fatal: %s\n", msg); + abort(); + } +} + int main(int argc, char** argv) { - QApplication app(argc,argv); + qInstallMsgHandler(myMessageOutput); + qDebug() << "--------------------------------------------------------------------------------------------"; - QWebSettings* settings = QWebSettings::globalSettings(); - settings->setAttribute( QWebSettings::JavascriptEnabled, true); - settings->setAttribute( QWebSettings::PluginsEnabled, true); - - MyWebView web(0); - web.load(QUrl("http://10.210.210.200/infoscreens/screen.php?screen_id=1&height=480&width=640")); - web.show(); - + QApplication app(argc,argv); + app.setApplicationName("infoscreen"); + MainView main(0); + main.show(); + return app.exec(); }