Changeset 128158 in webkit


Ignore:
Timestamp:
Sep 11, 2012 2:18:27 AM (12 years ago)
Author:
abecsi@webkit.org
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):

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/qt/ChangeLog

    r128006 r128158  
     12012-09-11  Andras Becsi  <andras.becsi@nokia.com>
     2
     3        [Qt][WK2] Fix the build with recent Qt5
     4        https://bugs.webkit.org/show_bug.cgi?id=96283
     5
     6        Reviewed by Simon Hausmann.
     7
     8        We should not use deprecated Qt API because doing that results
     9        in build failure since all the deprecated API was disabled
     10        in qtbase (https://codereview.qt-project.org/#change,24890).
     11
     12        * tests/qgraphicswebview/tst_qgraphicswebview.cpp:
     13        (tst_QGraphicsWebView::widgetsRenderingThroughCache):
     14        (tst_QGraphicsWebView::setPalette):
     15        (tst_QGraphicsWebView::compareCanvasToImage):
     16        * tests/qobjectbridge/tst_qobjectbridge.cpp:
     17        (tst_QObjectBridge::ownership):
     18        * tests/qwebframe/tst_qwebframe.cpp:
     19        (tst_QWebFrame::popupFocus):
     20        (tst_QWebFrame::inputFieldFocus):
     21        (tst_QWebFrame::evaluateWillCauseRepaint):
     22        * tests/qwebpage/tst_qwebpage.cpp:
     23        (Navigation):
     24        (PluginCounterPage):
     25        * tests/qwebview/tst_qwebview.cpp:
     26        (tst_QWebView::reusePage):
     27        (tst_QWebView::focusInputTypes):
     28        (tst_QWebView::setPalette):
     29        (tst_QWebView::renderingAfterMaxAndBack):
     30
    1312012-09-09  Emil A Eklund  <eae@chromium.org>
    232
  • trunk/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp

    r125603 r128158  
    185185    view.setGeometry(QRect(0, 0, 500, 500));
    186186    QWidget *const widget = &view;
    187     QTest::qWaitForWindowShown(widget);
     187    QTest::qWaitForWindowExposed(widget);
    188188
    189189    // 1. Reference without tiling.
     
    410410    QVERIFY(webView1.page()->palette() == palette1);
    411411
    412     QTest::qWaitForWindowShown(&view1);
     412    QTest::qWaitForWindowExposed(&view1);
    413413
    414414    if (!active) {
    415415        controlView.show();
    416         QTest::qWaitForWindowShown(&controlView);
     416        QTest::qWaitForWindowExposed(&controlView);
    417417        QApplication::setActiveWindow(&controlView);
    418418        activeView = &controlView;
     
    465465    view2.show();
    466466
    467     QTest::qWaitForWindowShown(&view2);
     467    QTest::qWaitForWindowExposed(&view2);
    468468
    469469    if (!active) {
    470470        controlView.show();
    471         QTest::qWaitForWindowShown(&controlView);
     471        QTest::qWaitForWindowExposed(&controlView);
    472472        QApplication::setActiveWindow(&controlView);
    473473        activeView = &controlView;
     
    611611    GraphicsView view;
    612612    view.show();
    613     QTest::qWaitForWindowShown(&view);
     613    QTest::qWaitForWindowExposed(&view);
    614614
    615615    QGraphicsWebView* const graphicsWebView = view.m_webView;
     
    621621        view.render(&painter);
    622622    }
    623     QApplication::syncX();
    624623
    625624    const QSize imageSize = reference.size();
  • trunk/Source/WebKit/qt/tests/qobjectbridge/tst_qobjectbridge.cpp

    r126976 r128158  
    20402040    // test ownership
    20412041    {
    2042         QWeakPointer<QObject> ptr = new QObject();
     2042        QPointer<QObject> ptr = new QObject();
    20432043        QVERIFY(ptr);
    20442044        {
     
    20502050    }
    20512051    {
    2052         QWeakPointer<QObject> ptr = new QObject();
     2052        QPointer<QObject> ptr = new QObject();
    20532053        QVERIFY(ptr);
    20542054        QObject* before = ptr.data();
     
    20742074    }
    20752075    {
    2076         QWeakPointer<QObject> ptr = new QObject();
     2076        QPointer<QObject> ptr = new QObject();
    20772077        QVERIFY(ptr);
    20782078        {
     
    20862086    {
    20872087        QObject* parent = new QObject();
    2088         QWeakPointer<QObject> child = new QObject(parent);
     2088        QPointer<QObject> child = new QObject(parent);
    20892089        QVERIFY(child);
    20902090        {
  • trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp

    r125603 r128158  
    602602    view.setFocus();
    603603    view.show();
    604     QTest::qWaitForWindowShown(&view);
     604    QTest::qWaitForWindowExposed(&view);
    605605    view.activateWindow();
    606606    QTRY_VERIFY(view.hasFocus());
     
    626626    view.resize(400, 100);
    627627    view.show();
    628     QTest::qWaitForWindowShown(&view);
     628    QTest::qWaitForWindowExposed(&view);
    629629    view.activateWindow();
    630630    view.setFocus();
     
    10281028    view.show();
    10291029
    1030     QTest::qWaitForWindowShown(&view);
     1030    QTest::qWaitForWindowExposed(&view);
    10311031    view.page()->mainFrame()->evaluateJavaScript(
    10321032        "document.getElementById('junk').style.display = 'none';");
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r125603 r128158  
    396396
    397397    struct Navigation {
    398         QWeakPointer<QWebFrame> frame;
     398        QPointer<QWebFrame> frame;
    399399        QNetworkRequest request;
    400400        NavigationType type;
     
    894894public:
    895895    int m_count;
    896     QWeakPointer<QObject> m_widget;
     896    QPointer<QObject> m_widget;
    897897    QObject* m_pluginParent;
    898898    PluginCounterPage(QObject* parent = 0)
  • trunk/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp

    r125603 r128158  
    140140    QFETCH(QString, html);
    141141    QWebView* view1 = new QWebView;
    142     QWeakPointer<QWebPage> page = new QWebPage;
     142    QPointer<QWebPage> page = new QWebPage;
    143143    view1->setPage(page.data());
    144144    page.data()->settings()->setAttribute(QWebSettings::PluginsEnabled, true);
     
    151151
    152152    view1->show();
    153     QTest::qWaitForWindowShown(view1);
     153    QTest::qWaitForWindowExposed(view1);
    154154    delete view1;
    155155    QVERIFY(page != 0); // deleting view must not have deleted the page, since it's not a child of view
     
    158158    view2->setPage(page.data());
    159159    view2->show(); // in Windowless mode, you should still be able to see the plugin here
    160     QTest::qWaitForWindowShown(view2);
     160    QTest::qWaitForWindowExposed(view2);
    161161    delete view2;
    162162
     
    235235    QWebView webView;
    236236    webView.show();
    237     QTest::qWaitForWindowShown(&webView);
     237    QTest::qWaitForWindowExposed(&webView);
    238238
    239239    QUrl url("qrc:///resources/input_types.html");
     
    361361    view1.show();
    362362
    363     QTest::qWaitForWindowShown(&view1);
     363    QTest::qWaitForWindowExposed(&view1);
    364364
    365365    if (!active) {
    366366        controlView.show();
    367         QTest::qWaitForWindowShown(&controlView);
     367        QTest::qWaitForWindowExposed(&controlView);
    368368        activeView = &controlView;
    369369        controlView.activateWindow();
     
    408408    view2.show();
    409409
    410     QTest::qWaitForWindowShown(&view2);
     410    QTest::qWaitForWindowExposed(&view2);
    411411
    412412    if (!active) {
    413413        controlView.show();
    414         QTest::qWaitForWindowShown(&controlView);
     414        QTest::qWaitForWindowExposed(&controlView);
    415415        activeView = &controlView;
    416416        controlView.activateWindow();
     
    450450    view.page()->settings()->setMaximumPagesInCache(3);
    451451
    452     QTest::qWaitForWindowShown(&view);
     452    QTest::qWaitForWindowExposed(&view);
    453453
    454454    QPixmap reference(view.page()->viewportSize());
     
    471471    view.showMaximized();
    472472
    473     QTest::qWaitForWindowShown(&view);
     473    QTest::qWaitForWindowExposed(&view);
    474474
    475475    QPixmap reference2(view.page()->viewportSize());
  • trunk/Source/WebKit2/ChangeLog

    r128157 r128158  
     12012-09-11  Andras Becsi  <andras.becsi@nokia.com>
     2
     3        [Qt][WK2] Fix the build with recent Qt5
     4        https://bugs.webkit.org/show_bug.cgi?id=96283
     5
     6        Reviewed by Simon Hausmann.
     7
     8        We should not use deprecated Qt API because doing that results
     9        in build failure since all the deprecated API was disabled
     10        in qtbase (https://codereview.qt-project.org/#change,24890).
     11
     12        * UIProcess/API/qt/qwebnavigationhistory.cpp:
     13        (QWebNavigationListModel::roleNames):
     14        (QWebNavigationListModel::reset):
     15        * UIProcess/API/qt/qwebnavigationhistory_p.h:
     16        * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp:
     17        (WebView::load):
     18        * UIProcess/qt/WebPopupMenuProxyQt.cpp:
     19        (PopupMenuItemModel):
     20        (WebKit::PopupMenuItemModel::PopupMenuItemModel):
     21        (WebKit::PopupMenuItemModel::roleNames):
     22        (WebKit):
     23
    1242012-09-11  Christophe Dumez  <christophe.dumez@intel.com>
    225
  • trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory.cpp

    r113330 r128158  
    9797}
    9898
    99 QWebNavigationListModel::QWebNavigationListModel()
    100     : QAbstractListModel()
     99QHash<int, QByteArray> QWebNavigationListModel::roleNames() const
    101100{
    102101    QHash<int, QByteArray> roles;
    103102    roles[QWebNavigationHistory::UrlRole] = "url";
    104103    roles[QWebNavigationHistory::TitleRole] = "title";
    105     setRoleNames(roles);
     104    return roles;
    106105}
    107106
     
    138137}
    139138
     139void QWebNavigationListModel::reset()
     140{
     141    beginResetModel();
     142    endResetModel();
     143}
     144
    140145QWebNavigationHistory::QWebNavigationHistory()
    141146    : QObject()
  • trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p.h

    r123456 r128158  
    4949    int rowCount(const QModelIndex& parent = QModelIndex()) const;
    5050    QVariant data(const QModelIndex& index, int role) const;
     51    QHash<int, QByteArray> roleNames() const;
     52    void reset();
    5153
    5254private:
    53     QWebNavigationListModel();
     55    QWebNavigationListModel()
     56        : QAbstractListModel()
     57    { }
     58
    5459    QWebNavigationListModelPrivate* d;
    5560    friend class QWebNavigationListModelPrivate;
  • trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp

    r128031 r128158  
    8383    {
    8484        m_frameLoaded = false;
    85         WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(html.toAscii().data()));
     85        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(html.toLocal8Bit().data()));
    8686        QVERIFY(::waitForSignal(this, SIGNAL(loaded()), 5000));
    8787    }
  • trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQt.cpp

    r124758 r128158  
    5656    virtual int rowCount(const QModelIndex& parent = QModelIndex()) const { return m_items.size(); }
    5757    virtual QVariant data(const QModelIndex&, int role = Qt::DisplayRole) const;
     58    virtual QHash<int, QByteArray> roleNames() const;
    5859
    5960    Q_INVOKABLE void select(int);
     
    168169    , m_allowMultiples(multiple)
    169170{
     171    buildItems(webPopupItems);
     172}
     173
     174QHash<int, QByteArray> PopupMenuItemModel::roleNames() const
     175{
    170176    static QHash<int, QByteArray> roles = createRoleNamesHash();
    171     setRoleNames(roles);
    172     buildItems(webPopupItems);
     177    return roles;
    173178}
    174179
  • trunk/Tools/ChangeLog

    r128157 r128158  
     12012-09-11  Andras Becsi  <andras.becsi@nokia.com>
     2
     3        [Qt][WK2] Fix the build with recent Qt5
     4        https://bugs.webkit.org/show_bug.cgi?id=96283
     5
     6        Reviewed by Simon Hausmann.
     7
     8        We should not use deprecated Qt API because doing that results
     9        in build failure since all the deprecated API was disabled
     10        in qtbase (https://codereview.qt-project.org/#change,24890).
     11
     12        * DumpRenderTree/qt/main.cpp:
     13        (main):
     14        * MiniBrowser/qt/MiniBrowserApplication.cpp:
     15        (MiniBrowserApplication::notify):
     16        * MiniBrowser/qt/raw/View.cpp:
     17        (View::exposeEvent):
     18        (main):
     19
    1202012-09-11  Christophe Dumez  <christophe.dumez@intel.com>
    221
  • trunk/Tools/DumpRenderTree/qt/main.cpp

    r125776 r128158  
    118118    WebKit::initializeTestFonts();
    119119
    120     QApplication::setGraphicsSystem("raster");
    121120    QApplication::setStyle(new QWindowsStyle);
    122121    QApplication::setDesktopSettingsAware(false);
  • trunk/Tools/MiniBrowser/qt/MiniBrowserApplication.cpp

    r124877 r128158  
    9595        return QGuiApplication::notify(target, event);
    9696
    97     if (isTouchEvent(event) && static_cast<QTouchEvent*>(event)->deviceType() == QTouchEvent::TouchScreen) {
     97    if (isTouchEvent(event)) {
    9898        if (m_pendingFakeTouchEventCount)
    9999            --m_pendingFakeTouchEventCount;
  • trunk/Tools/MiniBrowser/qt/raw/View.cpp

    r121620 r128158  
    7979    if (!m_active) {
    8080        m_active = true;
    81         WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(m_url.toAscii().data()));
     81        WKPageLoadURL(m_webView->pageRef(), WKURLCreateWithUTF8CString(m_url.toLocal8Bit().data()));
    8282
    8383        m_webView->setFocused(true);
     
    132132    QGuiApplication app(argc, argv);
    133133
    134     View view(app.arguments().size() > 1 ? app.arguments().at(1) : QString::fromAscii("http://www.google.com"));
     134    View view(app.arguments().size() > 1 ? app.arguments().at(1) : QStringLiteral("http://www.google.com"));
    135135    view.show();
    136136    return app.exec();
Note: See TracChangeset for help on using the changeset viewer.