summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-11-09 09:00:48 (GMT)
committerjasplin <qt-info@nokia.com>2009-11-09 09:00:48 (GMT)
commitd9c5a6828e0f5c846aeef214f2fe0a9de48072dc (patch)
treed757f66b28c644ee2d7379ba8dd682f7e0b6778c
parentb0ea2ae80f473d1698f518ed6324a8d328e8c67f (diff)
parentbbbdf511be4afdb08d2a4d7c365a84adde7ae324 (diff)
downloadQt-d9c5a6828e0f5c846aeef214f2fe0a9de48072dc.zip
Qt-d9c5a6828e0f5c846aeef214f2fe0a9de48072dc.tar.gz
Qt-d9c5a6828e0f5c846aeef214f2fe0a9de48072dc.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp9
-rw-r--r--tests/auto/qpainter/tst_qpainter.cpp14
2 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index a236b14..723e496 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -3349,6 +3349,9 @@ QPointF QGraphicsItem::pos() const
*/
void QGraphicsItem::setX(qreal x)
{
+ if (d_ptr->inDestructor)
+ return;
+
d_ptr->setPosHelper(QPointF(x, d_ptr->pos.y()));
}
@@ -3370,6 +3373,9 @@ void QGraphicsItem::setX(qreal x)
*/
void QGraphicsItem::setY(qreal y)
{
+ if (d_ptr->inDestructor)
+ return;
+
d_ptr->setPosHelper(QPointF(d_ptr->pos.x(), y));
}
@@ -3435,6 +3441,9 @@ void QGraphicsItem::setPos(const QPointF &pos)
if (d_ptr->pos == pos)
return;
+ if (d_ptr->inDestructor)
+ return;
+
// Update and repositition.
if (!(d_ptr->flags & ItemSendsGeometryChanges)) {
d_ptr->setPosHelper(pos);
diff --git a/tests/auto/qpainter/tst_qpainter.cpp b/tests/auto/qpainter/tst_qpainter.cpp
index 4d2c626..02c73c0 100644
--- a/tests/auto/qpainter/tst_qpainter.cpp
+++ b/tests/auto/qpainter/tst_qpainter.cpp
@@ -101,6 +101,8 @@ private slots:
void saveAndRestore_data();
void saveAndRestore();
+ void drawBorderPixmap();
+
void drawLine_data();
void drawLine();
void drawLine_clipped();
@@ -973,6 +975,18 @@ void tst_QPainter::initFrom()
delete widget;
}
+void tst_QPainter::drawBorderPixmap()
+{
+ QPixmap src(79,79);
+ src.fill(Qt::transparent);
+
+ QImage pm(200,200,QImage::Format_RGB32);
+ QPainter p(&pm);
+ p.setTransform(QTransform(-1,0,0,-1,173.5,153.5));
+ qDrawBorderPixmap(&p, QRect(0,0,75,105), QMargins(39,39,39,39), src, QRect(0,0,79,79), QMargins(39,39,39,39),
+ QTileRules(Qt::StretchTile,Qt::StretchTile), 0);
+}
+
void tst_QPainter::drawLine_data()
{
QTest::addColumn<QLine>("line");