diff options
Diffstat (limited to 'fbbrowser')
| -rwxr-xr-x | fbbrowser/fbbrowser | bin | 25250 -> 25401 bytes | |||
| -rw-r--r-- | fbbrowser/fbbrowser.cpp | 14 | ||||
| -rw-r--r-- | fbbrowser/fbbrowser.h | 5 | ||||
| -rw-r--r-- | fbbrowser/fbbrowser.o | bin | 4680 -> 4772 bytes | |||
| -rw-r--r-- | fbbrowser/main.cpp | 7 | ||||
| -rw-r--r-- | fbbrowser/main.o | bin | 2660 -> 2740 bytes | |||
| -rw-r--r-- | fbbrowser/moc_fbbrowser.cpp | 32 | ||||
| -rw-r--r-- | fbbrowser/moc_fbbrowser.o | bin | 7096 -> 7504 bytes |
8 files changed, 43 insertions, 15 deletions
diff --git a/fbbrowser/fbbrowser b/fbbrowser/fbbrowser Binary files differindex 8eb0594..e49c50a 100755 --- a/fbbrowser/fbbrowser +++ b/fbbrowser/fbbrowser diff --git a/fbbrowser/fbbrowser.cpp b/fbbrowser/fbbrowser.cpp index f31f3d5..87e054b 100644 --- a/fbbrowser/fbbrowser.cpp +++ b/fbbrowser/fbbrowser.cpp @@ -1,9 +1,12 @@ #include "fbbrowser.h" #include <QtGui> #include <QtWebKit> +#include <QApplication> fbbrowser::fbbrowser(const QUrl & url) { + + view = new QWebView(this); view->load(url); @@ -24,11 +27,13 @@ fbbrowser::~fbbrowser() } -void fbbrowser::addJSObject() { +void fbbrowser::addJSObject() +{ view->page()->mainFrame()->addToJavaScriptWindowObject(QString("webkitTest"), this); } -void fbbrowser::writeText(QString text){ +void fbbrowser::writeText(QString text) +{ QFile file("out.txt"); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) return; @@ -36,3 +41,8 @@ void fbbrowser::writeText(QString text){ QTextStream out(&file); out << text << "\n"; } + +void fbbrowser::quitAll() +{ + //emit lastWindowClosed(); +} diff --git a/fbbrowser/fbbrowser.h b/fbbrowser/fbbrowser.h index f7c3c3a..8c32ef9 100644 --- a/fbbrowser/fbbrowser.h +++ b/fbbrowser/fbbrowser.h @@ -17,12 +17,17 @@ public: fbbrowser(const QUrl& url); ~fbbrowser(); Q_INVOKABLE void writeText(QString text); //used for writing web content into a file + Q_INVOKABLE void quitAll(); private: QWebView * view; + //QApplication * app(int & argc, char ** argv); private slots: void addJSObject(); + +signals: + void signalQuitAll(); }; #endif // FBBROWSER_H diff --git a/fbbrowser/fbbrowser.o b/fbbrowser/fbbrowser.o Binary files differindex 1c83e1e..516e66b 100644 --- a/fbbrowser/fbbrowser.o +++ b/fbbrowser/fbbrowser.o diff --git a/fbbrowser/main.cpp b/fbbrowser/main.cpp index a95626b..e0210f5 100644 --- a/fbbrowser/main.cpp +++ b/fbbrowser/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); - a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); + QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); QUrl url; if (argc > 1) @@ -14,7 +14,8 @@ int main(int argc, char *argv[]) else //Default url = QUrl("http://132.230.4.3/webkitTest.html"); - fbbrowser *w = new fbbrowser(url); - w->show(); + fbbrowser *fbb = new fbbrowser(url); + QObject::connect(fbb, SIGNAL(signalQuitAll()), &a, SLOT(quit())); + fbb->show(); return a.exec(); } diff --git a/fbbrowser/main.o b/fbbrowser/main.o Binary files differindex bd5a0b1..de3c015 100644 --- a/fbbrowser/main.o +++ b/fbbrowser/main.o diff --git a/fbbrowser/moc_fbbrowser.cpp b/fbbrowser/moc_fbbrowser.cpp index e5713c2..fa040a3 100644 --- a/fbbrowser/moc_fbbrowser.cpp +++ b/fbbrowser/moc_fbbrowser.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** Meta object code from reading C++ file 'fbbrowser.h' ** -** Created: Wed Jan 12 12:36:47 2011 +** Created: Wed Jan 12 14:11:04 2011 ** by: The Qt Meta Object Compiler version 62 (Qt 4.7.1) ** ** WARNING! All changes made in this file will be lost! @@ -23,25 +23,29 @@ static const uint qt_meta_data_fbbrowser[] = { 5, // revision 0, // classname 0, 0, // classinfo - 2, 14, // methods + 4, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags - 0, // signalCount + 1, // signalCount + + // signals: signature, parameters, type, tag, flags + 11, 10, 10, 10, 0x05, // slots: signature, parameters, type, tag, flags - 11, 10, 10, 10, 0x08, + 27, 10, 10, 10, 0x08, // methods: signature, parameters, type, tag, flags - 30, 25, 10, 10, 0x02, + 46, 41, 10, 10, 0x02, + 65, 10, 10, 10, 0x02, 0 // eod }; static const char qt_meta_stringdata_fbbrowser[] = { - "fbbrowser\0\0addJSObject()\0text\0" - "writeText(QString)\0" + "fbbrowser\0\0signalQuitAll()\0addJSObject()\0" + "text\0writeText(QString)\0quitAll()\0" }; const QMetaObject fbbrowser::staticMetaObject = { @@ -73,12 +77,20 @@ int fbbrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { - case 0: addJSObject(); break; - case 1: writeText((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 0: signalQuitAll(); break; + case 1: addJSObject(); break; + case 2: writeText((*reinterpret_cast< QString(*)>(_a[1]))); break; + case 3: quitAll(); break; default: ; } - _id -= 2; + _id -= 4; } return _id; } + +// SIGNAL 0 +void fbbrowser::signalQuitAll() +{ + QMetaObject::activate(this, &staticMetaObject, 0, 0); +} QT_END_MOC_NAMESPACE diff --git a/fbbrowser/moc_fbbrowser.o b/fbbrowser/moc_fbbrowser.o Binary files differindex bc7aa36..8026c30 100644 --- a/fbbrowser/moc_fbbrowser.o +++ b/fbbrowser/moc_fbbrowser.o |
