summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/activeqt/shared/qaxtypes.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp5
-rw-r--r--src/gui/image/qvolatileimage.cpp5
-rw-r--r--src/gui/image/qvolatileimage_p.h1
-rw-r--r--src/openvg/qpaintengine_vg.cpp5
-rw-r--r--src/openvg/qpixmapdata_vg.cpp2
-rw-r--r--src/s60installs/bwins/QtGuiu.def1
-rw-r--r--src/s60installs/eabi/QtGuiu.def1
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp5
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp61
10 files changed, 86 insertions, 2 deletions
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index f0a8ad8440..b741620822 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -265,7 +265,7 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
return QVariantToVARIANT(var, *arg.pvarVal, typeName, false);
}
- if (out && proptype == QVariant::Invalid && typeName == "QVariant") {
+ if (out && proptype == QVariant::UserType && typeName == "QVariant") {
VARIANT *pVariant = new VARIANT;
QVariantToVARIANT(var, *pVariant, QByteArray(), false);
arg.vt = VT_VARIANT|VT_BYREF;
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 97ce0592a4..4c839a15d5 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -1398,7 +1398,12 @@ void QDeclarativeVisualDataModel::_q_layoutChanged()
void QDeclarativeVisualDataModel::_q_modelReset()
{
+ Q_D(QDeclarativeVisualDataModel);
+ d->m_root = QModelIndex();
emit modelReset();
+ emit rootIndexChanged();
+ if (d->m_abstractItemModel && d->m_abstractItemModel->canFetchMore(d->m_root))
+ d->m_abstractItemModel->fetchMore(d->m_root);
}
void QDeclarativeVisualDataModel::_q_createdPackage(int index, QDeclarativePackage *package)
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
index 098e9a1264..f5076e1d50 100644
--- a/src/gui/image/qvolatileimage.cpp
+++ b/src/gui/image/qvolatileimage.cpp
@@ -103,6 +103,11 @@ QVolatileImage &QVolatileImage::operator=(const QVolatileImage &rhs)
return *this;
}
+bool QVolatileImage::paintingActive() const
+{
+ return d->pengine && d->pengine->isActive();
+}
+
bool QVolatileImage::isNull() const
{
return d->image.isNull();
diff --git a/src/gui/image/qvolatileimage_p.h b/src/gui/image/qvolatileimage_p.h
index fc5d6b115c..d835f45b28 100644
--- a/src/gui/image/qvolatileimage_p.h
+++ b/src/gui/image/qvolatileimage_p.h
@@ -71,6 +71,7 @@ public:
~QVolatileImage();
QVolatileImage &operator=(const QVolatileImage &rhs);
+ bool paintingActive() const;
bool isNull() const;
QImage::Format format() const;
int width() const;
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index ebdfa5fd48..648415c387 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -1533,6 +1533,8 @@ bool QVGPaintEngine::begin(QPaintDevice *pdev)
bool QVGPaintEngine::end()
{
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgSeti(VG_MASKING, VG_FALSE);
return true;
}
@@ -3759,6 +3761,8 @@ void QVGPaintEngine::beginNativePainting()
#if !defined(QVG_NO_DRAW_GLYPHS)
d->setTransform(VG_MATRIX_GLYPH_USER_TO_SURFACE, d->pathTransform);
#endif
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgSeti(VG_MASKING, VG_FALSE);
d->rawVG = true;
}
@@ -3819,6 +3823,7 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty)
if ((dirty & QPaintEngine::DirtyBrushOrigin) != 0)
brushOriginChanged();
d->fillRule = 0;
+ d->clearColor = QColor();
if ((dirty & QPaintEngine::DirtyOpacity) != 0)
opacityChanged();
if ((dirty & QPaintEngine::DirtyTransform) != 0)
diff --git a/src/openvg/qpixmapdata_vg.cpp b/src/openvg/qpixmapdata_vg.cpp
index 80f5b2fd91..eae10c8df2 100644
--- a/src/openvg/qpixmapdata_vg.cpp
+++ b/src/openvg/qpixmapdata_vg.cpp
@@ -377,7 +377,7 @@ VGImage QVGPixmapData::toVGImage()
QVGImagePool::instance()->useImage(this);
}
- if (!source.isNull() && recreate) {
+ if (!source.isNull() && (recreate || source.paintingActive())) {
source.beginDataAccess();
vgImageSubData
(vgImage,
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 26a07612ab..45a8d7b884 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12981,4 +12981,5 @@ EXPORTS
?depth@QVolatileImage@@QBEHXZ @ 12980 NONAME ; int QVolatileImage::depth(void) const
?releaseCachedResources@QGraphicsSystem@@UAEXXZ @ 12981 NONAME ; void QGraphicsSystem::releaseCachedResources(void)
?qt_s60_setPartialScreenInputMode@@YAX_N@Z @ 12982 NONAME ; void qt_s60_setPartialScreenInputMode(bool)
+ ?paintingActive@QVolatileImage@@QBE_NXZ @ 12983 NONAME ; bool QVolatileImage::paintingActive(void) const
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index fafa07b10e..1914e1f900 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12183,4 +12183,5 @@ EXPORTS
_ZN15QGraphicsSystem22releaseCachedResourcesEv @ 12182 NONAME
_Z32qt_s60_setPartialScreenInputModeb @ 12183 NONAME
_Z29qt_draw_decoration_for_glyphsP8QPainterPKjPK11QFixedPointiP11QFontEngineRK5QFontRK15QTextCharFormat @ 12184 NONAME
+ _ZNK14QVolatileImage14paintingActiveEv @ 12186 NONAME
diff --git a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
index 85d7876f28..7b384f81aa 100644
--- a/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
+++ b/tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp
@@ -190,6 +190,11 @@ void tst_qdeclarativevisualdatamodel::rootIndex()
QMetaObject::invokeMethod(obj, "setRootToParent");
QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+ QMetaObject::invokeMethod(obj, "setRoot");
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == model.index(0,0));
+ model.clear(); // will emit modelReset()
+ QVERIFY(qvariant_cast<QModelIndex>(obj->rootIndex()) == QModelIndex());
+
delete obj;
}
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 0b5c30be79..0b2f527d0d 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -194,6 +194,8 @@ private slots:
#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG)
void vgImageReadBack();
#endif
+
+ void drawPixmapWhilePainterOpen();
};
static bool lenientCompare(const QPixmap &actual, const QPixmap &expected)
@@ -1881,5 +1883,64 @@ void tst_QPixmap::vgImageReadBack()
}
#endif // Symbian & OpenVG
+class PixmapWidget : public QWidget
+{
+public:
+ PixmapWidget(QPixmap &pixmap) : QWidget(0), m_pixmap(pixmap)
+ {
+ resize(pixmap.width(), pixmap.height());
+ }
+
+protected:
+ void paintEvent(QPaintEvent *)
+ {
+ QPainter p(this);
+ p.drawPixmap(0, 0, m_pixmap);
+ }
+
+private:
+ QPixmap &m_pixmap;
+};
+
+void tst_QPixmap::drawPixmapWhilePainterOpen()
+{
+ const int delay = 1000;
+ const int size = 100;
+ const QColor colors[] = { Qt::red, Qt::blue, Qt::green };
+
+ QPixmap pix(size, size);
+ pix.fill(colors[0]);
+
+ PixmapWidget w(pix);
+ w.show();
+ QTest::qWaitForWindowShown(&w);
+ QTest::qWait(delay);
+
+ QPainter p(&pix);
+ p.fillRect(0, 0, size, size, colors[1]);
+ w.update();
+ QTest::qWait(delay);
+
+ p.fillRect(0, 0, size, size, colors[2]);
+ w.update();
+ QTest::qWait(delay);
+
+ QPixmap actual = QPixmap::grabWindow(w.effectiveWinId(), 0, 0, size, size);
+
+ // If we captured some bogus content with grabWindow(), the comparison makes no sense
+ // because it cannot prove the feature is broken.
+ QPixmap guard(size, size);
+ bool matchesColors = false;
+ for (size_t i = 0; i < sizeof(colors) / sizeof(const QColor); ++i) {
+ guard.fill(colors[i]);
+ matchesColors |= lenientCompare(actual, guard);
+ }
+ if (!matchesColors) {
+ QSKIP("Skipping verification due to grabWindow() issue", SkipSingle);
+ } else {
+ QVERIFY(lenientCompare(actual, pix));
+ }
+}
+
QTEST_MAIN(tst_QPixmap)
#include "tst_qpixmap.moc"