summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-20 15:50:16 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-20 15:50:16 (GMT)
commit5a5e2d692981add098bd2fb6a7a15613778fb62c (patch)
treef5aaee3721706fb3d9b7b7e04ad600aed057cbe2
parent84f0ae22f4b1e7882f4c0fff2a1f5bc47ebceb37 (diff)
parentf6d816ffe37ac74d29a7423683d4e046a3906b74 (diff)
downloadQt-5a5e2d692981add098bd2fb6a7a15613778fb62c.zip
Qt-5a5e2d692981add098bd2fb6a7a15613778fb62c.tar.gz
Qt-5a5e2d692981add098bd2fb6a7a15613778fb62c.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: No repaint when resizing graphics item with an effect. Fix sqlite driver doesn't return error message RAISE by a trigger.
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h7
-rw-r--r--src/sql/drivers/sqlite/qsql_sqlite.cpp1
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp28
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp27
4 files changed, 63 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index ea04e0b..e737773 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -769,6 +769,13 @@ inline bool QGraphicsItemPrivate::insertionOrder(QGraphicsItem *a, QGraphicsItem
inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect)
{
QGraphicsItemPrivate *parentp = this;
+#ifndef QT_NO_GRAPHICSEFFECT
+ if (updateBoundingRect && parentp->graphicsEffect && !parentp->inSetPosHelper) {
+ parentp->notifyInvalidated = 1;
+ static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func()
+ ->source->d_func())->invalidateCache();
+ }
+#endif
while (parentp->parent) {
parentp = parentp->parent->d_ptr.data();
parentp->dirtyChildren = 1;
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp
index d3be304..9b9d30b 100644
--- a/src/sql/drivers/sqlite/qsql_sqlite.cpp
+++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp
@@ -259,6 +259,7 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i
q->setAt(QSql::AfterLastRow);
sqlite3_reset(stmt);
return false;
+ case SQLITE_CONSTRAINT:
case SQLITE_ERROR:
// SQLITE_ERROR is a generic error code and we must call sqlite3_reset()
// to get the specific error message.
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index dbd4a23..5dc0c9d 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -75,6 +75,7 @@ private slots:
void inheritOpacity();
void dropShadowClipping();
void childrenVisibilityShouldInvalidateCache();
+ void prepareGeometryChangeInvalidateCache();
};
void tst_QGraphicsEffect::initTestCase()
@@ -647,6 +648,33 @@ void tst_QGraphicsEffect::childrenVisibilityShouldInvalidateCache()
QCOMPARE(parent.nbPaint, 3);
}
+void tst_QGraphicsEffect::prepareGeometryChangeInvalidateCache()
+{
+ MyGraphicsItem *item = new MyGraphicsItem;
+ item->resize(200, 200);
+
+ QGraphicsScene scene;
+ scene.addItem(item);
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->setGraphicsEffect(new QGraphicsDropShadowEffect);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->resize(300, 300);
+ QTRY_COMPARE(item->nbPaint, 1);
+
+ item->nbPaint = 0;
+ item->setPos(item->pos() + QPointF(10, 10));
+ QTest::qWait(50);
+ QCOMPARE(item->nbPaint, 0);
+}
+
QTEST_MAIN(tst_QGraphicsEffect)
#include "tst_qgraphicseffect.moc"
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index db3a929..c7a61a5 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -209,6 +209,8 @@ private slots:
void QTBUG_6852();
void QTBUG_5765_data() { generic_data("QMYSQL"); }
void QTBUG_5765();
+ void sqlite_constraint_data() { generic_data("QSQLITE"); }
+ void sqlite_constraint();
#if 0
void benchmark_data() { generic_data(); }
@@ -3078,6 +3080,31 @@ void tst_QSqlQuery::QTBUG_5765()
QCOMPARE(q.value(0).toInt(), 123);
}
+void tst_QSqlQuery::sqlite_constraint()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+
+ if (db.driverName() != QLatin1String("QSQLITE")) {
+ QSKIP("Sqlite3 specific test", SkipSingle);
+ return;
+ }
+
+ QSqlQuery q(db);
+ const QString trigger(qTableName("test_constraint", __FILE__));
+
+ QVERIFY_SQL(q, exec("CREATE TEMP TRIGGER "+trigger+" BEFORE DELETE ON "+qtest+
+ "\nFOR EACH ROW "
+ "\nBEGIN"
+ "\n SELECT RAISE(ABORT, 'Raised Abort successfully');"
+ "\nEND;"
+ ));
+
+ QVERIFY(!q.exec("DELETE FROM "+qtest));
+ QCOMPARE(q.lastError().databaseText(), QLatin1String("Raised Abort successfully"));
+}
+
#if 0
void tst_QSqlQuery::benchmark()
{