From 29ac508b575fbfef98a526a6e60d11f814934bf3 Mon Sep 17 00:00:00 2001 From: "hausmann@webkit.org" Date: Wed, 16 Jan 2008 09:37:48 +0000 Subject: [PATCH] * Make the InspectorClientView inherit from QWebView instead of QWidget. This way paintEvent, mouse{Press,Release}Event and other events get forwarded to the QWebPage/WebInspector automatically. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29513 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/qt/ChangeLog | 13 +++++++++++++ WebKit/qt/WebCoreSupport/InspectorClientQt.cpp | 17 ++++++++--------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog index 57cb4cf36ee3..8b26d2676821 100644 --- a/WebKit/qt/ChangeLog +++ b/WebKit/qt/ChangeLog @@ -1,3 +1,16 @@ +2008-01-16 Holger Hans Peter Freyther + + Reviewed by Lars. + + * Make the InspectorClientView inherit from QWebView instead of QWidget. This + way paintEvent, mouse{Press,Release}Event and other events get forwarded to + the QWebPage/WebInspector automatically. + + + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientWebPage::createWindow): + (WebCore::InspectorClientView::InspectorClientView): + 2008-01-10 Maciej Stachowiak Reviewed by Sam. diff --git a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp index 9968bd7cef41..4e8f5a5c20db 100644 --- a/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp @@ -32,6 +32,8 @@ #include "qwebpage.h" #include "qwebpage_p.h" +#include "qwebview.h" + #include #include "InspectorController.h" @@ -46,27 +48,25 @@ class InspectorClientWebPage : public QWebPage public: QWebPage* createWindow() { - QWidget *w = new QWidget(0); + QWidget *w = new QWebView(0); QWebPage *page = new QWebPage(w); page->setView(w); connect(page, SIGNAL(destroyed()), w, SLOT(deleteLater())); return page; } }; - -class InspectorClientView : public QWidget { + +class InspectorClientView : public QWebView { public: InspectorClientView(InspectorController* controller) - : QWidget(0) + : QWebView(0) , m_controller(controller) - , m_page(new InspectorClientWebPage) { - m_page->setView(this); - connect(m_page, SIGNAL(destroyed()), SLOT(deleteLater())); + setPage(new InspectorClientWebPage); + connect(page(), SIGNAL(destroyed()), SLOT(deleteLater())); } - QWebPage* page() const { return m_page; } protected: void hideEvent(QHideEvent* ev) { @@ -82,7 +82,6 @@ protected: private: InspectorController* m_controller; - QWebPage* m_page; }; -- 2.36.0