Changeset 67688 in webkit
- Timestamp:
- Sep 16, 2010 6:33:44 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r67687 r67688 1 2010-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 1 19 2010-09-12 Antonio Gomes <tonikitoo@webkit.org> 2 20 -
trunk/WebKitTools/QtTestBrowser/webview.cpp
r65159 r67688 60 60 { 61 61 connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&))); 62 m_item->setPage(page);62 graphicsWebView()->setPage(page); 63 63 } 64 64 … … 75 75 76 76 m_resizesToContents = b; 77 m_item->setResizesToContents(m_resizesToContents);77 graphicsWebView()->setResizesToContents(m_resizesToContents); 78 78 79 79 // When setting resizesToContents ON, our web view widget will always size as big as the … … 95 95 setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); 96 96 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); 100 100 scene()->setSceneRect(itemRect); 101 101 } else { 102 102 setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 103 103 setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 104 m_item->page()->setPreferredContentsSize(QSize());104 graphicsWebView()->page()->setPreferredContentsSize(QSize()); 105 105 QRect viewportRect(QPoint(0, 0), size()); 106 m_item->setGeometry(viewportRect);106 graphicsWebView()->setGeometry(viewportRect); 107 107 scene()->setSceneRect(viewportRect); 108 108 } … … 116 116 117 117 if (m_resizesToContents) { 118 m_item->page()->setPreferredContentsSize(size);118 graphicsWebView()->page()->setPreferredContentsSize(size); 119 119 return; 120 120 } 121 121 122 122 QRectF rect(QPoint(0, 0), size); 123 m_item->setGeometry(rect);123 graphicsWebView()->setGeometry(rect); 124 124 scene()->setSceneRect(rect); 125 125 } … … 153 153 { 154 154 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) 155 QSizeF center = m_item->boundingRect().size() / 2;155 QSizeF center = graphicsWebView()->boundingRect().size() / 2; 156 156 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); 160 160 animation->setDuration(1000); 161 161 162 int rotation = int( m_item->rotation());162 int rotation = int(graphicsWebView()->rotation()); 163 163 164 164 animation->setStartValue(rotation); -
trunk/WebKitTools/QtTestBrowser/webview.h
r67687 r67688 76 76 void setPage(QWebPage* page); 77 77 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(); } 80 80 81 81 void setFrameRateMeasurementEnabled(bool enabled);
Note: See TracChangeset
for help on using the changeset viewer.