1 |
#include <QApplication> |
#include <QApplication> |
2 |
#include <QtWebKit> |
#include "mainview.h" |
3 |
|
#include <QtDebug> |
4 |
|
|
5 |
class MyWebView : public QWebView |
|
6 |
|
//TODO: write messages to log file |
7 |
|
void myMessageOutput(QtMsgType type, const char *msg) |
8 |
{ |
{ |
9 |
public: |
switch (type) { |
10 |
MyWebView(QWidget* parent) : QWebView(parent) { |
case QtDebugMsg: |
11 |
this->setWindowState( Qt::WindowFullScreen ); |
fprintf(stderr, "Debug: %s\n", msg); |
12 |
} |
break; |
13 |
|
case QtWarningMsg: |
14 |
}; |
fprintf(stderr, "Warning: %s\n", msg); |
15 |
|
break; |
16 |
|
case QtCriticalMsg: |
17 |
|
fprintf(stderr, "Critical: %s\n", msg); |
18 |
|
break; |
19 |
|
case QtFatalMsg: |
20 |
|
fprintf(stderr, "Fatal: %s\n", msg); |
21 |
|
abort(); |
22 |
|
} |
23 |
|
} |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
int main(int argc, char** argv) { |
int main(int argc, char** argv) { |
|
QApplication app(argc,argv); |
|
28 |
|
|
29 |
|
qInstallMsgHandler(myMessageOutput); |
30 |
|
qDebug() << "--------------------------------------------------------------------------------------------"; |
31 |
|
|
32 |
QWebSettings* settings = QWebSettings::globalSettings(); |
QApplication app(argc,argv); |
33 |
settings->setAttribute( QWebSettings::JavascriptEnabled, true); |
app.setApplicationName("infoscreen"); |
|
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(); |
|
|
|
|
34 |
|
|
35 |
|
MainView main(0); |
36 |
|
main.show(); |
37 |
|
|
38 |
return app.exec(); |
return app.exec(); |
39 |
} |
} |