http://code.google.com/p/mcrux/source/detail?r=158
Modified:
/trunk/src/lib/MCruxWebView.cpp
/trunk/src/lib/MCruxWebView.h
/trunk/src/lib/window/MCruxQTWindow.cpp
/trunk/src/lib/window/MCruxQTWindow.h
=======================================
--- /trunk/src/lib/MCruxWebView.cpp Sat Nov 7 10:37:22 2009
+++ /trunk/src/lib/MCruxWebView.cpp Sun Nov 8 04:26:31 2009
@@ -70,11 +70,9 @@
webView = new QWebView(parentWindow);
parentWindow->setCentralWidget(webView);
- //webView->show();
#endif
return false;
}
-
#ifdef WIN32
bool MCruxWebView::setFrameLoadDelegate(MCruxWebFrameLoadDelegate *
frameLoadDelegate)
=======================================
--- /trunk/src/lib/MCruxWebView.h Sat Nov 7 10:37:22 2009
+++ /trunk/src/lib/MCruxWebView.h Sun Nov 8 04:26:31 2009
@@ -60,8 +60,17 @@
MCruxQTWindow * _parentWindow
#endif
);
- ~MCruxWebView();
-
+#ifndef WIN32 // for linux
+ virtual
+#endif
+ ~MCruxWebView();
+
+#ifndef WIN32 // for linux
+ QWebView * getWebView() const
+ {
+ return webView;
+ }
+#endif
bool createWebView();
bool navigateTo(const wstring & url);
=======================================
--- /trunk/src/lib/window/MCruxQTWindow.cpp Sat Nov 7 10:37:22 2009
+++ /trunk/src/lib/window/MCruxQTWindow.cpp Sun Nov 8 04:26:31 2009
@@ -33,29 +33,40 @@
{
cerr << "Error navigating to url:" << endl;
}
+ connect(webView.getWebView()->page()->mainFrame(),
SIGNAL(javaScriptWindowObjectCleared()), this,
SLOT(javaScriptWindowObjectCleared()));
+ // get the mainFrame and call addToJavaScriptWindowObject
+ //webView->page()->mainFrame();
}
MCruxQTWindow::~MCruxQTWindow()
{
}
+
+
+void MCruxQTWindow::javaScriptWindowObjectCleared()
+{
+ cout << "window object cleared" << endl;
+
//webView.getWebView()->page()->mainFrame()->addToJavaScriptWindowObject("mcrux",
this);
+}
+
int MCruxQTWindow::ShowWindow()
{
this->show();
- return 0;
+ return 0;
}
int MCruxQTWindow::HideWindow()
{
- return -1;
+ return -1;
}
int MCruxQTWindow::UpdateWindow()
{
- return -1;
+ return -1;
}
=======================================
--- /trunk/src/lib/window/MCruxQTWindow.h Sat Nov 7 10:37:22 2009
+++ /trunk/src/lib/window/MCruxQTWindow.h Sun Nov 8 04:26:31 2009
@@ -32,15 +32,15 @@
: public QMainWindow,
public MCruxWindow
{
-#ifndef WIN32
Q_OBJECT
-#endif
private:
MCruxWebView webView;
-public:
-
+public slots:
+ void javaScriptWindowObjectCleared();
+
+public:
MCruxQTWindow(const MCruxWindowConfiguration * _config);
virtual ~MCruxQTWindow();