Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Qt] Fix compilation after QtQuick API changes
https://bugs.webkit.org/show_bug.cgi?id=91822

Patch by Simon Hausmann <simon.hausmann@nokia.com> on 2012-07-24
Reviewed by Kenneth Rohde Christiansen.

QQuickCanvas is now QQuickWindow, QQuickItem::canvas() is window() and rootItem()
is contentItem(). Also QQuickWindow::grabFrameBuffer() is now grabWindow().

* UIProcess/API/qt/qquickwebpage.cpp:
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::updateIcon):
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::multipleWebViews):
(tst_QQuickWebView::basicRenderingSanity):
(tst_QQuickWebView::transparentWebViews):
* UIProcess/API/qt/tests/testwindow.h:
(TestWindow::TestWindow):
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::isViewVisible):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::startDrag):

Canonical link: https://commits.webkit.org/109926@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
tronical authored and ossy-szeged committed Jul 24, 2012
1 parent c9c7771 commit 11ef543
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 12 deletions.
24 changes: 24 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,27 @@
2012-07-24 Simon Hausmann <simon.hausmann@nokia.com>

[Qt] Fix compilation after QtQuick API changes
https://bugs.webkit.org/show_bug.cgi?id=91822

Reviewed by Kenneth Rohde Christiansen.

QQuickCanvas is now QQuickWindow, QQuickItem::canvas() is window() and rootItem()
is contentItem(). Also QQuickWindow::grabFrameBuffer() is now grabWindow().

* UIProcess/API/qt/qquickwebpage.cpp:
* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewPrivate::updateIcon):
* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView::multipleWebViews):
(tst_QQuickWebView::basicRenderingSanity):
(tst_QQuickWebView::transparentWebViews):
* UIProcess/API/qt/tests/testwindow.h:
(TestWindow::TestWindow):
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::isViewVisible):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(WebKit::QtWebPageEventHandler::startDrag):

2012-07-24 Balazs Kelemen <kbalazs@webkit.org>

[Qt] Add quirks for running the web process in a profiler shell, like valgrind
Expand Down
1 change: 0 additions & 1 deletion Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Expand Up @@ -30,7 +30,6 @@
#include "qquickwebpage_p_p.h"
#include "qquickwebview_p.h"
#include "qwebkittest_p.h"
#include <QtQuick/QQuickCanvas>

using namespace WebKit;

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
Expand Up @@ -491,7 +491,7 @@ void QQuickWebViewPrivate::updateIcon()
{
Q_Q(QQuickWebView);

QQuickView* view = qobject_cast<QQuickView*>(q->canvas());
QQuickView* view = qobject_cast<QQuickView*>(q->window());
if (!view)
return;

Expand Down
Expand Up @@ -314,9 +314,9 @@ void tst_QQuickWebView::multipleWebViews()

// This should not crash.
QScopedPointer<QQuickWebView> webView1(newWebView());
webView1->setParentItem(m_window->rootItem());
webView1->setParentItem(m_window->contentItem());
QScopedPointer<QQuickWebView> webView2(newWebView());
webView2->setParentItem(m_window->rootItem());
webView2->setParentItem(m_window->contentItem());

webView1->setSize(QSizeF(300, 400));
webView1->setUrl(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/scroll.html")));
Expand Down Expand Up @@ -344,7 +344,7 @@ void tst_QQuickWebView::basicRenderingSanity()
// This should not crash.
webView()->setVisible(true);
QTest::qWait(200);
QImage grabbedWindow = m_window->grabFrameBuffer();
QImage grabbedWindow = m_window->grabWindow();
QRgb testColor = qRgba(0, 0xff, 0, 0xff);
QVERIFY(grabbedWindow.pixel(10, 10) == testColor);
QVERIFY(grabbedWindow.pixel(100, 10) == testColor);
Expand Down Expand Up @@ -376,9 +376,9 @@ void tst_QQuickWebView::transparentWebViews()

// This should not crash.
QScopedPointer<QQuickWebView> webView1(newWebView());
webView1->setParentItem(m_window->rootItem());
webView1->setParentItem(m_window->contentItem());
QScopedPointer<QQuickWebView> webView2(newWebView());
webView2->setParentItem(m_window->rootItem());
webView2->setParentItem(m_window->contentItem());
QVERIFY(!webView1->experimental()->transparentBackground());
webView2->experimental()->setTransparentBackground(true);
QVERIFY(webView2->experimental()->transparentBackground());
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/UIProcess/API/qt/tests/testwindow.h
Expand Up @@ -43,7 +43,7 @@ inline TestWindow::TestWindow(QQuickItem* webView)
: webView(webView)
{
Q_ASSERT(webView);
webView->setParentItem(rootItem());
webView->setParentItem(contentItem());
}

inline void TestWindow::resizeEvent(QResizeEvent* event)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/qt/QtPageClient.cpp
Expand Up @@ -35,7 +35,7 @@
#include "qquickwebview_p.h"
#include "qquickwebview_p_p.h"
#include <QGuiApplication>
#include <QQuickCanvas>
#include <QQuickWindow>
#include <WebCore/Cursor.h>
#include <WebCore/DragData.h>
#include <WebCore/FloatRect.h>
Expand Down Expand Up @@ -287,7 +287,7 @@ bool QtPageClient::isViewVisible()
return false;

// FIXME: this is a workaround while QWindow::isExposed() is not ready.
if (m_webView->canvas() && m_webView->canvas()->windowState() == Qt::WindowMinimized)
if (m_webView->window() && m_webView->window()->windowState() == Qt::WindowMinimized)
return false;

return m_webView->isVisible() && m_webView->page()->isVisible();
Expand Down
4 changes: 2 additions & 2 deletions Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
Expand Up @@ -33,7 +33,7 @@
#include <QGuiApplication>
#include <QInputMethod>
#include <QMimeData>
#include <QtQuick/QQuickCanvas>
#include <QQuickWindow>
#include <QStyleHints>
#include <QTextFormat>
#include <QTouchEvent>
Expand Down Expand Up @@ -562,7 +562,7 @@ void QtWebPageEventHandler::startDrag(const WebCore::DragData& dragData, PassRef
QPoint globalPosition;
Qt::DropAction actualDropAction = Qt::IgnoreAction;

if (QWindow* window = m_webPage->canvas()) {
if (QWindow* window = m_webPage->window()) {
QDrag* drag = new QDrag(window);
drag->setPixmap(QPixmap::fromImage(dragQImage));
drag->setMimeData(mimeData);
Expand Down

0 comments on commit 11ef543

Please sign in to comment.