summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-11 06:32:04 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-02-11 06:32:04 (GMT)
commit8e72075b8333dcefaa7ddbaeb0bc7ae45d42ff1e (patch)
treeb8b69f812095df8bf780f88302c7784c4d2e18e0 /tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
parent34450eb48e56677395601bf155a6a05752b326ad (diff)
parentdbfe5f81e300de3a43311197826f23ff031b4b23 (diff)
downloadQt-8e72075b8333dcefaa7ddbaeb0bc7ae45d42ff1e.zip
Qt-8e72075b8333dcefaa7ddbaeb0bc7ae45d42ff1e.tar.gz
Qt-8e72075b8333dcefaa7ddbaeb0bc7ae45d42ff1e.tar.bz2
Merge remote branch 'origin/master' into bearermanagement/integration
Conflicts: configure
Diffstat (limited to 'tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp')
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index 00bf144..6941d23 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -163,6 +163,7 @@ private slots:
void addChildInpolishEvent();
void polishEvent();
void polishEvent2();
+ void autoFillBackground();
void initialShow();
void initialShow2();
@@ -2858,6 +2859,32 @@ void tst_QGraphicsWidget::polishEvent2()
QVERIFY(widget->events.contains(QEvent::Polish));
}
+void tst_QGraphicsWidget::autoFillBackground()
+{
+ QGraphicsWidget *widget = new QGraphicsWidget;
+ QCOMPARE(widget->autoFillBackground(), false);
+ widget->setAutoFillBackground(true);
+ QCOMPARE(widget->autoFillBackground(), true);
+
+ const QColor color(Qt::red);
+ const QRect rect(0, 0, 1, 1);
+
+ QGraphicsScene scene;
+ scene.addItem(widget);
+ widget->setGeometry(rect);
+
+ QPalette palette = widget->palette();
+ palette.setColor(QPalette::Window, color);
+ widget->setPalette(palette);
+
+ QImage image(rect.size(), QImage::Format_RGB32);
+ QPainter painter;
+ painter.begin(&image);
+ scene.render(&painter, rect, rect);
+ painter.end();
+ QCOMPARE(image.pixel(0, 0), color.rgb());
+}
+
void tst_QGraphicsWidget::initialShow()
{
class MyGraphicsWidget : public QGraphicsWidget