diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-11-11 03:40:50 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-11-11 03:40:50 (GMT) |
commit | feae45e1a0b6079881e5e3493ed6f7bfaf83be45 (patch) | |
tree | 2c7eac400ac75f58477069b80cbbc20c562ef046 /src | |
parent | 8768193ce3a3dc26508a911e189a084ed72d019a (diff) | |
parent | 22fe9474b01c577337e43416666a8f90d0ad6064 (diff) | |
download | Qt-feae45e1a0b6079881e5e3493ed6f7bfaf83be45.zip Qt-feae45e1a0b6079881e5e3493ed6f7bfaf83be45.tar.gz Qt-feae45e1a0b6079881e5e3493ed6f7bfaf83be45.tar.bz2 |
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/debugger/qmldebug.cpp | 10 | ||||
-rw-r--r-- | src/declarative/debugger/qmldebug_p.h | 4 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicspainteditem.cpp | 20 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 3 |
4 files changed, 25 insertions, 12 deletions
diff --git a/src/declarative/debugger/qmldebug.cpp b/src/declarative/debugger/qmldebug.cpp index f24b456..72f613a 100644 --- a/src/declarative/debugger/qmldebug.cpp +++ b/src/declarative/debugger/qmldebug.cpp @@ -331,7 +331,7 @@ void QmlEngineDebugPrivate::message(const QByteArray &data) QVariant value; ds >> queryId >> debugId >> name >> value; - QmlDebugWatch *watch = watched.value(queryId); + QmlDebugWatch *watch = watched.value(queryId, 0); if (!watch) return; emit watch->valueChanged(name, value); @@ -428,13 +428,15 @@ void QmlEngineDebug::removeWatch(QmlDebugWatch *watch) { Q_D(QmlEngineDebug); - if (!watch || watch->state() == QmlDebugWatch::Inactive || watch->state() == QmlDebugWatch::Dead) + if (!watch || !watch->m_client) return; + watch->m_client = 0; watch->setState(QmlDebugWatch::Inactive); + d->watched.remove(watch->queryId()); - if (d->client->isConnected()) { + if (d->client && d->client->isConnected()) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); ds << QByteArray("NO_WATCH") << watch->queryId(); @@ -562,8 +564,6 @@ QmlDebugWatch::QmlDebugWatch(QObject *parent) QmlDebugWatch::~QmlDebugWatch() { - if (m_client) - m_client->removeWatch(this); } int QmlDebugWatch::queryId() const diff --git a/src/declarative/debugger/qmldebug_p.h b/src/declarative/debugger/qmldebug_p.h index 4bc54e8..cd2adf6 100644 --- a/src/declarative/debugger/qmldebug_p.h +++ b/src/declarative/debugger/qmldebug_p.h @@ -113,7 +113,7 @@ public: State state() const; Q_SIGNALS: - void stateChanged(State); + void stateChanged(QmlDebugWatch::State); //void objectChanged(int, const QmlDebugObjectReference &); //void valueChanged(int, const QVariant &); @@ -170,7 +170,7 @@ public: // bool waitUntilCompleted(); Q_SIGNALS: - void stateChanged(State); + void stateChanged(QmlDebugQuery::State); protected: QmlDebugQuery(QObject *); diff --git a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp index 2c849c8..b1b1210 100644 --- a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp @@ -49,6 +49,7 @@ #include <QApplication> #include <QGraphicsSceneMouseEvent> #include <QPainter> +#include <QPaintEngine> QT_BEGIN_NAMESPACE @@ -209,9 +210,24 @@ void QmlGraphicsPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem * ++inpaint; - const QRect clip = p->clipRegion().boundingRect(); + const QTransform &x = p->deviceTransform(); + QTransform xinv = x.inverted(); + QRegion effectiveClip; + QRegion sysClip = p->paintEngine()->systemClip(); + if (xinv.type() <= QTransform::TxScale && sysClip.numRects() < 5) { + // simple transform, region gets no more complicated... + effectiveClip = xinv.map(sysClip); + } else { + // do not make complicated regions... + effectiveClip = xinv.mapRect(sysClip.boundingRect()); + } + + QRegion topaint = p->clipRegion(); + if (topaint.isEmpty()) + topaint = effectiveClip; + else + topaint &= effectiveClip; - QRegion topaint(clip); topaint &= content; QRegion uncached(content); p->setRenderHints(QPainter::SmoothPixmapTransform, d->smooth); diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 87585a2..90c0ff2 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -3275,13 +3275,10 @@ void QGraphicsView::paintEvent(QPaintEvent *event) // Determine the exposed region d->exposedRegion = event->region(); - if (d->exposedRegion.isEmpty()) - d->exposedRegion = viewport()->rect(); QRectF exposedSceneRect = mapToScene(d->exposedRegion.boundingRect()).boundingRect(); // Set up the painter QPainter painter(viewport()); - painter.setClipRect(event->rect(), Qt::IntersectClip); #ifndef QT_NO_RUBBERBAND if (d->rubberBanding && !d->rubberBandRect.isEmpty()) painter.save(); |