summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-05-05 05:16:30 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-05-05 05:16:30 (GMT)
commit415708f85341448c6f30bbca6e31e48dbfde72a5 (patch)
treecbddfdd9d387d0033de4a0393ee2294b0399bfc1
parentd0b37af9b27849278fd56a83635c141525a912ce (diff)
downloadQt-415708f85341448c6f30bbca6e31e48dbfde72a5.zip
Qt-415708f85341448c6f30bbca6e31e48dbfde72a5.tar.gz
Qt-415708f85341448c6f30bbca6e31e48dbfde72a5.tar.bz2
Remove Painted, have WebView use ImageItem
Reducing duplicated code and functionality. Removing QFxPainted as it isn't used and has less features than QFxImageItem, which fufills the same roles. Have QFxWebView use QFxImageItem as a base to reduce duplicated caching code. Minimal risk given that QFxImageItem is based of QFxWebView.
-rw-r--r--src/declarative/fx/fx.pri3
-rw-r--r--src/declarative/fx/qfxpainted.cpp194
-rw-r--r--src/declarative/fx/qfxpainted.h87
-rw-r--r--src/declarative/fx/qfxpainted_p.h84
-rw-r--r--src/declarative/fx/qfxwebview.cpp143
-rw-r--r--src/declarative/fx/qfxwebview.h16
6 files changed, 24 insertions, 503 deletions
diff --git a/src/declarative/fx/fx.pri b/src/declarative/fx/fx.pri
index ef059c7..7e04459 100644
--- a/src/declarative/fx/fx.pri
+++ b/src/declarative/fx/fx.pri
@@ -28,8 +28,6 @@ HEADERS += \
fx/qfxlayouts_p.h \
fx/qfxmouseregion.h \
fx/qfxmouseregion_p.h \
- fx/qfxpainted.h \
- fx/qfxpainted_p.h \
fx/qfxparticles.h \
fx/qfxpath.h \
fx/qfxpath_p.h \
@@ -73,7 +71,6 @@ SOURCES += \
fx/qfxkeyproxy.cpp \
fx/qfxlayouts.cpp \
fx/qfxmouseregion.cpp \
- fx/qfxpainted.cpp \
fx/qfxparticles.cpp \
fx/qfxpath.cpp \
fx/qfxpathview.cpp \
diff --git a/src/declarative/fx/qfxpainted.cpp b/src/declarative/fx/qfxpainted.cpp
deleted file mode 100644
index 68918c3..0000000
--- a/src/declarative/fx/qfxpainted.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qfxpainted.h"
-#include "qfxpainted_p.h"
-
-
-QT_BEGIN_NAMESPACE
-/*!
- \internal
- \class QFxPainted
- \brief The QFxPainted class is an abstract base class for QFxView items that want cached painting.
-
- \ingroup group_coreitems
-
- This is a convenience class allowing easy use of cached painting within a custom item.
- The contents of the item are cached behind the scenes. Any time you change the contents
- you should call markDirty to make sure the cache is refreshed the next time painting occurs.
-
- \code
- class GradientRect : public QFxPainted
- {
- Q_OBJECT
- public:
- GradientRect() : QFxPainted()
- {
- connect(this, SIGNAL(widthChanged()), this, SLOT(markDirty()));
- connect(this, SIGNAL(heightChanged()), this, SLOT(markDirty()));
- }
-
- void paint(QPainter *painter)
- {
- painter->fillRect(0, 0, width(), height(), QBrush(QLinearGradient(0,0,width(),height())));
- }
- };
- \endcode
-
- \warning Dirty is only ever automatically set by QFxPainted at construction. Any other changes (including resizes) to the item need to be handled by the subclass (as in the example above).
- \warning Frequent calls to markDirty will result in sub-optimal painting performance.
-*/
-
-/*!
- Constructs a painted item with parent object \a parent.
-*/
-QFxPainted::QFxPainted(QFxItem *parent)
- : QFxItem(*(new QFxPaintedPrivate), parent)
-{
- //### what options do we need to set?
- setOptions(HasContents, true);
-}
-
-/*!
- Destroys the item.
-*/
-QFxPainted::~QFxPainted()
-{
-}
-
-/*! \internal
-*/
-QFxPainted::QFxPainted(QFxPaintedPrivate &dd, QFxItem *parent)
- : QFxItem(dd, parent)
-{
- setOptions(HasContents, true);
-}
-
-/*!
- \fn QFxPainted::paint(QPainter *painter)
-
- Implement this method to paint the item using \a painter.
- The painting will be cached and paint() will only be called again
- if \l markDirty() has been called.
-
- \sa markDirty()
-*/
-
-/*!
- The contents of the item are cached behind the scenes. Any time you change the contents
- you should call markDirty to make sure the cache is refreshed the next time painting occurs.
-*/
-void QFxPainted::markDirty()
-{
- Q_D(QFxPainted);
- if (d->dirty)
- return;
- d->dirty = true;
-
- // release cache memory (will be reallocated upon paintContents, if visible)
-#if defined(QFX_RENDER_QPAINTER)
- d->cachedImage = QImage();
-#elif defined(QFX_RENDER_OPENGL)
- d->cachedTexture.clear();
-#endif
-
- update();
-}
-
-#if defined(QFX_RENDER_QPAINTER)
-void QFxPainted::paintContents(QPainter &p)
-{
- Q_D(QFxPainted);
- if (d->dirty) {
- d->cachedImage = QImage(width(), height(), QImage::Format_ARGB32_Premultiplied);
- d->cachedImage.fill(0);
- QPainter painter(&(d->cachedImage));
- paint(&painter);
- d->dirty = false;
- }
- p.drawImage(0, 0, d->cachedImage);
-}
-#elif defined(QFX_RENDER_OPENGL2)
-void QFxPainted::paintGLContents(GLPainter &painter)
-{
- Q_D(QFxPainted);
- if (d->dirty) {
- QImage img = QImage(width(), height(), QImage::Format_ARGB32);
- img.fill(0);
- QPainter p(&(img));
- paint(&p);
- d->cachedTexture.setImage(img);
- d->dirty = false;
- }
-
- //### mainly copied from QFxImage code
- QGLShaderProgram *shader = painter.useTextureShader();
-
- GLfloat vertices[8];
- GLfloat texVertices[8];
- GLTexture *tex = &d->cachedTexture;
-
- float widthV = d->cachedTexture.width();
- float heightV = d->cachedTexture.height();
-
- vertices[0] = 0; vertices[1] = heightV;
- vertices[2] = widthV; vertices[3] = heightV;
- vertices[4] = 0; vertices[5] = 0;
- vertices[6] = widthV; vertices[7] = 0;
-
- texVertices[0] = 0; texVertices[1] = 0;
- texVertices[2] = 1; texVertices[3] = 0;
- texVertices[4] = 0; texVertices[5] = 1;
- texVertices[6] = 1; texVertices[7] = 1;
-
- shader->setAttributeArray(SingleTextureShader::Vertices, vertices, 2);
- shader->setAttributeArray(SingleTextureShader::TextureCoords, texVertices, 2);
-
- glBindTexture(GL_TEXTURE_2D, tex->texture());
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- shader->disableAttributeArray(SingleTextureShader::Vertices);
- shader->disableAttributeArray(SingleTextureShader::TextureCoords);
-}
-
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfxpainted.h b/src/declarative/fx/qfxpainted.h
deleted file mode 100644
index 1f22414..0000000
--- a/src/declarative/fx/qfxpainted.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFXPAINTED_H
-#define QFXPAINTED_H
-
-#include <qfxitem.h>
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-QT_MODULE(Declarative)
-/*
-WARNING: INTENDED TO MERGE WITH QFxImageItem
-*/
-
-class QFxPaintedPrivate;
-class Q_DECLARATIVE_EXPORT QFxPainted : public QFxItem
-{
-Q_OBJECT
-public:
- QFxPainted(QFxItem *parent);
- ~QFxPainted();
-
- virtual void paint(QPainter *painter) = 0;
-
-#if defined(QFX_RENDER_QPAINTER)
- void paintContents(QPainter &painter);
-#elif defined(QFX_RENDER_OPENGL2)
- void paintGLContents(GLPainter &);
-#endif
-
-protected Q_SLOTS:
- void markDirty();
-
-protected:
- QFxPainted(QFxPaintedPrivate &dd, QFxItem *parent);
-
-private:
- Q_DISABLE_COPY(QFxPainted)
- Q_DECLARE_PRIVATE(QFxPainted)
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QFXPAINTED_H
diff --git a/src/declarative/fx/qfxpainted_p.h b/src/declarative/fx/qfxpainted_p.h
deleted file mode 100644
index 68ac83e..0000000
--- a/src/declarative/fx/qfxpainted_p.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFXPAINTED_P_H
-#define QFXPAINTED_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qfxitem_p.h"
-#if defined(QFX_RENDER_OPENGL)
-#include "gltexture.h"
-#endif
-
-QT_BEGIN_NAMESPACE
-
-class QFxPaintedPrivate : public QFxItemPrivate
-{
- Q_DECLARE_PUBLIC(QFxPainted)
-
-public:
- QFxPaintedPrivate()
- : dirty(true)
- {
- }
-
- bool dirty;
-
-#if defined(QFX_RENDER_QPAINTER)
- QSimpleCanvasConfig::Image cachedImage;
-#elif defined(QFX_RENDER_OPENGL)
- GLTexture cachedTexture;
-#endif
-};
-
-QT_END_NAMESPACE
-
-#endif // QFXPAINTED_P_H
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index dac8ced..9b18a9e 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -68,7 +68,7 @@
#include "qfxwebview.h"
#include <qsimplecanvasfilter.h>
-#include <private/qfxitem_p.h>
+#include <private/qfximageitem_p.h>
QT_BEGIN_NAMESPACE
QML_DEFINE_TYPE(QFxWebView,WebView);
@@ -142,14 +142,14 @@ public:
};
-class QFxWebViewPrivate : public QFxItemPrivate
+class QFxWebViewPrivate : public QFxImageItemPrivate
{
Q_DECLARE_PUBLIC(QFxWebView)
public:
QFxWebViewPrivate()
- : page(0), idealwidth(0), idealheight(0), interactive(true), lastPress(0), lastRelease(0), mouseX(0), mouseY(0),
- smooth(true), max_imagecache_size(100000), progress(1.0), pending(PendingNone)
+ : QFxImageItemPrivate(), page(0), idealwidth(0), idealheight(0), interactive(true), lastPress(0), lastRelease(0), mouseX(0), mouseY(0),
+ max_imagecache_size(100000), progress(1.0), pending(PendingNone)
{
}
@@ -189,7 +189,6 @@ public:
bool interactive;
QMouseEvent *lastPress, *lastRelease;
int mouseX, mouseY;
- bool smooth;
int max_imagecache_size;
qreal progress;
QBasicTimer dcTimer;
@@ -254,13 +253,13 @@ public:
*/
QFxWebView::QFxWebView(QFxItem *parent)
- : QFxItem(*(new QFxWebViewPrivate), parent)
+ : QFxImageItem(*(new QFxWebViewPrivate), parent)
{
init();
}
QFxWebView::QFxWebView(QFxWebViewPrivate &dd, QFxItem *parent)
- : QFxItem(dd, parent)
+ : QFxImageItem(dd, parent)
{
init();
}
@@ -284,7 +283,7 @@ void QFxWebView::init()
void QFxWebView::componentComplete()
{
- QFxItem::componentComplete();
+ QFxImageItem::componentComplete();
Q_D(QFxWebView);
switch (d->pending) {
case QFxWebViewPrivate::PendingUrl:
@@ -460,28 +459,6 @@ void QFxWebView::setInteractive(bool i)
emit interactiveChanged();
}
-/*!
- \qmlproperty bool WebView::smooth
- This property holds hints as to whether the item should be drawn anti-aliased.
-*/
-/*!
- \property QFxWebView::smooth
- \brief hints as to whether the item should be drawn anti-aliased.
-*/
-bool QFxWebView::smooth() const
-{
- Q_D(const QFxWebView);
- return d->smooth;
-}
-
-void QFxWebView::setSmooth(bool i)
-{
- Q_D(QFxWebView);
- if (d->smooth == i) return;
- d->smooth = i;
- update();
-}
-
void QFxWebView::updateCacheForVisibility()
{
Q_D(QFxWebView);
@@ -514,13 +491,15 @@ void QFxWebView::geometryChanged(const QRectF &newGeometry,
{
if (newGeometry.size() != oldGeometry.size())
expandToWebPage();
- QFxItem::geometryChanged(newGeometry, oldGeometry);
+ QFxImageItem::geometryChanged(newGeometry, oldGeometry);
}
void QFxWebView::paintPage(const QRect& r)
{
Q_D(QFxWebView);
- d->dirtyCache(r);
+ if (d->page->mainFrame()->contentsSize() != contentsSize())
+ setContentsSize(d->page->mainFrame()->contentsSize());
+ dirtyCache(r);
update();
}
@@ -575,96 +554,12 @@ void QFxWebView::dump(int depth)
{
QByteArray ba(depth * 4, ' ');
qWarning() << ba.constData() << "url:" << url();
- QFxItem::dump(depth);
+ QFxImageItem::dump(depth);
}
-#if defined(QFX_RENDER_QPAINTER)
-void QFxWebView::paintContents(QPainter &p)
-#elif defined(QFX_RENDER_OPENGL)
-void QFxWebView::paintGLContents(GLPainter &p)
-#else
-#error "What render?"
-#endif
+void QFxWebView::drawContents(QPainter *p, const QRect &r)
{
- Q_D(QFxWebView);
- QWebFrame *frame = page()->mainFrame();
- const QRect content(QPoint(0,0),frame->contentsSize());
-
- if (content.width() <= 0 || content.height() <= 0)
- return;
-
-#if defined(QFX_RENDER_QPAINTER)
- bool wasAA = p.testRenderHint(QPainter::Antialiasing);
- bool wasSM = p.testRenderHint(QPainter::SmoothPixmapTransform);
- p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, d->smooth);
- QRectF clipf = p.clipRegion().boundingRect();
- const QRect clip = p.clipRegion().isEmpty() ? content : clipf.toRect();
-#elif defined(QFX_RENDER_OPENGL)
- const QRectF clipf = p.sceneClipRect;
- const QRect clip = mapFromScene(clipf).toRect();
-#endif
-
- QRegion topaint(clip);
- topaint &= content;
- QRegion uncached(content);
-
- int cachesize=0;
- for (int i=0; i<d->imagecache.count(); ++i) {
- QRect area = d->imagecache[i]->area;
- if (topaint.contains(area)) {
- p.drawImage(area, d->imagecache[i]->image);
- topaint -= area;
- d->imagecache[i]->age=0;
- } else {
- d->imagecache[i]->age++;
- }
- cachesize += area.width()*area.height();
- uncached -= area;
- }
-
- if (!topaint.isEmpty()) {
- // Find a sensible larger area, otherwise will paint lots of tiny images.
- QRect biggerrect = topaint.boundingRect().adjusted(-64,-64,128,128);
- cachesize += biggerrect.width() * biggerrect.height();
- while (d->imagecache.count() && cachesize > d->max_imagecache_size) {
- int oldest=-1;
- int age=-1;
- for (int i=0; i<d->imagecache.count(); ++i) {
- int a = d->imagecache[i]->age;
- if (a > age) {
- oldest = i;
- age = a;
- }
- }
- cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height();
- uncached += d->imagecache[oldest]->area;
- d->imagecache.removeAt(oldest);
- }
- const QRegion bigger = QRegion(biggerrect) & uncached;
- const QVector<QRect> rects = bigger.rects();
- foreach (QRect r, rects) {
- QImage img(r.size(),QImage::Format_ARGB32_Premultiplied);
- img.fill(0);
- {
- QPainter qp(&img);
- qp.translate(-r.x(),-r.y());
- frame->render(&qp,r);
- }
- QFxWebViewPrivate::ImageCacheItem *newitem = new QFxWebViewPrivate::ImageCacheItem;
- newitem->area = r;
-#if defined(QFX_RENDER_QPAINTER)
- newitem->image = QSimpleCanvasConfig::Image(QSimpleCanvasConfig::toImage(img));
-#else
- newitem->image.setImage(img);
-#endif
- d->imagecache.append(newitem);
- p.drawImage(r, newitem->image);
- }
- }
-#if defined(QFX_RENDER_QPAINTER)
- p.setRenderHints(QPainter::Antialiasing, wasAA);
- p.setRenderHints(QPainter::SmoothPixmapTransform, wasSM);
-#endif
+ page()->mainFrame()->render(p,r);
}
QString QFxWebView::propertyInfo() const
@@ -761,7 +656,7 @@ void QFxWebView::mousePressEvent(QGraphicsSceneMouseEvent *event)
event->setAccepted(false);
}
if (!event->isAccepted())
- QFxItem::mousePressEvent(event);
+ QFxImageItem::mousePressEvent(event);
}
void QFxWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
@@ -775,7 +670,7 @@ void QFxWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
event->setAccepted(false);
}
if (!event->isAccepted())
- QFxItem::mouseReleaseEvent(event);
+ QFxImageItem::mouseReleaseEvent(event);
}
void QFxWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
@@ -796,7 +691,7 @@ void QFxWebView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
event->setAccepted(false);
}
if (!event->isAccepted())
- QFxItem::mouseMoveEvent(event);
+ QFxImageItem::mouseMoveEvent(event);
}
void QFxWebView::keyPressEvent(QKeyEvent* event)
@@ -805,7 +700,7 @@ void QFxWebView::keyPressEvent(QKeyEvent* event)
if (d->interactive)
page()->event(event);
if (!event->isAccepted())
- QFxItem::keyPressEvent(event);
+ QFxImageItem::keyPressEvent(event);
}
void QFxWebView::keyReleaseEvent(QKeyEvent* event)
@@ -814,7 +709,7 @@ void QFxWebView::keyReleaseEvent(QKeyEvent* event)
if (d->interactive)
page()->event(event);
if (!event->isAccepted())
- QFxItem::keyReleaseEvent(event);
+ QFxImageItem::keyReleaseEvent(event);
}
/*!
diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h
index 6ba4601..17037ca 100644
--- a/src/declarative/fx/qfxwebview.h
+++ b/src/declarative/fx/qfxwebview.h
@@ -45,7 +45,7 @@
#include <QAction>
#include <QUrl>
#include <qfxglobal.h>
-#include <qfxitem.h>
+#include <qfximageitem.h>
#include <QtNetwork/qnetworkaccessmanager.h>
#include <QWebPage>
@@ -74,7 +74,7 @@ private:
};
-class Q_DECLARATIVE_EXPORT QFxWebView : public QFxItem
+class Q_DECLARATIVE_EXPORT QFxWebView : public QFxImageItem
{
Q_OBJECT
@@ -91,7 +91,6 @@ class Q_DECLARATIVE_EXPORT QFxWebView : public QFxItem
Q_PROPERTY(int idealWidth READ idealWidth WRITE setIdealWidth NOTIFY idealWidthChanged)
Q_PROPERTY(int idealHeight READ idealHeight WRITE setIdealHeight NOTIFY idealHeightChanged)
Q_PROPERTY(QString url READ url WRITE setUrl NOTIFY urlChanged)
- Q_PROPERTY(bool smooth READ smooth WRITE setSmooth)
Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
Q_PROPERTY(bool interactive READ interactive WRITE setInteractive NOTIFY interactiveChanged)
@@ -128,9 +127,6 @@ public:
int mouseX() const;
int mouseY() const;
- bool smooth() const;
- void setSmooth(bool);
-
int idealWidth() const;
void setIdealWidth(int);
int idealHeight() const;
@@ -146,11 +142,6 @@ public:
virtual void dump(int depth);
virtual QString propertyInfo() const;
-#if defined(QFX_RENDER_QPAINTER)
- void paintContents(QPainter &painter);
-#elif defined(QFX_RENDER_OPENGL)
- void paintGLContents(GLPainter &);
-#endif
QWebPage *page() const;
void setPage(QWebPage *page);
@@ -197,6 +188,9 @@ private Q_SLOTS:
protected:
QFxWebView(QFxWebViewPrivate &dd, QFxItem *parent);
+
+ void drawContents(QPainter *, const QRect &);
+
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);