Title: [128158] trunk
Revision
128158
Author
[email protected]
Date
2012-09-11 02:18:27 -0700 (Tue, 11 Sep 2012)

Log Message

[Qt][WK2] Fix the build with recent Qt5
https://bugs.webkit.org/show_bug.cgi?id=96283

Reviewed by Simon Hausmann.

We should not use deprecated Qt API because doing that results
in build failure since all the deprecated API was disabled
in qtbase (https://codereview.qt-project.org/#change,24890).

Source/WebKit/qt:

* tests/qgraphicswebview/tst_qgraphicswebview.cpp:
(tst_QGraphicsWebView::widgetsRenderingThroughCache):
(tst_QGraphicsWebView::setPalette):
(tst_QGraphicsWebView::compareCanvasToImage):
* tests/qobjectbridge/tst_qobjectbridge.cpp:
(tst_QObjectBridge::ownership):
* tests/qwebframe/tst_qwebframe.cpp:
(tst_QWebFrame::popupFocus):
(tst_QWebFrame::inputFieldFocus):
(tst_QWebFrame::evaluateWillCauseRepaint):
* tests/qwebpage/tst_qwebpage.cpp:
(Navigation):
(PluginCounterPage):
* tests/qwebview/tst_qwebview.cpp:
(tst_QWebView::reusePage):
(tst_QWebView::focusInputTypes):
(tst_QWebView::setPalette):
(tst_QWebView::renderingAfterMaxAndBack):

Source/WebKit2:

* UIProcess/API/qt/qwebnavigationhistory.cpp:
(QWebNavigationListModel::roleNames):
(QWebNavigationListModel::reset):
* UIProcess/API/qt/qwebnavigationhistory_p.h:
* UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
(WebView::load):
* UIProcess/qt/WebPopupMenuProxyQt.cpp:
(PopupMenuItemModel):
(WebKit::PopupMenuItemModel::PopupMenuItemModel):
(WebKit::PopupMenuItemModel::roleNames):
(WebKit):

Tools:

* DumpRenderTree/qt/main.cpp:
(main):
* MiniBrowser/qt/MiniBrowserApplication.cpp:
(MiniBrowserApplication::notify):
* MiniBrowser/qt/raw/View.cpp:
(View::exposeEvent):
(main):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (128157 => 128158)


--- trunk/Source/WebKit/qt/ChangeLog	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-09-11 09:18:27 UTC (rev 128158)
@@ -1,3 +1,33 @@
+2012-09-11  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] Fix the build with recent Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=96283
+
+        Reviewed by Simon Hausmann.
+
+        We should not use deprecated Qt API because doing that results
+        in build failure since all the deprecated API was disabled
+        in qtbase (https://codereview.qt-project.org/#change,24890).
+
+        * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
+        (tst_QGraphicsWebView::widgetsRenderingThroughCache):
+        (tst_QGraphicsWebView::setPalette):
+        (tst_QGraphicsWebView::compareCanvasToImage):
+        * tests/qobjectbridge/tst_qobjectbridge.cpp:
+        (tst_QObjectBridge::ownership):
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (tst_QWebFrame::popupFocus):
+        (tst_QWebFrame::inputFieldFocus):
+        (tst_QWebFrame::evaluateWillCauseRepaint):
+        * tests/qwebpage/tst_qwebpage.cpp:
+        (Navigation):
+        (PluginCounterPage):
+        * tests/qwebview/tst_qwebview.cpp:
+        (tst_QWebView::reusePage):
+        (tst_QWebView::focusInputTypes):
+        (tst_QWebView::setPalette):
+        (tst_QWebView::renderingAfterMaxAndBack):
+
 2012-09-09  Emil A Eklund  <[email protected]>
 
         Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect

Modified: trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp (128157 => 128158)


--- trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -184,7 +184,7 @@
     scene->addItem(webView);
     view.setGeometry(QRect(0, 0, 500, 500));
     QWidget *const widget = &view;
-    QTest::qWaitForWindowShown(widget);
+    QTest::qWaitForWindowExposed(widget);
 
     // 1. Reference without tiling.
     webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, false);
@@ -409,11 +409,11 @@
     QVERIFY(webView1.palette() == palette1);
     QVERIFY(webView1.page()->palette() == palette1);
 
-    QTest::qWaitForWindowShown(&view1);
+    QTest::qWaitForWindowExposed(&view1);
 
     if (!active) {
         controlView.show();
-        QTest::qWaitForWindowShown(&controlView);
+        QTest::qWaitForWindowExposed(&controlView);
         QApplication::setActiveWindow(&controlView);
         activeView = &controlView;
         controlView.activateWindow();
@@ -464,11 +464,11 @@
     webView2.setPalette(palette2);
     view2.show();
 
-    QTest::qWaitForWindowShown(&view2);
+    QTest::qWaitForWindowExposed(&view2);
 
     if (!active) {
         controlView.show();
-        QTest::qWaitForWindowShown(&controlView);
+        QTest::qWaitForWindowExposed(&controlView);
         QApplication::setActiveWindow(&controlView);
         activeView = &controlView;
         controlView.activateWindow();
@@ -610,7 +610,7 @@
 {
     GraphicsView view;
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
 
     QGraphicsWebView* const graphicsWebView = view.m_webView;
     graphicsWebView->load(url);
@@ -620,7 +620,6 @@
         QPainter painter(&pixmap);
         view.render(&painter);
     }
-    QApplication::syncX();
 
     const QSize imageSize = reference.size();
 

Modified: trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp (128157 => 128158)


--- trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -2039,7 +2039,7 @@
 {
     // test ownership
     {
-        QWeakPointer<QObject> ptr = new QObject();
+        QPointer<QObject> ptr = new QObject();
         QVERIFY(ptr);
         {
             QWebPage page;
@@ -2049,7 +2049,7 @@
         QVERIFY(!ptr);
     }
     {
-        QWeakPointer<QObject> ptr = new QObject();
+        QPointer<QObject> ptr = new QObject();
         QVERIFY(ptr);
         QObject* before = ptr.data();
         {
@@ -2073,7 +2073,7 @@
         QCOMPARE(qvariant_cast<QObject*>(v), (QObject *)0);
     }
     {
-        QWeakPointer<QObject> ptr = new QObject();
+        QPointer<QObject> ptr = new QObject();
         QVERIFY(ptr);
         {
             QWebPage page;
@@ -2085,7 +2085,7 @@
     }
     {
         QObject* parent = new QObject();
-        QWeakPointer<QObject> child = new QObject(parent);
+        QPointer<QObject> child = new QObject(parent);
         QVERIFY(child);
         {
             QWebPage page;

Modified: trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp (128157 => 128158)


--- trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -601,7 +601,7 @@
     // Call setFocus before show to work around http://bugreports.qt.nokia.com/browse/QTBUG-14762
     view.setFocus();
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
     view.activateWindow();
     QTRY_VERIFY(view.hasFocus());
 
@@ -625,7 +625,7 @@
     view.setHtml("<html><body><input type=\"text\"></input></body></html>");
     view.resize(400, 100);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
     view.activateWindow();
     view.setFocus();
     QTRY_VERIFY(view.hasFocus());
@@ -1027,7 +1027,7 @@
     view.setHtml(html);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
     view.page()->mainFrame()->evaluateJavaScript(
         "document.getElementById('junk').style.display = 'none';");
 

Modified: trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp (128157 => 128158)


--- trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -395,7 +395,7 @@
     TestPage(QObject* parent = 0) : QWebPage(parent) {}
 
     struct Navigation {
-        QWeakPointer<QWebFrame> frame;
+        QPointer<QWebFrame> frame;
         QNetworkRequest request;
         NavigationType type;
     };
@@ -893,7 +893,7 @@
 class PluginCounterPage : public QWebPage {
 public:
     int m_count;
-    QWeakPointer<QObject> m_widget;
+    QPointer<QObject> m_widget;
     QObject* m_pluginParent;
     PluginCounterPage(QObject* parent = 0)
         : QWebPage(parent)

Modified: trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp (128157 => 128158)


--- trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -139,7 +139,7 @@
 
     QFETCH(QString, html);
     QWebView* view1 = new QWebView;
-    QWeakPointer<QWebPage> page = new QWebPage;
+    QPointer<QWebPage> page = new QWebPage;
     view1->setPage(page.data());
     page.data()->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     QWebFrame* mainFrame = page.data()->mainFrame();
@@ -150,14 +150,14 @@
     }
 
     view1->show();
-    QTest::qWaitForWindowShown(view1);
+    QTest::qWaitForWindowExposed(view1);
     delete view1;
     QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
 
     QWebView *view2 = new QWebView;
     view2->setPage(page.data());
     view2->show(); // in Windowless mode, you should still be able to see the plugin here
-    QTest::qWaitForWindowShown(view2);
+    QTest::qWaitForWindowExposed(view2);
     delete view2;
 
     delete page.data(); // must not crash
@@ -234,7 +234,7 @@
 {
     QWebView webView;
     webView.show();
-    QTest::qWaitForWindowShown(&webView);
+    QTest::qWaitForWindowExposed(&webView);
 
     QUrl url("qrc:///resources/input_types.html");
     QWebFrame* const mainFrame = webView.page()->mainFrame();
@@ -360,11 +360,11 @@
     view1.page()->setViewportSize(view1.page()->currentFrame()->contentsSize());
     view1.show();
 
-    QTest::qWaitForWindowShown(&view1);
+    QTest::qWaitForWindowExposed(&view1);
 
     if (!active) {
         controlView.show();
-        QTest::qWaitForWindowShown(&controlView);
+        QTest::qWaitForWindowExposed(&controlView);
         activeView = &controlView;
         controlView.activateWindow();
     } else {
@@ -407,11 +407,11 @@
     view2.page()->setViewportSize(view2.page()->currentFrame()->contentsSize());
     view2.show();
 
-    QTest::qWaitForWindowShown(&view2);
+    QTest::qWaitForWindowExposed(&view2);
 
     if (!active) {
         controlView.show();
-        QTest::qWaitForWindowShown(&controlView);
+        QTest::qWaitForWindowExposed(&controlView);
         activeView = &controlView;
         controlView.activateWindow();
     } else {
@@ -449,7 +449,7 @@
 
     view.page()->settings()->setMaximumPagesInCache(3);
 
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
 
     QPixmap reference(view.page()->viewportSize());
     reference.fill(Qt::red);
@@ -470,7 +470,7 @@
 
     view.showMaximized();
 
-    QTest::qWaitForWindowShown(&view);
+    QTest::qWaitForWindowExposed(&view);
 
     QPixmap reference2(view.page()->viewportSize());
     reference2.fill(Qt::blue);

Modified: trunk/Source/WebKit2/ChangeLog (128157 => 128158)


--- trunk/Source/WebKit2/ChangeLog	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-11 09:18:27 UTC (rev 128158)
@@ -1,3 +1,26 @@
+2012-09-11  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] Fix the build with recent Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=96283
+
+        Reviewed by Simon Hausmann.
+
+        We should not use deprecated Qt API because doing that results
+        in build failure since all the deprecated API was disabled
+        in qtbase (https://codereview.qt-project.org/#change,24890).
+
+        * UIProcess/API/qt/qwebnavigationhistory.cpp:
+        (QWebNavigationListModel::roleNames):
+        (QWebNavigationListModel::reset):
+        * UIProcess/API/qt/qwebnavigationhistory_p.h:
+        * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
+        (WebView::load):
+        * UIProcess/qt/WebPopupMenuProxyQt.cpp:
+        (PopupMenuItemModel):
+        (WebKit::PopupMenuItemModel::PopupMenuItemModel):
+        (WebKit::PopupMenuItemModel::roleNames):
+        (WebKit):
+
 2012-09-11  Christophe Dumez  <[email protected]>
 
         WTR needs an implementation of applicationCacheDiskUsageForOrigin

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory.cpp (128157 => 128158)


--- trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -96,13 +96,12 @@
         WKPageGoToBackForwardListItem(m_page.get(), itemRef.get());
 }
 
-QWebNavigationListModel::QWebNavigationListModel()
-    : QAbstractListModel()
+QHash<int, QByteArray> QWebNavigationListModel::roleNames() const
 {
     QHash<int, QByteArray> roles;
     roles[QWebNavigationHistory::UrlRole] = "url";
     roles[QWebNavigationHistory::TitleRole] = "title";
-    setRoleNames(roles);
+    return roles;
 }
 
 QWebNavigationListModel::~QWebNavigationListModel()
@@ -137,6 +136,12 @@
     return QVariant();
 }
 
+void QWebNavigationListModel::reset()
+{
+    beginResetModel();
+    endResetModel();
+}
+
 QWebNavigationHistory::QWebNavigationHistory()
     : QObject()
 {

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p.h (128157 => 128158)


--- trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p.h	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p.h	2012-09-11 09:18:27 UTC (rev 128158)
@@ -48,9 +48,14 @@
 
     int rowCount(const QModelIndex& parent = QModelIndex()) const;
     QVariant data(const QModelIndex& index, int role) const;
+    QHash<int, QByteArray> roleNames() const;
+    void reset();
 
 private:
-    QWebNavigationListModel();
+    QWebNavigationListModel()
+        : QAbstractListModel()
+    { }
+
     QWebNavigationListModelPrivate* d;
     friend class QWebNavigationListModelPrivate;
     friend class QWebNavigationHistory;

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp (128157 => 128158)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -82,7 +82,7 @@
     void load(const QString& html)
     {
         m_frameLoaded = false;
-        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(html.toAscii().data()));
+        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(html.toLocal8Bit().data()));
         QVERIFY(::waitForSignal(this, SIGNAL(loaded()), 5000));
     }
 

Modified: trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp (128157 => 128158)


--- trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -55,6 +55,7 @@
     PopupMenuItemModel(const Vector<WebPopupItem>&, bool multiple);
     virtual int rowCount(const QModelIndex& parent = QModelIndex()) const { return m_items.size(); }
     virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
+    virtual QHash<int, QByteArray> roleNames() const;
 
     Q_INVOKABLE void select(int);
 
@@ -167,11 +168,15 @@
     : m_selectedModelIndex(-1)
     , m_allowMultiples(multiple)
 {
-    static QHash<int, QByteArray> roles = createRoleNamesHash();
-    setRoleNames(roles);
     buildItems(webPopupItems);
 }
 
+QHash<int, QByteArray> PopupMenuItemModel::roleNames() const
+{
+    static QHash<int, QByteArray> roles = createRoleNamesHash();
+    return roles;
+}
+
 QVariant PopupMenuItemModel::data(const QModelIndex& index, int role) const
 {
     if (!index.isValid() || index.row() < 0 || index.row() >= m_items.size())

Modified: trunk/Tools/ChangeLog (128157 => 128158)


--- trunk/Tools/ChangeLog	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Tools/ChangeLog	2012-09-11 09:18:27 UTC (rev 128158)
@@ -1,3 +1,22 @@
+2012-09-11  Andras Becsi  <[email protected]>
+
+        [Qt][WK2] Fix the build with recent Qt5
+        https://bugs.webkit.org/show_bug.cgi?id=96283
+
+        Reviewed by Simon Hausmann.
+
+        We should not use deprecated Qt API because doing that results
+        in build failure since all the deprecated API was disabled
+        in qtbase (https://codereview.qt-project.org/#change,24890).
+
+        * DumpRenderTree/qt/main.cpp:
+        (main):
+        * MiniBrowser/qt/MiniBrowserApplication.cpp:
+        (MiniBrowserApplication::notify):
+        * MiniBrowser/qt/raw/View.cpp:
+        (View::exposeEvent):
+        (main):
+
 2012-09-11  Christophe Dumez  <[email protected]>
 
         WTR needs an implementation of applicationCacheDiskUsageForOrigin

Modified: trunk/Tools/DumpRenderTree/qt/main.cpp (128157 => 128158)


--- trunk/Tools/DumpRenderTree/qt/main.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Tools/DumpRenderTree/qt/main.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -117,7 +117,6 @@
 
     WebKit::initializeTestFonts();
 
-    QApplication::setGraphicsSystem("raster");
     QApplication::setStyle(new QWindowsStyle);
     QApplication::setDesktopSettingsAware(false);
 

Modified: trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp (128157 => 128158)


--- trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -94,7 +94,7 @@
     if (!event->spontaneous() || m_realTouchEventReceived || !m_windowOptions.touchMockingEnabled())
         return QGuiApplication::notify(target, event);
 
-    if (isTouchEvent(event) && static_cast<QTouchEvent*>(event)->deviceType() == QTouchEvent::TouchScreen) {
+    if (isTouchEvent(event)) {
         if (m_pendingFakeTouchEventCount)
             --m_pendingFakeTouchEventCount;
         else

Modified: trunk/Tools/MiniBrowser/qt/raw/View.cpp (128157 => 128158)


--- trunk/Tools/MiniBrowser/qt/raw/View.cpp	2012-09-11 09:16:21 UTC (rev 128157)
+++ trunk/Tools/MiniBrowser/qt/raw/View.cpp	2012-09-11 09:18:27 UTC (rev 128158)
@@ -78,7 +78,7 @@
 {
     if (!m_active) {
         m_active = true;
-        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(m_url.toAscii().data()));
+        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(m_url.toLocal8Bit().data()));
 
         m_webView->setFocused(true);
         m_webView->setVisible(true);
@@ -131,7 +131,7 @@
 {
     QGuiApplication app(argc, argv);
 
-    View view(app.arguments().size() > 1 ? app.arguments().at(1) : QString::fromAscii("http://www.google.com"));
+    View view(app.arguments().size() > 1 ? app.arguments().at(1) : QStringLiteral("http://www.google.com"));
     view.show();
     return app.exec();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to