From de751b500e635ea4c102a7c9bde442a45667b264 Mon Sep 17 00:00:00 2001 From: Niklas Goby Date: Tue, 11 Jan 2011 17:12:03 +0100 Subject: der bisherige stand der dinge --- webkitTest/webkittest.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 webkitTest/webkittest.cpp (limited to 'webkitTest/webkittest.cpp') diff --git a/webkitTest/webkittest.cpp b/webkitTest/webkittest.cpp new file mode 100644 index 0000000..c8d460d --- /dev/null +++ b/webkitTest/webkittest.cpp @@ -0,0 +1,58 @@ +#include +#include +#include //needed for In/Output +#include "webkittest.h" + +webkitTest::webkitTest(QWidget *parent, QUrl & url) + : QWidget(parent) +{ + ui.setupUi(this); + this->url = url; + //define starting page + ui.webView->load(this->url); //QUrl("http://132.230.4.3/webkitTest.html") + ui.webView->show(); + + //enable JavaScript access to qt objects + QObject::connect(ui.webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJSObject())); + + //remove the window decoration + Qt::WindowFlags flags = Qt::SplashScreen; + this->setWindowFlags(flags); + + //set form to fullscreen + this->showFullScreen(); + + //set webView to the same size as the form + ui.webView->resize(this->size()); + +} + + +//enable JavaScript access to qt objects +void webkitTest::addJSObject() { + ui.webView->page()->mainFrame()->addToJavaScriptWindowObject(QString("webkitTest"), this); +} + +void webkitTest::writeText(QString text){ + QFile file("out.txt"); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream out(&file); + out << text << "\n"; +} +/* +void webkitTest::setQApplication(const QApplication & app){ + +} +*/ +void webkitTest::setUrl(QUrl & url){ + this->url = url; +} + +webkitTest::~webkitTest() +{ + +} + + -- cgit v1.2.3-55-g7522