Changeset 67688 in webkit


Ignore:
Timestamp:
Sep 16, 2010 6:33:44 PM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

2010-09-12 Antonio Gomes <tonikitoo@webkit.org>

Reviewed by Andreas Kling.

Make all accesses to m_item (GraphicsWebView) done by WebViewGraphicsBased class happen though graphicsWebView getter method.

This patch is mostly a preparation for another commit, where the ownership of the m_item/GraphicsWebView
object will move to the qgraphicsscene instead of the qgraphicsview.

  • QtTestBrowser/webview.cpp: (WebViewGraphicsBased::setPage): (WebViewGraphicsBased::setResizesToContents): (WebViewGraphicsBased::resizeEvent): (WebViewGraphicsBased::animatedFlip):
  • QtTestBrowser/webview.h: (WebViewGraphicsBased::setItemCacheMode): (WebViewGraphicsBased::itemCacheMode):
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r67687 r67688  
     12010-09-12  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        Make all accesses to m_item (GraphicsWebView) done by WebViewGraphicsBased class happen though graphicsWebView getter method.
     6
     7        This patch is mostly a preparation for another commit, where the ownership of the m_item/GraphicsWebView
     8        object will move to the qgraphicsscene instead of the qgraphicsview.
     9
     10        * QtTestBrowser/webview.cpp:
     11        (WebViewGraphicsBased::setPage):
     12        (WebViewGraphicsBased::setResizesToContents):
     13        (WebViewGraphicsBased::resizeEvent):
     14        (WebViewGraphicsBased::animatedFlip):
     15        * QtTestBrowser/webview.h:
     16        (WebViewGraphicsBased::setItemCacheMode):
     17        (WebViewGraphicsBased::itemCacheMode):
     18
    1192010-09-12  Antonio Gomes  <tonikitoo@webkit.org>
    220
  • trunk/WebKitTools/QtTestBrowser/webview.cpp

    r65159 r67688  
    6060{
    6161    connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&)));
    62     m_item->setPage(page);
     62    graphicsWebView()->setPage(page);
    6363}
    6464
     
    7575
    7676    m_resizesToContents = b;
    77     m_item->setResizesToContents(m_resizesToContents);
     77    graphicsWebView()->setResizesToContents(m_resizesToContents);
    7878
    7979    // When setting resizesToContents ON, our web view widget will always size as big as the
     
    9595        setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    9696        setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    97         m_item->page()->setPreferredContentsSize(size());
    98         QRectF itemRect(m_item->geometry().topLeft(), m_item->page()->mainFrame()->contentsSize());
    99         m_item->setGeometry(itemRect);
     97        graphicsWebView()->page()->setPreferredContentsSize(size());
     98        QRectF itemRect(graphicsWebView()->geometry().topLeft(), graphicsWebView()->page()->mainFrame()->contentsSize());
     99        graphicsWebView()->setGeometry(itemRect);
    100100        scene()->setSceneRect(itemRect);
    101101    } else {
    102102        setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    103103        setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    104         m_item->page()->setPreferredContentsSize(QSize());
     104        graphicsWebView()->page()->setPreferredContentsSize(QSize());
    105105        QRect viewportRect(QPoint(0, 0), size());
    106         m_item->setGeometry(viewportRect);
     106        graphicsWebView()->setGeometry(viewportRect);
    107107        scene()->setSceneRect(viewportRect);
    108108    }
     
    116116
    117117    if (m_resizesToContents) {
    118         m_item->page()->setPreferredContentsSize(size);
     118        graphicsWebView()->page()->setPreferredContentsSize(size);
    119119        return;
    120120    }
    121121
    122122    QRectF rect(QPoint(0, 0), size);
    123     m_item->setGeometry(rect);
     123    graphicsWebView()->setGeometry(rect);
    124124    scene()->setSceneRect(rect);
    125125}
     
    153153{
    154154#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
    155     QSizeF center = m_item->boundingRect().size() / 2;
     155    QSizeF center = graphicsWebView()->boundingRect().size() / 2;
    156156    QPointF centerPoint = QPointF(center.width(), center.height());
    157     m_item->setTransformOriginPoint(centerPoint);
    158 
    159     QPropertyAnimation* animation = new QPropertyAnimation(m_item, "rotation", this);
     157    graphicsWebView()->setTransformOriginPoint(centerPoint);
     158
     159    QPropertyAnimation* animation = new QPropertyAnimation(graphicsWebView(), "rotation", this);
    160160    animation->setDuration(1000);
    161161
    162     int rotation = int(m_item->rotation());
     162    int rotation = int(graphicsWebView()->rotation());
    163163
    164164    animation->setStartValue(rotation);
  • trunk/WebKitTools/QtTestBrowser/webview.h

    r67687 r67688  
    7676    void setPage(QWebPage* page);
    7777
    78     void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
    79     QGraphicsItem::CacheMode itemCacheMode() { return m_item->cacheMode(); }
     78    void setItemCacheMode(QGraphicsItem::CacheMode mode) { graphicsWebView()->setCacheMode(mode); }
     79    QGraphicsItem::CacheMode itemCacheMode() { return graphicsWebView()->cacheMode(); }
    8080
    8181    void setFrameRateMeasurementEnabled(bool enabled);
Note: See TracChangeset for help on using the changeset viewer.