-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
31 lines (29 loc) · 1.04 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <QApplication>
#include "html5applicationviewer.h"
#include "chumbycontrolls.h"
#include <QDebug>
#include <mydebug.h>
#include <mypage.h>
#include <QGraphicsWebView>
#include <QScopedPointer>
#include <QWebFrame>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Html5ApplicationViewer viewer;
viewer.setOrientation(Html5ApplicationViewer::ScreenOrientationAuto);
viewer.showFullScreen();
viewer.webView()->setPage(new MyPage);
QWebSettings *settings = viewer.webView()->page()->settings();
settings->enablePersistentStorage("/mnt/usb/webcache");
settings->setMaximumPagesInCache(1);
settings->setObjectCacheCapacities(0, 0, 0);
QWebFrame *frame = viewer.webView()->page()->mainFrame();
QScopedPointer<ChumbyControlls> chum(new ChumbyControlls());
frame->addToJavaScriptWindowObject("chumby", chum.data());
viewer.loadUrl(QUrl(app.arguments().at(1)));
qDebug() << "Running application";
MyDebug *mdb = new MyDebug(viewer.webView());
mdb->test();
return app.exec();
}