tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   207 }
   207 }
   208 
   208 
   209 void tst_QGraphicsEffectSource::graphicsItem()
   209 void tst_QGraphicsEffectSource::graphicsItem()
   210 {
   210 {
   211     QVERIFY(effect->source());
   211     QVERIFY(effect->source());
   212     QCOMPARE(effect->source()->graphicsItem(), item);
   212     QCOMPARE(effect->source()->graphicsItem(), (const QGraphicsItem*)item);
   213 }
   213 }
   214 
   214 
   215 void tst_QGraphicsEffectSource::styleOption()
   215 void tst_QGraphicsEffectSource::styleOption()
   216 {
   216 {
   217     // We don't have style options unless the source is drawing.
   217     // We don't have style options unless the source is drawing.
   235     // Make sure isPixmap() returns true for QGraphicsPixmapItem.
   235     // Make sure isPixmap() returns true for QGraphicsPixmapItem.
   236     QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem;
   236     QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem;
   237     CustomEffect *anotherEffect = new CustomEffect;
   237     CustomEffect *anotherEffect = new CustomEffect;
   238     pixmapItem->setGraphicsEffect(anotherEffect);
   238     pixmapItem->setGraphicsEffect(anotherEffect);
   239     QVERIFY(anotherEffect->source());
   239     QVERIFY(anotherEffect->source());
   240     QCOMPARE(anotherEffect->source()->graphicsItem(), static_cast<QGraphicsItem *>(pixmapItem));
   240     QCOMPARE(anotherEffect->source()->graphicsItem(), static_cast<const QGraphicsItem *>(pixmapItem));
   241     QVERIFY(anotherEffect->source()->isPixmap());
   241     QVERIFY(anotherEffect->source()->isPixmap());
   242     delete pixmapItem;
   242     delete pixmapItem;
   243 }
   243 }
   244 
   244 
   245 void tst_QGraphicsEffectSource::draw()
   245 void tst_QGraphicsEffectSource::draw()